This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241570

Summary: Wizard fails to create class from wsdl, in maven project and JavaFX client
Product: webservices Reporter: albert.af77
Component: ClientAssignee: Milan Kuchtiak <mkuchtiak>
Status: RESOLVED WONTFIX    
Severity: normal CC: markiewb, pjiricka
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter: Failed to read schema document 'NewWebService.xsd_1.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.

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 ?