SLF4J is a module in
JBoss AS7. I therefore assumed it would
not be necessary to ship SLF4J with my web application. To my surprise, my application failed with a ClassNotFoundException.
Caused by:
java.lang.ClassNotFoundException:
org.slf4j.Logger
Hmm... How can I use a JBoss AS7 module as a dependency?
The solution is to add the org.slf4j entry as a MANIFEST.MF dependency. The MANIFEST.MF file looks then like that:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: M1key
Build-Jdk: 1.6.0_27
Dependencies: org.slf4j
Maven can do it for you automatically.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Dependencies>org.slf4j</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
I guess I should have RTFM... More about
class loading in AS7.
Hi Michał,
ReplyDeleteNice blog! Is there an email address I can contact you in private??
Great Article android based projects
DeleteJava Training in Chennai
Project Center in Chennai
Java Training in Chennai
projects for cse
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Hi Ilias, sure, there it is: http://m1key.me/about_me/
ReplyDeleteA prefered way is to use the jboss-deployment-structure.xml file.
ReplyDeleteHere is an example:
http://pastebin.com/69PAdp7S
DeleteThank you!
DeleteHi Akram, I'm afraid you're going to have to escape the xml code ([blah][/blah]) or provide a link, sorry.
ReplyDelete