3 Replies Latest reply on Jun 26, 2013 3:21 AM by sfcoy

    Maven Provided Dependency wth Custom External Module (AS 7)

    cgeo

      Hello, I am trying to deploy an external library (javamelody+jrobin) to a JavaEE6 maven project. However it is a requirement that the libraries are "provided scope" and not compiled. Essentially I want to provide the libraries through the JBoss server.

       

      So I have created the two modules as follows as modules in the jboss c:\boss-as-7.1.1.Final\modules\gnu\javamelody\main and c:\boss-as-7.1.1.Final\modules\gnu\jrobin\main

       

      and have included the following code in standalone.xml

       

        <subsystem xmlns="urn:jboss:domain:ee:1.0"/>

              <global-modules>

                   <module name="gnu.javamelody" slot="main"/>

                   <module name="gnu.jrobin" slot="main"/>

         </global-modules>

      </subsystem>

       

      in my pom.xml i have the following

       

      <dependency>

           <groupId>net.bull.javamelody</groupId>

           <artifactId>javamelody-core</artifactId>

            <version>1.45.0</version>

            <scope>provided</scope>

      </dependency>

       

      finally I get the following warning from the server log:

       

      16:39:22,293 WARNING [net.bull.javamelody] (MSC service thread 1-3) exception while collecting data: java.lang.NoClassDefFoundError: sun/nio/ch/DirectBuffer

                at org.jrobin.core.RrdNioBackend.unmapFile(RrdNioBackend.java:84) [jrobin-1.5.9.jar:1.5.9]

                at org.jrobin.core.RrdNioBackend.close(RrdNioBackend.java:148) [jrobin-1.5.9.jar:1.5.9]

                at org.jrobin.core.RrdDb.close(RrdDb.java:443) [jrobin-1.5.9.jar:1.5.9]

                at org.jrobin.core.RrdDbPool.release(RrdDbPool.java:196) [jrobin-1.5.9.jar:1.5.9]

                at net.bull.javamelody.JRobin.addValue(JRobin.java:333) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.Collector.collectJRobinValues(Collector.java:449) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.Collector.collectJavaInformations(Collector.java:358) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.Collector.collect(Collector.java:297) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.Collector.collectWithoutErrors(Collector.java:284) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.Collector.collectLocalContextWithoutErrors(Collector.java:274) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.FilterContext.initCollect(FilterContext.java:231) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.FilterContext.<init>(FilterContext.java:101) [javamelody-1.45.0.jar:]

                at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:111) [javamelody-1.45.0.jar:]

                at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3269) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3865) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_15]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_15]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_15]

      Caused by: java.lang.ClassNotFoundException: sun.nio.ch.DirectBuffer from [Module "gnu.jrobin:main" from local module loader @ccec5f (roots: C:\Users\Chris-Geo\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)

       

      Anyone have some idea what's wrong?