[shrinkwrap-issues] [JBoss JIRA] (SHRINKDESC-137) Compilation fails under windows

Ralf Battenfeld (JIRA) jira-events at lists.jboss.org
Sun Dec 2 12:02:21 EST 2012


    [ https://issues.jboss.org/browse/SHRINKDESC-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738742#comment-12738742 ] 

Ralf Battenfeld edited comment on SHRINKDESC-137 at 12/2/12 12:01 PM:
----------------------------------------------------------------------

It seams that Saxon HE 9.4 is more strictly checking boolean values. Saxon 8.7 allows to define a string 'true' and accepts this but not Saxon HE 9.4. In order to fix this, just change the metadata-parser and XsltTransformer class for passing a boolean value instead of the string:

MetadataParser:
{noformat}
 
 /**
    * Generates source code by applying the <code>ddJavaAll.xsl</code> XSLT extracted from the resource stream.
    * @throws TransformerException
    */
   public void generateCode(final MetadataParserPath path, final boolean verbose) throws TransformerException
   {
      /** initialize the map which will overwrite global parameters as defined in metadata.xsl/ddJava.xsl */
      // final Map<String, String> xsltParameters = new HashMap<String, String>();
      final Map<String, Object> xsltParameters = new HashMap<String, Object>();
      xsltParameters.put("gOutputFolder", path.getPathToImpl());
      xsltParameters.put("gOutputFolderApi", path.getPathToApi());
      xsltParameters.put("gOutputFolderTest", path.getPathToTest());
      xsltParameters.put("gOutputFolderService", path.getPathToServices());
      // xsltParameters.put("gVerbose", Boolean.toString(verbose));
      xsltParameters.put("gVerbose", verbose);

      final InputStream is = MetadataParser.class.getResourceAsStream("/META-INF/ddJavaAll.xsl");
      if(log.isLoggable(Level.FINE)){
          log.fine("Stream resource: " + is);
      }

      XsltTransformer.simpleTransform(pathToMetadata, is, new File("./tempddJava.xml"), xsltParameters);
   }
{noformat} 

If you apply these little changes, does it work under windows? In XsltTransformer, the HashMap definition is HashMap<String, Object>() instead of HashMap<String, String>()

                
      was (Author: rbattenfeld):
    It seams that Saxon HE 9.4 is more strictly checking boolean values. Saxon 8.7 allows to define a string 'true' and accepts this but not Saxon HE 9.4. In order to fix this, just change the metadata-parser and XsltTransformer class for passing a boolean value instead of the string:

MetadataParser:
{noformat}
 
 /**
    * Generates source code by applying the <code>ddJavaAll.xsl</code> XSLT extracted from the resource stream.
    * @throws TransformerException
    */
   public void generateCode(final MetadataParserPath path, final boolean verbose) throws TransformerException
   {
      /** initialize the map which will overwrite global parameters as defined in metadata.xsl/ddJava.xsl */
      // final Map<String, String> xsltParameters = new HashMap<String, String>();
      final Map<String, Object> xsltParameters = new HashMap<String, Object>();
      xsltParameters.put("gOutputFolder", path.getPathToImpl());
      xsltParameters.put("gOutputFolderApi", path.getPathToApi());
      xsltParameters.put("gOutputFolderTest", path.getPathToTest());
      xsltParameters.put("gOutputFolderService", path.getPathToServices());
      // xsltParameters.put("gVerbose", Boolean.toString(verbose));
      xsltParameters.put("gVerbose", verbose);

      final InputStream is = MetadataParser.class.getResourceAsStream("/META-INF/ddJavaAll.xsl");
      if(log.isLoggable(Level.FINE)){
          log.fine("Stream resource: " + is);
      }

      XsltTransformer.simpleTransform(pathToMetadata, is, new File("./tempddJava.xml"), xsltParameters);
   }
{noformat} 

If you apply these little changes, does it work under windows?

                  
> Compilation fails under windows
> -------------------------------
>
>                 Key: SHRINKDESC-137
>                 URL: https://issues.jboss.org/browse/SHRINKDESC-137
>             Project: ShrinkWrap Descriptors
>          Issue Type: Bug
>          Components: gen, metadata-parser
>    Affects Versions: 2.0.0-alpha-4
>         Environment: win7 x64
>            Reporter: Michal Matloka
>            Assignee: Michal Matloka
>            Priority: Critical
>
> mvn clean install results in
> {noformat}
> [INFO]
> [INFO] --- shrinkwrap-descriptors-metadata-parser:2.0.0-alpha-5-SNAPSHOT:parse (executionJ2ee13) @ shrinkwrap-descriptors-gen ---
> Error at xsl:result-document on line 249 of :
>   Resolved URL is malformed: unknown protocol: i
> [INFO] ------------------------------------------------------------------------
> {noformat}
> I've tried to upgrade to saxon-he 9.4, but under that version other error appears:
> {noformat}
> [INFO] --- shrinkwrap-descriptors-metadata-parser:2.0.0-alpha-5-SNAPSHOT:parse (executionJ2ee13) @ shrinkwrap-descriptors-gen ---
> Error on line 246
>   XPTY0004: Required item type of value of variable $gVerbose is xs:boolean; supplied value
>   has item type xs:string
>   at xsl:call-template name="WriteInterface2" (#74)
>   at xsl:call-template name="GenerateInterfaces" (#58)
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the shrinkwrap-issues mailing list