You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "John McGinn (JIRA)" <ji...@apache.org> on 2009/07/30 15:31:15 UTC

[jira] Commented: (CXF-2368) defaultOptions in cxf-codegen-plugin only works with wsdlRoot scanning

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

John McGinn commented on CXF-2368:
----------------------------------

Thanks again Daniel, this is correct and works fine with the wsdlRoot.

John



> defaultOptions in cxf-codegen-plugin only works with wsdlRoot scanning
> ----------------------------------------------------------------------
>
>                 Key: CXF-2368
>                 URL: https://issues.apache.org/jira/browse/CXF-2368
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.2
>         Environment: Windows XP, Eclipse 3.3.2 + m2eclipse plug-in 
>            Reporter: John McGinn
>            Assignee: Daniel Kulp
>            Priority: Minor
>         Attachments: bindingMapping.xsd, bindings.xjb, Equipment.xsd, EquipmentService.wsdl, pom.xml, stacktrace.txt
>
>
> I setup the plug-in with defaultOptions + a wsdlOption and get the following stack trace:
> java.lang.NullPointerException
>         at java.io.File.<init>(File.java:222)
>         at org.apache.cxf.maven_plugin.WSDL2JavaMojo.mergeOptions(WSDL2JavaMojo.
> java:143)
>         at org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:
> 195)
> This appears to be happening at this line of code:
> private void mergeOptions(List<WsdlOption> options) {
>         File outputDirFile = testSourceRoot == null ? sourceRoot : testSourceRoot;
>         for (WsdlOption o : wsdlOptions) {
>             if (o.getOutputDir() == null) {
>                 o.setOutputDir(outputDirFile);
>             }
>             
>             File file = new File(o.getWsdl()); <!------------------
> I believe this method is merging default options with wsdl options, but the default options doesn't have a wsdl file those the File constructor fails.
> I put a wsdl option in my default options and the exception went away and the code was generated.
> My plugin config:
> 			<plugin>
> 				<groupId>org.apache.cxf</groupId>
> 				<artifactId>cxf-codegen-plugin</artifactId>
> 				<version>2.2.2</version>
> 				<executions>
> 					<execution>
> 						<id>generate-sources</id>
> 						<phase>generate-sources</phase>
> 						<configuration>
> 							<wsdlOptions>
> 								<defaultOptions>
> 									<validateWsdl>true</validateWsdl>
> 									<wsdl>src/main/wsdl/EquipmentService.wsdl</wsdl>
> 								</defaultOptions>
> 								<wsdlOption>
> 								 <bindingFiles> 
> 					              <bindingFile>src/main/wsdl/bindings/bindings.xjb</bindingFile> 
> 					          </bindingFiles>
> 									<wsdl>src/main/wsdl/EquipmentService.wsdl</wsdl>
> 								</wsdlOption>
> 							</wsdlOptions>
> 						</configuration>
> 						<goals>
> 							<goal>wsdl2java</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.