Community
Participate
Working Groups
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
Created attachment 1394 [details] Sample build file. "target1" works. "build" or "target3" both fail. After fail, "target1" fails.
When sample script is run from ANT outside eclipse, "target1" is again successful. "build" and "target3" still fail. Brian
What build are you using? About your problem, please check if you are not trying to load the dll twice.
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.
Created attachment 1398 [details] TestCase and sample class to load driver twice.
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.
Marking as M4 for investigation.
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.
We have attempted to greatly improve the Ant error reporting. Brian could you verify that errors get reported.
With nothing further from the reporter, marking as worksforme.