Question

I am testing JBoss AS 7 prior to deployment with a .war file of an app running in a different server.

I get this error when I try to log onto the database via the app:

SEVERE [] (http--0.0.0.0-8080-4) java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException from [Module "deployment.app.war:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
      at org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:220)

In some forums, they suggest adding the commons-codec jar, but I already have it in JBoss, right? (in here: jboss-as-7.1.1.Final/modules/org/apache/commons/codec/main/commons-codec-1.4.jar)

OSGi is not activated, frankly I have no idea to what purpose it serves, but when I try to activate it it messes with my war as it fails to deploy...

I have JDK, but no JRE if that's any help.

No correct solution

OTHER TIPS

JBoss AS 7 does not use OSGi by default for modular class loading. It uses JBoss Modules so this has nothing to do with OSGi.

What you need to do if you want to use the commons-codec provided with JBoss AS 7 is add a dependency to your deployment.

Modules are not visible by your artefact classes automatically. You have three possibilities:

  1. Define a global module in your standalone.xml http://javahowto.blogspot.de/2012/09/how-to-create-global-modules-in-jboss.html This module will be used by all artefacts you are deploying on Jboss.
  2. Put it into your war artefact, into the lib folder. You can do that with Maven.
  3. Define an explicit dependency within your Manifest. https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7 Section Dependencies: Manifest Entries
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top