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

Utility Classes for EJB, get NoClasDefFound - urgent

0 views
Skip to first unread message

Pete

unread,
Jan 23, 2002, 7:46:08 AM1/23/02
to

I'm have an EJB jar the references supporting classes in another jar. I have produced
an EJB jar with a manifest file containing a Class-Path: setting. But I still
get NoClassDefFoundError for one of the utility classes which is in another project
and jar. I have been trying to fix this for about 3 days so would appreciate any
help :-

- I have WL6.1 with sp2, the ejbc was done by JB6 for an ejb1.1 session bean.
- The manifest.mf file has
Class-Path: rdfinf.jar nrinf.jar.
The full manifest.mf is shown at the end of this post.
- I have an expanded EAR directory structure.
\OurDomain\Applications\EnterpriseAppsEAR\AccountManagerEJB.jar
\OurDomain\Applications\EnterpriseAppsEAR\RDFInfrastuctureBeans.jar
\OurDomain\Applications\EnterpriseAppsEAR\nrinf.jar
\OurDomain\Applications\EnterpriseAppsEAR\rdfinf.jar

The last two jars are the supporting/utility classes.
The 2nd ejb jar RDFInfrastuctureBeans deploys ok, but doesn't use supporting classes.

The 1st ejb jar AccountManagerEJB gets the NoClassDefFoundError for com/rdf/infrastructure/exceptions/RDFApplicationException,
a class in nrinf.jar. I can clearly see the com/rdf/infrastructure/exceptions/RDFApplicationException.class
in the nrinf.jar.

The manifest.mf is :-
Manifest-Version: 1.0
Class-Path: rdfinf.jar nrinf.jar
Name: META-INF/ejb-jar.xml

Name: com/rdf/nr/clas/bus/accountmanager/ejb/AccountManager.class

Name: com/rdf/nr/clas/bus/accountmanager/ejb/AccountManagerBean.class

Name: com/rdf/nr/clas/bus/accountmanager/ejb/AccountManagerHome.class

Name: META-INF/weblogic-ejb-jar.xml

Weblogic 6.1 with SP2, gives this error on start up :-

<23-Jan-02 11:53:57 GMT> <Info> <EJB> <EJB Deploying file: AccountManagerEJB.jar>
<23-Jan-02 11:53:58 GMT> <Error> <J2EE> <Error deploying application AccountManagerEJB:

Unable to deploy EJB: D:\bea\wlserver6.1\.\config\NRDomain\applications\.wlnotdelete\wlap21587\AccountManagerEJB.jar
from AccountManagerEJB.
jar:

EJB : AccountManagerBean .Unable to initialize method info for remote or home
interface.The error is java.lang.NoClassDefFoundError: com/rdf
/infrastructure/exceptions/RDFApplicationException
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)

Deepak Vohra

unread,
Jan 23, 2002, 1:19:47 PM1/23/02
to
Pete

All supporting/utility classes for the EJB should be in the Ejb jar file. You could
also put all the utility/supporting classes in one jar file and put that jar file
in the weblogic classpath.

Deepak

Dimitri Rakitine

unread,
Jan 23, 2002, 11:04:09 AM1/23/02
to
NoClassDefFoundError means that com.rdf.infrastructure.exceptions.RDFApplicationException
class was found, but the class it depends on was not, so, make sure you package everything
needed into AccountManagerEJB.jar/*inf.jar when you deploy your beans.

Pete <pete....@orange.net> wrote:

> Name: com/rdf/nr/clas/bus/accountmanager/ejb/AccountManager.class

> Name: com/rdf/nr/clas/bus/accountmanager/ejb/AccountManagerBean.class

> Name: com/rdf/nr/clas/bus/accountmanager/ejb/AccountManagerHome.class

> Name: META-INF/weblogic-ejb-jar.xml

--
Dimitri

Pete

unread,
Jan 24, 2002, 10:33:20 AM1/24/02
to

Finally solved it.

The manifest was correct all the time, as were the jars, but one of the supporting
classes was also on the class path.

It's kind of weird that this gives NoClassDefFound as the .class file is the correct
version.
Normally this gives a message from WL saying found x class on class path so you
won't be able to hot redeploy.

Deepak, just to let you know the method you describe is the old way of doing this.
With WL6.1 you cannot redeploy if supprting classes are on the classpath. This
is where the mainfest Class-Path: entry comes in.

Pete

0 new messages