|
From: Colin S. <col...@ex...> - 2003-08-22 11:33:34
|
I somehow missed the inContainer property, even though I looked at the source! I think it does make sense though to add the check for the scheme as per your and mine suggestion; even in a container you still need to be able to override this... Regards, Colin jürgen höller [werk3AT] wrote: >Hi Colin, > >AbstractJndiLocator only does so when the "inContainer" property is set to true (the default). Setting this property to false should result in looking up the JNDI name as is. It could make sense to add a check for scheme though, e.g. only apply "java:comp/env/" if "inContainer" is true *and* the JNDI name does not contain a ":". What do you think? > >Juergen > > > -----Ursprüngliche Nachricht----- > Von: Colin Sampaleanu [mailto:col...@ex...] > Gesendet: Fr 22.08.2003 05:43 > An: spr...@li... > Cc: > Betreff: [Springframework-developer] AbstractJndiLocator should not assume java:comp/env prefix while not allowing others > > > > AbstractJndiLocator right now looks at the jndi name it is given, and if > it doesn't start with > java:comp/env > prepends this value automatically. This behaviour is not correct. > Somebody using the bean should be able to look up resources anywhere, > and currently you can't. For example, in jboss, the main datasource by > default is bound to > java:DefaultDS > > As well, you may want to look up something on JNDI using another scheme > entirely... > > What the code should probably do is see if the is a scheme > xxxxx: > at the beginning of the jndi name. If there isn't, then it is probably > reasonable to assume 'java:comp/env. or 'java:' If there is a scheme, it > should leave the name alone. > > I would have supplied a patch, but the fix is trivial, and I don't know > how exactly you want to handle this, but it's pretty critical to me. > > Right now with JBoss it's pretty nasty. I can not use JBoss's naming > alias service to alias > java:comp/env/DefaultDS > to > java:DefaultDS > because it apparently doesn't let you alias stuff under comp/env. I can > probably modify my resource entries in the war file I use to do a > resource ref to the right location, but I would really rather not do > that, since the war is fine the way it is. > > Regards, > Colin > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines > at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > |