• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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

 
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic