Discussions

EJB programming & troubleshooting: Log4j error while deploying EJB 3.0 in weblogic 10

  1. Hi Friends, I am migrating an application EJB from 2.0 to 3.0 annotations. The log4j-1.2.3 for the project is configured in this way, it is added to the startWeblogic.cmd in weblogic 10 as : set JAVA_OPTIONS=%JAVA_OPTIONS% -Dlog4j.configuration=log4j.properties Now i am trying to deploy my EAR file that contains an EJB 3.0 Project and a Web project , it gives following error while deployment. ### <[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> > <Stack trace for message 149004 weblogic.application.ModuleException: Exception preparing module: EJBModule(streamlinesuspenseEJB.jar) [EJB:011023]An error occurred while reading the deployment descriptor. The error was: org.apache.log4j.spi.RootCategory.(Lorg/apache/log4j/Level;)V. at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42) at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723) at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190) at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) java.lang.NoSuchMethodError: org.apache.log4j.spi.RootCategory.(Lorg/apache/log4j/Level;)V at org.apache.log4j.LogManager.(LogManager.java:113) at org.apache.log4j.Logger.getLogger(Logger.java:124) at com.jmfamily.common.log.LogManager.getLogger(LogManager.java:33) at com.jmfamily.common.log.LogManager.getLogger(LogManager.java:42) at com.jmfamily.jma.contract.ejb.SuspendedContractSOBean.(SuspendedContractSOBean.java:33) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processWLSAnnotations(EjbAnnotationProcessor.java:1699) at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processWLSAnnotations(EjbDescriptorReaderImpl.java:346) at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192) at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93) at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1198) at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:380) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42) at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723) at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190) at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    If i remove the "set JAVA_OPTIONS=%JAVA_OPTIONS% -Dlog4j.configuration=log4j.properties" from the weblogic statrup script and install the EAR it will be installed , but the logger is not initialized. If the option "set JAVA_OPTIONS=%JAVA_OPTIONS% -Dlog4j.configuration=log4j.properties" added to the startup script and i deployed the OLD EJB 2.0 app , it is installed successfully, but it didnt let me deploy EJB 3.0 app. I am hitting my head around it for a day now, no success so far.. Please provide you suggestions , thanks a lot to all in advance. Thanks Sachin Andy Kay Greenhorn Joined: Oct 26, 2009 Messages: 28
  2. Hi Sachin, You need to deploy from a directory or upload the war and extract it on the server and deploy form that directory. Regards, TiKi
  3. Hi, Thanks for your reply. Well the problem turned out to be with the classpath and the logging jar name, There jar which is exactly used in project and the one set in classpath were different. Matching the names in classpath fixed it. Thanks again... -Sachin