Eric, I have seen this problem with WebLogic, but not with JBoss, so I didn't want to lead you off in the wrong direction. Also note that I have not used a 2.x version in quite some time so I don't know how relevant this information will be to that version.
As far as I know there are two ways to include third-party jars or classes in your EJB jar. One is to unpack all the classes from the original jar and include them the EJB jar. (Personally, I always hated having to do this because it felt kludgy.) The other way is to package everything in a EAR and include the third party jars in the EAR off the root or in a lib/ directory. In this case I believe you have to specify them in the Class-Path element of the jars manifest file (i.e. "Class-Path: lib/log4j.jar"). I'm sure you already knew both of those but I wanted to go over it just to make sure. The problem I ran into with WebLogic was that the class I had which was using Log4j was being packaged in the EJB jar (and thereby loaded by the EJB's class loader) and being used in the webapp. Since I was packaging the log4j.jar in the WEB-INF/lib directory the EJB class didn't have access to it. I solved this by fixing my build script to only include the absolute essential classes in the EJB jar. However, since it sounds like you need to have access to the log4j classes in the EJB jar and webapp the best (and I think only) way you can solve this is by packaging Log4j in the EAR jar rather than the EJB jar. I have no idea if this helped at all, but maybe it sparked some thoughts in you head that may lead to a solution... /mike On Tue, 2002-04-23 at 06:46, Eric Kaplan wrote: > ok, now i feel like i'm being ignored. is this is a difficult question? i > see other people encountered this same problem, > but have tried various things and nothing seems to fix this. can someone > please tell me, this is critical for the work > we're doing. if you can't use log4j with jboss without great pain, it's a > problem. > > > -----Original Message----- > > From: Eric Kaplan [mailto:[EMAIL PROTECTED]] > > Sent: Monday, April 22, 2002 2:12 PM > > To: [EMAIL PROTECTED] > > Subject: log4j > > > > I had posed this question a while ago and never actually got an answer > > that worked. If I instantiate a static > > Category in one of my beans, I get the following error upon loading. This > > is jboss 2.4.1. Yes, I'm behind a bit, > > but that's because when I tried to upgrade to 2.4.4 I got some errors > > which I have not had time to resolve. > > What needs to happen here? > > > > Thanks > > > > Eric > > > > [Verifier] java.lang.NoClassDefFoundError: org/apache/log4j/Category > > [Verifier] at > > com.armanta.ejb.coldefs.ColdefsMasterBean.<clinit>(ColdefsMas > > terBean.java:103) > > [Verifier] at java.lang.Class.newInstance0(Native Method) > > [Verifier] at java.lang.Class.newInstance(Class.java:237) > > [Verifier] at > > org.jboss.verifier.strategy.AbstractVerifier.hasDefaultConstr > > uctor(AbstractVerifier.java:356) > > [Verifier] at > > org.jboss.verifier.strategy.EJBVerifier11.verifySessionBean(E > > JBVerifier11.java:630) > > [Verifier] at > > org.jboss.verifier.strategy.EJBVerifier11.checkSession(EJBVer > > ifier11.java:93) > > [Verifier] at > > org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:134) > > > > [Verifier] at > > org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:4 > > 67) > > [Verifier] at > > org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:3 > > 69) > > [Verifier] at > > org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:3 > > 04) > > [Verifier] at java.lang.reflect.Method.invoke(Native Method) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1628) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1523) > > [Verifier] at > > org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.j > > ava:494) > > [Verifier] at > > org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeploy > > er.java:468) > > [Verifier] at > > org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:20 > > 8) > > [Verifier] at java.lang.reflect.Method.invoke(Native Method) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1628) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1523) > > [Verifier] at > > org.jboss.ejb.AutoDeployer.deploy(AutoDeployer.java:379) > > [Verifier] at org.jboss.ejb.AutoDeployer.run(AutoDeployer.java:217) > > [Verifier] at > > org.jboss.ejb.AutoDeployer.startService(AutoDeployer.java:353 > > ) > > [Verifier] at > > org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport. > > java:107) > > [Verifier] at java.lang.reflect.Method.invoke(Native Method) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1628) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1523) > > [Verifier] at > > org.jboss.configuration.ConfigurationService$ServiceProxy.inv > > oke(ConfigurationService.java:836) > > [Verifier] at $Proxy0.start(Unknown Source) > > [Verifier] at > > org.jboss.util.ServiceControl.start(ServiceControl.java:81) > > [Verifier] at java.lang.reflect.Method.invoke(Native Method) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1628) > > [Verifier] at > > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl > > .java:1523) > > [Verifier] at org.jboss.Main.<init>(Main.java:210) > > [Verifier] at org.jboss.Main$1.run(Main.java:116) > > [Verifier] at java.security.AccessController.doPrivileged(Native > > Method) > > [Verifier] at org.jboss.Main.main(Main.java:112) > > Eric Kaplan > > Armanta, Inc. > > 55 Madison Ave. > > Morristown, NJ 07960 > > Phone: (973) 326-9600 > > _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user