0 Replies Latest reply on Feb 12, 2013 5:56 PM by Cezariusz Marek

    Service parameters on Linux

    Cezariusz Marek Newbie

      Hello,

       

      I have an AS7 application which uses FOP for reports. It runs fine on Windows, but on the Linux box (CentOS) I get an error:

       

      13:00:02,701 FATAL [APP_PU.pl.gov.mf.edeklaracje.PU.fop.XSLFOServlet] (http--0.0.0.0-8080-7) BĹÄd podczas drukowania dokumentu XML!: javax.xml.transform.TransformerException: XML-22
              at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:881) [xmlparserv2.jar:]
              at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:477) [xmlparserv2.jar:]
              at pl.gov.mf.edeklaracje.PU.fop.XSLFOServlet.processRequest(XSLFOServlet.java:722) [classes:]
              at pl.gov.mf.edeklaracje.PU.fop.XSLFOServlet.doGet(XSLFOServlet.java:823) [classes:]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.13.Final.jar:]
              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_38]
      Caused by: javax.xml.transform.TransformerException: XML-22101: (Fatal Error) DOMSource node as this type not supported.
              at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883) [xmlparserv2.jar:]
              at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:463) [xmlparserv2.jar:]
              ... 18 more
      

       

      One solution I've found is to define TransformerFactory, and it works if I run it like this:

       

      [jboss@edek-jboss01 ~]$ jboss-as-7/bin/standalone.sh -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
      

       

      But the server should run as a service, so I decided to add this define to the standalone.conf like this:

       

      JAVA_OPTS="$JAVA_OPTS -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl"
      

       

      But now when I try to start the server I get the error:

       

      [jboss@edek-jboss01 ~]$ jboss-as-7/bin/standalone.sh
      =========================================================================
      
      
        JBoss Bootstrap Environment
      
      
        JBOSS_HOME: /opt/srv/jboss/jboss-as-7
      
      
        JAVA: java
      
      
        JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
      
      
      =========================================================================
      
      
      Exception in thread "main" javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
              at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:108)
              at __redirected.__TransformerFactory.<clinit>(__TransformerFactory.java:66)
              at __redirected.__JAXPRedirected.initAll(__JAXPRedirected.java:82)
              at org.jboss.modules.Module$1.run(Module.java:85)
              at org.jboss.modules.Module$1.run(Module.java:72)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.jboss.modules.Module.<clinit>(Module.java:72)
              at org.jboss.modules.Main.main(Main.java:255)
      

       

      So now I have few questions:

      1. What is the recommended way of adding service parameters?
      2. Why setting JAVA_OPTS in standalone.conf doesn't work the same as the command line parameter?
      3. Why I'm getting this XML-22101 error only on the Linux box? Java version is exactly the same.