Hey,

I'm a developer from DrFTPD, a Java FTP Daemon, and I'm planning to use JBoss 
AOP in a part of the project.

Our current code depends heavily on JPF (Java Plugin Framework). Quoting from 
JPF's site: "The plug-in architecture used by Eclipse was taken as the basic 
model for JPF in early 2004.". This frameworks provides an easy way of adding 
extensions, creating a complex plugin hierarchy with dependencies, on-the-fly 
reloading of classes, etc...  But in order to manage all this nice stuff it 
relies heavilly on its own ClassLoaders (lots are use, creating a complex 
ClassLoaders graph).

Well, enough of explanations, let's go to the real fun :P

Running an example that is distributed with JBoss AOP 2.0 CR8, I get the 
following output:


  | DEBUG main org.jboss.aop.instrument.InstrumentorFactory - Passed in 
instrumentor: null
  | DEBUG main org.jboss.aop.instrument.InstrumentorFactory - Defaulting 
instrumentor to: org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
  | DEBUG main org.jboss.aop.AdvisorFactory - Passed in advisor: null
  | DEBUG main org.jboss.aop.AdvisorFactory - [debug] Defaulting advisor to: 
org.jboss.aop.ClassAdvisor
  | DEBUG main org.jboss.aop.Deployment - jboss.aop.class.path is NULL
  | DEBUG main org.jboss.aop.Deployment - jboss.aop.search.classpath: 'null' 
true
  | DEBUG main org.jboss.aop.Deployment - jboss.aop.path: jboss-aop.xml
  | DEBUG main org.jboss.aop.Deployment - jboss.aop.path[0]: jboss-aop.xml
  | DEBUG main org.jboss.aop.Deployment - deploying 
file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml
  | DEBUG main org.jboss.aop.AspectXmlLoader - AspectXMLLoader using [EMAIL 
PROTECTED]
  | DEBUG main org.jboss.aop.instrument.Instrumentor - trying to transform 
test.Driver
  | DEBUG main org.jboss.aop.instrument.CallerTransformer - There are no caller 
pointcuts!
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] static main ([Ljava/lang/String;)V] matches no pointcuts
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] teste ()V] matches no pointcuts
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] Driver ()V] matches no pointcuts
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - 
test.POJO.var:I matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - 
test.POJO.var:I matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] POJO ()V] matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.Instrumentor - was test.Driver 
converted: true
  | DEBUG main org.jboss.aop.SuperClassesFirstWeavingStrategy - cannot compile, 
isInterface: test.Interface
  | --- new POJO(); ---
  | DEBUG main org.jboss.aop.instrument.Instrumentor - trying to transform 
test.POJO
  | DEBUG main org.jboss.aop.instrument.CallerTransformer - There are no caller 
pointcuts!
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] someMethod ()V] matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] POJO ()V] matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] POJO ()V] matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - 
test.POJO.var:I matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - 
test.POJO.var:I matches pointcut: all(test.POJO)
  | DEBUG main org.jboss.aop.instrument.Instrumentor - was test.POJO converted: 
true
  | DEBUG main org.jboss.aop.ClassAdvisor - Creating chains for class test.POJO 
[EMAIL PROTECTED]
  | DEBUG main org.jboss.aop.ClassAdvisor - iterate binding 
file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml0 all(test.POJO)
  | [debug] method matched binding: public void test.POJO.someMethod()
  | DEBUG main org.jboss.aop.advice.AdviceBinding - added advisor: test.POJO 
from binding: file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml0
  | DEBUG main org.jboss.aop.advice.AdviceBinding - added advisor: test.POJO 
from binding: file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml0
  | [debug] field matched read binding: public int test.POJO.var
  | [debug] field matched write binding: public int test.POJO.var
  | DEBUG main org.jboss.aop.advice.AdviceBinding - added advisor: test.POJO 
from binding: file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml0
  | [debug] constructor matched binding: public test.POJO()
  | DEBUG main org.jboss.aop.advice.AdviceBinding - added advisor: test.POJO 
from binding: file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml0
  | DEBUG main org.jboss.aop.MethodMatchInfo - populate bindings for public 
void test.POJO.someMethod() all bindings
  | DEBUG main org.jboss.aop.MethodMatchInfo - 0 test.POJO all(test.POJO) : 1
  | DEBUG main org.jboss.aop.MethodMatchInfo - populate bindings for public 
void test.POJO.someMethod() actual bindings
  | DEBUG main org.jboss.aop.MethodMatchInfo - 0 test.POJO all(test.POJO) : 1
  | DEBUG main org.jboss.aop.advice.AdviceBinding - added advisor: test.POJO 
from binding: file:/home/flavio/drftpd/workspace/TestAOP/jboss-aop.xml0
  | DEBUG main org.jboss.aop.instrument.Instrumentor - trying to transform 
test.SimpleInterceptor
  | DEBUG main org.jboss.aop.instrument.CallerTransformer - There are no caller 
