ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McVeigh, Ryan" <rmcve...@vignette.com>
Subject RE: ejbjar and issues with class loading?
Date Wed, 24 Oct 2001 21:49:10 GMT
In my next message to the list I indicated that I had figured out the first
issue - with class loading.  

Though I'm still stuck on the ejbc warnings.  I've figured out that I can
remove certain classes from my wlclasspath that should not be there for ejbc
- and I'll get a compilation w/out warning.  However, I want those classes
there, so I end up putting them back after executing ejbc.

I've also removed the build.destdir from wlclasspath but then ejbc fails to
compile classes.  For example, all of my session beans extend my own class
which extends SessionBean.  If I don't include build.destdir in the
wlclasspath (my updated ejbjar call follows), I get a NoClassDefFoundError
thrown because it cannot find my subclass of SessionBean.

		<ejbjar srcdir="${build.destdir}" 
			descriptordir="./WebLogic/dev" 
			basejarname="myJar">

			<weblogic destdir="${jar.out}" 
				rebuild="false" 
				compiler="jikes -nowarn"
				keepgenerated="false"
				keepgeneric="true"
				newCMP="true"
	
classpath="${build.destdir};${serverBuild.classpath}"
				wlclasspath="${weblogic.jar}">
			</weblogic>

			<dtd publicId="-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 1.1//EN" location="./WebLogic/ejb-jar_1_1.dtd" />
			<dtd publicId="-//BEA Systems, Inc.//DTD WebLogic
5.1.0 EJB//EN" location="./WebLogic/weblogic-ejb-jar.dtd" />

			<exclude name="**/*weblogic*.xml" />
		</ejbjar>

--

Any ideas?

-Ryan


-----Original Message-----
From: Conor MacNeill	
Sent: Wednesday, October 24, 2001 8:33 AM
To: ant-user@jakarta.apache.org
Subject: Re: ejbjar and issues with class loading?


McVeigh, Ryan wrote:

> Background info:  Ant 1.4.1, WL 6.0 SP2.
> 
> I've got an <ejbjar ... /> tag built and I'm seeing a lot of warnings from
> my classes that say something similar to:
> 
>    [ejbjar] Could not fully load class someClassName for super class check
> 
> I see in the source for ejbjar (the GenericDeploymentTool.java file) that
> this is a NoClassDefFoundError being thrown, which doesn't make sense to
me.



Let me try to explain this a little. The EJB spec says that all classes 
necessary for the EJB should be contained in the EJB jar. <ejbjar> has 
tried overtime to collect more of the necessary classes into the jar as 
per the spec. The way it achieves this at the moment is to load the bean 
classes as java classes with a classloader. It then determines the 
superclasses and adds them to the jar. The NoClassDefFoundError occurs 
when the classpath given to ejbjar does not contain all of the classes 
necessary to instantiate the bean classes. This is what the "Could not 
fully load class blah" means. <ejbjar> will still beign a jar which will 
probably work but it will not necessarily contain the super classes.

The <support> element provides a mechanism to add in other classes which 
are necessary for the bean but which are not super classes.

Ant 1.5 will change this mechanism under the covers to actually analyse 
the bean classes at a bytecode level to determine all of the classes 
required automatically, without using reflection. This should give 
better results.


> 
> Second issue, same email - I'm also getting the complaint from ejbc about
> home and remote interfaces from a bean being in the system classpath.


Yes, this was introduced into WLS 6.0. Since <ejbjar>'s classpath 
predated this, I added a separate attribute wlclasspath which is the 
classpath to use when running the weblogic.ejbc tool. <ejbjar> still 
needs the full classpath since it is doing its bean check thing, 
described above.


> Clearly that has something to do with the classpath and wlclasspath
> attributes to the weblogic element.  My build.destdir property is the
entire
> output of all of my built classes.  How might I specify these things so
that
> ejbc doesn't complain about seeing the generated classes in the classpath?


You should be able to take the build.destdir out of the wlclasspath and 
the complainst should stop. Let me know if that causes you issues.


> I'd really like to be able to make an ejbjar work without warnings.


Josh Lannin provided a patch which will allow you to silence ejbc for 
these warnings. It isn't documented yet, though.


Conor



Mime
View raw message