aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes I include an external .jar, but i'm asked to import his libs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "I include an external .jar, but i Watch "I include an external .jar, but i New topic
Author

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

Dupont Girard
Greenhorn

Joined: Mar 21, 2011
Posts: 24
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

Joined: May 14, 2008
Posts: 5836
    
    7

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.


JBoss In Action
Dupont Girard
Greenhorn

Joined: Mar 21, 2011
Posts: 24
I changed my post. Please let me know if something is not clear.
Thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I include an external .jar, but i'm asked to import his libs