[jboss-jira] [JBoss JIRA] (AS7-2566) Jar included in a MANIFEST.MF from an ejb jar can not see user defined modules. Results in java.lang.ClassNotFound error.
David Lloyd (Commented) (JIRA)
jira-events at lists.jboss.org
Fri Nov 18 17:36:41 EST 2011
[ https://issues.jboss.org/browse/AS7-2566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644131#comment-12644131 ]
David Lloyd commented on AS7-2566:
----------------------------------
Okay, I think I see. You should be able to see classes in {{com.test.module}} from {{common.jar}} if any of the following are true:
# {{common.jar}}'s manifest contains {{Dependency: com.test.module}}
# {{common.jar}}'s manifest contains {{Class-Path: ejb.jar}} *and* {{ejb.jar}}'s manifest contains {{Dependency: com.test.module export}}
# {{testEar.ear}}'s manifest contains {{Dependency: com.test.module export}}
Otherwise there's nothing which would cause this dependency to become visible. The {{ejb.jar}} module doesn't "own" {{common.jar}}, so it cannot force its dependencies onto it. On the contrary the {{ejb.jar}} module *depends* on {{common.jar}} (that is to say, the arrow goes in the other direction). In other words if you reference a JAR by class-path, you can "see" that JAR but it can't necessarily "see" you unless it references you back again.
Does this help to explain things?
> Jar included in a MANIFEST.MF from an ejb jar can not see user defined modules. Results in java.lang.ClassNotFound error.
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: AS7-2566
> URL: https://issues.jboss.org/browse/AS7-2566
> Project: Application Server 7
> Issue Type: Bug
> Components: EE
> Affects Versions: 7.1.0.Alpha1
> Environment: Windows 7 64 bit, 32bit Sun/Oracle JDK 1.6.0_27, Latest release of JBoss 7.1.0.Alpha1 X.
> Reporter: Rodney Kite
> Assignee: David Lloyd
> Priority: Blocker
> Attachments: testJBossModuleErrorApp.zip
>
>
> In an ear file user defined modules referenced from MANIFEST.MF are available to ejb jars but not to the ejb jars manifested jars. When the jar manifested in tries to access a modules classes a java.lang.ClassNotFoundException is raised. By the java jar spec the manifested jar should be in classpath of the jar manifesting it. I tried putting the modules Dependencies: reference in both the ejb jars MANIFEST.MF as well as the non ejb jars MANIFEST.MF. This is a run time error it deploys fine.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list