4 Replies Latest reply on Jun 27, 2012 2:34 AM by chandrashekar.bn

    Migrating from 7.0.1 to 7.1final, getting  java.lang.ClassNotFoundException

    chandrashekar.bn

      Hi All,

       

      I am trying to migrate from AS 7.0 to AS 7.1 final, my ear had no problem while deployment. when i try to move deploy my application on 7.1 AS i am getting following error

       

      Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressException from [Module "org.apache.log4j:main" from local module loader @31b95f (roots: E:\JBOSSAS7\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)

          ... 12 more

       

      I did search for previos discuession an found the similar issue post by robert walker

      moving from 7.0.1 to 7.1final , getting NoClassDefFoundError

       

      I followed the correct answer but it was not working for me..

       

      any suggestion will be appriciated.

       

      Thanks

        • 1. Re: Migrating from 7.0.1 to 7.1final, getting  java.lang.ClassNotFoundException
          jaikiran

          Do you have any SMTP appender configurations in your logging configuration? What does your log4j.xml look like?

           

          P.S: I think we should add an "optional" module dependency on the javax mail module in org.apache.log4j module.

          • 2. Re: Migrating from 7.0.1 to 7.1final, getting  java.lang.ClassNotFoundException
            chandrashekar.bn

            Ys we have org.apache.log4j.net.SMTPAppender configured which implements  org.apache.log4j.xml.UnrecognizedElementHandler.

             

            we have any log4j.properties

             

            # Set root logger level to DEBUG and its only appender to A1.

            log4j.rootLogger=INFO, A1

             

            # A1 is set to be a ConsoleAppender.

            #log4j.appender.A1=org.apache.log4j.ConsoleAppender

             

            # A1 uses PatternLayout.

            log4j.appender.A1.layout=org.apache.log4j.PatternLayout

            log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

             

            # Print messages up to level INFO

            #log4j.logger.net.jawr=INFO

             

             

            we have mail-1.4.4.jar and log4j-1.2.15.jar in our application lib and classpath.

             

            we did try to add

                    <module name="org.slf4j" />

                    <module name="org.apache.log4j" />

            in modules\javax\mail\api\main\module.xml

            but did not help.

             

            i am new to jboss AS can you please give some more details on adding optional module. do i need to manully copy any jars.

            • 3. Re: Migrating from 7.0.1 to 7.1final, getting  java.lang.ClassNotFoundException
              jaikiran

              chandrashekar bn wrote:

               

               

               

              we have mail-1.4.4.jar and log4j-1.2.15.jar in our application lib and classpath.

               

              If you are packaging those jars within the application deployment then you don't require the (implicit) dependency on the log4j module shipped in AS7. So just add a jboss-deployment-structure.xml to your deployment which contains:

               

              <?xml version="1.0" encoding="UTF-8"?>
              <jboss-deployment-structure>
                 <deployment>
                   <exclusions>
                     <module name="org.apache.log4j" />
                   </exclusions>
                 </deployment>
               <!-- If you have a subdeployment, like a war, then add the following too -->
                 <sub-deployment name="your-war-name.war">
                   <exclusions>
                     <module name="org.apache.log4j" />
                   </exclusions>
                 </sub-deployment>
              
              </jboss-deployment-structure>
              
              • 4. Re: Migrating from 7.0.1 to 7.1final, getting  java.lang.ClassNotFoundException
                chandrashekar.bn

                Thankyou very much for your jaikiran, I worked....