Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Class not found in webapp

0 views
Skip to first unread message

Sudarma Pokta

unread,
Oct 7, 2002, 10:36:11 PM10/7/02
to

All the struts classes and lib are in the webapp. All ejbs are in another package.
All war and jar are then package into one ear file. I have 2 similar struts actions
inheriting from the same base class ListBaseAction. Somehow one of them consistently
have loading problem.

The ListBaseAction class is in WEB-INF/classes in the war file.

[INFO] RequestProcessor - -Processing a 'GET' for path '/hotlist/listaction'
java.lang.NoClassDefFoundError: com/cubic/cts/struts/ListBaseAction
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
6)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:390)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:152)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
areClassLoader.java:44)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.jav
a:193)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.
java:219)
at org.apache.struts.action.RequestProcessor.processActionCreate(Request
Processor.java:316)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:260)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:129
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:5412)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:744)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
[ERROR] RequestProcessor - -No action instance for path /hotlist/listaction coul
d be created <java.lang.NoClassDefFoundError: com/cubic/cts/struts/ListBaseAction>

Matt Krevs

unread,
Oct 8, 2002, 4:09:48 AM10/8/02
to
are there any external classes that your failed class uses? I have had this
problem if a class has import statements from a jar that i have forgotten to
add to my lib directory

ie - it may not be the class that the classloader cannot find but another
class that it imports

try running in verbose mode (-verbose switch) - it may tell you what class
exactly cannot be found

"Sudarma Pokta" <sudarm...@cubic.com> wrote in message
news:3da2449b$1...@newsgroups.bea.com...

Sudarma Pokta

unread,
Oct 8, 2002, 1:58:51 PM10/8/02
to

My environment is WebLogic 7.0 Patch 1.

Inheritance relationship:
DeviceTypeListAction -> ListBaseAction -> BaseAction.
HotlistAction -> ListBaseAction -> BaseAction.

When things is working:

[Loaded org.apache.struts.action.RequestProcessor]
[INFO] RequestProcessor - -Processing a 'GET' for path '/DeviceType/listaction'
[Loaded weblogic.utils.http.QueryParams]
[Loaded weblogic.utils.enumerations.IteratorEnumerator]
[Loaded org.apache.struts.action.Action]
[Loaded com.cubic.cts.struts.BaseAction]
[Loaded com.cubic.cts.struts.ListBaseAction]
[Loaded com.cubic.cts.struts.DeviceType.DeviceTypeListAction]
[Loaded org.apache.struts.action.ActionMessages]
[Loaded org.apache.struts.action.ActionErrors]
[Loaded com.cubic.cts.util.ejb.EJBHomeFactory]
[Loaded weblogic.servlet.internal.session.FileSessionData]
[Loaded weblogic.servlet.internal.session.CookieSessionData]
[Loaded weblogic.servlet.internal.session.SessionData$1]
[Loaded javax.servlet.http.Cookie]
.... goes on loading all the required classes

When things are not working:


Why does it try to load com.cubic.cts.struts.ListBaseAction which has been loaded
before?
It seems like a different class loader.

Matt Krevs

unread,
Oct 9, 2002, 2:53:43 AM10/9/02
to
I have seen this happen when there is a class my webapp tries to use that
has already been loaded by my ejb app

Try to work out what classes HotlistAction uses/imports that are different
to DeviceTypeListAction

perhaps try loading just your webapp without your ejb app and see if you get
any further

"Sudarma Pokta" <sudarm...@cubic.com> wrote in message

news:3da31cdb$1...@newsgroups.bea.com...

Sudarma Pokta

unread,
Oct 11, 2002, 7:22:33 PM10/11/02
to

We finally found the problem with the class loading. Weblogic load classes in following
orders:
1) system classpath
2) jar (jar manifest)
3) web app.
So my problem was weblogic starting loading classes from step 2 and it doesn't
go back to the web app to look for class to load.

You can read all of these in
http://e-docs.bea.com/wls/docs70/programming/classloading.html

Cheers,
Sudarma

"Sudarma Pokta" <sudarm...@cubic.com> wrote:
>
>My environment is WebLogic 7.0 Patch 1.
>
>Inheritance relationship:
>DeviceTypeListAction -> ListBaseAction -> BaseAction.
>HotlistAction -> ListBaseAction -> BaseAction.
>
>When things is working:
>
>[Loaded org.apache.struts.action.RequestProcessor]
>[INFO] RequestProcessor - -Processing a 'GET' for path '/DeviceType/listaction'
>[Loaded weblogic.utils.http.QueryParams]
>[Loaded weblogic.utils.enumerations.IteratorEnumerator]
>[Loaded org.apache.struts.action.Action]
>[Loaded com.cubic.cts.struts.BaseAction]
>[Loaded com.cubic.cts.struts.ListBaseAction]
>[Loaded com.cubic.cts.struts.DeviceType.DeviceTypeListAction]
>[Loaded org.apache.struts.action.ActionMessages]
>[Loaded org.apache.struts.action.ActionErrors]
>[Loaded com.cubic.cts.util.ejb.EJBHomeFactory]
>[Loaded weblogic.servlet.internal.session.FileSessionData]
>[Loaded weblogic.servlet.internal.session.CookieSessionData]
>[Loaded weblogic.servlet.internal.session.SessionData$1]
>[Loaded javax.servlet.http.Cookie]

>..... goes on loading all the required classes

Selvamohan Neethiraj

unread,
Nov 19, 2002, 11:37:40 PM11/19/02
to
In WebLogic, if you are creating a EAR file to load your application, the
WEB application (WAR) file is loaded in a different JVM and the EJB Classes
are loaded in another JVM. So, make sure that all of the WEB related
classes (including Struts, EJB Home, EJB Remote classes) are stored in the
WAR file.

Thanks,
Selva-


"Sudarma Pokta" <sudarm...@cubic.com> wrote in message
news:3da2449b$1...@newsgroups.bea.com...
>

fear

unread,
Nov 20, 2002, 8:16:25 AM11/20/02
to

Hi Selva,

sorry .. but the WAR and EAR scopes do not (!) have a different JVM .. but the
classes are loaded by different classloaders.
Your thoughts were right but the words not.
WLS is running in one JVM ...

fear

0 new messages