<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
ClassNotFoundException when deploying ear file on Jboss AS 7
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/mcatalin23">Catalin Moga</a> in <i>JBoss AS7 Development</i> - <a href="http://community.jboss.org/message/617351#617351">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I included my ear file into <jboss_home>\standalone\deployments\ folder.</p><p>The ear file was generated with Jboss Developer Studio version 4.0.0.GA.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm getting following error when starting Jboss 7 as standalone:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>12:07:08,729 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."<ear_name>.ear".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."<ear_name>.ear".INSTALL: Failed to process phase INSTALL of deployment "<ear_name>.ear"</p><p>    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)</p><p>    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)</p><p>    at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)</p><p>    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]</p><p>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]</p><p>    at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]</p><p>Caused by: java.lang.RuntimeException: Error getting reflective information for class <my_class_name></p><p>    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)</p><p>    at org.jboss.as.ee.component.EEModuleClassDescription$DefaultConfigurator.configure(EEModuleClassDescription.java:144)</p><p>    at org.jboss.as.ee.component.EEClassConfigurationProcessor.processClasses(EEClassConfigurationProcessor.java:133)</p><p>    at org.jboss.as.ee.component.EEClassConfigurationProcessor.deploy(EEClassConfigurationProcessor.java:76)</p><p>    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)</p><p>    ... 5 more</p><p><strong>Caused by: java.lang.NoClassDefFoundError: Lorg/apache/log4j/Category;</strong></p><p>    at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_23]</p><p>    at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_23]</p><p>    at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_23]</p><p>    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)</p><p>    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)</p><p>    ... 9 more</p><p><strong>Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Category from [Module "deployment.<ear_name>.ear.<jar_name>.jar:main" from Service Module Loader]</strong></p><p>    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)</p><p>    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)</p><p>    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)</p><p>    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)</p><p>    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)</p><p>    ... 14 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Following instructions from</p><p><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7">https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7</a></p><p>section "<em>How to find the JBoss module dependency"</em></p><p>I searched for the jboss 7 module that contains the class <strong>org.apache.log4j.Category</strong></p><p>The class is included into following jar: <jboss_home>\modules\org\apache\log4j\main\log4j-1.2.16.jar</p><p>From module.xml file I got the module name <strong>org.apache.log4j</strong>, and I added this module name to the Dependencies in the <tt>MANIFEST.MF</tt> file:</p><p>like <strong>Dependencies: org.apache.log4j</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I did all these steps from the documentation but I still get the same error ClassNotFoundException.</p><p>I have tried to update the main MANIFEST.MF file from the ear and also the MANIFEST.MF file from jar included into the ear that requires the class.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The MANIFEST.MF file I used is attached.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Where is the problem regarding this issue?</p><p>Is anything wrong with my configuration for manifest file? I manually edited the manifest file.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/617351#617351">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS7 Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>