<!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;">
    Re: Running Seam 2 archives on Jboss 7
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/jaikiran">jaikiran pai</a> in <i>JBoss AS7 Development</i> - <a href="http://community.jboss.org/message/608887#608887">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><blockquote class="jive-quote"><p>Matt Drees wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>Ales Justin wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>but my test app is quite old so it failed to find some HibValidator class.</p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To get my app running I had to bundle org.hibernate:hibernate-validator-legacy:4.0.2.GA with my app.&#160; It was provided on AS6, I think, but it's not available on AS7, apparently.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote><p>The way classloading works in AS7 is different from what was in previous versions. Here's a quick intro:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7" target="_blank">https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7</a></p><p><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS7/Implicit+module+dependencies+for+deployments" target="_blank">https://docs.jboss.org/author/display/AS7/Implicit+module+dependencies+for+deployments</a><span> (work in progress article)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To briefly summarize the behaviour, I'll just copy/paste a message that I sent out in some other discussion:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p><span>Classloading has changed drastically in AS7. In earlier versions of JBoss AS, if an application did not package a jar for some dependent code (like logging) then the classloading system would delegate loading of that class to the "parent" classloader which would pick it up from the server level jars which we ship (example: log4j jars). More details about the classloading in previous versions can be found here </span><a class="jive-link-external-small" href="http://community.jboss.org/docs/DOC-10290" target="_blank">http://community.jboss.org/wiki/JBossClassLoadingUseCases</a><span>.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Now in AS7, the classloading system is based on module classloaders. Each application will have a module classloader associated with it and the "module" specifies it's "dependencies" on other module. Each module is a collection of classes and resources. In the early stages of deployment processing, a deployment in AS7 by default doesn't have any module dependencies, unless explicitly specified (see later part of the mail on how to do it). The deployment processing implementation code implicitly adds some module dependencies based on what kind of a application is being processed. For example, if the deployment has EJBs, then the deployment processing code explicitly adds a dependency on Java EE module. So effectively, all the Java EE API classes are now "visible" to this deployment and can be loaded by the classloader associated with this deployment. Furthermore, all the jar contained in the .war/WEB-INF/lib or .ear/lib are added to the module dependencies. If an application depends on some other library which isn't part of this set, then it has to be explicitly specified as a module dependency by the application developer. This can be done via the MANIFEST.MF file which should contain a "Dependencies" attribute as follows:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Dependencies: org.hibernate.validator</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In this example, the application is specifying a dependency on the "org.hibernate.validator" module (note that the module name and the package name need not always match. Module name can be arbitrary and is defined in the module.xml of the module. See JBOSS_HOME/modules folder and subfolders for examples).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Similarly, in your example, you'll have to setup an explicit dependency on the Hibernate validator module. If you don't want to add this dependency explicitly, then packaging those jar files within the .war/WEB-INF/lib (or .ear/lib) should get you past these issues (like it did in your case)</p></blockquote></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/608887#608887">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>