5 Replies Latest reply on Oct 28, 2016 1:33 PM by garjanice9

    Class loading problem

    samuele.firpo

      Hi,

       

      I'm a JBoss newbie.

      I have a problem with a sample application that declare a dependency from a module. This module try to access to a class that is contained in web-inf/classes of the application (a single war application).

      When this happens, I get the execption:

       

      java.lang.ClassNotFoundException: <class_name> from [Module "<module_name>" from local module loader @39378e61

       

      The same application deployed in other application server works fine.

       

      Is there a way to solve my problem?

       

      How I have to configure modules and their dependencies?

       

      Thanks and idvance

        • 1. Re: Class loading problem
          ehugonnet

          Your moudle should be able to 'see' all he classes it needs thus you can't have a cycle war --> module --> war : either put the required jars in your module and add them to the module.xml or don't use a module there.

          • 2. Re: Class loading problem
            samuele.firpo

            Hi ehugonnet,

            thanks for the reply.

            The application server we actually use has a different class loading mechanism (it isnt' module based) in which local classes and parent classes are at same level.

             

            If I understand your answer, the only way to solve my problem is to modify application structure?

             

            It's correct?

             

            Regards

            • 3. Re: Class loading problem
              ehugonnet

              Yes, if your missing classes are in module then they would be available for the module and the war. So in my opinion just moving stuff around should fix your issue

              • 4. Re: Class loading problem
                garjanice9

                Hi,

                 

                I want to take a JBoss 6.4.2 module out, but JBoss throws an error that it can not load this module. I took the module out of the jboss-deployment-structure.xml file, restarted JBoss and computer and I am still getting this message. I do not need this module in JBoss. It was a log4j module, we are now using this as jar in a .war/.ear file.

                • 5. Re: Class loading problem
                  garjanice9

                  Other modules are dependent on that module, so leave it as a module, as I wrote the question and it dawned on me that this module has dependencies.