Closed estan closed 10 years ago
If somehow ANT_OPTS could be passed to the Ant task, it could probably be worked around by passing -Djavax.xml.accessExternalSchema=file, but so far I haven't found a way to do this :(
I tried both hacking the plugin to do ant.properties['env.ANT_OPTS'] = '-Djavax.xml.accessExternalSchema=file' and systemProp.javax.xml.accessExternalSchema=file in my gradle.properties.
I am not using this plugin but ran into the same problem when using the xjc ant task with gradle. Your comment makes me believe that this plugin somehow also uses the ant task.
I fixed the problem by passing the "-disableXmlSecurity" argument.
ant.taskdef(name:'xjc', classname:'com.sun.tools.xjc.XJC2Task', classpath:configurations.generateSources.asPath)
ant.xjc(schema:'some.xsd", destdir:generatedSources, encoding:encoding, catalog:catalogFile) {
arg(value:"-disableXmlSecurity")
}
I hope this helps with fixing the issue.
Author of the maven-jaxb2-plugin. https://java.net/jira/browse/MAVEN_JAXB2_PLUGIN-80 is now resolved in 0.9.0. So relevant JAXP properties accessExternalSchema and accessExternalDTD can be controlled now. Further properties are out of the scope. accessExternalSchema and accessExternalDTD can be controlled and set to "all" by default.
Sorry for taking this long to answer, but we are not maintaining this plugin anymore. You should look at jacobono's alternative instead.
Ah. Thanks. Right now I'm actually working on the very same product I was working on when I had this problem, almost exactly a year ago :) I'll look into jacobono's plugin. Though right now I'm not having any trouble with this one.
solved : ref : http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8 Create a file named jaxp.properties (if it doesn't exist) under /path/to/jdk1.8.0/jre/lib and then write this line in it:
javax.xml.accessExternalSchema = all
That's all. Enjoy JDK 8.
Hi,
I recently upgraded my OpenJDK (7.u40_2.4.0 -> 7.u40_2.4.1) and I think I've been bitten by the same problem as described in [1]:
I'm not sure if the Gradle plugin is able to solve this, since I can't find a way in the Ant task to control the JAXP features used (to turn off the now default restricted access to external resources), but I'll file it as a bug here since at the moment I've had to downgrade my JDK to work around the problem.
Thanks a lot for an otherwise nice plugin!
[1] https://java.net/jira/browse/MAVEN_JAXB2_PLUGIN-80