[
https://issues.apache.org/jira/browse/CXFXJC-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Kulp moved CXF-5824 to CXFXJC-7:
---------------------------------------
Estimated Complexity: (was: Unknown)
Affects Version/s: (was: 3.0.0)
3.0.0
Key: CXFXJC-7 (was: CXF-5824)
Project: CXF XJC Utils (was: CXF)
> cxf-xjc-dv generates code that cannot be compiled
> -------------------------------------------------
>
> Key: CXFXJC-7
> URL: https://issues.apache.org/jira/browse/CXFXJC-7
> Project: CXF XJC Utils
> Issue Type: Bug
> Affects Versions: 3.0.0
> Reporter: Kosta Krauth
>
> After updating to CXF 3.0.0 I noticed compile errors in classes generated
> from XSDs using wsdl2java with cxf-xjc-dv plugin.
> The problematic piece of generated code showed up in a couple of places and
> looked like this:
> {code}
> protected List<ExternalItem> redemptions = new List<ExternalItem>();
> {code}
> Resulting in "Cannot instantiate the type List" error. The type list in this
> case was not a custom class but the standard java collections interface
> java.util.List.
> My setup is (roughly) as follows:
> *Schema definition*
> {code}
> <s:element name="itemRedemption">
> <s:complexType>
> <s:sequence>
> <s:element name="userId" type="s:string" />
> <s:element name="redemptions" maxOccurs="unbounded"
> type="tns:externalItem" />
> </s:sequence>
> </s:complexType>
> </s:element>
>
> <s:complexType name="externalItem">
> <s:sequence>
> <s:element minOccurs="0" name="redemptionNumber" type="s:string" />
> </s:sequence>
> </s:complexType>
> {code}
> *Maven config*
> {code}
> ...
> <properties>
> <cxf.version>3.0.0</cxf.version>
> </properties>
> ...
> <plugin>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-codegen-plugin</artifactId>
> <version>${cxf.version}</version>
> <configuration>
> <encoding>UTF-8</encoding>
> <wsdlRoot>${basedir}/src/main/webapp/WEB-INF/wsdl</wsdlRoot>
> <includes>
> <include>*Service.wsdl</include>
> </includes>
> <defaultOptions>
> <bareMethods />
> <extraargs>
>
> <extraarg>-xjc-b,${basedir}/src/main/resources/jaxb-bindings.xml</extraarg>
> <extraarg>-xjc-Xdv</extraarg> <!-- Activates plugin for default
> value support -->
> <extraarg>-xjc-Xbgi</extraarg> <!-- Creates both get/is methods
> for booleans -->
> </extraargs>
> </defaultOptions>
> </configuration>
> <executions>
> <execution>
> <id>generate-sources</id>
> <phase>generate-sources</phase>
> <goals>
> <goal>wsdl2java</goal>
> </goals>
> </execution>
> </executions>
> <dependencies>
> <dependency>
> <groupId>org.apache.cxf.xjcplugins</groupId>
> <artifactId>cxf-xjc-dv</artifactId>
> <version>${cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf.xjcplugins</groupId>
> <artifactId>cxf-xjc-boolean</artifactId>
> <version>${cxf.version}</version>
> </dependency>
> </dependencies>
> </plugin>
> {code}
> If I change the version of cxf-xjc-dv to 2.7.0, this problem does not happen.
--
This message was sent by Atlassian JIRA
(v6.2#6252)