Issue Details (XML | Word | Printable)

Key: NUCENHANCER-52
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Dr. Michael Paus
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus Enhancer (ARCHIVED)

Exception when re-enhancing files in Eclipse

Created: 18/Jan/10 08:43 PM   Updated: 01/Apr/11 03:27 PM   Resolved: 24/Feb/11 05:19 PM
Component/s: JDK1.6 Enhancer Processor
Affects Version/s: 2.0.0.release
Fix Version/s: None

Environment: Windows XP, Eclipse, JDK 1.6

Forum Thread URL: http://www.jpox.org/servlet/forum/viewthread_thread,5921
Datastore: DB4O
Severity: Test/Acceptance


 Description  « Hide
Well, I thought I got automatic enhancement working in Eclipse
with Java 1.6 and annotation processing enabled, but this does not seem to be true. If I let Eclipse rebuild the project
completely (Project->clean + automatic rebuild) everything seems to
work and my classes are enhanced automatically. If however I make a change to one class in the editor and save it I get the following error message.

Message:
Exception thrown by Java annotation processor org.datanucleus.enhancer.EnhancerProcessor@1e50ba9

Exception Stack Trace:
java.lang.IllegalArgumentException: Hook previously registered
at java.lang.ApplicationShutdownHooks.add(Unknown Source)
at java.lang.Runtime.addShutdownHook(Unknown Source)
at org.datanucleus.enhancer.EnhancerProcessor.process(EnhancerProcessor.java:136)
at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:
139)
at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:110)
at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(Bas
eAnnotationProcessorManager.java:159)
at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotation
s(IdeAnnotationProcessorManager.java:134)
at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:837)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:428)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:364)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.compile(IncrementalImageBuilder.java:3
21)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:301)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:134
)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:265)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:193)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Session Data:
eclipse.buildId=M20090917-0800
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86 -data C:\Dokumente und Einstellungen\Paus\workspace_dbtest

How can this be avoided?

Michael

PS: With the Eclipse plugin I can start the enhancer as often as I like without problems.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 24/Feb/11 05:19 PM
Since some time ago the "annotation processor" has not been enabled since
1). it impacts on other people using JDK1.6+ who don't care about such features
2). it is, at best, a poor way of using an annotation processor. By this I mean, an annotation processor is there to perform some step pre-compile as a hook. This is not what we need for enhancement which needs a hook post-compile to update the compiled bytecode.

Since Eclipse doesn't allow use of the "processor" compiler argument then there is no prospect that this issue will ever be addressed (and certainly not without anyone offering their time), so closing. Just use the Eclipse plugin, which is more convenient to that environment anyway