Amir_Af
Amir_Af

Reputation: 574

JBoss 7 add jar to classpath

I'm trying to deploy WAR file into JBoss 7. I placed the WAR file in the standalone/deployments folder. while starting the server I’m getting ClassNotFoundError. I believe Since the jars are not part of the WAR file and not placed in the WEB_INF/lib folder so I need to add them externally.

I read so many tutorials but I just can’t understand how it works.

So my question is how I simply add JAR files to the JBoss classpath.

Upvotes: 1

Views: 6298

Answers (2)

Amir_Af
Amir_Af

Reputation: 574

Ok I solved it by creating new module and by adding the module dependency in the MANIFEST of my jar.

Upvotes: 0

Bharat
Bharat

Reputation: 31

If you want to add any jars that are not part of WebApp but are still needed to be loaded, one approach would trying to copy the jars at following location: $JAVA_HOME/jre/lib/ext.

The JBOSS server should point to this java installation and this might resolve your issue.

This might be one way.

JBOSS 7 uses module based loading, hence most of the jars will be loaded if module is included in standalone.xml.

You will need to check in JBoss Release notes if third party modules can be loaded.

Upvotes: 1

Related Questions