1
votes

I'm beginning with jboss and already have a trouble.

My project has next structure:

root pom.xml
 - core module
 - ddbac module
 - web module - includes core.jar and ddbac.jar
 -ear module - includes web.war

Each module also contains a pom.xml. All dependencies are declared in the root pom.xml. When i execute `mvn clean install` inside of ear module, i'm getting ear-file, that contains web.war. This web.war contains core.jar and ddbac.jar.

After that i'm deploying this ear file into jBoss 7.1.1 - it works. But when i'm starting to test it - do some actions - i'm getting exception:

Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @5a0deddc (roots: /home/roman/jboss-as-7.1.1.Final/modules)]
    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)
    ... 99 more

So the question: how need to define dependencies correctly, that code from ddbac module could "see" libs in web.war?

1
Are you using spring? When CXF detects Spring in your application .... maybe id decides to use CXF+Spring implementation instead of CXF alone. community.jboss.org/thread/194685venergiac
yes, i'm using Spring, but problem was solved already (see an accepted answer). Thanks for the hint :)Roman Proshin

1 Answers

1
votes

You can use descriptors to specify your dependencies. One of the following ways could be useful for you.

application.xml. Specify you library as module inside your application. Put application.xml into ear-root/META-INF/ and describe your project. You must specify something like that:

<application>
    <module>
        <web>
             <web-uri>web.war</web-uri>
             <context-root>web</context-root>
        </web>
    </module>   
    <module>
        <java>web/WEB-INF/lib/ddbac.jar</java>
    </module>
</application>

OR

jboss-app.xml. It's JBOSS-specific configuration file, which is also should be located in META-INF/.

<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 5.0//EN"
  "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd" >
<jboss-app>
    <library-directory>web/WEB-INF/lib</library-directory>
</jboss-app>