Org.aspectj.weaver.tools.jdk14trace Error
Contents |
here for a quick overview of the site Help Center Detailed answers to
Java.lang.runtimeexception: Cannot Register Non Aspect:
any questions you might have Meta Discuss the workings and warning register definition failed -- (runtimeexception) cannot register non aspect policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Reusable aspects jar up vote 1 down vote favorite 1 We are going to start using aspectsJ in our production Java standalone apps soon. So, I am trying to come up with a jar that has aspects so I can weave them to the production apps without any code change. I am trying to create a separate project (MyAspects.jar)for aspects and include them to the existing java class path to minimize code changes. While I am adding the aop.xml to the production application jar's META-INF folder. While running the app, I am using -javaagent:pathto\aspectjweaver.jar and include MyAspects.jar in the folder that is on the classpath. But when execute it, it errors out with below details. Including whole stacktrace. I am using aspectjweaver-1.8.4.jar. [AppClassLoader@553f5d07] info AspectJ Weaver Version 1.8.4 built on Thursday Nov 6, 2014 at 20:19:21 GMT [AppClassLoader@553f5d07] info register classloader sun.misc.Launcher$AppClassLoader@553f5d07 [AppClassLoader@553f5d07] info using configuration file:/C:/riskEventLoader/lib/risk-event-loader.jar!/META-INF/aop.xml [AppClassLoader@553f5d07] info register aspect com.aspect.generic.GenericAspect Jan 12, 2015 8:37:15 AM org.aspectj.weaver.tools.Jdk14Trace error SEVERE: register definition failed java.lang.RuntimeException: Cannot register non aspect: com$aspect$generic$GenericAspect , com.aspect.generic.GenericAspect at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:219) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:485) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.register
Organization: Aspect Programming User-agent: Thunderbird 1.5.0.8 (X11/20061025) Yes, the LTW agent does not attempt to compile the aspects being woven. It requires everything to be compiled already. Dean Kyle Lomeli wrote: After more poking around (I hope this helps someone some day), I have found that either my understanding of how LTW works is way off... or I missed key instructions somewhere along the line. I found that if http://stackoverflow.com/questions/27905982/reusable-aspects-jar I place the .class file that is generated from the .aj file in the classpath (I obtained this .class file from having enabled the Eclipse AspectJ on the project and then disabling it), LTW works as expected. However, if the .aj file is used instead, the whole process breaks https://dev.eclipse.org/mhonarc/lists/aspectj-users/msg07399.html down. Is there something I am missing? Does LTW depend on having the .class file present for LTW? -Kyle ----- Original Message ---- From: Kyle Lomeli
Importance: normal Priority: normal Thread-index: AcutFZehcHU2HQDjTk6twsQ/bhMWYwE0hizg Thread-topic: Cannot register non aspect: com$.... Title: FW: Cannot register non aspect: com$.... Got https://dev.eclipse.org/mhonarc/lists/aspectj-users/msg12674.html it to work - put aspect class + aspect classes http://maintainj.com/smf/index.php?topic=412.0 in application jar files. No need to bother thanks, Bob The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized cannot register designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. From: Markle, Bob Sent: Wednesday, January 05, 2011 3:18 PM To: aspectj-users@xxxxxxxxxxx Subject: Cannot register non aspect: com$.... Hello and cannot register non Help! Trying to use ASPECTJ to implement method tracing in an Eclipse/spring distribution: Using aspectj 1.10 LTW and Tanuki Service wrapper on Windows. Methods in the Wrapper and launcher are traced OK but when trying to register the same aspect for the app I get an error: 2011-01-04 16:00:43,351 ERROR [Start Level Event Dispatcher] org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor - register definition failed java.lang.RuntimeException: Cannot register non aspect: com$compuware$mfm$mtrace$mtagent , com.compuware.mfm.mtrace.mtagent at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:221) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:466) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(ClassLoaderWeavingAdaptor.java:290) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:176) "csp-system.log" showing aspectj that IS weaving: DEBUG | wrapper | 2011/01/04 16:00:33 | JVM started (PID=3160) INFO | jvm 1 | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info AspectJ Weaver Version 1.6.10 built on Friday Oct 22, 2010 at 03:50:26 GMT INFO | jvm 1 | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info register classloader sun.misc.Launcher$AppClassLoader@fabe9 INFO | jvm 1 | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info using
Unable to launch MaintainJ with certain projects « previous next » Print Pages: [1] Author Topic: Unable to launch MaintainJ with certain projects (Read 5833 times) mcofran Newbie Posts: 3 Unable to launch MaintainJ with certain projects « on: October 27, 2008, 12:13:03 PM » I just downloaded and purchased MaintainJ 2.5 eclipse plugin last week. I'm running on eclipse 3.4, jdk 1.5, gef 3.4.0, ajdt 1.5.3 on Windows XP. The plugin works for newer projects, but for the legacy projects that I bought it for, it will not launch. I see two different issues, but the one I'd most like to resolve is an Index out of Bounds error, which prevents both the app and MaintainJ from starting up. Here's the stack trace.!ENTRY org.eclipse.core.jobs 4 2 2008-10-27 09:57:50.438!MESSAGE An internal error occurred during: "Launching MJ-Engine".!STACK 0java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1768) at com.maintainj.launching.j2se.J2SELauncher.getMainPackage(J2SELauncher.java:49) at com.maintainj.launching.j2se.J2SELauncher.generateAspect(J2SELauncher.java:126) at com.maintainj.launching.j2se.J2SELauncher.launch(J2SELauncher.java:96) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:764) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:614) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:880) at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1083) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Logged Choudary Kothapalli Administrator Full Member Posts: 174 Re: Unable to launch MaintainJ with certain projects « Reply #1 on: October 27, 2008, 10:21:09 PM » mcofran,Yes, that is a defect with projects that have the main class in default package. It is fixed and a new bug fix version 2.5.1 is released. Please update your Eclipse.What is the other issue that you need to resolve? Let me know.Regards,Choudary. Logged mcofran Newbie Posts: 3 Re: Unable to launch MaintainJ with certain projects « Reply #2 on: October 29, 2008, 12:45:55 PM » Thanks very much, now my app starts up. Unfortunately MaintainJ doesn't, due to the other issue I mentioned. This seems to occur when instrumenting and before my main is actually invoked. The stack trace I get is as follows:[AppClassLoader@a39137] info AspectJ Weaver Version 1.5.3 built on Wednesday Nov 22, 2006 at 11:18:15 GMT[AppClassLoader@a39137] info register classloader sun.misc.La