Struts - war deployment

Discussions

Web tier: servlets, JSP, Web frameworks: Struts - war deployment

  1. Struts - war deployment (3 messages)

    hi all;

    we have created an application and are trying to 'war' it but we are not really succesfull;

    I know that there is a classloading problem but i havant got a clue what to change:
    Im using a war and my ejbs are in seperate jars. I have put the utility jars in my classpath of the server(ex struts.jar) and in the web-inf/lib of my war file.

    the error I receive when i try to go a page by the action servlet is :

    Anybody got a clue?

    <6-jan-04 14:28:54 CET> <Error> <HTTP> <[WebAppServletContext(3500811,mobific,/m
    obific)] MoBiFiCControllerServlet: Error creating Action instance for path '/com
    plexRequestActionServlet', class name 'com.mobistar.mobific.gui.struts.actions.C
    omplexRequestAction'
    java.lang.ClassNotFoundException: com.mobistar.mobific.gui.struts.actions.Comple
    xRequestAction
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:115)
            at org.apache.struts.action.ActionServlet.processActionCreate(ActionServ
    let.java:1631)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:157
    7)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2546)
            at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2260)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    Threaded Messages (3)

  2. Struts - war deployment[ Go to top ]

    1. If a utility class is being used only by the WAR module, then package it only inside WEB-INF/lib. DO NOT PACKAGE it anywhere else.

    2. If a utility class is being used by both WAR as well as EJB module, keep it inside EAR file, but outside WAR and EJBs and use the manifest dependency attribute Class-Path to link the util jar to EJBs and WAR files.

    In general, IF YOU ARE HAVING TO PACKAGE A JAR FILE AT TWO LOCATIONS, YOU HAVE GOT SOMETHING WRONG! OnJava.com had a nice article on this.

    -Sanjay.
  3. Struts - war deployment 2[ Go to top ]

    apparently it is not a good idea to put the struts.jar in the systems classpath... So i managed to resolve former issue. But of course the solution is not obtained yet. I still have a classloading error:

    anybody?


    <EJB Exception during invocation from home: com.ejb.EJBConfig_731q73_HomeImpl@4f4b61 threw exception: java.lang.NoClassDefFoundError: com.gui.ejb.EJBSmsRemoteHome>
    java.lang.NoClassDefFoundError: com.gui.ejb.EJBSmsRemoteHome
    at com.mobistar.mobific.gui.common.service.ServiceLocator.class$(ServiceLocator.java)
    at com.gui.common.service.ServiceLocator.<clinit>(ServiceLocator.java:95)
    at com.gui.ejb.EJBConfig.getListOfValue(EJBConfig.java:187)
    at com.gui.ejb.EJBConfig_731q73_EOImpl.getListOfValue(EJBConfig_731q73_EOImpl.java:83)
    at com.gui.ejb.EJBConfig_731q73_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
  4. Struts - war deployment 2[ Go to top ]

    apparently it is not a good idea to put the struts.jar in the systems classpath... So i managed to resolve former issue. But of course the solution is not obtained yet. I still have a classloading error:

    >
    > anybody?
    >
    >
    > <EJB Exception during invocation from home: com.ejb.EJBConfig_731q73_HomeImpl@4f4b61 threw exception: java.lang.NoClassDefFoundError: com.gui.ejb.EJBSmsRemoteHome>
    > java.lang.NoClassDefFoundError: com.gui.ejb.EJBSmsRemoteHome
    > at com.mobistar.mobific.gui.common.service.ServiceLocator.class$(ServiceLocator.java)
    > at com.gui.common.service.ServiceLocator.<clinit>(ServiceLocator.java:95)
    > at com.gui.ejb.EJBConfig.getListOfValue(EJBConfig.java:187)
    > at com.gui.ejb.EJBConfig_731q73_EOImpl.getListOfValue(EJBConfig_731q73_EOImpl.java:83)
    > at com.gui.ejb.EJBConfig_731q73_EOImpl_WLSkel.invoke(Unknown Source)
    > at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
    Can you provide more info on your deployment? Are you using the extension mechanism as suggested above?