12 Replies Latest reply on Jun 6, 2012 11:54 AM by lafr

    possible jboss as7 bug

    abisaro

      Hi all,

      i ported a webapp (.war) running on JBoss 4.2.2 to JBoss 5.1.0 without big problems, then I was asked to try to port it to JBoss AS 7.

       

      After two or three days of frustrating temptatives, always getting an obscure error at deployment time, trying to modify, add, remove xml conf files in the app's WEB-INF, I cleaned up my mind and started from beginning, that is the error printed by the server.

      The error is the following:

       

      14:36:26,605 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."XXXX.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."XXXX.war".PARSE: Failed to process phase PARSE of deployment "XXXX.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_20]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20]

          at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]

      Caused by: java.lang.IllegalArgumentException: No enum const class org.jboss.metadata.web.spec.BodyContentType.emtpy

          at java.lang.Enum.valueOf(Enum.java:196) [:1.6.0_20]

          at org.jboss.metadata.web.spec.BodyContentType.valueOf(BodyContentType.java:30)

          at org.jboss.metadata.parser.jsp.TagMetaDataParser.parse(TagMetaDataParser.java:117)

          at org.jboss.metadata.parser.jsp.TldMetaDataParser.parse(TldMetaDataParser.java:226)

          at org.jboss.as.web.deployment.TldParsingDeploymentProcessor.parseTLD(TldParsingDeploymentProcessor.java:124)

          at org.jboss.as.web.deployment.TldParsingDeploymentProcessor.deploy(TldParsingDeploymentProcessor.java:89)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

          ... 5 more

       

      and I noticed what looks like a typo error somewhere in the code that parse the TLDs.

      I put it in bold for your convenience

       

      Caused by: java.lang.IllegalArgumentException: No enum const class org.jboss.metadata.web.spec.BodyContentType.emtpy

       

      The BodyContentType enum declaration is:

       

      public enum BodyContentType {

          tagdependent, JSP, empty, scriptless

      }

       

      the valueOf method throwing the exception is:

       

      public static <T extends Enum<T>> T valueOf(Class<T> enumType, String name) {

           T result = enumType.enumConstantDirectory().get(name);

           if (result != null)

                return result;

           if (name == null)

                throw new NullPointerException("Name is null");

           throw new IllegalArgumentException("No enum const " + enumType +"." + name);

      }

       

      I think that the wrong emtpy name is passed instead of the right empty

       

       

      I got it using jboss-as-7.0.1.Final but I think it affects also previous versions

        • 1. Re: possible jboss as7 bug
          jaikiran

          Looks like one of the .tld files in your application is using that incorrect emtpy value.

          • 2. Re: possible jboss as7 bug
            mka

            Hi Jaikiran,

            I would have to agree with Andrea's observation as this does seem to be a bug with AS 7.0.1. I'm experiencing the problem too, and I've looked through the TLDs on my machine; the 'empty' value is spelt correctly. Can you confirm that all is well within the AS. We experienced the same problem on a colleagues computer. What we had to do there was remove ALL the tags, and only then did the application we have deploy.

             

            Thanks.

            • 3. Re: possible jboss as7 bug
              abisaro

              Hi mka,

              in my case the suggestion was right.

              I'm not the owner of the application, I was just asked to evaluate the cost of porting it from jboss 4.2.2 to jboss 5.1.

              the application is quite old, a single war, using some custom taglibs.

              I checked out from repository exactly the version running in production and just made some changes to make it start without errors and did some simple testing, and my duty stopped here, as regression tests will be done by someone else through thetest suite (I just did the dirty work ;-) ).

              then I was asked to evaluate the possibility to port the same application to jboss as 7, and I started from the application running on jboss 5.1.

              at that point I got that error.

              after Jaikiran suggestion (and, I must say, three days dancing around and ending digging into the jboss code) I greped "emty" on the WEB-INF directory and found the typo in one .tld.

              the application is still not starting, but now it's a matter of classloading and dependencies, nothing "serious".

              my mistake is that I've been misleaded by the fact that the application was, and is, actually running without problem on jboss 4.2.2 and 5.1.

              it seems that on those versions that code is not executed

              • 4. Re: possible jboss as7 bug
                mka

                Hi Andrea,

                thanks for the response. I too have started digging around and it's starting to look like a taglib version issue for me. Oh boy, do I have work to do!

                 

                Jaikiran, I'm porting from 5.0.1 to 7.0.1 and still reading up on what I need to do with Tags. So far, it looks like I need to align dtds to work with the versions that AS 7 will work with. Current problems point to "Enum type of jsp is not defined". Any pointers from your end to help speed up my work?

                 

                Thanks.

                • 5. Re: possible jboss as7 bug
                  mka

                  Got past this problem, thanks.

                  • 6. Re: possible jboss as7 bug
                    ceefour

                    Please show your support for bug AS7-630

                    • 7. Re: possible jboss as7 bug
                      sfcoy

                      Hendy Irawan wrote:

                       

                      Please show your support for bug AS7-630

                       

                      Personally, I can't support this request for two reasons:

                      1. You hijacked a legitimate (closed) bug report to try and include an agenda to support case insensitive parsing of XML TLD files. Case insensitive parsing is a different problem to that originally reported;
                      2. XML is defined to be case sensitive. Period. Supporting this will result in non-portable applications;

                       

                      You may have a legitimate issue with the diagnostic reporting and the JBoss guys may suggest that you raise a JIRA for this particular problem. It will get a lot more attention if you provide a patch.

                      • 8. Re: possible jboss as7 bug
                        ceefour

                        Thank you Stephen. I understand your concern.

                         

                        I've been searching for JBoss Metadata SCM repository but I can't find it yet. Could you provide pointers where it is so I can checkout the current trunk?

                        • 9. Re: possible jboss as7 bug
                          jaikiran
                          • 10. Re: possible jboss as7 bug
                            sfcoy

                            jaikiran pai wrote:

                             

                            https://github.com/jboss/metadata

                             

                            and the most recent commit message "Fix error reporting with bad enum values." suggests that someone may have already addressed the diagnostic problem for us.

                            • 11. Re: possible jboss as7 bug
                              ceefour

                              Indeed.

                               

                              I just tried the trunk JBoss Metadata and already the error messages has been vastly improved:

                               

                              Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/home/ceefour/jasper-jboss/standalone/deployments/jasperserver.war/WEB-INF/jasperserver.tld" at [168,16]

                                      at org.jboss.as.web.deployment.TldParsingDeploymentProcessor.parseTLD(TldParsingDeploymentProcessor.java:126)

                                      at org.jboss.as.web.deployment.TldParsingDeploymentProcessor.deploy(TldParsingDeploymentProcessor.java:89)

                                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                                      ... 5 more

                               

                              I consider the issue already fixed now. :-)

                              • 12. Re: possible jboss as7 bug
                                lafr

                                See http://java.net/jira/browse/SPRINGMODULES-13.

                                So you'll have to extract this file from the archive, modify it, then update archive with the new version.