Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I include an external .jar, but i'm asked to import his libs

 
Dupont Girard
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I succeed to include ojdbc14_g.jar to my project, but i am asked to import OracleConnectionPoolDataSource wich is included in ojdbc14_g.jar

Here is my code:



But when it runs, it gives me this exception:



Because the following import can't be done:

import oracle.jdbc.pool.OracleConnectionPoolDataSource;

How can i resolve this please
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, but i don't understand what the problem is. Are you getting an error when you run the Ant build, or are you getting an error when you run the application after it was built by Ant? If you are getting an error during the ant build, please post the full build output. If you are getting an error while running the app, please post the command line output or error dialog, or whatever it is that you are seeing.
 
Dupont Girard
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed my post. Please let me know if something is not clear.
Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18162
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you're attempting to include a library jar inside an executable jar. Java does not automatically add embedded jars to the classpath, so your driver classes would be un-findable by the runtime classloader.

To make that work, you'd either need to explode the oracle driver jar and copy its contents into the executable jar or create a custom classloader that would look inside the embedded driver jar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic