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:06:14 UTC

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

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
            Priority: Minor
         Attachments: Equipment.xsd, EquipmentService.wsdl, pom.xml

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.


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

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-2368:
-----------------------------

    Fix Version/s:     (was: Invalid)
          Summary: defaultOptions in cxf-codegen-plugin only works with wsdlRoot scanning  (was: NPE in cxf-codegen-plugin when trying to use defaultOptions with wsdlOptions)


The wiki page at:
http://cwiki.apache.org/CXF20DOC/maven-integration-and-plugin.html
 says the defaultOptions should work with the "wsdlOptions" specified wsdl, but it doesn't.   It only applies to wsdlOptions obtained by the directory scan using wsdlRoot with includes/excludes.    Not sure if this is a doc error or code error.   My gut feeling says it was MEANT to be a doc error, but it's definitely a good feature and thus is a code error.

In anycase, you can use the wsdlRoot form:

                            <wsdlRoot>src/main/wsdl</wsdlRoot>
                            <defaultOptions>
                                <validateWsdl>true</validateWsdl>
                                <bindingFiles>
                                    <bindingFile>src/main/wsdl/bindings/bindings.xjb</bindingFile>
                                </bindingFiles>
                                <extraargs>
                                    <extraarg>-server</extraarg>
                                </extraargs>
                            </defaultOptions>



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


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John McGinn updated CXF-2368:
-----------------------------

    Attachment: Equipment.xsd
                EquipmentService.wsdl
                pom.xml

pom + wsdl & xsd

> 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
>            Priority: Minor
>         Attachments: Equipment.xsd, EquipmentService.wsdl, pom.xml
>
>
> 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.


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736276#action_12736276 ] 

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

Thanks Daniel, 

I put another ticket out there to fix the user guide on the wiki
http://cwiki.apache.org/CXF20DOC/maven-integration-and-plugin.html

This is where I got the bad syntax from.

John

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


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John McGinn updated CXF-2368:
-----------------------------

    Attachment: bindings.xjb
                bindingMapping.xsd

binding files

> 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
>            Priority: Minor
>         Attachments: bindingMapping.xsd, bindings.xjb, Equipment.xsd, EquipmentService.wsdl, pom.xml
>
>
> 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.


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736275#action_12736275 ] 

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

Hey Daniel, thanks for the update,

Should I or someone update the wiki page then?

http://cwiki.apache.org/CXF20DOC/maven-integration-and-plugin.html
I was using these examples that led me down the bad config path.

Thanks

John



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


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

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2368.
------------------------------

       Resolution: Invalid
    Fix Version/s: Invalid
         Assignee: Daniel Kulp



This is a bug in the pom/plugin configuration.  (I wish Maven would report this error, but that's a Maven issue)

The "defaultOptions" element goes outside the wsdlOptions element.   Like:
                        <configuration>
                            <defaultOptions>
                                <validateWsdl>true</validateWsdl>
                            </defaultOptions>
                            <wsdlOptions>
                                <wsdlOption>
                                    <bindingFiles>
                                        <bindingFile>src/main/wsdl/bindings/bindings.xjb</bindingFile>
                                    </bindingFiles>
                                    <wsdl>src/main/wsdl/EquipmentService.wsdl</wsdl>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>

That should resolve this for you.

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


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

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2368.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.5


The default options are now merged into the configured options more or less as documented.

> 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
>             Fix For: 2.2.5
>
>         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.


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

Posted by "John McGinn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John McGinn updated CXF-2368:
-----------------------------

    Attachment: stacktrace.txt

full stacktrace

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