wl6.1sp2 can't find classes in WEB-INF/lib - Weblogic

This is a discussion on wl6.1sp2 can't find classes in WEB-INF/lib - Weblogic ; Hi, I meet a very strange problem. I use struts in my application.so I put struts.jar in web-inf/lib. In the .war file, the struts.jar can be found under web-inf/lib. my servlet configuration in web.xml is: action org.apache.struts.action.ActionServlet application StrutsProperties config ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: wl6.1sp2 can't find classes in WEB-INF/lib

  1. wl6.1sp2 can't find classes in WEB-INF/lib


    Hi,
    I meet a very strange problem.

    I use struts in my application.so I put struts.jar in web-inf/lib.
    In the .war file, the struts.jar can be found under web-inf/lib.

    my servlet configuration in web.xml is:

    action
    org.apache.struts.action.ActionServlet

    application
    StrutsProperties


    config
    /WEB-INF/struts-config.xml

    1


    when this .war file is deploy, the console not show any error message.
    then,when i visit a jsp page that has a tag, the console will show
    the error below:
    <[WebAppServletContext(5418530,struts,/
    struts)] Servlet failed with Exception
    java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :486)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:11
    1)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 97)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 90)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 90)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 53)
    at weblogic.utils.classloaders.ChangeAwareClassLoader .loadClass(ChangeAw
    areClassLoader.java:43)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:313)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at org.apache.struts.taglib.html.FormTag.doStartTag(F ormTag.java:563)
    at jsp_servlet.__logon._jspService(__logon.java:137)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java: 27)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    pl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    pl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    pl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
    rvletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:120)
    >


    note "org/apache/struts/action/ActionForm" can be found when i open struts.jar
    in web-inf/lib
    why weblogic can't find this class but can find the "org.apache.struts.action.ActionServlet",
    these 2 classes should all be located in struts.jar

    i used it in win2k,so i think it may not be connect with case sensitive.

    Any one can give me some help or a link I did not found in this group.

    Thanks



  2. Re: wl6.1sp2 can't find classes in WEB-INF/lib


    Are the tld files including the struts-html.tld in the web-inf directory
    & specified in the web.xml deployment descriptor?

    thanks,

    Deepak


    "erric_sarra" wrote:
    >
    >Hi,
    >I meet a very strange problem.
    >
    >I use struts in my application.so I put struts.jar in web-inf/lib.
    >In the .war file, the struts.jar can be found under web-inf/lib.
    >
    >my servlet configuration in web.xml is:
    >
    > action
    > org.apache.struts.action.ActionServlet
    >
    > application
    > StrutsProperties
    >

    >
    > config
    > /WEB-INF/struts-config.xml
    >

    > 1
    >

    >
    >when this .war file is deploy, the console not show any error message.
    >then,when i visit a jsp page that has a tag, the console
    >will show
    >the error below:
    > <[WebAppServletContext(5418530,struts,/
    >struts)] Servlet failed with Exception
    >java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
    > at java.lang.ClassLoader.defineClass0(Native Method)
    > at java.lang.ClassLoader.defineClass(ClassLoader.java :486)
    > at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:11
    >1)
    > at java.net.URLClassLoader.defineClass(URLClassLoader .java:248)
    > at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
    > at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
    > at java.security.AccessController.doPrivileged(Native Method)
    > at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    > at java.lang.ClassLoader.loadClass(ClassLoader.java:2 97)
    > at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:286)
    > at java.lang.ClassLoader.loadClass(ClassLoader.java:2 90)
    > at java.lang.ClassLoader.loadClass(ClassLoader.java:2 90)
    > at java.lang.ClassLoader.loadClass(ClassLoader.java:2 53)
    > at weblogic.utils.classloaders.ChangeAwareClassLoader .loadClass(ChangeAw
    >areClassLoader.java:43)
    > at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:313)
    > at java.lang.Class.forName0(Native Method)
    > at java.lang.Class.forName(Class.java:120)
    > at org.apache.struts.taglib.html.FormTag.doStartTag(F ormTag.java:563)
    > at jsp_servlet.__logon._jspService(__logon.java:137)
    > at weblogic.servlet.jsp.JspBase.service(JspBase.java: 27)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    >pl.java:265)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    >pl.java:304)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    >pl.java:200)
    > at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
    >rvletContext.java:2495)
    > at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
    >pl.java:2204)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:139)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:120)
    >>

    >
    >note "org/apache/struts/action/ActionForm" can be found when i open struts.jar
    >in web-inf/lib
    >why weblogic can't find this class but can find the "org.apache.struts.action.ActionServlet",
    >these 2 classes should all be located in struts.jar
    >
    >i used it in win2k,so i think it may not be connect with case sensitive.
    >
    >Any one can give me some help or a link I did not found in this group.
    >
    >Thanks
    >
    >



  3. Re: wl6.1sp2 can't find classes in WEB-INF/lib


    1.the struts-html.tld is in web-inf directory
    2.this is part of the web.xml
    ===========

    /WEB-INF/struts-html.tld
    /WEB-INF/struts-html.tld


    /WEB-INF/struts-bean.tld
    /WEB-INF/struts-bean.tld


    /WEB-INF/struts-logic.tld
    /WEB-INF/struts-logic.tld


    /WEB-INF/struts-template.tld
    /WEB-INF/struts-template.tld

    ================


    "Deepak Vohra" wrote:
    >
    >Are the tld files including the struts-html.tld in the web-inf directory
    >& specified in the web.xml deployment descriptor?
    >
    >thanks,
    >
    >Deepak
    >
    >
    >"erric_sarra" wrote:
    >>
    >>Hi,
    >>I meet a very strange problem.
    >>
    >>I use struts in my application.so I put struts.jar in web-inf/lib.
    >>In the .war file, the struts.jar can be found under web-inf/lib.
    >>
    >>my servlet configuration in web.xml is:
    >>
    >> action
    >> org.apache.struts.action.ActionServlet
    >>
    >> application
    >> StrutsProperties
    >>

    >>
    >> config
    >> /WEB-INF/struts-config.xml
    >>

    >> 1
    >>

    >>
    >>when this .war file is deploy, the console not show any error message.
    >>then,when i visit a jsp page that has a tag, the console
    >>will show
    >>the error below:
    >> <[WebAppServletContext(5418530,struts,/
    >>struts)] Servlet failed with Exception
    >>java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
    >> at java.lang.ClassLoader.defineClass0(Native Method)
    >> at java.lang.ClassLoader.defineClass(ClassLoader.java :486)
    >> at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:11
    >>1)
    >> at java.net.URLClassLoader.defineClass(URLClassLoader .java:248)
    >> at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
    >> at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
    >> at java.security.AccessController.doPrivileged(Native Method)
    >> at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    >> at java.lang.ClassLoader.loadClass(ClassLoader.java:2 97)
    >> at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:286)
    >> at java.lang.ClassLoader.loadClass(ClassLoader.java:2 90)
    >> at java.lang.ClassLoader.loadClass(ClassLoader.java:2 90)
    >> at java.lang.ClassLoader.loadClass(ClassLoader.java:2 53)
    >> at weblogic.utils.classloaders.ChangeAwareClassLoader .loadClass(ChangeAw
    >>areClassLoader.java:43)
    >> at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:313)
    >> at java.lang.Class.forName0(Native Method)
    >> at java.lang.Class.forName(Class.java:120)
    >> at org.apache.struts.taglib.html.FormTag.doStartTag(F ormTag.java:563)
    >> at jsp_servlet.__logon._jspService(__logon.java:137)
    >> at weblogic.servlet.jsp.JspBase.service(JspBase.java: 27)
    >> at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    >>pl.java:265)
    >> at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    >>pl.java:304)
    >> at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
    >>pl.java:200)
    >> at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
    >>rvletContext.java:2495)
    >> at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
    >>pl.java:2204)
    >> at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:139)
    >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:120)
    >>>

    >>
    >>note "org/apache/struts/action/ActionForm" can be found when i open

    >struts.jar
    >>in web-inf/lib
    >>why weblogic can't find this class but can find the "org.apache.struts.action.ActionServlet",
    >>these 2 classes should all be located in struts.jar
    >>
    >>i used it in win2k,so i think it may not be connect with case sensitive.
    >>
    >>Any one can give me some help or a link I did not found in this group.
    >>
    >>Thanks
    >>
    >>

    >



  4. Re: wl6.1sp2 can't find classes in WEB-INF/lib


    Hi, I have found something.

    When I put struts.jar into weblogic classpath, then all is ok.
    So I think this problem is related with classloader.

    I checked my application,found that:
    my ejb.jar is deploy seperately
    my .war is deploy seperately
    that means my ejb has a classloader, and my .war has another classloader.
    then anyone can give me help on How this classloader work together
    eg:when I click a page in .war, the working classloader is the classloader for
    war(I guess), then in what circumstances, the classloader will be replaceed by
    system default classloader?


    "Emmanuel Bernard" wrote:
    >
    >Does your struts jar contain 'dot' (except for .jar) like struts-1.1.jar
    >?
    >There was a bug in the wls7 relating to this subject.
    >Workaround : remove extra dots like struts-1.1.jar -> struts.jar



+ Reply to Thread