Failed to add output directory to classpath

614 views
Skip to first unread message

chazzu

unread,
May 3, 2012, 2:36:41 PM5/3/12
to activejd...@googlegroups.com
I have a working code set if compiled in Maven, but when trying to build from Eclipse it gives this error from pom.xml, where the instrumentation plugin is set up. I am a bit baffled as to the difference here between Eclipse and Maven, does anyone else have any idea what I am doing wrong?

Igor Polevoy

unread,
May 3, 2012, 2:38:16 PM5/3/12
to activejd...@googlegroups.com
not familiar with Eclipse per se, but ensure that your Eclipse build is running from correct directory

ipolevoy

unread,
May 3, 2012, 2:40:13 PM5/3/12
to activejd...@googlegroups.com

chazzu

unread,
May 3, 2012, 4:26:15 PM5/3/12
to activejd...@googlegroups.com
Sorry to keep asking for help. The project you provided before wasn't really much help. I threw some data dumps into activejdbc and ultimately got this back:

java.lang.RuntimeException: org.javalite.instrumentation.InstrumentationException: java.lang.RuntimeException: com.hostedsolutions.em7reports.dbmodels.EM7Ticket class is frozen (org.javalite:activejdbc-instrumentation:1.2.3-SNAPSHOT:instrument:default:process-classes)

Google isn't terribly helpful here. My guess is that you are trying to modify the .class file somehow, but it is marked as "in use" and Eclipse won't let it go? I don't suppose you have any ideas? I'll keep Googling and post back if I find anything useful.

Igor Polevoy

unread,
May 3, 2012, 4:37:46 PM5/3/12
to activejd...@googlegroups.com, chazzu
it might be, can you please provide a full stack trace?
Also, while intrumenting you shoulkd not run the project itself

chazzu

unread,
May 3, 2012, 4:48:51 PM5/3/12
to activejd...@googlegroups.com, chazzu
Sorry, I'm new to Java. I have it a little more figured out... 

Because Eclipse was complaining about the instrumentation plugin (Plugin execution not covered by lifecycle configuration) I added org.eclipse.m2e.lifecycle-mapping under pluginsmanagement and set the plugin to always execute. This allowed everything to build, but started the other error.

Eclipse was trying to run the plugin during incremental builds, which apparently caused this new problem: The class was loaded, yet the plugin was trying to modify the class. Of course, it fails.

So.. Is there a better way to solve the lifecycle configuration issue? The example in the Eclipse project you used was Ant. The Maven example on your website doesn't seem to address this, or I couldn't find anything that looked relevant.

ipolevoy

unread,
May 3, 2012, 6:08:00 PM5/3/12
to activejd...@googlegroups.com, chazzu
If somehow Maven plugin interferes with your IDE, you can do instrumentation using Ant:
http://code.google.com/p/activejdbc/wiki/Instrumentation?ts=1336082790&updated=Instrumentation#Bare_bones_Ant_script

Adjust your paths if needed. You can even hookup this script to some button in Eclipse if needed.

thanks
igor

evan.leonard

unread,
Mar 8, 2013, 11:01:34 AM3/8/13
to activejd...@googlegroups.com

FYI, I've also run into this error in the following situation:

I'm seeing a similar error (class is frozen) but in a different scenario.  I'm trying to setup my jetty plugin to start and stop before and after the integration-test phase of the build lifecycle. (more info here: http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin)

When maven runs "jetty:run" at the "pre-integration-test" phase, instrumentation tries to run again, and I'm guessing jetty's already got a hold on the classes by then so it fails with this error.  

To get around this I needed to upgrade the jetty plugin to 7.6 or later which added the "jetty:start" goal which does not trigger the build steps up to test-compile again.  

Hope this helps someone else out there.

Evan
Reply all
Reply to author
Forward
0 new messages