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

Packing Utility classes

1 view
Skip to first unread message

Francesco

unread,
Jan 28, 2002, 11:09:19 AM1/28/02
to

Hi all,
I have a questions about class-loading of Utility classes via Class-path attribute.
This class-loading mechanism works only if I wrap all jar files in an EAR file?

Or it can be achieved simply packing into the EJB jar file the jar with utility
classes?

mybean.jar
|------- ejbclasses.jar
|------- utils.jar
|------- META-INF (bearing Manifest with Class-Path: utils.jar)

In other words, this class-loading mechanism works only if I build and EAR file?
or it's enough if the Manifest-file of the ejbs points to the utility jar?

Hope I explained myself correctly
Thanks
Francesco

Dimitri Rakitine

unread,
Jan 28, 2002, 1:21:49 PM1/28/02
to
No, you'll have to build an EAR. You may find these 2 articles useful:

http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html

Francesco <fmarc...@libero.it> wrote:


--
Dimitri

Francesco

unread,
Jan 29, 2002, 4:44:31 AM1/29/02
to

Hi Dimitri, thanks for your answers. I read the articles and I tried to add log4j
libraries to the basic Trader example.
Unfortunately weblogic refuses the ear file...it seems that WLS considers log4j
as an EJB so it wants the ejb-jar file!

Unable to deploy EJB: log4j.jar from log4j.jar:

An error occurred while reading the deployment descriptor. The error was:
java.io.FileNotFoundException: META-INF/ejb-jar.xml not found in jar file
at weblogic.ejb20.dd.xml.DDUtils.getEntry(DDUtils.java:332)
at weblogic.ejb20.dd.xml.DDUtils.getEjbJarXml(DDUtils.java:236)
at weblogic.ejb20.dd.xml.DDUtils.loadEJBJarDescriptorFromJarFile(DDUtils.java:151)
at weblogic.ejb20.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.java:139)
at weblogic.ejb20.deployer.Deployer.createEJBDescriptor(Deployer.java:712)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:807)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
at weblogic.j2ee.Application.addComponent(Application.java:163)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:491)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:361)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:984)
at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:971)
at weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:956)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl

the problem may lie in the application.xml...I have inserted only one entry for
the trader.jar...

<?xml version="1.0" encoding="ISO8859_1"?>

<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application
1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>

<application>
<display-name>estore</display-name>
<description>Application description</description>
<module>
<ejb>trader.jar</ejb>
</module>
</application>

do I need a special entry also for utility class? or the problem is somewhere
else??
thanks a lot
Francesco

Dimitri Rakitine

unread,
Jan 29, 2002, 5:49:01 AM1/29/02
to
Strange. Your application.xml looks correct. What does your EAR look like?
If should contain
WEB-INF/application.xml
trader.jar (in it's manifest Class-Path: log4j.jar)
log4j.jar

Francesco <fmarc...@libero.it> wrote:


--
Dimitri

Francesco

unread,
Jan 29, 2002, 6:58:33 AM1/29/02
to

well the attachment didn't appear in my reply...Dima I have sent you the ear on
your mail, hope this doesn't bore you.
Tks

Dimitri Rakitine

unread,
Jan 29, 2002, 9:23:02 AM1/29/02
to
application.xml :

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>

<application>
<display-name>estore</display-name>
<description>Application description</description>
<module>
<ejb>trader.jar</ejb>
</module>
</application>

should be in ear's META-INF/ folder. And, also, for some reason WebLogic gets confused
when .ear and .jar in it have the same name (you have trade.jar inside trade.eari - probably
a bug) - rename trade.ear to something else and it will work.

Francesco <fmarc...@libero.it> wrote:


--
Dimitri

0 new messages