|Summary:||@Resource(name=) Normalization of JNDI Name|
|Product:||Tomcat 7||Reporter:||Gurkan Erdogdu <gurkanerdogdu>|
|Component:||Catalina||Assignee:||Tomcat Developers Mailing List <dev>|
Description Gurkan Erdogdu 2010-09-17 20:15:03 UTC
Created attachment 26048 [details] Resolves issue name attribute of @Resource defines JNDI name of the resource that binds the resource to web component java:comp/env/. java:comp/env/bla..bla.. could be given as a JNDI name. Therefore before using name in DefaultInstanceManager to inject fields & methods, it must be normalized. For example, @Resource(name="java:comp/env/myDataSource") DataSource ds; Before looking up "context.lookup(name)" in DefaultInstanceManager, we have to normalize name to "myDataSource". Patch is attached
Comment 1 Mark Thomas 2010-10-06 17:59:45 UTC
Thanks for the patch. I applied the indentation changes as a separate fix so the actual patch was cleaner. I also had to tweak the patch since the return value from normalize was ignored. The fix has been applied to trunk and will be included in 7.0.4 onwards.