The console configuration uses just the standard classpath of the project it is in.
This is actually required. If Hibernate Tools run Usertype code, they need to pull in the jars that such usertype code might use. So - no "irrelevant" jars in this case. Stripping down the jars will mitigate the problem, but it won't solve it for everybody.
Oh, and while I agree that Hibernate Tools aren't the only Eclipse plug-in with the need to run user code (bean editors come to mind), it's still outside standard plug-in operating procedures - e.g. editor plug-ins usually don't need that. In other words, there should be a solution out there, but I don't believe that Hibernate Tools are doing it right yet.
BTW I'm not sure that sandboxing is so easy. Assume Hibernate Tools runs a bit of code from a user-defined type, and that user-defined type insists on logging something.
If the sandboxes are strictly separate, the UDT will do logging to whatever facilities the application defines. This might even crash&burn if logging is set up in a way that depends on proper initialization in main().
On the other hand, if the UDT is running in the same sandbox as Hibernate Tools, but requires a different version of Logback than what Hibernate Tools require, then depending on which version of logging is run, it will crash Hibernate Tools or the UDT.
I see no good way to resolve this. A not-so-good approach might be to at least diagnose the problem - check the two class paths, and if both share classes in different, incompatible versions, emit a warning. (The problem here being determining whether two classes are indeed incompatible. And, of course, that check could involve dealing with quite a lot of jars.)
I'm not sure what version of JBoss Tools the Hibernate Tools I'm using is part of, version numbers don't match.
The Hibernate Tools I'm using identify themselves as 3.3.0.v20101016-0359-H111-Beta1 - that's what's listed as current on the update site, so I guess I'm current.
If I do the "Use generation in external process" checkbox with the incompatible version of Logback in the class path, I get this:
Code:
Buildfile: C:\DOKUME~1\DURCHH~1\LOKALE~1\Temp\build_2989851213482961091xml
hibernateAntCodeGeneration:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
BUILD FAILED
C:\DOKUME~1\DURCHH~1\LOKALE~1\Temp\build_2989851213482961091xml:30: java.lang.IncompatibleClassChangeError
Total time: 5 seconds
This happens regardless of whether I have the jar files exported or not (nonexported files seem to be left outside the class path).
UPDATE: Turns out that sometimes removing the conflicting jar from the export list is enough, sometimes I need to removed them from the classpath. Might be related to whether Reveng was run or not.