3 Replies Latest reply on Feb 10, 2006 5:52 AM by smani

    problems in deploying Jboss 4.0.3SP1

    smani

      smani



      Joined: Wed Feb 8, 2006 03:31 AM
      Posts: smani
      Location:
      Posted: Wed Feb 8, 2006 09:18 AM Post subject: xml.transform fails when war file is deployed in JBOSS 4.0.3

      --------------------------------------------------------------------------------

      Hi,
      We have a small application written in java1.4.2 sdk deployed initially with JBOSS 4.0.2. It was working fine. Now we have upgraded JBoss version to 4.0.3 SP1 and the application doesnot work anymore. After investigation, we found that the code is failing in a xml.transform method.

      This is the excetion thrown:
      12:54:09,640 INFO [STDOUT] RB TransformerException java.io.FileNotFoundExceptio
      n: file:\C:\jboss-4.0.3SP1\server\default\tmp\deploy\tmp39595xsdgenerator-exp.wa
      r\files\temp1139313249640\generated.xsd (The filename, directory name, or volume
      label syntax is incorrect)

      and this is the code:

      private File writeXmlFile(Document finalXsd, String name) {
      try {
      System.out.print("RB WriteXmlFile finalXsd/Name = " + finalXsd + "/" + name);
      // Prepare the DOM document for writing
      Source source = new DOMSource(finalXsd);

      // Prepare the output file
      if (tempDir == null) {
      createTempDir();
      }

      File file = new File(tempDir.getAbsolutePath() + System.getProperty("file.separator") + name + ".xsd");
      System.out.print("File exists: " + file.getAbsolutePath());
      file.deleteOnExit();
      System.out.print("RB After DeleteOnExit: ");
      Result result = new StreamResult(file);

      // Write the DOM document to the file
      Transformer xformer = TransformerFactory.newInstance() .newTransformer();

      xformer.setOutputProperty(OutputKeys.INDENT, "yes");
      xformer.setOutputProperty( "{http://*xml*.apache.org/xslt}indent-amount<http://xml.apache.org/xslt%7Dindent-amount>", "2");
      System.out.println("Before Transformer File exists: " + file.exists());

      xformer.transform(source, result); (Returns an error on this statement)

      System.out.println("After Transformer File exists: " + file.exists());
      return file;
      } catch (TransformerConfigurationException e)
      {
      System.out.println("RB TransformerConfigurationException " + e.getMessage());
      } catch (TransformerException e) {
      System.out.println("RB TransformerException " + e.getMessage() );

      }

      return null;
      }

      Can someone tell me why the difference is between the 2 versions of JBoss? Does it have anything to do with the new security features of JBoss 4.0.3SP1? How can we overcome this error?

      Any help is highly appreciated..

      Thanks and Regards
      Suchi

        • 1. Re: problems in deploying Jboss 4.0.3SP1
          peterj

          I'm not sure if this is the cause of the problem, but one of the changes between 4.0.2 and 4.0.3SP1 was the removal of the classes that handle XPath (various classes within dom4j.jar, and all of jaxen.jar). See http://jira.jboss.com/jira/browse/JBAS-1970 . This caused us a problem with our code that dealt with XML files (though our error was dirfferent from yours). When we included dom4j.jar and jaxen.jar in our war file, all was well.

          • 2. Re: problems in deploying Jboss 4.0.3SP1
            smani

            We r getting FileNotFoundException. According to another topic in a java forum, (http://forum.java.sun.com/thread.jspa?threadID=699130&messageID=4058140), "It runs in a J2EE environment that disallows direct file access by specification. At least for EJBs..."
            And in the new Security features of Jboss it says, that its fully J2EE Compatible. Thats why I was wondering if that could be the cause.

            And do you mean adding these jar files from the old version of jboss to the war file? And could you please explain me how I can do that? We r using Eclipse and ant build to generate the war file.

            Thanks,

            • 3. Re: problems in deploying Jboss 4.0.3SP1
              smani

               

              "smani" wrote:
              We r getting FileNotFoundException. According to another topic in a java forum, (http://forum.java.sun.com/thread.jspa?threadID=699130&messageID=4058140), "It runs in a J2EE environment that disallows direct file access by specification. At least for EJBs..."
              And in the new Security features of Jboss it says, that its fully J2EE Compatible. Thats why I was wondering if that could be the cause.

              And do you mean adding these jar files from the old version of jboss to the war file? And could you please explain me how I can do that? We r using Eclipse and ant build to generate the war file.

              The full trace:

              11:50:58,561 INFO [STDOUT] XSD Generator: Current verb: addpassenger
              11:50:58,780 INFO [STDOUT] here before createtempdir
              11:50:58,780 INFO [STDOUT] date to be created:
              11:50:58,780 INFO [STDOUT] time: 1139568658780
              11:50:58,780 INFO [STDOUT] temp dir name: file:/C:/jboss-4.0.3SP1/server/defaul
              t/tmp/deploy/tmp42738xsdgenerator-exp.war/includes
              11:50:58,780 INFO [STDOUT] dir to be created:
              11:50:58,780 INFO [STDOUT] File exists 1: false
              11:50:58,780 INFO [STDOUT] TransformerExceptionjava.io.FileNotFoundException: f
              ile:\C:\jboss-4.0.3SP1\server\default\tmp\deploy\tmp42738xsdgenerator-exp.war\in
              cludes\temp1139568658780\generated.xsd (The filename, directory name, or volume
              label syntax is incorrect)
              11:50:58,795 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
              java.lang.NullPointerException
              at org.apache.jsp.file_jsp._jspService(org.apache.jsp.file_jsp:79)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
              .java:322)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
              14)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:173)
              at filter.verbListFilter.doFilter(verbListFilter.java:53)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:173)
              at filter.selectionSetFilter.doFilter(selectionSetFilter.java:93)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:173)
              at filter.checkFormFilter.doFilter(checkFormFilter.java:143)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
              lter.java:81)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
              alve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
              alve.java:178)
              at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
              ipalValve.java:39)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
              yAssociationValve.java:159)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
              e.java:59)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
              ava:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
              ava:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
              ve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
              a:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
              :856)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
              ssConnection(Http11Protocol.java:744)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
              int.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
              kerThread.java:112)
              at java.lang.Thread.run(Thread.java:534)

              Thanks,