[ 
https://issues.apache.org/jira/browse/CXF-3854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126678#comment-13126678
 ] 

Sergey Beryozkin commented on CXF-3854:
---------------------------------------

Indeed, I spotted it too, but we probably can't get that fixed, that schema 
name has been around for years...
The latest trace is identical to the one I'm seeing on my system except for the 
actual values for the named options.
I think all roads lead to REST.wadl - there's something there that exposes a 
bug in SourceGenerator.
Would it be possible to emulate the structure of this WADL somehow and attach ? 
Or may be you can experiment with its content locally and see if you can narrow 
the problem ? Here is another idea, can you download this file:
http://svn.apache.org/repos/asf/cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml

and repeat the test but using this file ? If it passes then it's definitely 
something with REST.wadl
                
> java.lang.StringIndexOutOfBoundsException is thrown when generating sources 
> for a WADL with WADL2Java Maven plugin
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3854
>                 URL: https://issues.apache.org/jira/browse/CXF-3854
>             Project: CXF
>          Issue Type: Bug
>          Components: Build system, JAX-RS, JAXB Databinding
>    Affects Versions: 2.5
>         Environment: Apache Maven 2.2.1 (rdebian-4)
> Java version: 1.6.0_26
> Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux" version: "2.6.38-11-generic" arch: "amd64" Family: "unix"
>            Reporter: Lars Weber
>              Labels: cxf-wadl2java-plugin, jaxrs, wadl, wadl2java
>         Attachments: logging.properties
>
>
> I want to create the client stubs with a .wadl file.
> *Before you ask, it's not possible for me to attach the file due to an NDA.*
> (on) *Important:*
> It works fine, if I don't use the {{<extraarg>-impl</extraarg>}} extraarg.
> This is the maven plugin definition in the {{pom.xml}} file:
> {code:xml} 
> <plugin>
>     <groupId>org.apache.cxf</groupId>
>     <artifactId>cxf-wadl2java-plugin</artifactId>
>     <!-- version>2.4.1</version -->
>     <version>2.5.0-SNAPSHOT</version>
>     <executions>
>             <execution>
>                     <id>generate-sources</id>
>                     <phase>generate-sources</phase>
>                     <configuration>
>                             
> <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
>                             <wadlOptions>
>                                     <wadlOption>
>                                             
> <wadl>${basedir}/src/main/resources/wadl/myWadlFile.wadl</wadl>
>                                             <!-- impl>true</impl -->
>                                             
> <packagename>org.apache.cxf.systest.jaxrs.codegen.service</packagename>
>                                             <schemaPackagenames>
>                                                     
> <schemaPackagename>http://MYPACKNAME=org.apache.cxf.systest.jaxrs.codegen.schema</schemaPackagename>
>                                             </schemaPackagenames>
>                                             <extraargs>
>                                                     <extraarg>-impl</extraarg>
>                                                     
> <extraarg>-interface</extraarg>
>                                                     
> <extraarg>-verbose</extraarg>
>                                             </extraargs>
>                                     </wadlOption>
>                             </wadlOptions>
>                     </configuration>
>                     <goals>
>                             <goal>wadl2java</goal>
>                     </goals>
>             </execution>
>     </executions>
> </plugin>
> {code} 
> Then, after calling {{mvn clean generate-sources}}, I get this exception:
> {noformat}
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] java.lang.StringIndexOutOfBoundsException: String index out of range: 0
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: 
> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>       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)
> Caused by: org.apache.maven.plugin.MojoExecutionException: 
> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
>       at 
> org.apache.cxf.maven_plugin.wadlto.AbstractCodeGeneratorMojo.callCodeGenerator(AbstractCodeGeneratorMojo.java:458)
>       at 
> org.apache.cxf.maven_plugin.wadlto.WADL2JavaMojo.execute(WADL2JavaMojo.java:101)
>       at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>       ... 17 more
> Caused by: org.apache.cxf.tools.common.ToolException: 
> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
>       at 
> org.apache.cxf.tools.wadlto.jaxrs.JAXRSContainer.execute(JAXRSContainer.java:84)
>       at 
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
>       at org.apache.cxf.tools.wadlto.WADLToJava.run(WADLToJava.java:65)
>       at org.apache.cxf.tools.wadlto.WADLToJava.run(WADLToJava.java:57)
>       at 
> org.apache.cxf.maven_plugin.wadlto.AbstractCodeGeneratorMojo.callCodeGenerator(AbstractCodeGeneratorMojo.java:455)
>       ... 20 more
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: 0
>       at java.lang.String.charAt(String.java:686)
>       at 
> org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.getClassName(SourceGenerator.java:432)
>       at 
> org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.writeResourceMethod(SourceGenerator.java:595)
>       at 
> org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.writeMethods(SourceGenerator.java:474)
>       at 
> org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.writeResourceClass(SourceGenerator.java:381)
>       at 
> org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.generateResourceClasses(SourceGenerator.java:234)
>       at 
> org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.generateSource(SourceGenerator.java:201)
>       at 
> org.apache.cxf.tools.wadlto.jaxrs.JAXRSContainer.processWadl(JAXRSContainer.java:144)
>       at 
> org.apache.cxf.tools.wadlto.jaxrs.JAXRSContainer.execute(JAXRSContainer.java:67)
>       at 
> org.apache.cxf.tools.wadlto.jaxrs.JAXRSContainer.execute(JAXRSContainer.java:76)
>       ... 24 more
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to