servlet cannot find classes when in a EAR - Weblogic

This is a discussion on servlet cannot find classes when in a EAR - Weblogic ; Hi I have a EAR that contains a EJB module and a web application module. The Web application module contains two servlets to be deployed. One is Action Servlet (struts.jar) and the other is our home-made. I am able to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: servlet cannot find classes when in a EAR

  1. servlet cannot find classes when in a EAR


    Hi

    I have a EAR that contains a EJB module and a web application module.
    The Web application module contains two servlets to be deployed. One is Action
    Servlet (struts.jar) and the other is our home-made. I am able to deploy the
    WAR and JAR separately, but when these are packaged in an EAR I get the following
    errors

    <03-Oct-2003 11:14:58 o'clock BST> <[ServletContext(id=6832671,name=payments-web,context-path=/payments-web)]:
    Servlet class org.apache.struts.action.ActionServlet for servlet action could
    not be handled by the classloader with classpath C:\bea2\user_projects\domains\paymentsdomain\myser ver\upload\payments.ear\payments-web.war;C:\bea2\user_projects\domains\paymentsdoma in\myserver\upload\payments.ear\payments-web.war\WEB-INF\classes;C:\bea2\user_projects\domains\payments domain\.\myserver\.wlnotdelete\extract\myserver_pa yments_payments-web\jarfiles\WEB-INF\lib\struts30440.jar.
    java.lang.ExceptionInInitializerError.>
    <03-Oct-2003 11:14:58 o'clock BST> failed to preload on startup in Web application: "payments-web".
    javax.servlet.ServletException: [HTTP:101254][ServletContext(id=6832671,name=payments-web,context-path=/payments-web)]:
    Servlet class org.apache.struts.action.ActionServlet for servlet action could
    not be handled by the classloader with classpath C:\bea2\user_projects\domains\paymentsdomain\myser ver\upload\payments.ear\payments-web.war;C:\bea2\user_projects\domains\paymentsdoma in\myserver\upload\payments.ear\payments-web.war\WEB-INF\classes;C:\bea2\user_projects\domains\payments domain\.\myserver\.wlnotdelete\extract\myserver_pa yments_payments-web\jarfiles\WEB-INF\lib\struts30440.jar.
    java.lang.ExceptionInInitializerError.
    at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubImpl.java:822)
    at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppServletContext.java:3236)
    at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebAppServletContext.java:3181)
    at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:3154)
    at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServletContext.java:5637)
    at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:866)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer.java:2017)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2058)
    at weblogic.management.deploy.slave.SlaveDeployer$Com ponentActivateTask.activateContainer(SlaveDeployer .java:2624)
    at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.doCommit(SlaveDeployer.java:2547)
    at weblogic.management.deploy.slave.SlaveDeployer$Tas k.commit(SlaveDeployer.java:2349)
    at weblogic.management.deploy.slave.SlaveDeployer$Tas k.checkAutoCommit(SlaveDeployer.java:2431)
    at weblogic.management.deploy.slave.SlaveDeployer$Tas k.prepare(SlaveDeployer.java:2343)
    at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.prepare(SlaveDeployer.java:2511)
    at weblogic.management.deploy.slave.SlaveDeployer.pro cessPrepareTask(SlaveDeployer.java:833)
    at weblogic.management.deploy.slave.SlaveDeployer.pre pareDelta(SlaveDeployer.java:542)
    at weblogic.management.deploy.slave.SlaveDeployer.pre pareUpdate(SlaveDeployer.java:500)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execu te(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    >

    <03-Oct-2003 11:14:58 o'clock BST> were detected while initiating Deploy task for application payments.>
    <03-Oct-2003 11:14:58 o'clock BST> complete the deployment task with ID 1 for the application payments.
    weblogic.management.DeploymentException:
    Exception:weblogic.management.ApplicationException : start() failed.
    Module: payments-web Error: java.lang.ExceptionInInitializerError



    My observations are
    1. The servlet has been located.
    2. Please note the message that the ActionServlet class could not be handled
    by the classloader. What does this mean ???
    3 I also tried putting these jars in APP-INF/lib but got the same errors


    I am using WLS 8.1 SP1 on XP professional


    Thanks
    Jasmeet

  2. Re: servlet cannot find classes when in a EAR


    Just to add on to that ...

    If I put all my required/referemced application classes and dependent classes
    in System CLASSPATH, the whole deploys and runs quite nicely.

    Is that allowed ?? Would it not be better to have some application level classloading
    rather than going for the system classpath

    thanks
    jasmeet


    "jasmeet" wrote:
    >
    >Hi
    >
    >I have a EAR that contains a EJB module and a web application module.
    >The Web application module contains two servlets to be deployed. One
    >is Action
    >Servlet (struts.jar) and the other is our home-made. I am able to deploy
    >the
    >WAR and JAR separately, but when these are packaged in an EAR I get the
    >following
    >errors
    >
    ><03-Oct-2003 11:14:58 o'clock BST> <[ServletContext(id=6832671,name=payments-web,context-path=/payments-web)]:
    >Servlet class org.apache.struts.action.ActionServlet for servlet action
    >could
    >not be handled by the classloader with classpath C:\bea2\user_projects\domains\paymentsdomain\myser ver\upload\payments.ear\payments-web.war;C:\bea2\user_projects\domains\paymentsdoma in\myserver\upload\payments.ear\payments-web.war\WEB-INF\classes;C:\bea2\user_projects\domains\payments domain\.\myserver\.wlnotdelete\extract\myserver_pa yments_payments-web\jarfiles\WEB-INF\lib\struts30440.jar.
    >java.lang.ExceptionInInitializerError.>
    ><03-Oct-2003 11:14:58 o'clock BST> >"action"
    >failed to preload on startup in Web application: "payments-web".
    >javax.servlet.ServletException: [HTTP:101254][ServletContext(id=6832671,name=payments-web,context-path=/payments-web)]:
    >Servlet class org.apache.struts.action.ActionServlet for servlet action
    >could
    >not be handled by the classloader with classpath C:\bea2\user_projects\domains\paymentsdomain\myser ver\upload\payments.ear\payments-web.war;C:\bea2\user_projects\domains\paymentsdoma in\myserver\upload\payments.ear\payments-web.war\WEB-INF\classes;C:\bea2\user_projects\domains\payments domain\.\myserver\.wlnotdelete\extract\myserver_pa yments_payments-web\jarfiles\WEB-INF\lib\struts30440.jar.
    >java.lang.ExceptionInInitializerError.
    > at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubImpl.java:822)
    > at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppServletContext.java:3236)
    > at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebAppServletContext.java:3181)
    > at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:3154)
    > at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServletContext.java:5637)
    > at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:866)
    > at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer.java:2017)
    > at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2058)
    > at weblogic.management.deploy.slave.SlaveDeployer$Com ponentActivateTask.activateContainer(SlaveDeployer .java:2624)
    > at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.doCommit(SlaveDeployer.java:2547)
    > at weblogic.management.deploy.slave.SlaveDeployer$Tas k.commit(SlaveDeployer.java:2349)
    > at weblogic.management.deploy.slave.SlaveDeployer$Tas k.checkAutoCommit(SlaveDeployer.java:2431)
    > at weblogic.management.deploy.slave.SlaveDeployer$Tas k.prepare(SlaveDeployer.java:2343)
    > at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.prepare(SlaveDeployer.java:2511)
    > at weblogic.management.deploy.slave.SlaveDeployer.pro cessPrepareTask(SlaveDeployer.java:833)
    > at weblogic.management.deploy.slave.SlaveDeployer.pre pareDelta(SlaveDeployer.java:542)
    > at weblogic.management.deploy.slave.SlaveDeployer.pre pareUpdate(SlaveDeployer.java:500)
    > at weblogic.drs.internal.SlaveCallbackHandler$1.execu te(SlaveCallbackHandler.java:25)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    >>

    ><03-Oct-2003 11:14:58 o'clock BST>
    > >were detected while initiating Deploy task for application payments.>
    ><03-Oct-2003 11:14:58 o'clock BST> >to
    >complete the deployment task with ID 1 for the application payments.
    >weblogic.management.DeploymentException:
    >Exception:weblogic.management.ApplicationException : start() failed.
    > Module: payments-web Error: java.lang.ExceptionInInitializerError
    >
    >
    >
    >My observations are
    >1. The servlet has been located.
    >2. Please note the message that the ActionServlet class could
    >not be handled
    >by the classloader. What does this mean ???
    >3 I also tried putting these jars in APP-INF/lib but got the same errors
    >
    >
    >I am using WLS 8.1 SP1 on XP professional
    >
    >
    >Thanks
    >Jasmeet



+ Reply to Thread