Re: Use of AspectJ load time weaving in Geronimo
Ahh, true Kevan, I am omitting one other step that I normally do to make this run on Apache Tomcat. Namely, this context.xml is placed in the web app META-INF/context.xml, and the Spring JAR spring-tomcat-weaver.jar is placed into $CATALINA_HOME/server/lib: Context path=/MyApp reloadable=false Loader loaderClass=org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader/ /Context I've had success now in Geronimo with instrumenting the the system class loader by setting JAVA_OPTS==-javaagent:%ASPECTJ_WEAVER% (where ASPECTJ_WEAVER points to aspectjweaver-1.6.2.jar) before I call geronimo.bat, but I would rather run the weaver as part of the web app class loader rather than the system class loader. So is it possible to do an instrumented web app class classloader using context.xml or some other mechanism in Geronimo? Kevan Miller wrote: On Jul 13, 2009, at 11:26 AM, Dan Becker wrote: I've been implementing an Aspect Oriented Programming (AOP) profiling and timing system on some of my web application code. I've been able to Load Time Weave (LTW) my application code using plain Apache Tomcat by placing the following AOP configuration file in WEB-INF/classes/META-INF/aop.xml: ... However, when I try the same operation in Geronimo 1.1.1 (J2EE version with Tomcat), I do not see the weaver weaving, nor do I catch any of the application code with the pointcuts or the aspects. I assume you're using G 1.1.1 for a reason. Have you tried 2.1.4? You must be doing more than simply creating an aop.xml file. Otherwise, how is AspectJ getting loaded/triggered to read the configuration file? Have other people tried AOP with Geronimo? Have they been successful load time weaving with such a configuration file? Pointers to any AOP examples with Geronimo are appreciated. Maybe others who have used it. I've never tried it. But interested to see it running. Even more interested to see it on G 2.1.4 :-P, but happy to help with 1.1.1, also... Prolly best to follow up on our user@ list... -- Thanks, Dan
Apache Con US '09 Geronimo Track
Repost from our dev list. On Jul 13, 2009, at 5:53 PM, Kevan Miller wrote: All, There will be a Geronimo Track at ApacheCon US '09. We will be sharing a full day with the Directory Project. This means that we'll have 2 to 3 50 minute time slots. We have some flexibility on how we format these time slots. So, IIUC, we can sub-divide these time slots, if we desire. I've put together the following proposed Track Description. Comments much appreciated. I'd like to settle on the track description quickly, if possible. And hope we can start discussing talk proposals and track formats, real soon. * Apache Geronimo is a lightweight, flexible, component-based server for building dynamic application server environments. Geronimo plugins can be assembled into a fully compliant Java EE Server. However, it can be easily assembled into a server providing a subset of functionality or a minimal subset required to meet the requirements of a set of applications. In addition to the Apache Geronimo Server, the Geronimo project is also comprised of a number of subprojects: Development Tools, XBean, Yoko, GShell, Specs, etc. Potential topics for the Geronimo Track include, but are in no way limited to: * Geronimo architecture, * Systems management, * Application development and user experiences, * OSGi Blueprint, * Kernel restructuring, * Java EE 6, * etc. * Please let me know your thoughts on the above. Also, please start thinking about potential talks. However, please don't start making specific talk proposals, yet. Finally, we will need to discuss our selection process for talk proposals. I would prefer that we reach our talk decisions on our public mailing list, rather than our private@ mailing list. This could be a bit sensitive, however. So, I would appreciate your thoughts. If we're concerned about potential harm this might cause, it's possible that some sort of anonymous vote could be held. --kevan
Re: log4jResource setting in GBean: ApplicationLog4jConfigurationGBean
Thanks David and Viola. The document http://cwiki.apache.org/GMOxDOC22/configuring-application-specific-logging-with-log4j.htmlhas been updated with this issue: You can also use a log4j.properties file in your classpath, for example, in WEB-INF/classes/META-INF. (If you prefer not to place this file under WEB-INF/classes/, the path of this file must be added to your classpath).But this will obstruct anyone trying to configure logging as the file will remain packed in your application somewhere hard to find. gbean name=DirectoryLog4jConfiguration class= org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean attribute name=log4jResourceMETA-INF/log4j.properties/attribute /gbean Best Regards, Ying Tang 2009/6/9 David Jencks david_jen...@yahoo.com On Jun 8, 2009, at 11:03 PM, viola.lu wrote: hi, i follow steps in http://cwiki.apache.org/GMOxDOC22/configuring-application-specific-logging-with-log4j.html , and add gbean information in geronimo-web.xml using log4jResource. dep:gbean class=org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean name=testlogLog4jConfiguration dep:attribute name=log4jResourceMETA-INF/log4j.properties/dep:attribute /dep:gbean But Can't find META-INF/log4j.properties error always exists. if i use log4jFile setting like below: dep:gbean class=org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean name=testlogLog4jConfiguration dep:attribute name=log4jFilevar/log/log4j.properties/dep:attribute dep:reference name=ServerInfodep:nameServerInfo/dep:name/dep:reference !--dep:attribute name=log4jResourceMETA-INF/log4j.properties/dep:attribute-- /dep:gbean it works well. I looked into ApplicationLog4jConfigurationGBean code: ... InputStream in; if (log4jFile != null) { File file = serverInfo.resolveServer(log4jFile); in = new FileInputStream(file); } else if (log4jResource != null) { in = classloader.getResourceAsStream(log4jResource); if (in == null) { throw new NullPointerException(No log4j properties resource found at + log4jResource); } } else { return; } ... in = classloader.getResourceAsStream(log4jResource); ClassLoader will search this file from classpath, and my project structure is: LogWeb ---src(testlog.java ---WebContent META-INF(log4j.properties) WEB-INF index.jsp Why it can't find out file META-INF/log4j.properties? Because that's not in your classpath. Try WEB-INF/classes/META-INF/log4j.properties. thanks david jencks Anyone can figure it out? Thanks. -- View this message in context: http://www.nabble.com/log4jResource-setting-in-GBean%3A-ApplicationLog4jConfigurationGBean-tp23936783s134p23936783.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.