This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Cannot compile MethodBeforeAdvice in Spring 2.5 in RAD 6(JDK 1.4.2)

 
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use Spring 2.5 in RAD 6 (which uses JDK 1.4.2) for a stand-alone main class for AOP.

MethodBeforeAdcice, AfterReturningAdvice, ThrowsAdvice are not in the class. However MethodBeforeAdcice, AfterReturningAdvice, ThrowsAdvice are NOt showing any compile error with the package import.

The code is showing compile error as:
org.aopalliance.aop.Advice cannot be resolved. It is indirectly referenced from .class

I do not have aop specific jar file. I have the following jar files (obtained from from Spring 2.5 dist) in the classpath for this Java project (not web based) which is a simple main class kind of project.

spring-aop.jar
commons-logging-1.1.1.jar
sprin-beans.jar
spring-context.jar
spring-context-support.jar
spring-core.jar
spring-jdbc.jar
spring-jms.jar
spring-orm.jar
spring-test.jar
spring-tx.jar
spring-web.jar
spring-webmvc.jar
spring-webmvc.portlet.jar
spring-webmvc-struts.jar


My class is:

import java.lang.reflect.Method;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.ThrowsAdvice;

public class LoggingInterceptor implements MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice{
.....

}

It cannot compile/recognize MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice classes after public class LoggingInterceptor

However, the package import is NOt showing any compile error for MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add \lib\aopalliance\aopalliance.jar in your CLASSPATH. Note that it's already included in the full bundle spring.jar.
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!