• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!