tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Robitu <adr...@intelliware.ca>
Subject JNDI InitialContext not working when upgrading from Tomcat 3.2.3 to 3.3
Date Thu, 29 Nov 2001 17:49:27 GMT
Hi,

We are in the process of migrating our app from 3.2.3 to 3.3 (both on JDK
1.2.2). The application uses a trim-down in-house EJB container and Tomcat
as its servlet container. It works just fine under 3.2.3 but not under 3.3.
Here is the sample code that we have problem with.

	Properties properties = new Properties(System.getProperties());
	InputStream input =
classLoader.getResourceAsStream("jndi.properties");
      ...
	properties.load(input);
	...
	Context context = InitialContext(properties);
	VendorServiceHome home = (VendorServiceHome)
context.lookup(VendorServiceHome.class.getName());

Our jndi.properties file is:

	
java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
	java.naming.provider.url=file\:d\:\\cellbucks

After loading the properties we print them and get:
	
{java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory,
java.naming.provider.url=file:d:\cellbucks}
which would indicate that jndi.properties is visible.

Under 3.2.3 the context.lookup returns a VendorServiceHomeImpl (which is
what we expect). Under 3.3 the context returns a javax.naming.Reference.

We've searched the archives, the manuals and other web resources that we
could think of, but we didn't get anywhere. Any help on this matter would be
highly appreciated.

Best regards,
Adrian Robitu
e-Commerce Architect
(416) 762-0032/410
IT.IP.IQ
http://www.intelliware.ca

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message