You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Thomas Papke (JIRA)" <ji...@apache.org> on 2019/05/14 13:05:00 UTC

[jira] [Commented] (CXF-8005) cxf-codegen-plugin - External DTD: Failed to read external DTD ‘.dtd’

    [ https://issues.apache.org/jira/browse/CXF-8005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16839404#comment-16839404 ] 

Thomas Papke commented on CXF-8005:
-----------------------------------

I also run into this issue while trying to upgrade certain libaries (e.g. cxf from 3.2.7 to 3.3.1). 

From me the issue slighly looks to be present in wss4j? The following schema definition
https://github.com/apache/wss4j/blob/trunk/ws-security-stax/src/main/resources/schemas/xml.xsd
contains a dtd reference, while the one present in CXF does not have them defined:
https://github.com/apache/cxf/blob/master/rt/ws/policy/src/main/resources/schemas/xml.xsd

Since both file locations are accessible with the same classpath "schemas/xml.xsd", the issue might occur.

So is the xsd in wss4j maybe the originally issue?

> cxf-codegen-plugin - External DTD: Failed to read external DTD ‘.dtd’
> ---------------------------------------------------------------------
>
>                 Key: CXF-8005
>                 URL: https://issues.apache.org/jira/browse/CXF-8005
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Tsvetoslav
>            Assignee: Colm O hEigeartaigh
>            Priority: Blocker
>         Attachments: wsdl.zip, xmldsig-core-schema.xsd
>
>
> Hello,
>  
> First I would like to mention that I'm using "Spring Boot CXF JAX-WS Starter" for developing my web service. When I'd migrated my project dependencies to the latest version - Apache-cxf(3.3.1) and Spring boot(2.1.3.RELEASE), the Maven build system started to give me during the build this blocking error "_Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:3.3.1:wsdl2java failed: org.apache.ws.commons.schema.XmlSchemaException: External DTD: Failed to read external DTD 'XMLSchema.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property._" I've returned back to the older/current version of dependencies Apache-cxf(3.2.7) and Spring boot(1.5.17.RELEASE), the error has gone.
>  
> I've found a solution [stackoverflow|[https://stackoverflow.com/a/23012746/7357959]] which I don't prefer because it's applied directly in the jre and I need to look after it when I create a new environment.
>  
> Based on your official documentation[maven-cxf-codegen-plugin|[http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html]], section "Other configuration options", I can apply the same configuration to my JVM using cxf-codegen-plugin. I tried out this configuration:
> {code:java}
> <plugin>
>      <groupId>org.apache.cxf</groupId>
>      <artifactId>cxf-codegen-plugin</artifactId>
>      <version>${cxf.version}</version>
>      <configuration>
>          <additionalJvmArgs>-Djavax.xml.accessExternalDTD=all</additionalJvmArgs>
>      </configuration>
>      ......................{code}
> based on this example [External DTD|https://programtalk.com/java/external-dtd-failed-restriction-accessexternaldtd/] but unfortunately it doesn't work
> I will appreciate if somebody can take a look at the problem.
> Thank you in advance!
>  
> P.S. I tried different configuration option like:
>  
> {code:java}
> <configuration>
>     <fork>once</fork>
>     <additionalJvmArgs>-Djavax.xml.accessExternalDTD=all</additionalJvmArgs>
>     <additionalJvmArgs>-Djavax.xml.accessExternalSchema=all</additionalJvmArgs>
>  </configuration>{code}
>  
> ----
>  
> {code:java}
> <configuration>
>     <additionalJvmArgs>-Djavax.xml.accessExternalDTD=all</additionalJvmArgs>
>     <additionalJvmArgs>-Djavax.xml.accessExternalSchema=all</additionalJvmArgs>
>  </configuration>
> {code}
> but unfortunately neither of them was working
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)