• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using the Application database connection from an application

 
Bhaskar kumar Rudrakshala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to establish a database connection from a swing application (oracle 10g) which resides in a different VM,
env.put("java.naming.provider.url", "ormi://localhost");
env.put("java.naming.factory.initial",
"com.evermind.server.ApplicationClientInitialContextFactory") Context ic = new InitialContext (env);
Object dataSource = ic.lookup("jdbc/datasource");
System.out.println("Retrieved "+dataSource );

The application is throwing the following exception
Exception javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec, application-client chapter for requirements and format of the file)
javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec, application-client chapter for requirements and format of the file)
at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:86)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.tasq.team.util.TestConnection.main(TestConnection.java:61)
I have defined the datasource in the application-client.xml and moved it the config of the oracle app server.Any Help would be appreciated!!!
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application-client.xml must be in the JAR file (contained within the EAR file) that runs on your CLIENT JVM, not the server JVM. The server will just ignore it.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!