Closed glassfishrobot closed 17 years ago
Reported by hr_stoyanov
hchar said: Can you please attach or provide a link to the specific xsd that triggered this problem ? Thanks.
hchar said: I just tried the fluent api plugin against the xhtml xsd I could find at:
http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
I could generate all the sources with the fluent API and compile succesfully. I couldn't reproduce the problem you encountered.
Can you please attach or email me a copy of the XSD that caused you this problem ? Thanks.
hchar said: Reassign to myself
hchar said: I'll be closing this issue shortly, unless I can provided with an xsd that can reproduce the problem.
hchar said: Closing issue. Feel free to reopen it if an XSD can be provided to have the problem reproduced.
class CodeType{ ..... public CodeType withContent(Serializable[]... values) { for (Serializable value: values)
{ getContent().add(value); }
return this; } ... }
I am using version 2.0.3 of the fluent API and the generated code is for the XHTML schema found in here: http://www.w3.org/TR/2004/WD-xhtml-modularization-20040218/
Inside this page, there is a link for a zip archive. Unpack it and try this for SCHEMA\xhtml11.xsd:
hchar said: Your xjc ant target makes me wonder which version of jaxb/xjc you are using, for there is no "target" attribute for the "xjc" ant task, "destdir" rather. See http://java.sun.com/webservices/docs/2.0/jaxb/xjcTask.html
Anyway, I just tried out the fluent api plugins both on jaxb-ri-20070413 (ie jaxb 2.1.3), jaxb-ri-20061211 (ie jaxb 2.1) and jaxb-ri-20070122 (ie jaxb 2.0.5) against xhtml11.xsd and they all work as expected. Note I changed the xjc ant target to become something like:
<xjc destdir="$
{src.dir}
" removeOldOutput="yes" package="com.peruncs.jaxb_xhtml">
Using jaxb-fluent-api-2.0.3.jar, it generates:
public CodeType withContent(Serializable... values) { for (Serializable value: values)
{ getContent().add(value); }
return this; }
Using jaxb-fluent-api-2.1.3.jar, it generates:
public CodeType withContent(Serializable... values) { if (values!= null) { for (Serializable value: values)
{ getContent().add(value); }
} return this; }
hchar said: For some reason I don't seem to be able to reproduce this problem. I wonder if anyone else has encountered it.
hchar said: No problem. Feel free to re-open this issue. However, it smells like a NetBean specific problem. I never used NB but rather direct ant 1.6.5+ build with Java 5 and Jaxb 2.x.
hr_stoyanov said: Ok, but have you ever try it with JDK1.6 - this is what I am using? I eliminated the NB5.5 JAXWS2.0 jars completely, suspecting they have bad/old XJC code there. But how can you explain the 'unrecognized parameter -Xfluent-api' problem?
My theory is that Sun made a huge mistake by including JAX-WS 2.0 in the jdk1.6. Then they came up with a very ugly patch (http://weblogs.java.net/blog/kohsuke/archive/2007/02/howitworks_runn.html) to make the JAX-WS2.1 jars work. So I think the the above exception is due to some classloader mess.
Btw, where is the link for 2.0.x fluent API download?
hr_stoyanov said: Ok. I got fluent-2.1.3 to work with Jaxb 2.0.5, eliminating the NB 5.5 bundled JAXWS2.0 module. All under Java 6.
However, there still seems to be a problem with fluent-2.1.3 and JAxb-2.1.3 under java 6. I will file a separate issue for this, if it is not too much for asking you to take a look at it. Thanks.
hchar said:
have you ever try it with JDK1.6
No I haven't. I avoid using jdk1.6 and jaxb together. I concur that it is a big mistake. Jaxb was going really well until it was included in the jdk. What a mess
where is the link for 2.0.x fluent API download?
They are all located with URL of the pattern:
https://jaxb2-commons.dev.java.net/fluent-api/release/2.0.x/jaxb-fluent-api-2.0.x.jar
(Just substitute "x" with the actual version number)
hchar said: Since this is a Java 6 related issue, I am closing this issue for now, and leave the other new issue (specific to the use of fluent API under Java 6) open.
Was assigned to hchar
This issue was imported from java.net JIRA JAXB2_COMMONS-5
Marked as won't fix on Monday, May 14th 2007, 1:34:48 pm
While generating Java code off XHTML schema with xjc, the fluent plugin generated:
class AType{ ....
public AType withType(String[]... values) { for (String value: values)
{ getType().add(value); }
return this; } }
but it should have generated "withType(String... values)". The resulting code does not compile!
Environment
Operating System: All Platform: All
Affected Versions
[current]