3 Replies Latest reply on Jun 2, 2006 7:31 AM by Peter Buus

    War unable to find classes from common.jar in ear

    Nancy Aggarwal Newbie

      Hi,
      I am currently using jdk1.4, jboss-4.0.4SP and my web application is based on JSF-framework

      We have developed a web-application named "framework"
      My framework application is working properly as a Web-Application

      I have created a common.jar file for sharing classes across my applications.
      so I have created an EAR file whose contents are common.jar, framework.war and a META-INF folder containing application.xml and Manifest.mf files.

      My application.xml is as follows

      <?xml version="1.0" encoding="ISO-8859-1"?>
      
      <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
      
      <application>
       <display-name>FrameWork</display-name>
       <module>
       <java>common.jar</java>
       </module>
       <module>
       <web>
       <web-uri>framework.war</web-uri>
       <context-root>/framework</context-root>
       </web>
       </module>
      
      
      
      </application>


      in framework.war's manifest file I have set the class path variable as
      Class-Path: ./common.jar


      My WEB-INF folder of framework.war do not contain any classes and lib as i have put all of them into common.jar.

      But when I hot deployed my EAR application I have got following error
      (snapshot)

      
      
      17:20:47,671 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
      17:20:49,671 INFO [StartupServletContextListener] ServletContext 'D:\JBoss-4.0.4\server\default\.\
      tmp\deploy\tmp33100Sample.ear-contents\framework-exp.war\' initialized.
      17:20:49,796 INFO [EARDeployer] Started J2EE application: file:/D:/JBoss-4.0.4/server/default/depl
      oy/Sample.ear
      17:20:52,625 INFO [EARDeployer] Init J2EE application: file:/D:/JBoss-4.0.4/server/default/deploy/
      Test.ear
      17:21:05,468 INFO [TomcatDeployer] deploy, ctxPath=/framework99, warUrl=.../tmp/deploy/tmp33101Tes
      t.ear-contents/framework99-exp.war/
      17:21:05,812 INFO [[/framework99]] Marking servlet Faces Servlet as unavailable
      



      Excpetion trace:
      17:21:05,812 ERROR [[/framework99]] Servlet /framework99 threw load() exception
      java.lang.ClassCastException
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055)
       at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
       at org.apache.catalina.core.StandardContext.loadOnStartup
      
      17:25:56,578 ERROR [ClassUtils] Class com.daffodilwoods.framework.component.DDataScroller not found
      
      java.lang.ClassNotFoundException: com.daffodilwoods.framework.component.DDataScroller
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)



      Please help in solving this problem.