7 Replies Latest reply on Oct 31, 2007 7:44 AM by pmuir

    Exception trying to run seam on glassfish.java.lang.NoClassD

    deepsix

      Hi,

      I have been trying to get a simple seam application up and running on glassfish. Whenever i try to deploy the application on glassfish, i get an error:

      App client jboss-seam.jar did not specify Main-Class in its manifest as described in the Java EE specification; no annotations in this app client will be processed
      deployed with moduleid = seam-facelets
      java.lang.NoClassDefFoundError: org/jboss/util/file/ArchiveBrowser$Filter
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:125)
       at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:149)
       at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:84)
       at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:898)
       at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:184)
       at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
       at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
       at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
       at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
       at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
       at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
      


      I am at a loss as to what this means. Has some one got this exception before? Does this mean that i have missed out on some jar dependency some where or i have made some error in persistence.xml or elsewhere..

      Any help would be greatly appreciated.


        • 1. Re: Exception trying to run seam on glassfish.java.lang.NoCl
          pmuir

          1) Seam should be declared as an ejb module, not a jar module
          2) Include jboss-archive-browsing.jar and jboss-common-core.jar in your ear lib/ directory.

          • 2. Re: Exception trying to run seam on glassfish.java.lang.NoCl
            deepsix

            Thanks!
            I included these two jars and changed the seam declaration from jar module to ejb module.

            But i get a different exception now.

            SMGT0007: Self Management Rules service is enabled
            Application server startup complete.
            Exception occured in J2EEC Phasejava.lang.IllegalArgumentException: Invalid ejb jar [jboss-seam.jar]: it contains zero ejb.
            Note:
            1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean.
            2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
            3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven), please check server.log to see whether the annotations were processed properly.
            com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment descriptors for module [seam-facelets] -- Invalid ejb jar [jboss-seam.jar]: it contains zero ejb.
            
            


            This is how my application.xml looks like.. nothing major.

            <?xml version="1.0" encoding="UTF-8"?>
            <application xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
             version="5">
            
             <display-name>seam-facelets</display-name>
            
             <module>
             <web>
             <web-uri>sesam-facelets-war.war</web-uri>
             <context-root>/seam-facelets</context-root>
             </web>
             </module>
             <module>
             <ejb>seam-facelets-ejb.jar</ejb>
             </module>
            <module>
             <ejb>jboss-seam.jar</ejb>
             </module>
            </application>
            



            I think i am missing something simple somewhere..
            just cant figure out what..

            • 3. Re: Exception trying to run seam on glassfish.java.lang.NoCl
              deepsix

              After a bit of googling, came across this bug

              https://glassfish.dev.java.net/issues/show_bug.cgi?id=3386

              And this one:
              http://jira.jboss.org/jira/browse/JBSEAM-1590

              Looks like an autodeployment issue in glassfish.

              • 4. Re: Exception trying to run seam on glassfish.java.lang.NoCl
                deepsix

                When i now try to deploy my application, i now get

                ould not expand entry null into destination I:\glassfish\domains\domain1\applications\j2ee-apps\seam-facelets\sesam-facelets-war_war
                java.io.IOException: Error expanding archive I:\glassfish\domains\domain1\applications\j2ee-apps\seam-facelets\sesam-facelets-war.war; please see the server log file for more information
                 at com.sun.enterprise.deployment.backend.J2EEModuleExploder.explodeJar(J2EEModuleExploder.java:359)
                 at com.sun.enterprise.deployment.backend.J2EEModuleExploder.explodeEar(J2EEModuleExploder.java:296)
                 at com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:285)
                 at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:207)
                 at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
                 at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
                 at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
                 at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
                 at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
                 at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788)
                 at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
                 at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
                Caused by: java.util.zip.ZipException: The system cannot find the file specified
                 at java.util.zip.ZipFile.open(Native Method)
                 at java.util.zip.ZipFile.<init>(ZipFile.java:203)
                 at java.util.jar.JarFile.<init>(JarFile.java:132)
                 at java.util.jar.JarFile.<init>(JarFile.java:97)
                 at com.sun.enterprise.deployment.backend.J2EEModuleExploder.explodeJar(J2EEModuleExploder.java:311)
                 ... 11 more
                Exception occured in J2EEC Phase
                com.sun.enterprise.deployment.backend.IASDeploymentException: Error expanding archive I:\glassfish\domains\domain1\applications\j2ee-apps\seam-facelets\sesam-facelets-war.war; please see the server log file for more information
                 at com.sun.enterprise.deployment.backend.J2EEModuleExploder.explodeJar(J2EEModuleExploder.java:359)
                 at com.sun.enterprise.deployment.backend.J2EEModuleExploder.explodeEar(J2EEModuleExploder.java:296)
                 at com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:285)
                 at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:207)
                 at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
                 at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
                


                Is something wrong with my conf file again(missing some entry ?) Or is it just that i shouldnt be using glassfish..

                • 5. Re: Exception trying to run seam on glassfish.java.lang.NoCl
                  pmuir

                  What version of Seam?

                  • 6. Re: Exception trying to run seam on glassfish.java.lang.NoCl
                    deepsix

                    I am using 2.0.0.CR2 version of seam.
                    But i found out my problem.

                    I had a typo in application.xml which said "sesam-facelets-war" instead of seam-facelets.

                    Had to look at the first line of the stack trace carefully to see that happening.

                    Apologies for the trouble caused.. And thanks for the help and patience.

                    • 7. Re: Exception trying to run seam on glassfish.java.lang.NoCl
                      pmuir

                      You should place all the ear libraries in a lib directory in your deployed ear for JBoss AS 4.2 rather than declaring in application.xml