3

In a seam-gen generated application the following exception is thrown during deployment:

ERROR [LoadMgr3] Not resheduling failed loading task, loadTask=org.jboss.mx.loading.ClassLoadingTask@8c5c9c{classname: org.jboss.seam.remoting.gwt.GWT14Service, requestingThread: Thread[ScannerThread,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@3e4532{ url=f
ile:/C:/dev/jboss-4.3.0.GA/server/default/deploy/myapp.ear/ ,addedOrder=50}, loadedClass: nullnull, loadOrder: 2147483647, loadException: java.lang.NoClassDefFoundError: com/google/gwt/user/server/rpc/SerializationPolicyProvider, threadTaskCount: 0, state: 1, #CCE: 1}
java.lang.NoClassDefFoundError: com/google/gwt/user/server/rpc/SerializationPolicyProvider
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
...
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)

The problem (and workaround) is described here. Since I don't use gwt, my question is why do I have this dependency when I'm not using gwt at all?

Seam version 2.1.2

EDIT: Just for the records: Until another solution is available I added gwt-servlet.jar in the file deployed-jars-ear.list this satisfies the deployment scanner.

stacker
  • 68,052
  • 28
  • 140
  • 210

3 Answers3

1

It looks like some part of seam just depends on classes from the gwt-servlet.jar.

Bet you have to take it as it is and hope for a code cleanup on seam's side, because it is surprising that your're required to add 'gwt' libs to your project even if you do not use gwt.

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
1

Here you can see Ant Target responsible for copying libraries used by Seam-gen

<target name="copy-lib" depends="copyseam, copyseamdependencies, copyjbossembedded, copy-icefaces-home, copy-icefaces-maven">
    <echo message="Copying Seam and dependencies to the ${project.home}/lib directory..."/>

    <copy todir="${project.home}/lib" overwrite="true">
        <fileset dir="${seam.dir}/lib">
            <exclude name="jsf-facelets.jar" if="icefaces.property"/>
            <exclude name="ajax4jsf*.jar" if="icefaces.property"/>
            <exclude name="richfaces*.jar" if="icefaces.property"/>
            <exclude name="jboss-container.jar"/>
            <exclude name="jboss-seam-wicket.jar"/>
            <exclude name="jboss-seam-resteasy.jar"/>
            <exclude name="test/jboss-deplyers.jar"/>
            <exclude name="test/jboss-embedded-api.jar"/>
            <exclude name="interop/**/*"/>
            <exclude name="gen/**/*"/>
        </fileset>
        <fileset file="${driver.jar}"/>
    </copy>

    <!-- we must use an endorsed jars directory containing JAXB 2.1 for running SeamTest under Java 6 -->
    <copy todir="${project.home}/lib/endorsed" file="${seam.dir}/lib/gen/jaxb-api.jar" overwrite="true"/>

    <echo message="Copying JBoss Embedded configuration to the ${project.home}/bootstrap directory..."/>
    <copy todir="${project.home}/bootstrap" overwrite="true">
        <fileset dir="${seam.dir}/bootstrap"/>
    </copy>

</target>

Notice it is not exclude GWT library. But As far i know, Seam does not depends on GWT library. So you can set up your custom exclude. Here you can see how your Seam app should looks like.

The build.xml file Seam-gen uses is located in

<SEAM_HOME&GT;/seam-gen/build.xml

Community
  • 1
  • 1
Arthur Ronald
  • 33,349
  • 20
  • 110
  • 136
  • Thanks, but there is no other jar in the lib dir but gwt-servlet.jar which name indicates that it could be involved in this issue. – stacker Jun 09 '10 at 16:31
  • @stacker Have you seen Chris Bauer comment: http://seamframework.org/Community/NoClassDefFoundExceptionOnGoogleSerializationPolicyProvider#comment72922 – Arthur Ronald Jun 09 '10 at 16:57
  • @arthur-ronald-f-d-garcia thanks he says it's logged as DEBUG (including the exception) and user shouldn't worry. Now I'm relaxed and if I have time I'm going to find out why this appears as error. – stacker Jun 09 '10 at 17:14
  • For the records I excluded gwt-servlet.jar and jboss-seam-remoting.jar – stacker Oct 08 '10 at 15:20
0

As a matter of fact, checking on my seam project, the awt library is an internal dependecie for some faces modules, you just need to be sure to add gwt-servlet-2.3.0.jar to your

Project-ear.ear\Project.war\WEB-INF\lib

Camilo Casadiego
  • 907
  • 3
  • 9
  • 33