Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when accessing a Bean from a JSP(URGENT!!!)

Status
Not open for further replies.

Shailaja

Programmer
Mar 11, 2001
6
US
Hi,
Could someone help me on this. I get this error msg
when calling the bean named UserData from Savename.jsp.

Parsing of JSP File '/SaveName.jsp' failed:
--------------------------------------------------------------------------------
/SaveName.jsp(1): Could not create a bean of type: myBean.UserData: java.lang.ClassNotFoundException: myBean.UserData
probably occurred due to an error in /SaveName.jsp line 1:
<jsp:useBean id=&quot;user&quot; class=&quot;myBean.UserData&quot; scope=&quot;session&quot;/>
--------------------------------------------------------------------------------
Sun Mar 11 18:22:47 EST 2001

Thanks,
Shailaja
kshailaja@angelfire.com
 
Hi,

I am not a master in JSP, but I have already used them.
The compiler seems not to be able to access your myBean.UserData class. So maybe you should set the classpath
to access the directory &quot;myBean&quot; when your web server or JSP engine is about to be launched.
You might have to configure the corresponding web server in order to set the correct classpath, I do not know which one you use, but try it.

Bye

--
Globos
 
I am using BEA Weblogic server 5.1 to deploy the JSP. I am trying to call a bean from my JSP. I have made the following
settings in the weblogic.properties file :


weblogic.httpd.register.*.jsp= weblogic.servlet.JSPServlet
weblogic.httpd.initArgs.*.jsp= pageCheckSeconds=1, compileCommand=C:/jdk1.3.0_02/bin/javac.exe, workingDir=C:/weblogic/myserver/classfiles, verbose=true


weblogic.httpd.register.UserData= c:/weblogic/myBean/UserData
weblogic.allow.execute.weblogic.servlet.UserData=everyone


weblogic.ejb.deploy=c:/weblogic/myBean/UserData


and also included the full package name in the <jsp:UseBean> syntax.
But it gives a ClassNotFoundException
Can you tell me whether I am missing something or what else could be the problem? This is really urgent.
 
Have you tried instead of:
<jsp:useBean id=&quot;user&quot; class=&quot;myBean.UserData&quot; scope=&quot;session&quot;/>

use just

<jsp:useBean id=&quot;user&quot; class=&quot;UserData&quot; scope=&quot;session&quot;/>

without the package name?

Also, try adding a <%@ page import=&quot;myBean.*&quot; %>

at the top of your JSP and omit the package name from the bean tag.

Not really good style but if it tells you that it cant import myBean.* then it might tell you more which could help you.

Regards,
Gerald
 
I really appreciate for such quick response. Gerald, I tried using <%@page import &quot;myBean.*&quot;%> at the top of the jsp file. But it still gives me the same error saying &quot;Parsing of JSP File '/SaveName.jsp failed:and could not create a bean of type myBean.UserData&quot;

Now I tried starting the weblogic server from the command prompt with weblogic.class.path and other system properties set as shown below:
C:\weblogic\jre1_2\jre\bin\java.exe -mx32m -ms32m -classpath &quot;C:\weblogic\jre1_2\jre\lib\rt.jar;C:\weblogic\jre1_2\jre\lib\i18n.jar;C:\weblogic\lib\i18n.jar;C:\weblogic\classes\boot;C:\weblogic\eval\cloudscape\lib\cloudscape.jar&quot; -Dweblogic.class.path=C:\weblogic\license;C:\weblogic\classes;C:\weblogic\myserver\serverclasses;C:\weblogic\lib\weblogicaux.jar;c:\weblogic;c:\weblogic\com\ora\jsp\beans\userinfo;c:\weblogic\myBean;c:\weblogic\myserver\classfiles -Dweblogic.system.discardOutAndErr=true -Djava.security.manager -Djava.security.policy==C:\weblogic\weblogic.policy -Dweblogic.system.name=myserver -Dweblogic.system.home=C:\weblogic -Dweblogic.cluster.enable=false -Dweblogic.cluster.name=mycluster -Dweblogic.system.listenPort=7001 -Dweblogic.system.SSLListenPort=7002 -Dweblogic.cluster.multicastAddress=237.0.0.1 weblogic.Server

This time it gives me a different error saying
&quot;Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.&quot;

Can anyone help me figure out what's going on?


 
you will have to import the classes you'd like to use first.
you can manage this by writing:
<%@ page import=&quot;beans.*&quot;%> ( or whatever you would like to include )

guenter

guenter
guenter.porzer@oekb.co.at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top