users@glassfish.java.net

Re: Jersey WADL to HTML XSL stylesheet

From: <forums_at_java.net>
Date: Wed, 26 Oct 2011 15:04:48 -0500 (CDT)

I've been trying to use this tool to format a Jersey generated WADL file
without success.  With the stylesheet wadl_documentation.xsl that is bundled
with generate-wadl-1.9-ea04, I get a NPE:

[ERROR] Failed to execute goal
org.codehaus.mojo:xml-maven-plugin:1.0:transform (default) on project BobApp:
Failed to transform input file
C:\workspaces\jboss\BobApp\target\classes\application.wadl:
java.lang.ArrayIndexOutOfBoundsException: -1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.codehaus.mojo:xml-maven-plugin:1.0:transform (default) on project
BobApp: Failed to transform input file
C:\workspaces\jboss\BobApp\target\classes\application.wadl:
java.lang.ArrayIndexOutOfBoundsException: -1
    at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to
transform input file
C:\workspaces\jboss\BobApp\target\classes\application.wadl:
java.lang.ArrayIndexOutOfBoundsException: -1
    at
org.codehaus.mojo.xml.TransformMojo.transform(TransformMojo.java:418)
    at
org.codehaus.mojo.xml.TransformMojo.transform(TransformMojo.java:554)
    at org.codehaus.mojo.xml.TransformMojo.execute(TransformMojo.java:629)
    at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: javax.xml.transform.TransformerException:
java.lang.ArrayIndexOutOfBoundsException: -1
    at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:716)
    at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
    at
org.codehaus.mojo.xml.TransformMojo.transform(TransformMojo.java:401)
    ... 23 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at
com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM2._type2(SAX2DTM2.java:1989)
    at
com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM2$PrecedingIterator.setStartNode(SAX2DTM2.java:869)
    at
com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl$NamespaceWildcardIterator.setStartNode(SAXImpl.java:1313)
    at
com.sun.org.apache.xalan.internal.xsltc.dom.CurrentNodeListIterator.setStartNode(CurrentNodeListIterator.java:153)
    at
wadl_documentation.http$colon$$slash$$slash$www$dot$w3$dot$org$slash$1999$slash$xhtml$colon$template$dot$11()
    at wadl_documentation.applyTemplates4()
    at
wadl_documentation.http$colon$$slash$$slash$www$dot$w3$dot$org$slash$1999$slash$xhtml$colon$template$dot$8()
    at wadl_documentation.applyTemplates()
    at wadl_documentation.applyTemplates()
    at wadl_documentation.transform()
    at
com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:603)
    at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:709)
    ... 25 more

With the stylesheet that Mark posted above, wadl_documentation-2006-10.xsl,
the transformation succeeds, however, I basically get an empty html file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        This is a paragraph that is added to the start of the
generated application.wadl
 

Any suggestions?

thanks, Mitchell


--
[Message sent by forum member 'mcacker']
View Post: http://forums.java.net/node/734264