[
https://jira.jboss.org/jira/browse/EJBTHREE-1671?page=com.atlassian.jira....
]
jaikiran pai commented on EJBTHREE-1671:
----------------------------------------
The ResourceHandler uses the incorrect classloader to load the resource reference type:
private static void loadXmlResourceEnvRefs(InjectionContainer container,
Collection<ResourceEnvironmentReferenceMetaData> refs)
{
for (ResourceEnvironmentReferenceMetaData envRef : refs)
{
...
String resTypeName = envRef.getType();
try
{
if(resTypeName != null)
{
Class<?> resType = Class.forName(resTypeName);
...
Should be using the classloader of the container, instead of the classloader through which
the ResourceHandler was loaded.
CNFE when injecting @Resource of application specific type in an
application packaged as EAR with jboss-app.xml classloading configuration
------------------------------------------------------------------------------------------------------------------------------------------
Key: EJBTHREE-1671
URL:
https://jira.jboss.org/jira/browse/EJBTHREE-1671
Project: EJB 3.0
Issue Type: Bug
Affects Versions: 1.0.0-Beta11
Environment: JBossAS-5.0 GA
Reporter: jaikiran pai
Assignee: jaikiran pai
When a @Resource injection is attempted on a application specific type in a EJB deployed
through an EAR containing classloader configuration in jboss-app.xml, a
ClassNotFoundException for the application specific type is thrown:
vfsfile:/home/jpai/jboss-5.0.0.GA/server/default/deploy/myapp.ear/ ->
java.lang.ClassNotFoundException: org.myapp.ejb.AnotherBeanLocal from
BaseClassLoader@12e712f{VFSClassLoaderPolicy@8f57a{name=vfsfile:/home/jpai/jboss-5.0.0.GA/server/default/conf/jboss-service.xml
domain=ClassLoaderDomain@1bd669d
{name=DefaultDomain parentPolicy=BEFORE
parent=org.jboss.system.NoAnnotationURLClassLoader@2a15cd}
roots=[MemoryContextHandler@2903774[path=
context=vfsmemory://3j001-sl378g-fpr19973-1-fpr19fkl-6
real=vfsmemory://3j001-sl378g-fpr19973-1-fpr19fkl-6],
DelegatingHandler(a)15593128[path=bcel.jar
context=file:/home/jpai/jboss-5.0.0.GA/common/lib/
real=file:/home/jpai/jboss-5.0.0.GA/common/lib/bcel.jar],
DelegatingHandler(a)13595063[path=jboss-ejb3-interceptors.jar context=file:/h....
..........
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:385)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:203)
See referenced forum thread for more details
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira