cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-3854) java.lang.StringIndexOutOfBoundsException is thrown when generating sources for a WADL with WADL2Java Maven plugin
Date Thu, 13 Oct 2011 14:26:12 GMT

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

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

that one is OK, it's a proper URI.
I'm not sure how to reproduce it, just works for me. Can you please capture one more fragment,
something like this:

11-Oct-2011 22:21:46 org.apache.cxf.tools.common.toolspec.parser.CommandLineParser parseArguments
FINE: <command xmlns="http://cxf.apache.org/Xutil/Command" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://cxf.apache.org/Xutil/Command http://cxf.apache.org/schema/xutil/commnad.xsd">
<option name="outputdir">/home/sberyozkin/work/apache/cxf/trunk/systests/jaxrs/target/generated/src/main/java</option>
<option name="packagename">org.apache.cxf.systest.jaxrs.codegen.service</option>
<option name="schemaPackagename">http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema</option>
<option name="impl"/>
<option name="interface"/>
<option name="verbose"/>
<argument name="wadl">file:/home/sberyozkin/work/apache/cxf/trunk/systests/jaxrs/src/test/resources/wadl/bookstoreImport.xml</argument>
</command>

there could be some space or something which may be prevents the tool to recognize the parameters
properly.
I captured this output with -Djava.util.logging.config.file=logging.properties


 
                
> 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
>
> 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

        

Mime
View raw message