0 Replies Latest reply on Feb 8, 2006 9:18 AM by Suchithra Mani

    xml.transform fails when war file is deployed in JBOSS 4.0.3

    Suchithra Mani Newbie

      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