tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Winslow <martinge...@yahoo.com>
Subject JNDI resources different between 5.0 and 5.5?
Date Wed, 02 Feb 2005 16:52:17 GMT
Hi, I'm trying to upgrade from 5.0.28 to 5.5.4.  I
have a java bean resource that no longer works in
5.5.4.  Apparently the resource isn't being found.  My
code for looking up the resources is:

 public static Manager getManager()
 {
	try
	{
		Context initCtx = new InitialContext();
		Context envCtx = (Context)
initCtx.lookup("java:comp/env");
		Manager manager = (Manager)
envCtx.lookup("bean/MyManager"); // fails here on
lookup.
		return manager;  
	}
	catch (Exception e)
	{
		e.printStackTrace();
		return null;
	}
 }

In server.xml:

<Resourcource name="bean/MyManager" auth="Container"
type="MXForm.Manager"/>

I didn't have a web.xml entry in 5.0, but I added one
after reading the docs.
In web.xml:
<resource-env-ref>
  <Description>
    Manager resource.
  </Description>
  <resource-env-ref-name>
    bean/MyManager
  </resource-env-ref-name>
  <resource-env-ref-type>
    MXForm.Manager
  </resource-env-ref-type>
</resource-env-ref>

Thanks.



		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message