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/28 22:50:14 UTC

[jira] Reopened: (CXF-2368) NPE in cxf-codegen-plugin when trying to use defaultOptions with wsdlOptions

     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John McGinn reopened CXF-2368:
------------------------------


I tried this and now my defaultOptions is being ignored,

My updated pom is this:

			<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>
							<defaultOptions>
								<validateWsdl>true</validateWsdl>
								<bindingFiles> 
					              <bindingFile>src/main/wsdl/bindings/bindings.xjb</bindingFile> 
					          	</bindingFiles>
					          	<extraargs>
					          		<extraarg>-server</extraarg>
					          	</extraargs>
							</defaultOptions>
							<wsdlOptions>
								<wsdlOption>
									<wsdl>src/main/wsdl/EquipmentService.wsdl</wsdl>
								</wsdlOption>
							</wsdlOptions>
						</configuration>
						<goals>
							<goal>wsdl2java</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

It is ignoring all 3 default values I specified, -server, the jaxb bindings, and the validate wsdl.

> NPE in cxf-codegen-plugin when trying to use defaultOptions with wsdlOptions
> ----------------------------------------------------------------------------
>
>                 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
>             Fix For: Invalid
>
>         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.