• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using the Application database connection from an application

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
His brain is the size of a cherry pit! About the size of this ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic