Thanks for creating a JIRA issue [1]. Replying here for the benefit of the list. As it happens exactly the same issue was reported yesterday by our runtime team, and it is caused by the fact that you have multiple GET methods without 'id' attributes, so the generator attempts to use specific path values to create unique method identifiers ("get" + path value) - and there was a bug to do with not processing '{' and '}' symbols, hence the compilation failure. This was fixed yesterday, however there's also a workaround which can lead to generating better method names, configure WADLGenerator (which produces the original WADL) with the 'addResourceAndMethodIds' set to true.

By the way, the actual WADL is not very useful because the schema links are missing, you probably need to get a namespace attribute added to XMLRootElement annotations

HTH, SErgey

[1] https://issues.apache.org/jira/browse/CXF-4481
On 21/08/12 15:48, Sergey Beryozkin wrote:
Hi

The generator produces the code which does not compile for some reasons,
can you open a JIRA and attach the wadl document there (simplified if
needed) ?

Cheers, Sergey
On 21/08/12 15:09, yousef wrote:
i succeeded to created rest with CXF,all good except that i get error
when
generating WADL2java.
i use the following configuration:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-wadl2java-plugin</artifactId>
<version>2.6.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>

<sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
<wadlOptions>
<wadlOption>

<wadl>http://localhost:8080/apache-cxf-rest-test?_wadl</wadl>
<impl>true</impl>
<interface>true</interface>

<packagename>org.apache.cxf.systest.jaxrs.codegen.service</packagename>
<schemaPackagenames>

<schemaPackagename>http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema</schemaPackagename>

</schemaPackagenames>

</wadlOption>
</wadlOptions>
</configuration>
<goals>
<goal>wadl2java</goal>
</goals>
</execution>
</executions>
</plugin>


stack error:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project wad: Compilation failure: Compilation
failure:
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResourceImpl.java:[11,27]

error: ';' expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResourceImpl.java:[11,28]

error: not a statement
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResourceImpl.java:[11,30]

error: ';' expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResourceImpl.java:[11,31]

error: illegal start of type
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResourceImpl.java:[11,32]

error: ';' expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResourceImpl.java:[11,41]

error:<identifier> expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResource.java:[18,20]

error: = expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResource.java:[18,23]

error:<identifier> expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResource.java:[18,24]

error: ';' expected
[ERROR]
\DEV\wad\target\generated\src\main\java\org\apache\cxf\systest\jaxrs\codegen\service\ServiceResource.java:[18,51]

error: = expected


please help




--
View this message in context:
http://cxf.547215.n5.nabble.com/WADL-2-java-error-tp5712878.html
Sent from the cxf-user mailing list archive at Nabble.com.


Reply via email to