2 Replies Latest reply on Mar 8, 2012 4:23 AM by guinotphil

    Jboss 7 trying to read the wrong module

    Rodrigo Gomes Newbie

      Hi,

       

      Today I started to study how to migrate applications from jboss6 to 7, and I started to do some tests and create my modules do reproduce my system. But I got an error.

       

      Let me explain my situation: I created a module for mongo driver (called com.mongo) and this module is used in 3 different 'projects' (ejb-jars).

      I can successfully deploy 2 projects pointing to this module, but when I put another project I got an error.

       

      Caused by: java.lang.NoClassDefFoundError: com/mongodb/DBObject
                at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_24]
                at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [rt.jar:1.6.0_24]
                at java.lang.Class.getDeclaredFields(Class.java:1743) [rt.jar:1.6.0_24]
                at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
                at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
                ... 10 more
      Caused by: java.lang.ClassNotFoundException: com.mongodb.DBObject from [Module "q10.comum:main" from local module loader @6513cf0 (roots: /home/.../appserver/jboss-as-7.1.0.Final/modules)]
      
      

       

      JBoss is trying to load com.mongodb.DBObject from the module q10.comum (the wrong one), instead of load from the com.mongo

       

      On my MANIFEST I put:

      Dependencies: com.mongo, q10.comum

       

      Is not allowed to have a module that is accessible from multiple clients?

       

      Am I doing something wrong?

       

      best regards,

      Rodrigo Gomes