Hello Apostolos,
It seems to me that getting the Tuscany domain launcher info timing, but
not the timings from your own classes would be an issue in the point cut
specification. I am not an expert in AspectJ, but perhaps you can try
variations on the point cuts to see if you can get info from a different
path.
Regarding the error statement "error Non-aspect types can only be
specified in a declare...", I am going to have to do some reading into
the AspectJ docs to try to decipher that one. I will report here what I
find.
Apostolos Papageorgiou wrote:
- I built the tracing/aspectj module under 1.4 and the test seems to work.
When I try to use it in my sample application, the timing info is printed for
the log.info() calls of the domain launcher (or whatever...) like:
Timing Around timedSection jp=call(void java.util.logging.Logger.info(String))
16.03.2009 11:03:20 org.apache.tuscany.sca.http.jetty.JettyServer
info_aroundBody0
INFO: Added Servlet mapping: http://flip:8085/GuidelineService
Timing Around timedSection Roundtrip is 1ms for jp.getSignature=void
java.util.logging.Logger.info(String)
- But the same time-logging does not successfully take place for a log.info()
call that I have added inside my web service :-(
The following output appears when the web service is called:
[generatedclassloa...@1a0724a] info AspectJ Weaver Version 1.6.1 built on
Thursday Jul 3, 2008 at 18:35:41 GMT
[generatedclassloa...@1a0724a] info register classloader
org.apache.tuscany.sca.interfacedef.java.jaxws.generatedclassloa...@1a0724a
[generatedclassloa...@1a0724a] info using configuration
/C:/Program%20Files/Apache%20Software%20Foundation/tuscany-sca-1.4-src/modules/tracing-aspectj/target/classes/META-INF/aop.xml
[generatedclassloa...@1a0724a] info define aspect
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@1a0724a] warning no match for this type name:
org.apache.tuscany.sca.aspectj.UserTimingAspect [Xlint:invalidAbsoluteTypeName]
[generatedclassloa...@1a0724a] error Non-aspect types can only be specified in
a declare precedence statement when subtypes are included. Non-aspect type is :
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@1a0724a] error Non-aspect types can only be specified in
a declare precedence statement when subtypes are included. Non-aspect type is :
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@1a0724a] error Non-aspect types can only be specified in
a declare precedence statement when subtypes are included. Non-aspect type is :
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@fd0695] info AspectJ Weaver Version 1.6.1 built on
Thursday Jul 3, 2008 at 18:35:41 GMT
[generatedclassloa...@fd0695] info register classloader
org.apache.tuscany.sca.interfacedef.java.jaxws.generatedclassloa...@fd0695
[generatedclassloa...@fd0695] info using configuration
/C:/Program%20Files/Apache%20Software%20Foundation/tuscany-sca-1.4-src/modules/tracing-aspectj/target/classes/META-INF/aop.xml
[generatedclassloa...@fd0695] info define aspect
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@fd0695] warning no match for this type name:
org.apache.tuscany.sca.aspectj.UserTimingAspect [Xlint:invalidAbsoluteTypeName]
[generatedclassloa...@fd0695] error Non-aspect types can only be specified in a
declare precedence statement when subtypes are included. Non-aspect type is :
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@fd0695] error Non-aspect types can only be specified in a
declare precedence statement when subtypes are included. Non-aspect type is :
org.apache.tuscany.sca.aspectj.UserTimingAspect
[generatedclassloa...@fd0695] error Non-aspect types can only be specified in a
declare precedence statement when subtypes are included. Non-aspect type is :
org.apache.tuscany.sca.aspectj.UserTimingAspect
16.03.2009 11:09:12 governance.GuidelineImpl getGuideline
INFO: Hello Simon and Ben!
- However, all of the above happens when I use the 1.3.2
tuscany-sca-manifest.jar in the classpath. With the 1.4 manifest, I get the
following error and no time-logging appears then at all:
[appclassloa...@df6ccd] error Attempt to concretize but chosen aspect name already
defined: <concrete-aspect name='org.apache.tuscany.sca.aspectj.UserTimingAspect'
extends='org.apache.tuscany.sca.aspectj.TimingAspect'/> in aop.xml
[appclassloa...@df6ccd] error Concrete-aspect
'org.apache.tuscany.sca.aspectj.UserTimingAspect' could not be registered
- Any conclusions the above random :-) clues lead you to could be helpful.
Thanks in advance.
Apostolos
-----Ursprüngliche Nachricht-----
Von: Dan Becker [mailto:[email protected]]
Gesendet: Freitag, 13. März 2009 15:02
An: [email protected]
Betreff: Re: AW: AW: Tuscany AOP Logging, Tracking, Timing example
Hi Apostolos,
You are not missing anything. Sorry, but I mis-spoke when I mentioned
1.3.1 and 1.3.2 releases. Currently I see the Tuscany tracing-aspectj
module in the 1.4 release and the latest 1.x branch, so my statements
apply to those branches. (The module has relatively few dependencies so
it might work on 1.3.1 and 1.3.2 with a bit of copying and pom.xml
editing, but I have not tried this yet.) So, please give this a try on
1.4 or later.
Apostolos Papageorgiou wrote:
I guess I am missing something important...
C:\Program Files\Apache Software
Foundation\tuscany-sca-1.3.1-src\modules\tracing-aspectj>mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:tuscany-tracing-aspectj:jar:null
Reason: Cannot find parent: org.apache.tuscany.sca:tuscany-modules for project:
null:tuscany-tracing-aspectj:jar:null for project
null:tuscany-tracing-aspectj:jar:null
-----Ursprüngliche Nachricht-----
Von: Dan Becker [mailto:[email protected]]
Gesendet: Donnerstag, 12. März 2009 19:09
An: [email protected]
Betreff: Re: AW: Tuscany AOP Logging, Tracking, Timing example
Apostolos Papageorgiou wrote:
So, I have to add tracing-aspectj under "modules" in the source distribution
and re-build, right? Or can I build the module (or simply test) independently?
Will it be OK with the 1.3.1 source?
Then I need to download aspectjweaver.jar separately, right?
Hello Apostolos,
You do not have to add any code to run the simple test case. If you run
"mvn install" on the source directory, tracing-aspectj, it should
download all dependencies, build the code, and run the simple test case.
This simple test will use the aspect in aop.xml to time a logging statement.
Once this is running, you should be able to log and time your own code
by editing the pointcut and the aspect in aop.xml. You can also add new
aspects, or edit the existing ones if the aspect in aop.xml does not
meet your needs. Additional aspects may be added in
/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj.
These statements hold for 1.3.1 and later releases.
I hope to find the time to dig into it and come back with "better" questions
and further discussion about my logging/timing needs...
Your questions are just fine! Continue to ask as many as you like.
--
Thanks, Dan Becker
--
Thanks, Dan Becker
--
Thanks, Dan Becker