Discussions

EJB programming & troubleshooting: HOW TO DEPLOY AN EJB JAR

  1. HOW TO DEPLOY AN EJB JAR (4 messages)

    Hi All,
    I am trying to deploy a jar file, with EJB and support classes, in weblogic 7. But WL gives the following exception. Can you please figure out where could the problem be? What is it that I need to do for the successful deployment of the applictation. Please list out any and every possiblity that could cause this type of problem.

    Thanks for your time and efforts, indeed.

    Harsh

    ------------------------LOG------------------------------

    preparing application mtrsTest_app on MTRSServer
    Exception caught for task Activate application mtrsTest_app on MTRSServer: Prepare failed. Task Id = 5
    Module, mtrsTest_app, reported error: Exception preparing module: EJBModule(mtrsTest_app,status=NEW)


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


    Class not found: Lorg/apache/log4j/Category;
    java.lang.NoClassDefFoundError: Class not found: Lorg/apache/log4j/Category;
    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:282)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:227)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:923)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:879)
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:232)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:487)
    at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:799)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1248)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1425)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:650)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:263)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:227)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:923)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:879)
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:232)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:487)
    at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:799)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1248)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1425)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:650)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)



    failed application mtrsTest_app on MTRSServer




    ----------------------EXCEPTION----------------------------




    weblogic.management.ApplicationException: Prepare failed. Task Id = 5
    {
    Module Name: mtrsTest_app, Error: Exception preparing module: EJBModule(mtrsTest_app,status=NEW)


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


    Class not found: Lorg/apache/log4j/Category;
    java.lang.NoClassDefFoundError: Class not found: Lorg/apache/log4j/Category;
    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:282)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:227)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:923)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:879)
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:232)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:487)
    at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:799)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1248)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1425)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:650)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:263)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:227)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:923)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:879)
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:232)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:487)
    at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:799)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1248)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1425)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:650)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)



     TargetException:

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


    Class not found: Lorg/apache/log4j/Category;
    java.lang.NoClassDefFoundError: Class not found: Lorg/apache/log4j/Category;
    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:282)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:227)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:923)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:879)
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:232)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:487)
    at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:799)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1248)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1425)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:650)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:263)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:227)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:923)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:879)
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:232)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:487)
    at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:799)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1248)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1425)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:650)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)



    }
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:657)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    Threaded Messages (4)

  2. HOW TO DEPLOY AN EJB JAR[ Go to top ]

    Is this to do something with ejb-jars.xml? What and how can the descriptors be included so that WL is able to deploy the application without any error?

    Thanks & Regards,
    Harsh
  3. HOW TO DEPLOY AN EJB JAR[ Go to top ]

    Hi,

    from the first line of the error message it's clear that the Apache log4j.jar is not found in the classpath: "Class not found: Lorg/apache/log4j/Category;".

    So why you don't put it in the classpath? Just package you log4j.jar into your ear (e.g. under "lib"). Then add a "Class-Path: lib/log4j.jar" entry to your MANIFEST.MF file. You're done.

    Ciao,

    René
  4. HOW TO DEPLOY AN EJB JAR[ Go to top ]

    All the required libraries are already packaged in the EAR. But still when deploying WLS gives this exception. That is the core problem...perhaps due to some problem/mis-match in the descriptors it is not able to locate but the libraries are there in the EAR file.
    Any idea?
  5. HOW TO DEPLOY AN EJB JAR[ Go to top ]

    At times it also gives the following error and the WLS crashes. Any idea of the two problems. I would appreciate any advances towards the solution.

    Thanks for you time.

    Regards,
    Harsh

    [FileUploadAction] upload started
    [FileUploadAction] upload complete
    #
    # HotSpot Virtual Machine Error, Internal Error
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    #
    # Error ID: 4349254E560E43505000F4
    #
    # Problematic Thread: prio=5 tid=0x80f590 nid=0xf44 runnable
    #

    C:\bea\user_projects\MTRSDomain>ENDLOCAL