We help IT Professionals succeed at work.

Application server classpath problem

xoxomos
xoxomos asked
on
I've got classpath set to D;\Websphere\AppServer\hosts\default_host\WebReg\servlets;
D;\Websphere\AppServer\hosts\default_host\WebReg\servlets\classes;
D:\WebSphere\jdk\jre\ext\classes12.zip
in the Win2000 environment.  The Application server also starts with a classpath switch the same.  When i call the servlets WebSphere doesn't find the class which is in the servlets directory.

When i enter the  http://localhost/servlet/CUXXHome i get the error messages

Wrapped Error-2: Servlet [CSXXHome]: Could not find required servlet class - CSXXHome.class
javax.servlet.ServletException: Servlet [CSXXHome]: Could not find required servlet class - CSXXHome.class at javax.servlet.ServletException.(ServletException.java:61) at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:56) at com.ibm.servlet.engine.webapp.WebApp.addServlet(WebApp.java:305) at com.ibm.servlet.engine.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java:42) at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:155) at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at ........................................................
--------------------------------------------------------------------------------
Wrapped Error-3: Servlet [CSXXHome]: Could not find required servlet class - CSXXHome.class
javax.servlet.ServletException: Servlet [CSXXHome]: Could not find required servlet class - CSXXome.class at javax.servlet.ServletException.(ServletException.java:73) at


Wrapped Error-4: Server caught unhandled exception from servlet [invoker]
com.ibm.servlet.engine.webapp.UncaughtServletException: Server caught unhandled exception from servlet [invoker] at ..................................................................................................

Why is Websphere not finding the servlet classes.
Comment
Watch Question

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Websphere's probably not using your CLASSPATH env var.
Most containers generally have their own method for defining their classpath.

Check your websphere documentation.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
You don't actually mention where you put you classes.
I think they should be in the servlets directory, and if your using packages then ensure they are in the correct subdirectory.
Commented:
Two problems.  One is you have semicolons after your drive letter (D; instead of D:).  Second, you can't set the system classpath for WebSphere.  You have two options.  Just to get it working I suggest option number 1.  Option number two will require you to understand more about the websphere administration console.

1) Find the admin.config file in the bin directory for websphere.  In this file you can set a system wide classpath.  This is the quick and dirty way.

2) Set the classpath with the -classpath flag to the JVM on the "command line options" of the webapp.  So for the command line parms put
-classpath "D:\Websphere\AppServer\hosts\default_host\WebReg\servlets;D:\Websphere\AppServer\hosts\default_host\WebReg\servlets\classes;D:\WebSphere\jdk\jre\ext\classes12.zip"

Author

Commented:
The Application server also starts with a classpath switch the same.  I believe this is the same as your command line param.  At the application server tab under command line arguments -mx128m -classpath d:\WebSphere\AppServer\hosts...... I've checked the case and all the servlet class files are in the ..\servlets subdirectory.

Author

Commented:
You know, looking at that classpath line in that conf file, i don't see a path to that servlets directory included.
plus its putting d:\:/ instead of d:\   ????????????????
com.ibm.ejs.sm.adminserver.classpath=d\:/WebSphere/AppServer/lib/ibmwebas.jar;
d\:/WebSphere/AppServer/properties;
d\:/WebSphere/AppServer/lib/servlet.jar;
d\:/WebSphere/AppServer/lib/webtlsrn.jar;
d\:/WebSphere/AppServer/lib/lotusxsl.jar;
d\:/WebSphere/AppServer/lib/compat.jar;
d\:/WebSphere/AppServer/lib/xalan.jar;
d\:/WebSphere/AppServer/lib/ns.jar;
d\:/WebSphere/AppServer/lib/ejs.jar;
d\:/WebSphere/AppServer/lib/ujc.jar;
d\:/WebSphere/AppServer/lib/idb.jar;
d\:/WebSphere/AppServer/lib/repository.jar;
d\:/WebSphere/AppServer/lib/admin.jar;
d\:/WebSphere/AppServer/lib/swingall.jar;
d\:/WebSphere/AppServer/lib/console.jar;
d\:/WebSphere/AppServer/lib/was20cm.jar;
d\:/WebSphere/AppServer/lib/tasks.jar;
d\:/WebSphere/AppServer/lib/xml4j.jar;
d\:/WebSphere/AppServer/lib/vaprt.jar;
d\:/WebSphere/AppServer/lib/sslight.jar;
d\:/WebSphere/AppServer/lib/ibmjndi.jar;
d\:/WebSphere/AppServer/lib/deployTool.jar;
d\:/WebSphere/AppServer/lib/databeans.jar;
d\:/WebSphere/AppServer/classes;
d\:/WebSphere/AppServer/jdk/lib/tools.jar;
d\:/WebSphere/AppServer/lib/jsp10.jar;
d\:/WebSphere/AppServer/lib/dertrjrt.jar;
d\:/WebSphere/AppServer/lib/derdbpw.jar;
d\:/WebSphere/AppServer/lib/ivjejb35.jar

I'll try including that.

Author

Commented:
O.K. That does get rid of the classpath error message although it's still saying page can't be displayed.
thanks

Commented:
What error are you getting now?  If it's one I'm familiar with I'll let you know.  Have you tried running this in VAJ?

Author

Commented:
I'll put that out as another question, but it will be about a week off.  I did get further along in VAJ but had trouble with some .css and .js files.  Kindly check back in about 2 weeks at which time i hope to formulate better questions.
thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.