You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jimmy Ray <ji...@yahoo.com> on 2005/06/21 22:26:06 UTC

JNDI Bean problem - Tomcat 5.0.28

Trying to get a bean through a JNDI context:  My
context.xml in the META-INF directory entry is:

<Context path="/apppath">
    	<Resource name="bean/properties"
type="com.ifx.ric.dwh.bean.PropertiesBean"
auth="Container"/>
	<ResourceParams name="bean/properties">
		<parameter>
			<name>factory</name>
		
<value>org.apache.naming.factory.BeanFactory</value>
		</parameter>
	</ResourceParams>
      </Context>

My web.xml in META-INF:
<resource-env-ref>
		<description>
			JNDI bean for application properties
		</description>
		<resource-env-ref-name>
			bean/properties
		</resource-env-ref-name>
		<resource-env-ref-type>
			com.ifx.ric.dwh.bean.PropertiesBean
		</resource-env-ref-type>
	</resource-env-ref>

My servlet JNDI lookup:
Context initCtx = new InitialContext();
            Context envCtx = (Context)
initCtx.lookup("java:comp/env");
            PropertiesBean bean = (PropertiesBean)
envCtx.lookup("bean/properties");

But the Exception is:

"Cannot create resource instance"



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 


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