2
votes

My application uses jaxb jar (jaxb-impl-2.2.1.1.jar)from apache wink. I deployed my application on bluemix.

When it accesses com.sun.xml.bind.marshaller.CharacterEscapeHandler it fails with NoClassDefFoundError on bluemix.

Does bluemix use some other version of this jar which does not have this class? How can I check this?

2
Can you provide a little bit more of the stack? - RandalAnders

2 Answers

3
votes

Enable jaxb-2.2 feature:

cf set-env <appname> JBP_CONFIG_LIBERTY "app_archive: {features: ["jsf-2.0", "jsp-2.2", "servlet-3.0", "ejbLite-3.1", "cdi-1.0", "jpa-2.0", "jdbc-4.0", "jndi-1.0", "managedBeans-1.0", "jaxrs-1.1", "jaxb-2.2"]}"

You can also try using OpenJDK

cf set-env myapp JVM 'openjdk'

0
votes

When you're running on Liberty, you mustn't include the wink jaxb jar in your application and your code should only depend on classes included in the jaxb spec (mostly in the javax.xml.bind package) and not on any wink-specific classes.

You then just need to include the jaxb-2.2 feature in your server.xml.

There's a tutorial for developing jaxb applications on liberty which walks through the steps needed to configure your development environment and your liberty server.