IllegalAnnotationExceptions : StreamCompression$Failure$Condition does not have a no-arg default constructor
Issue #48
closed
Im using maven dependency xmpp-core-client 0.5.1, to deploy a simple xmpp client.
public JsonObject prebind(String user, String password){
try {
BoshConnectionConfiguration boshConfiguration = BoshConnectionConfiguration.builder().hostname(BOSH_SERV).port(5280).file("/http-bind/").wait(60).build();
XmppSession xmppSession = new XmppSession(BOSH_SERV, boshConfiguration);
try {
xmppSession.connect();
} catch (XmppException ex) {
ex.printStackTrace();
}
....
}
It works fine with Apache-tomcat-8.0.22, but in production I use a Jboss/Wildfire and throws this exception:
Exception com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
rocks.xmpp.extensions.compress.model.StreamCompression$Failure$Condition does not have a no-arg default constructor.
this problem is related to the following location:
at rocks.xmpp.extensions.compress.model.StreamCompression$Failure$Condition
at rocks.xmpp.extensions.compress.model.StreamCompression$Failure$SetupFailed
at private final rocks.xmpp.extensions.compress.model.StreamCompression$Failure$Condition rocks.xmpp.extensions.compress.model.StreamCompression$Failure.condition
at rocks.xmpp.extensions.compress.model.StreamCompression$Failure
at @javax.xml.bind.annotation.XmlSeeAlso(value=[class rocks.xmpp.extensions.compress.model.feature.CompressionFeature, class rocks.xmpp.extensions.compress.model.StreamCompression$Compress, class rocks.xmpp.extensions.compress.model.StreamCompression$Compressed, class rocks.xmpp.extensions.compress.model.StreamCompression$Failure])
There you talk about "no-args constructor" issues, but couldn't find a solution
Thank you, this library is great and easy to use.
Comments (3)
-
repo owner -
reporter - changed status to resolved
Including JAXB dependencies.
<dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> <version>2.2.11</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.2.11</version> </dependency>
-
repo owner - changed status to closed
- Log in to comment
That's strange. I suspect it's a different JAXB version (and/or JDK) on your two servers. Could you check this? Maybe it's a JAXB bug. I think the solution is to either add a no-arg default constructor to the class in question or to add @XmlTransient to the class:
public abstract static class Condition
(or to update the JDK).
Are able to build branch 0.5 yourself (with the suggested fix) to test, if this is indeed the solution?