[Design of AOP on JBoss (Aspects/JBoss)] - Dynamic AOP and User-Defined Class Loader
by shu_boston
Hi,
I want to weave interceptors which loaded by a user-defined class loader (like NetworkClassLoader), but I got a javassist.NotFoundException. My code is as follows
| ClassLoader loader = new ... // my class loader
| Thread.currentThread().setContextClassLoader(loader);
| Class clazz = Class.forName("aspect.GreetingInterceptor", false, loader);
|
| AdviceBinding binding = new AdviceBinding();
| binding.setPointcutExpression("execution(* *.Test->*(..))");
| binding.addInterceptor(clazz);
| AspectManager.instance().addBinding(binding);
|
| Test t = new Test();
| t.print();
|
My class loader reads aspect.GreetingInterceptor.class file and calls defineClass() to load it. At the end of the code above, aspect.GreetingInterceptor is supposed to be invoked. When aspect.GreetingInterceptor is in classpath and specified as addInterceptor(aspect.GreetingInterceptor.class), it works fine. However, I got following exception when aspect.GreetingInterceptor is loaded dynamically.
| Exception generating JoinPoint_print4216308509294254048_1: aspect.GreetingInterceptor
| java.lang.RuntimeException: Error generating joinpoint class for joinpoint Method[method=public void Test.print()]
| at org.jboss.aop.instrument.JoinPointGenerator.doGenerateJoinPointClass(JoinPointGenerator.java:321)
| ...
|
| Caused by: javassist.NotFoundException: aspect.GreetingInterceptor
| at javassist.ClassPool.get(ClassPool.java:436)
| at org.jboss.aop.util.ReflectToJavassist.classToJavassist(ReflectToJavassist.java:49)
| at org.jboss.aop.instrument.JoinPointGenerator$AdviceSetup.<init>(JoinPointGenerator.java:1390)
| ...
|
Does anyone know how I can use dynamically loaded class as an interceptor?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148723#4148723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148723
16 years
[Design of JBoss Profiler] - Jboss profiler -problem in getting the log files and runtime
by anamica_r
Hi,
My requirement is find out the memory leak in a particular functionality & improve the performance.
followed the steps as in http://wiki.jboss.org/wiki/HowToConfigureJBossProfiler.
Installed Jboss profiler 1.0 on JBoss appserver 4.0.5. i.e copied jboss-profiler-jvmti.sar, jboss-profiler-noAOP.sar and jboss-profiler.war files into \server\deploy directory and copied the dll files into java and jre path.
java option is set as JAVA_OPTS=-agentlib:jbossAgent -XrunjbossInspector:/tmp,include=org.ex,ignore=*,start=org.ex.Main
using native profiler in the jmx console window activated and did that task and stopped native profiler. But only the app server startup process id files are available in /tmp directory and functionality related process id not getting listed in the profiler web interface.
Even if I select the server startup process id the next page is displaying something like
Opening C:\tmp\serverspy_2712_thread_1210045750923_0_21.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045750923_0_22.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045752997_0_23.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045753200_0_24.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045753200_0_25.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045753215_0_26.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045753418_15625000_27.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045754806_15625000_28.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045756224_0_29.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045756443_0_30.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045757815_93750000_31.log.gz
Opening C:\tmp\serverspy_2712_thread_1210045764379_62500000_32.log.gz
Processed 10000 registers (13%)
Processed 20000 registers (26%)
Processed 30000 registers (40%)
-------------------------------
----------------------------
Process finished Click here.
On clicking this, it takes to a page where only table title is displayed without any content in the table.
Issues are,
1. only server process id related files are generated in /tmp directory and why not the application related log files ?
2. Why the next page of runtime process displays message as in the mail and could not view the method level report
If anyone can help me, that would be great
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148722#4148722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148722
16 years
[Design of EJB 3.0] - Re: jndi name issues
by ALRubinger
My problems with Proxies and Scott's with JNDI Metadata have converged here.
The solution that will enable us to further decouple and get resolution more in-line with the current direction is to add the "resolvedJndiName" property accessors to JBossEnterpriseBeanMetaData, effective metadata-1.0.0.Beta12.
>From there we can make another step towards decoupling the Proxy/ProxyFactory components from the Containers (read: EJB3 Core).
It'll then be the responsibility of the MappedReferenceMetaDataResolverDeployer to properly resolve the JNDI name in the case of @RemoteBinding overrides.
An issue exposed here is that @RemoteBindings(Array) is non-deterministic at the class level in the case that more than one interface is defined on the bean. For now, I'll assume that each @RemoteBinding in the specified array should be used on each of the business interfaces (creating multiple bindings).
Still to be covered is the handling of "getInvokedBusinessInterface()" under this mechanism, I'm looking into those tests now.
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148716#4148716
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148716
16 years
[Design of EJB 3.0] - Re: How to Resolve JNDI Name from beanInterface?
by scott.stark@jboss.org
So I am going to add a non-managed getResolvedJndiName(String iface) to the JBossEnterpriseBeanMetaData so that there is a stable api to call. This will be implemented to use the default jndi policy if set, the following default implementation if not set:
- String getJndiName(EjbDeploymentSummary summary) : return the ejb resolved jndi name or mapped name.
- String getDefaultRemoteJndiName(EjbDeploymentSummary summary) : returns getJndiName(summary) } + "/remote"
- String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary) : returns getJndiName(summary) } + "/home"
- String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary) : returns getJndiName(summary) } + "/local-home"
- String getDefaultLocalJndiName(EjbDeploymentSummary summary) : returns getJndiName(summary) } + "/local"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148713#4148713
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148713
16 years