<!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="https://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;">
excluding classes from being exported from rar
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/danielgreb">Daniel Berg</a> in <i>IronJacamar</i> - <a href="https://community.jboss.org/message/790445#790445">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello</p><p>I have a resource adapter using jca 1.6 deployed on jboss 7.1.1.Final, the problem is that the classloader exports all classes included in the rar. Im trying to exclude the classes that are only used internally(implementation details..)</p><p>Using various versions of jboss-deployment-structure files I have been unable to archive this.</p><p>So I have a rar containing a few jar files with my implementation and some dependencies.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>adapter.rar</p><p>- common_v1.jar (contains a class named A)</p><p>- adapter.jar (contains connection factories, mdb interfaces, activation spec and so on..) placed in packages below int_.nato.adapter.*</p><p>-META-INF/ jboss-deployment-structure.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I want my adapter to export the content of adapter.jar to modules using it, but not the other stuff in common_v1.jar..</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I tried quite a few variations of the below without success..</p><p>jboss-deployment-structure.xml</p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;"><jboss-deployment-structure></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">  <deployment></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">    <exports></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">                    <exclude path="/**"/></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">                    <include <span style="color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #eef4f9;">path=" int_/nato/adapter/"**/></span></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">  </exports></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">  </deployment></p><p style="background-color: #eef4f9; font-size: 12px; color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">   </jboss-deployment-structure></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The problem arrises when we try to use the adapter from a web application</p><p>webapp.war</p><p>-WEB-INF/lib/common_v2.jar(contains new version of class A and a class B)</p><p>test.jsp</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>in test.jsp I add </p><p><%= A.class.getCLassLoader()%></p><p><%= A.class.getProtectionDomain().getCodeSource().getLocation()%></p><p><%= B.class.getCLassLoader()%></p><p><%= B.class.getProtectionDomain().getCodeSource().getLocation()%></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Now for A.class I get the class packaged insite the rar</strong></p><p><strong>For the B.class I get the class packaged inside the war.</strong></p><p>I also tried several variations of jboss-deployment-structure.xml to exclude the classes from import in the webapp (WEB-INF/jboss-deployment-structure.xml) doing so is not preffered as several applications are to be using the adapter..<strong><br/></strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>In production I end up with NoSuchMethodError since in version 2 of class A there are new methods used within the webapp, that does not exist in v1.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Deploys by copying the rar and war to the deployments directory, and everythings works nicely if I just use the same version of common.jar, or just not include it in the webapp..</p><p>Any pointers will be appreciated.</p><p><strong><br/></strong></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/790445#790445">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in IronJacamar at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>