12 Replies Latest reply on Feb 10, 2012 10:35 AM by Calebe Varga

    Seam Rest on Jboss 7

    Fabricio Lemos Newbie

      Since Seam 3.1.0.CR1 was not released yet, is there any workaround to make Seam Rest work with Jboss 7?


      I´m with this problem: SEAMREST-44


      thanks

        • 1. Re: Seam Rest on Jboss 7
          Jason Porter Master

          Looks like Jozef stated the workaround in a comment. You'll need to add some extra dependencies to your application.

          • 2. Re: Seam Rest on Jboss 7
            Shane Bryzak Master

            It looks like that issue is resolved now.  Try using version 3.1.0.Beta2 for seam-rest, hopefully it will define the correct dependencies for AS7.

            • 3. Re: Seam Rest on Jboss 7
              Fabricio Lemos Newbie

              Jason, I´m already importing commons-httpclient 3.1.


              Shane, I upgraded seam-rest to 3.1.0.Beta2 and now I guess I need to import Seam Logging, but could not find it. Here is the exception:




              09:57:45,916 WARN  [org.jboss.weld] (MSC service thread 1-4) Could not load portable extension org.jboss.seam.rest.client.RestClientExtension: java.lang.RuntimeException: Error getting reflective information for class org.jboss.seam.rest.client.RestClientExtension
                   at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
                   at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:116) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
                   at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
                   at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
                   at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
                   at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
                   at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
                   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
                   at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
              Caused by: java.lang.NoClassDefFoundError: Lorg/jboss/seam/logging/Logger;
                   at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_25]
                   at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_25]
                   at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_25]
                   at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)
                   at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
                   ... 9 more
              Caused by: java.lang.ClassNotFoundException: org.jboss.seam.logging.Logger from [Module "deployment.jee6-intranet.war:main" from Service Module Loader]
                   at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
                   at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
                   ... 14 more
              
              09:57:45,932 WARN  [org.jboss.weld] (MSC service thread 1-4) Could not load portable extension org.jboss.seam.rest.exceptions.ExceptionMappingExtension: java.lang.RuntimeException: Error getting reflective information for class org.jboss.seam.rest.exceptions.ExceptionMappingExtension
                   at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
                   at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:116) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
                   at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
                   at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
                   at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
                   at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
                   at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
                   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
                   at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
              Caused by: java.lang.NoClassDefFoundError: Lorg/jboss/seam/logging/Logger;
                   at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_25]
                   at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_25]
                   at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_25]
                   at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)
                   at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
                   ... 9 more
              Caused by: java.lang.ClassNotFoundException: org.jboss.seam.logging.Logger from [Module "deployment.jee6-intranet.war:main" from Service Module Loader]
                   at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
                   at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
                   ... 14 more
              
              09:57:45,979 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."jee6-intranet.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."jee6-intranet.war".INSTALL: Failed to process phase INSTALL of deployment "jee6-intranet.war"
                   at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
                   at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
                   at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
                   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
                   at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
              Caused by: java.lang.RuntimeException: Error getting reflective information for class org.jboss.seam.rest.SeamRestStartupListener
                   at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
                   at org.jboss.as.ee.component.EEModuleClassDescription$DefaultConfigurator.configure(EEModuleClassDescription.java:163)
                   at org.jboss.as.ee.component.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:134)
                   at org.jboss.as.ee.component.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:114)
                   at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
                   at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
                   at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)
                   at org.jboss.as.ee.component.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:63)
                   at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
                   ... 5 more
              Caused by: java.lang.NoClassDefFoundError: Lorg/jboss/seam/logging/Logger;
                   at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_25]
                   at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_25]
                   at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_25]
                   at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)
                   at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
                   ... 13 more
              Caused by: java.lang.ClassNotFoundException: org.jboss.seam.logging.Logger from [Module "deployment.jee6-intranet.war:main" from Service Module Loader]
                   at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
                   at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
                   at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
                   ... 18 more



              • 5. Re: Seam Rest on Jboss 7
                Shane Bryzak Master

                You need to add Solder to your project, that's where the org.jboss.seam.logging classes are.  Adding this to your pom should do the trick, let me know if it doesn't work:



                <dependency>
                   <groupId>org.jboss.seam.solder</groupId>
                   <artifactId>seam-solder</artifactId>
                   <scope>compile</scope>
                </dependency>




                • 6. Re: Seam Rest on Jboss 7
                  Fabricio Lemos Newbie

                  Now the error is:



                  09:20:29,202 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."jee6-intranet.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jee6-intranet.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "jee6-intranet.war"
                       at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
                       at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
                       at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
                       at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
                  Caused by: java.lang.NoClassDefFoundError: org/jboss/logmanager/Logger$AttachmentKey
                       at org.jboss.seam.solder.logging.internal.JBossLogManagerProvider.<clinit>(JBossLogManagerProvider.java:36)
                       at org.jboss.seam.solder.logging.internal.LoggerProviders.findProvider(LoggerProviders.java:33)
                       at org.jboss.seam.solder.logging.internal.LoggerProviders.<clinit>(LoggerProviders.java:28)
                       at org.jboss.seam.solder.logging.internal.Logger.getLogger(Logger.java:2164)
                       at org.jboss.seam.logging.Logger.<init>(Logger.java:44)
                       at org.jboss.seam.logging.Logger.getLogger(Logger.java:1965)
                       at org.jboss.seam.logging.Logger.getLogger(Logger.java:1991)
                       at org.jboss.seam.rest.client.RestClientExtension.<clinit>(RestClientExtension.java:31)
                       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_25]
                       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_25]
                       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_25]
                       at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_25]
                       at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:117)
                       at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100)
                       at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86)
                       at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
                       ... 5 more
                  Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.Logger$AttachmentKey from [Module "deployment.jee6-intranet.war:main" from Service Module Loader]
                       at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
                       at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
                       ... 21 more



                  Two more questions:


                  Do I have to update seam-bom to 3.1.0.Beta2? Last time I tried some modules did not have a 3.1.0.Beta2 version. Right not the modules that I´m using in 3.1.0.Beta2 version are seam-rest, seam-rest-api, seam-solder, seam-solder-api. The others are still in 3.0.0.Final.


                  If I need seam-solder to use seam-rest, shouldn´t seam-rest declare a transitive dependency to solder?


                  • 7. Re: Seam Rest on Jboss 7
                    Fabricio Lemos Newbie

                    There is a typo in the previous msg: Right now the modules....

                    • 8. Re: Seam Rest on Jboss 7
                      Jason Porter Master

                      All modules have been updated to 3.1.0.Beta2, please try with 3.1.0.Beta2

                      • 9. Re: Seam Rest on Jboss 7
                        Shane Bryzak Master

                        Fabricio Lemos wrote on Sep 02, 2011 08:26:


                        If I need seam-solder to use seam-rest, shouldn´t seam-rest declare a transitive dependency to solder?



                        The seam-rest module does have a dependency on Solder, however there is a problem with Solder 3.1.0.Beta2 in that it doesn't correctly configure the logmanager (my fault).  To workaround this in the meantime, you can add the following code snippet to your project's pom.xml:




                                 
                           <build>
                              <plugins>
                        
                                 <!-- This plugin config is used to set the Dependencies entry in META-INF/MANIFEST.MF so that in AS7
                                      both JBoss Logging and the JBoss Log manager will be available in the classpath -->
                                 <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-jar-plugin</artifactId>
                                    <configuration>
                                       <archive>
                                          <manifestEntries>
                                             <Dependencies>org.jboss.logging,org.jboss.logmanager</Dependencies>
                                          </manifestEntries>
                                       </archive>
                                    </configuration>
                                 </plugin>
                        
                              </plugins>
                           </build>
                        




                        • 10. Re: Seam Rest on Jboss 7
                          Calebe Varga Newbie

                          I've made the given instructions, but no success.


                          I am having problems using @RestClient


                          After configuring manually the client dependancies (httpclient, velocity and freemaker)
                          i am still having difficulties to make it work.




                          01:25:06,201 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/tokstok-web-vitrine-frontend]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class org.jboss.seam.rest.SeamRestStartupListener: javax.enterprise.inject.AmbiguousResolutionException: Multiple TemplatingProviders found on classpath. Select the prefered one.
                               at org.jboss.seam.rest.templating.TemplatingMessageBodyWriter.init(TemplatingMessageBodyWriter.java:73) [seam-rest-3.1.0.Final.jar:]
                               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]
                               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]





                          I am using seam rest 3.1.0.Final and JBoss 7.1.0.CR1.


                          Any suggestions ?


                          Thanks

                          • 11. Re: Seam Rest on Jboss 7
                            Jason Porter Master

                            Could you past the contents of your pom.xml please?

                            • 12. Re: Seam Rest on Jboss 7
                              Calebe Varga Newbie

                              Hi Jason, sorry for the delay.

                               

                              The problem was on the configuration order and multiple templating systems (velocity + freemaker).

                               

                              Thanks.