Operating System: All
Attached is the testcase which simulates the way wsimport invokes xjc.
Passing episode works when directly used with xjc ant task. But wsimport uses
This is required for https://jax-ws.dev.java.net/issues/show_bug.cgi?id=368
Created an attachment (id=254)
Created an attachment (id=255)
Another bug is filed on jax-ws
(https://jax-ws.dev.java.net/issues/show_bug.cgi?id=690) on the same note.
I've tried xjc with episodes from command line and via com.sun.tools.xjc.api.XJC
and both ways are working fine.
SchemaCompiler sc = XJC.createSchemaCompiler();
InputSource file = new
InputSource episode = new
File("/Users/pavel/jaxb/bugs/514/tryout2/a.jar")); // works too
S2JJAXBModel model = sc.bind();
JCodeModel jcm = model.generateCode(null, null);
It is working even with xsd and episode you've provided with testcase (after
fixed typos in file wrap.xsd (complesElement and AbstrcatType).
In uploaded testase you're checking for Hello class but it's already present in
episode file so xjc won't generate it. I'm not sure if I understood this
correctly so please reply if I'm missing something.
marking as incomplete
Closing as invalid. Feel free to reopen with additional info.
Reopening the issue.
Please see the testcase. As in the testcase, JAX-WS tries to get Element Mapping
from the model. Although the model has proper schema information,
model.get(QName) is not returning anything. I think there is some problem in
populating the JAXBModelImpl.byXmlName map.
Also, please use the newly attached testcase to reproduce the issue.
Created an attachment (id=301)
New testcase with the reopened issue.
Can you provide file common-targets.xml, please?
– removing incomplete keyword
– ant output:
/Users/pavel/jaxb/config/common-targets.xml could not be found
java.io.FileNotFoundException: /Users/pavel/jaxb/config/common-targets.xml (No
such file or directory)
$ cat ./build.xml | grep common-targets
<!ENTITY commonTargets SYSTEM "../../../../config/common-targets.xml">
The common-targets does not have much other than setting up the classpath for
xjc and defining xjc task.
Your earlier test case should suffice for reproducing the problem, just check
the model (model.get(QName)), if it can give info about the elements defined in
Any update yet?
We have a workaround.
After short brainstorming session with snajper we've discovered that the easiest
way to support this is do two models - one with episode file included and one
without it (so first will be used to generate java classes and second for
We are aware of performance loss in this case but this isn't used in runtime so
it shouldn't be a major issue.
Please, let us know if this is acceptable (at least for now).
Is there an update on this?
This issue is very critical for us, we have a common schema and number of
extensions that should reuse the same binding files. So, without this fix the
wsimport can produce a conflicting code that fails at the runtime. Thanks.
Pavle, did you contact Rama/Jitu about this one?
Adding an evaluation here such that I don't forget again. Also setting target
The reason why JAXB standalone testcase works and why wsimport fails is the very
basic definition of episode files - JAXB ignores types specified in episode
files in it's processing. It doesn't have enough info to create a model from
them. However, wsimport is requesting this information - it requests Mapping
instance from model.get(QName) call. That includes Type and Annotation info.
One possibility to fix this would be to make a place in episode files to provide
such info. Better solution I think is this:
When wsimport requests information for a qname which is not found in the model,
jaxb would look up the episode file, find a corresponding classname; it will
load the class from classpath, read the annotation/type info using reflection
and return it back to jax-ws in mapping instance.
There's a risk in this however: we don't know yet what other information jax-ws
would require from the model, so this fix could be just a beginning and could
uncover more hidden issues. I'll check with Jitu/Rama about what info is
required in the model. Pavel will look into this for 2.2 release.
This is not really a bug in JAXB, it's an enhancement, so updating the issue. We'll target this one for 2.2.1
as it requires larger changes than we expected. We made several enhancements, but it requires more work
since JAX-WS requires a lot more information to be present from the classes.
Thanks for the update.
Any update ? Which version will be this available? Is there a work around? Thanks
I'm also interested for an update on this.
I also appear to be running into this issue and would appreciate an update, if one is available. Thanks
To be honest now we have quite a lot of BUGs to be closed. But the light became visible in the end of the tunnel. So I hope I'll be able to start working with this in 1-2 months.
Some people (myself included) have been waiting years for this. Any update on where this is going? I mean, we cannot really use episode files with wsimport effectively without this fix.
Can you at least provide a list of known workarounds that should be considered? I've been finding it difficult to workaround because in a project that uses episode files to make XML binding libraries, it's also really easy to get something generated that fails at runtime (e.g., multiple ObjectFactories that support the same element cause JAXBContext issues at runtime).
Any update on this? I wasted an entire day to figure out that this is actually a bug!