[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Unable to use aspectj monitoring

Hi,

The problem of

> java.lang.RuntimeException: Cannot register non aspect:
> com$xyz$kc$aop$monitor$MonitoredAspect ,
> com.xyz.kc.aop.monitor.MonitoredAspect

basically means the aspect could not be found.  (The 'dollars'
gradually replace 'dots' in the name as it searches for alternatives
where some component of the name is an inner class).  I am not sure
how to set things up under jboss but I've forwarded your question to a
colleague that should know.  I believe there may be some funky
classloading going on in this situation and you need the weaver that
finds the aop.xml to also be able to see the bytecode for the aspect.
AspectJ won't hunt for jars in an ear, hopefully the jboss code should
be doing that though.

I'll let you know more when I hear back from my colleague.

cheers,
Andy

On 3 July 2012 08:07, kishore <satyakishore09@xxxxxxxxx> wrote:
> Hi i'm trying to start jboss by keeping "aspectjweaver1.5.4.jar" as
> "javaagent" in the VM arguments and aop.xml in META-INF folder.
> I have added the compiled aspect classes as jar in my classpath.
>
> It gives me the following error.
>
> Can someone help.
>
> (Jboss4.3 and using JDK1.5)
>
> 23:49,559 ERROR [STDERR] [WebAppClassLoader@16c03ee] info AspectJ Weaver
> Version 1.5.4 built on Thursday Dec 20, 2007 at 13:44:10 GMT
> 20:23:49,559 ERROR [STDERR] [WebAppClassLoader@16c03ee] info register
> classloader org.jboss.web.tomcat.service.WebAppClassLoader@16c03ee
> 20:23:49,559 ERROR [STDERR] [WebAppClassLoader@16c03ee] info using
> configuration /C:/jboss/server/default/deploy/Default.ear/META-INF/aop.xml
> 20:23:49,563 ERROR [STDERR] [WebAppClassLoader@16c03ee] info register aspect
> com.xyz.kc.aop.monitor.MonitoredAspect
> 20:23:49,566 ERROR [STDERR] Jul 3, 2012 8:23:49 PM
> org.aspectj.weaver.tools.Jdk14Trace error
> SEVERE: register definition failed
> java.lang.RuntimeException: Cannot register non aspect:
> com$xyz$kc$aop$monitor$MonitoredAspect ,
> com.xyz.kc.aop.monitor.MonitoredAspect
>     at
> org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:207)
>     at
> org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:399)
>     at
> org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(ClassLoaderWeavingAdaptor.java:240)
>     at
> org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:152)
>     at
> org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:151)
>     at
> org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:156)
>     at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:122)
>     at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:73)
>     at
> org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52)
>     at
> sun.instrument.TransformerManager.transform(TransformerManager.java:122)
>     at
> sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>     at
> org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
>     at
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
>     at
> org.jboss.web.tomcat.service.WebAppClassLoader.findClass(WebAppClassLoader.java:139)
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
>     at
> org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:108)
>     at
> org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:58)
>     at
> org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)
>     at
> org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)
>     at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
>     at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>     at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4254)
>     at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
>     at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:732)
>     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
>     at
> org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at
> org.apache.catalina.core.StandardContext.init(StandardContext.java:5300)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
>     at
> org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at
> org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
>     at
> org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
>     at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
>     at org.jboss.web.WebModule.startModule(WebModule.java:83)
>     at org.jboss.web.WebModule.startService(WebModule.java:61)
>     at
> org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
>     at
> org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
>     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
>     at $Proxy0.start(Unknown Source)
>     at org.jboss.system.ServiceController.start(ServiceController.java:417)
>     at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>     at $Proxy45.start(Unknown Source)
>     at
> org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>     at
> org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>     at
> org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
>     at
> org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
>     at
> org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
>     at
> org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
>     at
> org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
>     at
> org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>     at $Proxy46.start(Unknown Source)
>     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
>     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
>     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
>     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
>     at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatc
> 20:23:49,567 ERROR [STDERR] h(Invocation.java:94)
>     at
> org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>     at
> org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>     at $Proxy10.deploy(Unknown Source)
>     at
> org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
>     at
> org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
>     at
> org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
>     at
> org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
>     at
> org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
>     at
> org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
>     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
>     at $Proxy0.start(Unknown Source)
>     at org.jboss.system.ServiceController.start(ServiceController.java:417)
>     at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>     at $Proxy4.start(Unknown Source)
>     at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
>     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
>     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
>     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
>     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>     at
> org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>     at
> org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
>     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>     at
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>     at $Proxy5.deploy(Unknown Source)
>     at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
>     at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
>     at org.jboss.Main.boot(Main.java:200)
>     at org.jboss.Main$1.run(Main.java:508)
>     at java.lang.Thread.run(Thread.java:595)
>
>
> Thanks & Regards,
> ~Clonov
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>