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

2.2.2 strips schemaLocation in binding files #803

Closed
Tomas-Kraus opened this issue Jan 10, 2011 · 7 comments
Closed

2.2.2 strips schemaLocation in binding files #803

Tomas-Kraus opened this issue Jan 10, 2011 · 7 comments

Comments

@Tomas-Kraus
Copy link
Member

CXF tried to upgrade from 2.2.1 to 2.2.2 but has run into a problem.

When processing a WSDL, CXF binds the internal Schemas into the SchemaCompiler using a URL like:

file:/tmp/hello_world.wsdl#types1
file:/tmp/hello_world.wsdl#types2
etc... for each schema in the WSDL.

There are cases where an external binding file would like to point to those and in 2.2.1 and earlier, they could use those URL's in the schemaLocation of the binding file. With 2.2.2, the "#types1" is stipped off of the schemaLocation for all "file" URL's and an error is raised as it no longer matches and schema in the compile unit.

The problem is at line 247 of Internalizer.java. The code creates a File object and uses it's URI which would stip that off. My suggestion would be to change it to:

schemaLocation = loc.toExternalForm();
    target = forest.get(schemaLocation);
    if (target == null && loc.getProtocol().startsWith("file")) {
        File f = new File(loc.getFile());
        schemaLocation = new File(f.getCanonicalPath()).toURI().toString();
    }

so that if the original URI will find a schema, it would work. If not, use the new algorithm.

Affected Versions

[2.2.2]

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Reported by dkulp

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Was assigned to snajper

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
mmatula said:
Martin, please evaluate ASAP.

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
snajper said:
fixed in trunk and merged to branches, thanks for patch

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Marked as fixed on Monday, January 10th 2011, 9:46:08 pm

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JAXB-803

@Tomas-Kraus
Copy link
Member Author

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

2 participants