Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsimport fails with JDK 8: Failed to read schema document 'xjc.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property #4

Closed
hboutemy opened this issue Oct 28, 2015 · 10 comments
Milestone

Comments

@hboutemy
Copy link
Member

see http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8
and https://java.net/jira/browse/JAX_WS_COMMONS-129

building jaxws-maven-plugin with JDK 8 shows this exact issue

@hboutemy
Copy link
Member Author

reference documentation: https://jaxp.java.net/1.5/1.5.0/ReleaseNotes.html and https://jaxp.java.net/1.5/JAXP1.5Guide.html#JAXP1.5Documentation%2CGuide-7.Usingtheproperties

should we add

    <vmArgs>
        <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
    </vmArgs>

as default value in jaxws-maven-plugin?
or simply add as an example?

@andham
Copy link
Member

andham commented Feb 28, 2017

I think we should align with how it is handled by jaxb2-maven-plugin.

@andham
Copy link
Member

andham commented Mar 7, 2017

Somehow this is handled automatically in the jaxb2-m-p case, either by the plugin or by some library:

[DEBUG] [SchemaGen]: mar 07, 2017 12:34:23 EM com.sun.xml.xsom.parser.JAXPParser allowFileAccess
FIN: Property "http://javax.xml.XMLConstants/property/accessExternalSchema" is supported and has been successfuly set by used JAXP implementation.

@andham
Copy link
Member

andham commented Mar 7, 2017

In a local test I upgraded the jaxws-m-p to use v2.2.10 of jaxws-tools and v0.11.1 of jaxb2-basics. Then it works with Oracle JDK 1.8b112 without having to specify the vm arg.

@andham andham added this to the 2.5 milestone Mar 9, 2017
@andham andham mentioned this issue Mar 10, 2017
@andham
Copy link
Member

andham commented Mar 10, 2017

This has been fixed as part of #8. No additional config args are needed with JDK 8.

@andham andham closed this as completed Mar 10, 2017
@andham
Copy link
Member

andham commented Jun 16, 2017

Until v2.5 is released, it is possible to make v2.4.x work with JDK 8 by upgrading one of its dependencies like this:

  		<plugin>
  			<groupId>org.codehaus.mojo</groupId>
  			<artifactId>jaxws-maven-plugin</artifactId>
  			<version>2.4.1</version>
  			<dependencies>
  				<dependency>
  					<groupId>com.sun.xml.ws</groupId>
  					<artifactId>jaxws-tools</artifactId>
  					<version>2.2.10</version>
  				</dependency>
  			</dependencies>
  		</plugin>

@CassandraTis
Copy link

@andham Not working for me. Still have the same issue

@titoasi
Copy link

titoasi commented Jul 19, 2018

Using v2.5 and the error is still the same no matter the JDK used

@ChristianWulf
Copy link

ChristianWulf commented Aug 30, 2018

I confirm. The bug still exists. However, I could fix it by building the parent project. When I only build the subproject containing the maven-jaxws-plugin, it fails.

@olgrosTrackit
Copy link

olgrosTrackit commented Oct 20, 2018

Hello
I am trying to generate the source for a webservice. I am using
mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: ...../apache-maven-3.5.4
Java version: 10.0.2, vendor: Oracle Corporation, runtime: D:\dev\java\jdk-10.0.2
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

The parent-pom contains:

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>

I get the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport (generate-my-soap-service-code) on project platform-my-soap-service: Invocation of com.sun.tools.ws.wscompile.WsimportTool failed - check output -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport (generate-my-soap-service-code) on project platform-my-soap-service: Invocation of com.sun.tools.ws.wscompile.WsimportTool failed - check output

This fails in eclipse as well.
Version: 2018-09 (4.9.0)
Build id: 20180917-1800

Root cause:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
-Xbootclasspath/p is no longer a supported option.

Root Cause is being addressed as Issue #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants