5 Replies Latest reply on Feb 21, 2013 4:34 AM by joydeep.sarkar

    XSLT parser exception with JBoss7 on certain Unix environments

    joydeep.sarkar

      Hi,

       

      I am using JBoss AS 7 with JDK 6.x in Unix platform. Even though the application runs properly in development environments, it somehow does not work in the Unix boxes of production environment.

       

      I have bundled xalan1.2.4.jar with my ear file and in the log I can see that the TransformerFactoryImpl is referring to the bundled xalan jar.

      I have checked the language is also set to en_us.UTF-8 which is identical to other Unix boxes where the application is working.

      I am running JBoss in standalone mode.

       

      I get following error when I access application page, but the same ear and setup is working in other Unix machines. Does anyone know what could be causing this? Any lead would be helpful.

       

      Note: I tried to remove ^M from the XSL files, but could not find any special charactes whatsoever in the file.

       

      Thanks in advance,

      Joydeep

       

       

      imagenet.system.xslt.api.XsltException: javax.xml.transform.TransformerException: head is not allowed in this position in the stylesheet!; JSP Path: null; XSL Path: /home/app/jboss-as-7.1.1.Final/standalone/tmp/vfs/deployment38a293b186a3b7b6/mm.war-9f77ca259aca3dfa/WEB-INF/views/display/displaygrid.xsl; XSL Fault?: false; Page fragment: ^M
      1: <?xml version="1.0" encoding="UTF-8"?>^M
      2: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">^M
      3:      <xsl:import href="/WEB-INF/template/common/page.xsl"/>^M
      4:      <xsl:import href="/WEB-INF/component/navigation/right_common.xsl"/>^M
      
      
              at imagenet.system.xslt.api.XsltException.throwHelpfulException(XsltException.java:216)
              at imagenet.system.xslt.impl.XslTransformerFactoryImpl$TemplatesFactory.createObject(XslTransformerFactoryImpl.java:241)
              at imagenet.system.cache.impl.MemorySensitiveCache.getObject(MemorySensitiveCache.java:66)
              at imagenet.system.xslt.impl.XslTransformerFactoryImpl.getTemplates(XslTransformerFactoryImpl.java:178)
              at imagenet.system.xslt.impl.XslTransformerFactoryImpl.transform(XslTransformerFactoryImpl.java:118)
              at imagenet.web.util.XmlTransformTag.doEndTag(XmlTransformTag.java:243)
              at org.apache.jsp.WEB_002dINF.views.display.endusergrid_jsp._jspService(endusergrid_jsp.java:904)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)
              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)
              at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
              at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)
              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)
              at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
              at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at imagenet.web.util.NavigationFilter.doFilter(NavigationFilter.java:64)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at imagenet.web.util.CrossSiteRequestForgeryFilter.doFilter(CrossSiteRequestForgeryFilter.java:159)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at imagenet.web.util.SimplifiedViewAuthenticationFilter.doFilter(SimplifiedViewAuthenticationFilter.java:103)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at imagenet.web.functions.monitoring.DebugFilter.doFilter(DebugFilter.java:91)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at imagenet.web.util.AuthenticationCodeFilter.doFilter(AuthenticationCodeFilter.java:115)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at imagenet.web.util.XadsEncodingFilter.doFilter(XadsEncodingFilter.java:50)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
              at java.lang.Thread.run(Thread.java:619)
      
        • 1. Re: XSLT parser exception with JBoss7 on certain Unix environments
          nickarls

          The ^M ususally comes from different line-endings in Win/Unix platforms. Have you examined the file with a hex (or similar) low-level editor?

          • 2. Re: XSLT parser exception with JBoss7 on certain Unix environments
            sfcoy

            ^M is a carriage return, which xalan would normally consume as whitespace.

             

            Does

            {code:bash}java -version{code}

            yield exactly the same result on all machines?

             

            OpenJDK has been known to behave oddly in some circumstances, particularly older releases.

            • 3. Re: XSLT parser exception with JBoss7 on certain Unix environments
              joydeep.sarkar

              Hi,

               

              Thank you for the response.

               

              The files have not been copied over to Unix environment from any Unix environment. I have checked the filesand did not see any carriage return. And again, the same file is not showinf any carriage return in other environments.

               

              I have cheked with same and different Java versions,  1.6.0_20, jdk1.6.0_38 and  jdk1.5.0_16. The OS versions are also not causing any problem in other environments. Even if the servers ae 32 bit or 64 bit.

               

              One observation though, that these servers are in production environment and are physical machines.The servers whcih are VMs are working properly, even if they are in the live environment.

               

              We did following things,

              1. Checked the environment
              2. Language setting has been cheecked
              3. Compared xslt.EnvironmentCheck (which appeared to be identical)
              4. Items in the path have been checked

               

              Could you please advise what I should be doing next to identify the problem? Any lead will be very helpful.

               

              Regards,

              Joydeep

              • 4. Re: XSLT parser exception with JBoss7 on certain Unix environments
                sfcoy
                1. ^M is a windows artifact. In other words, these files originated on a Windows machine. However, this should not make any difference in a well behaved environment
                2. Please show the output of "java -version" on each of the machines that has a problem.
                3. How is JBoss being started?
                4. Exactly what version of JBossAS 7.x are you using?
                • 5. Re: XSLT parser exception with JBoss7 on certain Unix environments
                  joydeep.sarkar

                  Hi,

                   

                  Following is the output of the java -version

                  [app@seapummsort01 ~]$ java -version

                  java version "1.6.0_20"

                  Java(TM) SE Runtime Environment (build 1.6.0_20-b02)

                  Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

                   

                  [app@seadcmmadm01 ~]$ java -version

                  java version "1.6.0_20"

                  Java(TM) SE Runtime Environment (build 1.6.0_20-b02)

                  Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

                   

                  I am using jboss-as-7.1.1.Final and starting the server up using "sudo ./standalone.sh"

                   

                  Regards,

                  Joydeep