pointcuts!
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] getName ()Ljava/lang/String;] matches no pointcuts
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] invoke (Lorg/jboss/aop/joinpoint/Invocation;)Ljava/lang/Object;] 
matches no pointcuts
  | DEBUG main org.jboss.aop.instrument.JoinpointSimpleClassifier - [EMAIL 
PROTECTED] SimpleInterceptor ()V] matches no pointcuts
  | DEBUG main org.jboss.aop.instrument.Instrumentor - was 
test.SimpleInterceptor converted: false
  | DEBUG main org.jboss.aop.advice.AspectFactoryWithClassLoaderSupport - Using 
context classloader [EMAIL PROTECTED] to load aspect test.SimpleInterceptor
  | <<< Entering SimpleInterceptor type: test.JoinPoint_constructor_POJO_0_1$aop
  | empty constructor
  | >>> Leaving SimpleInterceptor
  | --- pojo.someMethod(); ---
  | <<< Entering SimpleInterceptor type: 
test.JoinPoint_someMethod2315001504750198986_2$aop
  | someMethod
  | >>> Leaving SimpleInterceptor
  | --- pojo.var++; ---
  | <<< Entering SimpleInterceptor type: test.JoinPoint_r_var_3$aop
  | >>> Leaving SimpleInterceptor
  | <<< Entering SimpleInterceptor type: test.JoinPoint_w_var_4$aop
  | >>> Leaving SimpleInterceptor
  | 

In order to run the application I used the following Java Parameters:

  | -Dlog4j.configuration=file:log4j-debug.properties
  | -Djboss.aop.verbose=true
  | -Djboss.aop.path=jboss-aop.xml
  | -javaagent:lib/jboss-aop-jdk50.jar
  | 

So the example works fine, I can see that from the logs.

But when I try to run DrFTPD using the same parameters I used to run the 
example I only get the following output:


  | [aop-debug] org.jboss.aop.instrument.InstrumentorFactory Passed in 
instrumentor: null
  | [aop-debug] org.jboss.aop.instrument.InstrumentorFactory Defaulting 
instrumentor to: org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
  | [aop-debug] org.jboss.aop.AdvisorFactory Passed in advisor: null
  | [aop-debug] org.jboss.aop.AdvisorFactory [debug] Defaulting advisor to: 
org.jboss.aop.ClassAdvisor
  | [aop-debug] org.jboss.aop.Deployment jboss.aop.class.path is NULL
  | [aop-debug] org.jboss.aop.Deployment jboss.aop.search.classpath: 'null' true
  | [aop-debug] org.jboss.aop.Deployment jboss.aop.path: conf/aop
  | [aop-debug] org.jboss.aop.Deployment jboss.aop.path[0]: conf/aop
  | [aop-debug] org.jboss.aop.Deployment deploying 
file:/home/flavio/drftpd/trunk/conf/aop/lucene-aop.xml
  | [aop-debug] org.jboss.aop.AspectXmlLoader AspectXMLLoader using [EMAIL 
PROTECTED]
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.java.plugin.boot.ApplicationInitializer
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.java.plugin.boot.SplashHandler
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.java.plugin.boot.BootErrorHandler
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.java.plugin.boot.PluginsCollector
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy warning, 
isFrozen: org.apache.log4j.Category [class path: [EMAIL PROTECTED]:] - dcl 
[EMAIL PROTECTED]
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.log4j.spi.AppenderAttachable
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.commons.logging.Log
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.log4j.spi.LoggerRepository
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.log4j.spi.RepositorySelector
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.log4j.spi.RendererSupport
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.log4j.spi.LoggerFactory
  | [aop-debug] org.jboss.aop.SuperClassesFirstWeavingStrategy cannot compile, 
isInterface: org.apache.log4j.or.ObjectRenderer
  | 

That's not all the output, but the rest is pretty much the same.

Java Parameters:

  | -Dlog4j.configuration=file:conf/log4j-debug-nojpf.properties
  | -Djpf.boot.config=conf/boot-master.properties
  | -Djava.library.path=lib
  | -Djboss.aop.verbose=true
  | -Djboss.aop.path=conf/aop
  | -javaagent:lib/aop/jboss-aop-jdk50.jar
  | 

And the jboss-aop.xml

  | <?xml version="1.0" encoding="UTF-8"?>
  | <aop>
  | 
  |    <bind pointcut="all(org.drftpd.vfs.index.lucene.LuceneEngine)">
  |        <interceptor class="org.drftpd.vfs.index.lucene.SimpleInterceptor"/>
  |    </bind>
  | 
  | </aop>
  | 

As you can notice, the output is veery diferent when running the example (lots 
of lines saying that JBoss AOP found a pointcut match and all that suff) from 
when running DrFTPD, so I bet I'm making some kind of mistake or JPF and JBoss 
AOP cannot co-exist or something like this.

I'm willing to provide anymore info you need in order to trace my problem.

Thanks in advance,

Flavio 'fr0w' Costa 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155834#4155834

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155834
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to