hai,
im trying to call a simple bean from jsp..i put my bean in clientclasses and set my classpath to that..but i get the following problem when i call the jsp page
/hello.jsp(11): Could not create a bean of type: TestBean: java.lang.ClassNotFoundException: TestBean
probably occurred due to an error in /hello.jsp line 11:
<jsp:useBean id="test" class="TestBean" />
pls anyone help me
-
problem in weblogic(jsp calling bean) (14 messages)
- Posted by: sen sen
- Posted on: February 06 2001 07:57 EST
Threaded Messages (14)
- problem in weblogic(jsp calling bean) by sahil gupta on February 06 2001 10:44 EST
- problem in weblogic(jsp calling bean) by sen sen on February 06 2001 11:04 EST
- problem in weblogic(jsp calling bean) by Yaser Syed on February 06 2001 11:13 EST
- problem in weblogic(jsp calling bean) by Web Master on February 06 2001 11:14 EST
- problem in weblogic(jsp calling bean) by sen sen on February 06 2001 11:04 EST
- problem in weblogic(jsp calling bean) by Vel Saran on February 06 2001 12:16 EST
- problem in weblogic(jsp calling bean) by sen sen on February 06 2001 12:56 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 06 2001 02:34 EST
-
problem in weblogic(jsp calling bean) by sen sen on February 07 2001 07:37 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 07 2001 12:21 EST
-
problem in weblogic(jsp calling bean) by sen sen on February 07 2001 01:06 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 07 2001 01:49 EST
-
problem in weblogic(jsp calling bean) by sen sen on February 07 2001 03:13 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 07 2001 03:41 EST
- problem in weblogic(jsp calling bean) by Moorthi Ramasamy on February 08 2001 10:59 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 07 2001 03:41 EST
-
problem in weblogic(jsp calling bean) by sen sen on February 07 2001 03:13 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 07 2001 01:49 EST
-
problem in weblogic(jsp calling bean) by sen sen on February 07 2001 01:06 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 07 2001 12:21 EST
-
problem in weblogic(jsp calling bean) by sen sen on February 07 2001 07:37 EST
-
problem in weblogic(jsp calling bean) by Vel Saran on February 06 2001 02:34 EST
- problem in weblogic(jsp calling bean) by sen sen on February 06 2001 12:56 EST
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: sahil gupta
- Posted on: February 06 2001 10:44 EST
- in response to sen sen
are your home and remote interfaces also there in the client classes ..........?
p.s: It definately is a class path problem...nothing to lose sleep about -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: sen sen
- Posted on: February 06 2001 11:04 EST
- in response to sahil gupta
hello sahil,
i didnt use any ejb here..i just try to call a simple bean from a jsp code...my code is
<jsp:useBean id="test" class="TestBean" />
<% out.println(test.getMessage()); %>
TestBean is nothing but a simple bean has a single method
public class TestBean{
TestBean(){}
public String getMessage()
{
return "message";
}
}
i put my bean in clientclasses ant set my classpath to that before start the server...but i get the above mentioned error..pls help me
thx a lot
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Yaser Syed
- Posted on: February 06 2001 11:13 EST
- in response to sen sen
Make sure that you have set the classpath of the server. In other words, make sure that your server's batch file is not changing the classpath that you set on the console. -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Web Master
- Posted on: February 06 2001 11:14 EST
- in response to sahil gupta
Have you done the import of the bean?
<%@ page import="packages.BeanName"%>
You should put a line like that on the top of the page.
Maybe this will help you. -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Vel Saran
- Posted on: February 06 2001 12:16 EST
- in response to sen sen
Hi,
U donn't need to import the beans..
U put u'r bean in a package, say com.bean.test.TestBean
and put the class file in the WEB-INF/classes/com/bean/test
folder and in the jsp u mention the full path fo the bean class
<jsp:useBean id="test" scope="session" class="com.bean.test.TestBean" />
Hope this helps
Saran
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: sen sen
- Posted on: February 06 2001 12:56 EST
- in response to Vel Saran
hello friends,
i tried all those things u said..but still i get the same problem..is it right to put the classfile under clientclasses?..pls direct me...
dear mr.saran i dont find any web-inf directory under my weblogic directory(in weblogic5.1)....is there anyother way?
thx a lot again
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Vel Saran
- Posted on: February 06 2001 14:34 EST
- in response to sen sen
Hi,
Sorry.. i gave the path for weblogic6.0.
For 5.1.. i guess u have to put the javabean class files
weblogic/myserver/serverclasses.
for examples if u'r beans r in package com.bean.test
then put u'r bean class files in
weblogic/myserver/serverclasses/com/bean/test/TestBean.
jsp will be the same as i told before..
I think u no need to put it in clientclasses
Try it out and let me know..
Saran
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: sen sen
- Posted on: February 07 2001 07:37 EST
- in response to Vel Saran
hai saran,
i tried that aslo but i donno what the problem is here..im unable to access the beans..still i get the following error
Wed Feb 07 12:21:58 GMT 2001:<E> <ServletContext-General> Servlet failed with Exception
weblogic.servlet.jsp.JspException: (line 11): Could not create a bean of type: TestBean: java.lang.ClassNotFoundException
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(RuntimeException.java:50)
at weblogic.servlet.jsp.JspException.<init>(JspException.java:9)
at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:574)
at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1115)
at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(Compiled Code)
at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1521)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1431)
at weblogic.servlet.jsp.JspLexer.nextToken(Compiled Code)
at weblogic.servlet.jsp.JspLexer.parse(Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(Compiled Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:109)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at weblogic.utils.compiler.CodeGenerator.generate(Compiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(Compiled Code)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:174)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:164)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:99)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:742)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:686)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:247)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
at weblogic.kernel.ExecuteThread.run(Compiled Code)
if anyone knows the solution pls help me... -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Vel Saran
- Posted on: February 07 2001 12:21 EST
- in response to sen sen
Hi,
The problem will be in u'r environment settings..
serverclasses may not be included in the settings..
If possible send u'r env settings in u'r system..
Check u'r setEnv batch file in weblogic folder..
And how did u declared u'r bean initialisation in the jsp..?
If i get these inf i try to solve u'r prob...
Saran -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: sen sen
- Posted on: February 07 2001 13:06 EST
- in response to Vel Saran
hai saran,
yes definetely there is a problem in classpath...i didnt modify anything in startweblogic.cmd or setEnv..i just use a batch file..i execute it before starting the server..i have given it here
set path=%path%;e:\weblogic\bin\oci815_8;e:\weblogic\oci\bin\oci815_8;
set classpath=%classpath%;e:\weblogic\lib\weblogic510sp8boot.jar;c:\jdk1.1.8\lib\classes.zip;e:\weblogic\classes\boot;e:\weblogic\eval\cloudscape\lib\cloudscape.jar;e:\weblogic\lib\weblogicaux.jar;e:\weblogic\classes;e:\weblogic;e:\weblogic\myserver\clientclasses;
set Dweblogic.class.path=%Dweblogic.class.path%;e:\weblogic\lib\weblogic510sp8.jar;e:\weblogic\classes;e:\weblogic\licence;e:\weblogic\lib\weblogic\weblogicaux.jar;e:\weblogic\myserver\serverclasses weblogic.server
i think i made a mistake here..pls tell me what is wrong in the above file..if everything is right then tell me am i have to modify anything in the startweblogic.cmd or setenv
pls clear this
thx a lot
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Vel Saran
- Posted on: February 07 2001 13:49 EST
- in response to sen sen
Hi,
Try with including the serverclasses in u'r CLASSPATH environment variable though its there in weblogic classpath.
U'r CLASSPATH should be as:
CLASSPATH=
%CLASSPATH%; e:\weblogic\lib\weblogic510sp8boot.jar;
c:\jdk1.1.8\lib\classes.zip; e:\weblogic\classes\boot; e:\weblogic\eval\cloudscape\lib\cloudscape.jar; e:\weblogic\lib\weblogicaux.jar;e:\weblogic\classes; e:\weblogic;e:\weblogic\myserver\clientclasses;
e:\weblogic\myserver\serverclasses
I guess all other path settings r correct.
Saran
-
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: sen sen
- Posted on: February 07 2001 15:13 EST
- in response to Vel Saran
hai saran,
im still getting the same probs -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Vel Saran
- Posted on: February 07 2001 15:41 EST
- in response to sen sen
Hi,
Mmm.. Interesting..
Make sure u declared the bean in jsp with full path.
If u send me the codes i will try my level best..
Saran
saran_v@yahoo.com -
problem in weblogic(jsp calling bean)[ Go to top ]
- Posted by: Moorthi Ramasamy
- Posted on: February 08 2001 10:59 EST
- in response to Vel Saran
Hi guys,
It's quite interesting to see your conversation. As per my knowledge whatever the path saran mentioned should work.
ELSE
Try this:
inside jsp:
<page import="xxx.yyy.BeanName">
<jsp:useBean id="xxxxx" scope="yyy" class="BeanName">
Location of JSP:
Keep this JSP inside
C:\weblogic\myserver\public_html (if u want create your own package and add in your property file)
Location of Bean:
C:\weblogic\src\xxx\yyy
After doing this...
Give the classpath of the bean in the post classpath of the startweblogic.cmd file:
The classpath is:
C:\weblogic\src\xxx.yyy
after doing this start the server and call the JSP
Hope this should work:
if u have further problem give a msg
regards
Moorthi