Avi,
I am using Oracle AS 10g. I am trying to use the "DataSourceUserManager" provided with it. I configured this to be the user manager for my app, and and set all initialization params (of which datasource is one). When I try to go to the security section of my app thru OEM, I get a NamingException that the JNDI name for the datasource could not be found. When I looked at the logs, I got the follg. message:
Error instantiating application at file:/usr/oracle/infra/j2ee/OC4J_SECURITY/applications/B2B_Demo_App.ear: Error initializing
userManager 'com.evermind.sql.DataSourceUserManager': NamingException: Need to specify class name in environment or system property, or
as an
applet parameter, or in an application resource file: java.naming.factory.initial
What could be the problem? I thought all I need to do was to configure a data source and provide it to the DataSourceUserManager. OC4J doesn't seem to be storing and retrieving the JNDI name. Or am I missing something? Any help is appreciated. Thanks.
Originally posted by Avi Abrami:
Hi Ian and Madhu,
JNDI (as the name suggests) is an interface. Therefore it requires an implementation. And you need to register a lookup name with the implementation before a client can use that lookup name.
For example, I use a J2EE application server called OC4J (Oracle Container for J2EE). It has a JNDI implementation. When I start up this application server, it reads an XML (configuration) file that contains the lookup name for an Oracle datasource. It then registers that name with its JNDI implementation (also know as a "driver"). So after I start up OC4J, I can use code (similar to yours) in my client to obtain the datasource.
Now, what JNDI driver are you using, and how do you register the lookup name with that driver?
Hope this helps.
Good Luck,
Avi.