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
xjc with WSDL emits erroneous warning #1701
Comments
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
Hi @lukasj : is any backport of this issue will be done in 3.x branch and 2.3.x branch ? Or is it only for jakarta 4.x ? |
I just wanted to +1 @laurentschoelens question here... even though the classes are still generated successfully, having such an error message in our build logs when using the maven-jaxb2-plugin is extremely alarming and is going to raise flags and have to be explained any time a new person joins our team and sees it for the first time. To the point that we're strongly considering reverting to an older version of that plugin just to avoid this message. Anything that can be done to backport this fix to eliminate the message would be much appreciated. |
Hello @aprevost We are migrating the plugin to support jaxb3 (and then jaxb4) with Matt (see migration guide page on the wiki). My point is and was that we should have, if possible, backport to jaxb2 at least, since jaxb3 is only package renaming and getting nothing more in it. @lukasj I know you're pretty busy, could you give us small update on this please 😃 |
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com> (cherry picked from commit 5a10fab)
wrt backport, see #1765 |
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com> (cherry picked from commit 5a10fab)
I am using the latest version of maven-jaxb2-plugin (which now uses JAXB v2.3.x) to generate code from a wsdl file. It emits the following warning message, but did not used to when it was using JAXB v2.1.x. I believe this would also happen from the cli tooling since the issue is all in the JAXB code.
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
In my plugin configuration, the
schemaLanguage
is already properly set toWSDL
.After reviewing the source, I believe this warning is erroneous for the following reasons:
-wsdl
switch mentioned is used from cli to set theschemaLanguage
, which is already properly set by the plugin.ModelLoader
has asanityCheck()
method which seems intended to guard against someone mistakenly setting (or using the default)schemaLanguage
asXMLSCHEMA
when they really want aDTD
orWSDL
. In v2.1.x, it does this by checkingopt.getSchemaLanguage()==Language.XMLSCHEMA
and then using the file extension to guess if it really should be aDTD
orWSDL
and return the above messaging if so. See:jaxb-ri/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
Line 163 in cdebd87
opt.getSchemaLanguage()!=Language.XMLSCHEMA
which seems wrong. See: https://github.com/eclipse-ee4j/jaxb-ri/pull/1484/files#diff-505738a8042847a9040fdacbd669222bf6748184d054258ee78ba7356dd53e90schemaLanguage
is already properly set toDTD
orWSDL
, it will trip into that code and emit the warning.schemaLanguage
toWSDL
which does nothing to silence the warning because you still fail thesanityCheck()
. See: https://github.com/eclipse-ee4j/jaxb-ri/blob/master/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Options.java#L591-L594Fortunately, this message does not stop the code generation and things still work as expected for me. The issue is purely cosmetic.
It looks to me like all you need to do is revert that one commit to
ModelLoader
and things will go back to normal.If my analysis is incorrect, could you please help educate me on why that change was made, what that
sanityCheck()
is really for, and how to resolve this message (either on the cli, or through the plugin)?The text was updated successfully, but these errors were encountered: