Reputation: 2464
I need to access com.sun.image.codec classes from rt.jar which JBoss 7 hides by default. My modules/sun/jdk/main/module.xml has been update to include com/sun/image:
<module xmlns="urn:jboss:module:1.1" name="sun.jdk">
<resources>
<!-- currently jboss modules has not way of importing services from
classes.jar so we duplicate them here -->
<resource-root path="service-loader-resources"/>
</resources>
<dependencies>
<system export="true">
<paths>
<path name="com/sun/image/codec"/>
<path name="com/sun/script/javascript"/>
<path name="com/sun/jndi/dns"/>
<path name="com/sun/jndi/ldap"/>
<path name="com/sun/jndi/url"/>
<path name="com/sun/jndi/url/dns"/>
<path name="com/sun/security/auth"/>
<path name="com/sun/security/auth/login"/>
<path name="com/sun/security/auth/module"/>
<path name="sun/misc"/>
<path name="sun/io"/>
<path name="sun/nio"/>
<path name="sun/nio/ch"/>
<path name="sun/security"/>
<path name="sun/security/krb5"/>
<path name="sun/util"/>
<path name="sun/util/calendar"/>
<path name="sun/util/locale"/>
<path name="sun/security/provider"/>
<path name="META-INF/services"/>
</paths>
<exports>
<include-set>
<path name="META-INF/services"/>
</include-set>
</exports>
</system>
</dependencies>
Inside my ear, I have META-INF/MANIFEST.MF:
Manifest-Version: 1.0
Dependencies: sun.jdk export
And for good measure, I added -Djboss.modules.system.pkgs on startup.
I've tried moving MANIFEST.MF to inside the app's jar that's inside the ear, but didn't work either. The image processing code is inside a stateless session bean, so it's not inside a war, but it's in the jar in the ear.
I'm not seeing clear up to date documentation on any of the official JBoss documentation sources, or anything practical that offers the solution, or specifically talks about gaining access to rt.jar classes that are hidden by default. I've tried various bits and pieces I was able to pull from forum messages here and there, but nothing has worked so far.
Upvotes: 1
Views: 2003
Reputation: 186
Try add the code below as a dependency in your jboss-deployment-structure.xml file.
<system export="true">
<paths>
<path name="com/sun/image/codec"/>
<paths>
<system export="true">
Upvotes: 1