You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ted Vinke <tv...@first8.nl> on 2006/11/22 12:12:36 UTC

Lookup changes between 5.0.25 and 5.0.28

Hi!

I have a working mail setup under Tomcat 5.0.28 - which somehow doesn't 
seem to work with 5.0.25. The question is: why?

I copied 2 additional jars to $TOMCAT/common/lib:

	- activation.jar
	- mail.jar

Between the <Context> and </Context> tags I simply have:

	<Resource name="mail/Session" auth="Container"
		type="javax.mail.Session" />

I have this piece in context.xml in the META-INF of my .war

Lookup goes like this:

	Context initCtx = new InitialContext();
	Context envCtx = (Context) initCtx.lookup("java:comp/env");
	this.session = (Session) envCtx.lookup("mail/Session");

In code I update the session with some relevant mail properties, but 
what baffles me is that although this construction simply just works 
correctly with 5.0.28, with version 5.0.25 I get an exception on the 
"mail/Session" lookup:

Caused by: javax.naming.NamingException: Cannot create resource instance
         at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132)
         at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:791)
	...

I'm going through the release notes of 5.0.26, 5.0.27 and 5.028 to see 
what changed between these versions regarding this construction, as we 
speak, but I can't find it. Can somebody see what I need to adjust to 
get it to work under Tomcat 5.0.25?

Kind regards,
Ted

-- 
Ted Vinke
Software Developer
First8 BV / Conclusion

Toernooiveld 220 L | Postbus 31006
6525 EC Nijmegen   | 6503 CA Nijmegen

t +31 (0)24 348 35 70
f +31 (0)24 348 35 71

tvinke@first8.nl
http://www.first8.nl

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org