Bug 20164 - ANT not reporting internal errors
Summary: ANT not reporting internal errors
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2002-06-13 09:51 EDT by Brian Bonner CLA
Modified: 2003-02-06 09:48 EST (History)
1 user (show)

See Also:


Attachments
Sample build file. "target1" works. "build" or "target3" both fail. After fail, "target1" fails. (1.48 KB, text/plain)
2002-06-13 10:09 EDT, Brian Bonner CLA
no flags Details
TestCase and sample class to load driver twice. (1.43 KB, application/zip)
2002-06-13 13:10 EDT, Brian Bonner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Bonner CLA 2002-06-13 09:51:43 EDT
I ran multiple targets that had an SQL tasks inside.

When running ANT outside of Eclipse, it ANT Reported:
java.lang.UnsatisfiedLinkError: Native Library D:\SQLLIB\bin\db2jdbc.dll already
 loaded in another classloader

Inside Eclipse it reported Internal Error.  I couldn't track it down anywhere.

The error itself sounds like an ANT SQL bug,  but Eclipse didn't help report it 
properly.

Brian
Comment 1 Brian Bonner CLA 2002-06-13 10:09:40 EDT
Created attachment 1394 [details]
Sample build file.  "target1" works.  "build" or "target3" both fail.  After fail, "target1" fails.
Comment 2 Brian Bonner CLA 2002-06-13 10:10:32 EDT
When sample script is run from ANT outside eclipse,  "target1" is again 
successful.  "build" and "target3" still fail.

Brian
Comment 3 Rodrigo Peretti CLA 2002-06-13 10:44:53 EDT
What build are you using? About your problem, please check if you are not 
trying to load the dll twice.
Comment 4 Brian Bonner CLA 2002-06-13 13:09:28 EDT
I'm using build F2.  Notice in the attached script, that I'm calling the SQL 
task.

I call it twice for build modularity.  I'm not sure where the root source is.  
I don't specifically load the DLL, the DB2Driver loads it somewhere along the 
way and the the ANTClassLoader loads the DB2Driver (according to the SQLExec 
task source).

I'll attach a test case that loads the driver twice w/in the same class file 
(I'm assuming both methods use the same class loader.
Comment 5 Brian Bonner CLA 2002-06-13 13:10:05 EDT
Created attachment 1398 [details]
TestCase and sample class to load driver twice.
Comment 6 Rodrigo Peretti CLA 2002-06-18 11:20:43 EDT
Suggested workaround (haven't tried but should work):

In External Tools, instead of pointing directly to the Ant script, point to 
the ant.bat shipped with a binary distribution of Ant and add the same command 
lines as you were running outside of Eclipse. Of course, if you have Eclipse 
specific tasks in your script, they will not work.
Comment 7 Darin Wright CLA 2002-11-15 11:18:31 EST
Marking as M4 for investigation.
Comment 8 Gabor Kover CLA 2002-11-22 10:25:23 EST
I have experienced the same problem with POET ODBMS system. It also uses native 
DLLs when I enhace (post process) my files after compile.
I put this post compile step to an External Tools Builder as an Ant task.
Someone from OTI reported me that this is a problem Eclipse using different 
classloaders when executing Ant. I was told to run ant out of process.

In Eclipse 2.1 M3 the problem is completely gone. I think the problem is solved.
Comment 9 Darin Swanson CLA 2002-12-10 17:17:38 EST
We have attempted to greatly improve the Ant error reporting.
Brian could you verify that errors get reported.
Comment 10 Darin Swanson CLA 2003-02-06 09:48:19 EST
With nothing further from the reporter, marking as worksforme.