jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • classworlds
  • CLASSWORLDS-32

XML plugin transform fails when XSL imports from grandparent directories

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

If my XSL file has something like

<xsl:stylesheet>
<xsl:import href="../../somefile.xsl"/>

<xsl:template ...>
</xsl:template>
</xsl:stylesheet>

then the plugin throws an exception (the exception is really caused by classworlds) and the transformation fail

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at org.codehaus.classworlds.UrlUtils.normalizeUrlPath(UrlUtils.java:28)
at org.codehaus.classworlds.DefaultClassRealm.getResource(DefaultClassRealm.java:284)
at org.codehaus.classworlds.DefaultClassRealm.getResource(DefaultClassRealm.java:314)
at org.codehaus.classworlds.RealmClassLoader.getResource(RealmClassLoader.java:237)
at org.codehaus.mojo.xml.Resolver.resolveAsResource(Resolver.java:209)
at org.codehaus.mojo.xml.Resolver.resolve(Resolver.java:280)
at org.codehaus.mojo.xml.Resolver.resolve(Resolver.java:112)
at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:104)
at net.sf.saxon.style.XSLStylesheet.spliceIncludes(XSLStylesheet.java:754)
at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:168)
at net.sf.saxon.style.XSLStylesheet.spliceIncludes(XSLStylesheet.java:754)
at net.sf.saxon.style.XSLStylesheet.preprocess(XSLStylesheet.java:676)
at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:331)
at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:163)
at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139)
at org.codehaus.mojo.xml.TransformMojo.getTemplate(TransformMojo.java:167)
at org.codehaus.mojo.xml.TransformMojo.transform(TransformMojo.java:451)
at org.codehaus.mojo.xml.TransformMojo.execute(TransformMojo.java:585)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

The UrlUtils.normalizeUrlPath is pretty dodgy, it tried to change paths like

x/y/../z

to

x/z

but when the path starts with ../ (as in this case) it does not work.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    stacktrace.txt
    25/Oct/10 7:12 AM
    5 kB
    Moritz Winter

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Moritz Winter added a comment - 25/Oct/10 7:12 AM

Stacktrace of maven build.

Show
Moritz Winter added a comment - 25/Oct/10 7:12 AM Stacktrace of maven build.
Hide
Permalink
Moritz Winter added a comment - 25/Oct/10 7:13 AM

I get this bug, if i change the org.codehaus.mojo:xml-maven-plugin from 1.0-beta-2 to 1.0-beta-3. We also use relative paths. See stacktrace.txt (25/Oct/10 7:12 AM)

Show
Moritz Winter added a comment - 25/Oct/10 7:13 AM I get this bug, if i change the org.codehaus.mojo:xml-maven-plugin from 1.0-beta-2 to 1.0-beta-3. We also use relative paths. See stacktrace.txt (25/Oct/10 7:12 AM)

People

  • Assignee:
    Unassigned
    Reporter:
    Tim Carpenter
Vote (1)
Watch (1)

Dates

  • Created:
    01/Apr/10 1:02 AM
    Updated:
    25/Oct/10 7:13 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.