Bug 241570 - Wizard fails to create class from wsdl, in maven project and JavaFX client
Wizard fails to create class from wsdl, in maven project and JavaFX client
Status: RESOLVED WONTFIX
Product: webservices
Classification: Unclassified
Component: Client
8.0
PC Windows 7 x64
: P2 (vote)
: TBD
Assigned To: Milan Kuchtiak
issues@webservices
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-08 13:28 UTC by albert.af77
Modified: 2014-06-30 14:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description albert.af77 2014-02-08 13:28:56 UTC
Steps to reproduce
Open the javaFx project
Right click on
select New
Select "Web Service Client"
Select "WSDL URL"
Add a valid wsdl url.
Click "Finish"

THE SYSTEM THROW THE NEXT ERROR.
cd D:\albert\Proyectos\workSpaceNB8\mavenproject2; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0 Beta\\java\\maven\\bin\\mvn.bat\" -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.0 Beta\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 compile\""
Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building mavenproject2 1.0-SNAPSHOT
------------------------------------------------------------------------

--- jaxws-maven-plugin:2.3:wsimport (wsimport-generate-NewWebService) @ mavenproject2 ---
Processing: file:/D:/albert/Proyectos/workSpaceNB8/mavenproject2/src/wsdl/localhost_8080/mavenproject1/NewWebService.wsdl
jaxws:wsimport args: [-keep, -s, D:\albert\Proyectos\workSpaceNB8\mavenproject2\target\generated-sources\jaxws-wsimport, -d, D:\albert\Proyectos\workSpaceNB8\mavenproject2\target\classes, -verbose, -encoding, UTF-8, -extension, -Xnocompile, -catalog, D:\albert\Proyectos\workSpaceNB8\mavenproject2\src\jax-ws-catalog.xml, -wsdllocation, http://localhost:8080/mavenproject1/NewWebService?wsdl, "file:/D:/albert/Proyectos/workSpaceNB8/mavenproject2/src/wsdl/localhost_8080/mavenproject1/NewWebService.wsdl"]
parsing WSDL...


schema_reference: Failed to read schema document 'NewWebService.xsd_1.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property. 
  line 4 of file:/D:/albert/Proyectos/workSpaceNB8/mavenproject2/src/wsdl/localhost_8080/mavenproject1/NewWebService.wsdl#types?schema1

Exception in thread "main" java.lang.ClassCastException: java.lang.AssertionError cannot be cast to java.lang.Exception
	at org.jvnet.jax_ws_commons.jaxws.Invoker.main(Invoker.java:87)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.277s
Finished at: Sat Feb 08 09:09:02 BOT 2014
Final Memory: 6M/177M
------------------------------------------------------------------------
Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (wsimport-generate-NewWebService) on project mavenproject2: Mojo failed - check output -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Comment 1 Milan Kuchtiak 2014-02-14 14:37:54 UTC
The reason is the following:

Failed to read schema document 'NewWebService.xsd_1.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property. 

You have likely (in your environment) set on this restrinction, for JAXP parser.
See: http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA

Try to swith the restriction off in netbeans_home/etc/netbeans.conf:

-J-Djavax.xml.accessExternalSchema=all
Comment 2 phansson 2014-06-30 14:50:50 UTC
To anyone that finds this.

This is a result of a new, more restrictive, JAXP (v1.5) which is included with JDK 7u40 onwards and JDK8. The problem as such has nothing to do with NB, JavaFX or Maven.

As noted it can be "solved" by setting system property javax.xml.accessExternalSchema=all. Since the bug reporter uses Maven it needs to be a Maven solution. In this situation it doesn't help to set the property on the IDE.

Here's what I add to my pom.xml in order to fix this problem:



<plugin>
    <groupId>org.jvnet.jax-ws-commons</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <!-- Needed with JAXP 1.5 -->
        <vmArgs>
            <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
        </vmArgs>
    </configuration>
</plugin>



So, what I actually add is the <vmArgs> stuff.

The question is if it would make sense if NetBeans IDE always added this for you when it first generates the project ?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo