• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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 Ubuntu VI Editor
  • 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.
 
machines help you to do more, but experience less. Experience this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!