11 Replies Latest reply on Aug 29, 2011 8:17 AM by kozmoz

    Struts2 under JBoss ?

    rop

      Hi,

       

      Anyone here using Struts2 with Jboss6?

       

      What versions should I use?

       

      I am just trying to get the simplest "HelloWorld"-type webapp to execute, but keep running into different problems.

       

      I first tried Struts version 2.1.8.1. 

       

      I build with maven3 and the application runs OK on Tomcat.

       

      On Jboss however, I first got an error

        "Failed to parse source: cvc-datatype-valid.1.2.1: '2.2.3' is not a valid value for 'decimal'"

      Same as described here:   http://community.jboss.org/message/532593

      I read that one workaround was to turn off schema-validation in

        JBOSS_HOME\server\default\deployers\jbossweb.deployer\META-INF\war-deployers-jboss-beans.xml

      by adding

       

         <bean name="TldParsingDeployer" class="org.jboss.deployment.TldParsingDeployer">

             ...

            <property name="useSchemaValidation">false</property>     

         </bean>

       

      Is there a better solution/workaround to the above?

       

      Because I then got another deployment-error instead:

       

       

      [com.opensymphony.xwork2.util.FileManager]

      Could not create JarEntryRevision!: java.io.FileNotFoundException:

        vfs:\C:\program1\jboss6\server\default\deploy\msglist-webapp.war\WEB-INF\lib\struts2-sitemesh-plugin-2.1.8.1

       

       

      This one I dont understand, and didnt find a solution for.

      The file it complaints about

        C:\program1\jboss6\server\default\deploy\msglist-webapp.war\WEB-INF\lib\struts2-sitemesh-plugin-2.1.8.1.jar

      DOES exist on the server.

       

      I also tried the struts version in my POM to 2.2.1.1, but get a similar problem.

       

      Anyone can tell me what I am missing or doing wrong here?

       

      What are the versions to use and the basic things you need to do to get Struts2 running at all?

        • 1. Struts2 under JBoss ?
          genman
          • 2. Re: Struts2 under JBoss ?
            rop

            Hi Elias,

             

            Yes, that also solves the first problem I described above.

             

            But what about the second one?   Thats where I really get stuck...

             

            BR

            • 3. Re: Struts2 under JBoss ?
              rop

              Looks like it's related to this jira:

                https://issues.apache.org/jira/browse/WW-3507

               

              The problem they fixed there in Struts-2.2.2

              was that it had support for

              Jboss URL protocols vfszip: and vfsmemory:

              but not for vfsfile:

               

              So vfsfile: was added in this fix.

               

              But now... in my error msg above it complaints with another protocol, vfs:

               

              Is vfs: by any chance, something that was recently added in Jboss6, and now need to add that, too, in Struts2 ?

               

              Any ideas?

              • 4. Re: Struts2 under JBoss ?
                rop

                Heureka...

                 

                I downloaded the source-code for org.apache.struts.xwork : xwork-core

                and built a custom-version where I added protocol "vfs" in URLUtil.java

                 

                And finally, the Struts2-application runs OK in Jboss-6.

                 

                But what an ordeal...

                I just wonder... since google didnt turn this up...

                am I the first person in the universe to discover that Struts2 doesnt work with Jboss6 ?

                • 5. Re: Struts2 under JBoss ?
                  genman

                  rop,

                   

                  It'd be helpful to file a bug with a patch with your changes. It's possible that you're the first with the problem, or at least the first to post here with the problem.

                  • 6. Struts2 under JBoss ?
                    rop

                    Turned out, in spite of a long Exception-stacktrace in the server-log, it was just a warning and the application actually worked...

                     

                    Struts2/xwork team had a Jira for it already.

                    • 7. Struts2 under JBoss ?
                      jaikiran

                      rop wrote:

                       

                      Struts2/xwork team had a Jira for it already.

                      Could you please post a link to that JIRA?

                      • 8. Struts2 under JBoss ?
                        rop

                        Here the jira:

                         

                             xwork does not support the VFS of jboss-6.0Final

                         

                             https://issues.apache.org/jira/browse/WW-3558

                        • 9. Re: Struts2 under JBoss ?
                          kozmoz

                          Today I had some issues deploying my Struts 2 application on JBoss 6 and found this message.

                           

                          I am using Struts 2.2.1.1 and the convention-plugin. Because of the vfs JBoss error, my action classes cannot be found. "There is no Action mapped for namespace xxx and action xxx.". So it is not in all circumstances a warning only.

                           

                          It is fixed in Struts 2.3 (see Jira link), but unfortunately that version has other issues with JBoss 6. It has something to do with javassist that is now part of ognl. JBoss provides its own version of javassist that clashes with ognl's version.

                          • 10. Re: Struts2 under JBoss ?
                            wolfgangknauf

                            Hi,

                             

                            which Javassist version is bundled with Struts 2.3? Does it help to simply remove it and rely on the Javassist 3.12.0 bundled with JBoss 6.1.0?

                             

                            If not: you might take a look at JBoss classloading: http://community.jboss.org/wiki/JBossClassLoaderIntroduction

                             

                            Best regards

                             

                            Wolfgang

                            • 11. Re: Struts2 under JBoss ?
                              kozmoz

                              Hi,

                               

                              I solved my issue with Struts2. Indeed Javassis 3.12.0.GA is included through struts2-core 2.2.3 -> ognl 3.0.1.

                               

                              I have changed my pom.xml to include a dependency for Javassist with scope "provided". The resulting war does not include javassist.jar now. During startup, everything is fine.

                               

                              <dependency>

                                 <groupId>javassist</groupId>

                                 <artifactId>javassist</artifactId>

                                 <version>3.12.0.GA</version>

                                 <scope>provided</scope>

                              </dependency>

                               

                              See also this thread of the Struts-Dev mailing list for details:

                              http://struts.1045723.n5.nabble.com/Struts2-under-Jboss-6-td4275132.html#a4745931