Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using aspectJ in a web application - thisJoinPoint causes exceptions

45 views
Skip to first unread message

ouri....@gmail.com

unread,
Jun 21, 2007, 10:57:38 AM6/21/07
to
Hi,

I built a simple Java web application with a Web Service interface and added to it some simple aspects. When running the application as an aspectJ application it does exactly what it should, but when I run it as a web application and test it through the Web Services explorer I get strange exceptions. I isolated a line using the 'thisJoinPoint' command as the cause for the exception - commenting this line all works well also as a web application. (exception described below)

Platform:
Rational Software Architect 7.0
WebSphere 6.1
AspectJ Runtime 1.5.2

Thanks for anyone who can help me out here.
Ouri.

a sample exception (but I get different exceptions when using 'thisJoinPoint' in different places):
[6/21/07 17:52:54:953 IDT] 0000001c PivotHandlerW W com.ibm.ws.webservices.engine.PivotHandlerWrapper invoke WSWS3734W: Warning: Exception caught from invocation to com.ibm.ws.webservices.engine.dispatchers.java.JavaBeanDispatcher:
java.lang.NoClassDefFoundError: iSeller.Seller (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:123)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.ibm.ws.webservices.engine.utils.ClassUtils$2.run(ClassUtils.java:234)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)

Paul Ilechko

unread,
Jun 21, 2007, 11:03:56 AM6/21/07
to

ouri....@gmail.com

unread,
Jun 24, 2007, 6:38:30 AM6/24/07
to
Hi Paul, Thanks. This indeed looks like my problem.

However, I read somewhere that I should add the aspectjrt.jar file to either the WEB-INF/lib folder in my project, or to the corresponding EAR project. in order to add it to the right class path. Both ways did not solve (nor changed) my problem. What should be the correct way to add the aspectj library to a web application?

Thanks,
Ouri.

consijp

unread,
Oct 5, 2009, 1:57:04 PM10/5/09
to
I would suggest that you add it to the library in the Websphere install root. For example, if websphere was installed at C:\IBM\Websphere61\ then put it at C:\IBM\Websphere61\lib

Now if that works then you know it was a classpath issue. I would then remove it from that location and create or add to the this variable: ws.ext.dirs in the JVM directory. See this handy document from IBM at: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/crun_classload.html If that link does not work then search for ws.ext.dirs on google and it should come up as one of the top results.

stuart_wildcat

unread,
Oct 5, 2009, 4:07:58 PM10/5/09
to
Although I don't have anything to add about this specific AspectJ issue I would strongly caution against adding anything to the root WebSphere classpath. Using /lib or ws.ext.dirs is intended for WebSphere system code and not for applications.

The better way to test this by modifying the classpath of the application might be to use a "shared library". You can link a shared library to a server or individual applications. You can find more info here:
[http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.nd.doc/info/ae/ae/tcws_sharedlib.html]

If you put something in the WebSphere root classpaths you may be impacting something WebSphere needs to run. The shared library gives you the proper flexibility for classpath configuration. A shared library can also let you link a JAR file to multiple applications if needed without needing to package with each one.

Gook luck,
Stuart Smith
Administration Lead
Web Age Solutions
IBM Certified Advanced System Administrator WAS ND 6.1
www.webagesolutions.com

0 new messages