[jboss-jira] [JBoss JIRA] Updated: (EJBTHREE-1863) res-type in resource-ref is not checked
Wolfgang Knauf (JIRA)
jira-events at lists.jboss.org
Thu Jul 2 14:38:51 EDT 2009
[ https://jira.jboss.org/jira/browse/EJBTHREE-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wolfgang Knauf updated EJBTHREE-1863:
-------------------------------------
Attachment: ResourceRef.ear
Sample containing an ejb-jar.xml with two invalid "res-type" values. One "resource-ref" is used for injection, the other just provides an ENC entry. In both cases, no error is raised.
To test it: deploy ear and browse to http://localhost:8080/ResourceRefWeb/
Then take a look at the console to see some status output.
The session bean "ResourceRefTestBean" contains a business method which accesses the injected SessionContext and looks up another ENC SessionContext
> res-type in resource-ref is not checked
> ---------------------------------------
>
> Key: EJBTHREE-1863
> URL: https://jira.jboss.org/jira/browse/EJBTHREE-1863
> Project: EJB 3.0
> Issue Type: Bug
> Affects Versions: 1.1.7
> Reporter: Wolfgang Knauf
> Attachments: ResourceRef.ear
>
>
> The "res-type" of the "resource-ref" element in ejb-jar.xml is not verified.
> See the attached sample: neither on deploy nor on JNDI lookup, an error is raised for this xml snippet, which contains an invalid res-type:
> <resource-ref>
> <res-ref-name>EnvNameOfSessionContext1</res-ref-name>
> <res-type>whole.lotta.Crap</res-type>
> <mapped-name>java:comp/EJBContext</mapped-name>
> <injection-target>
> <injection-target-class>de.knauf.resourceref.ResourceRefTestBean</injection-target-class>
> <injection-target-name>sessionContext1</injection-target-name>
> </injection-target>
> </resource-ref>
> <resource-ref>
> <res-ref-name>EnvNameOfSessionContext2</res-ref-name>
> <res-type>whole.lotta.Crap</res-type>
> <mapped-name>java:comp/EJBContext</mapped-name>
> </resource-ref>
> The class org.jboss.injection.ResourceHandler.loadXmlResourceRefs almost completely ignores the "res-type" element ;-).
> For a "resource-env-ref" element, the "resource-env-ref-type" is validated, though maybe this happens by accident ;-):
> Caused by: java.lang.ClassNotFoundException: asdjavax.ejb.SessionContext from BaseClassLoader at 22adfd{...}
> at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:217)
> ... 73 more
> So, I would like a similar check for the "resource-ref" res-type.
--
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
More information about the jboss-jira
mailing list