Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1.2 Dependencies not complete. #30

Closed
drekka opened this issue May 22, 2015 · 9 comments
Closed

1.1.2 Dependencies not complete. #30

drekka opened this issue May 22, 2015 · 9 comments

Comments

@drekka
Copy link

drekka commented May 22, 2015

I've included 1.1.2 into a gradle project using this:

compile "org.springframework.retry:spring-retry:1.1.2.RELEASE"

However when I attempted to run the war file I get this exception:

Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Around
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_45]
....

It appears that there are dependencies which have not been resolved or downloaded. Is there something missing from the POM?

@garyrussell
Copy link
Contributor

spring-retry has no runtime dependencies on AspectJ.

Perhaps something else in your application is referencing it?

@ek-ex
Copy link

ek-ex commented Jun 10, 2015

I have the same problem as drekka, it's a completely new project just to test spring-retry with only spring retry and spring boot.

@garyrussell
Copy link
Contributor

AspectJ is only needed if you are using @Retry annotations so the project doesn't have it as a hard dependency because it's not needed if you are programmatically configuring or using XML.

@drekka
Copy link
Author

drekka commented Jul 7, 2015

Given that annotations are the way things are going, I would suggest that making AspectJ a dependency would be a good idea. XML configs are old school (and a pain to maintain) and programmatic is what people do when they need something not provided by out of the box annotations.

@dsyer dsyer closed this as completed Feb 12, 2016
@jonpeterson
Copy link

jonpeterson commented Nov 28, 2016

FWIW, I agree with @drekka. I came here with the same issue. Now I need to go figure out what version of AspectJ to manually include.

EDIT:
For anyone else who comes across this and is also using Spring Boot, including spring-boot-starter-aop solved this for me and ensured versioning compatibility with the rest of Spring Boot.

@selimok
Copy link

selimok commented Jan 11, 2017

I agree with @drekka too.

My workaround was to add following dependency into my pom:

<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-aspects</artifactId>
</dependency>

@Ghilteras
Copy link

Ghilteras commented Feb 21, 2019

I tried adding both spring-aspects and spring-aop together with aspectjtools aspectjrt and aspectjweaver but I keep getting
java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Pointcut
same thing with spring-boot-starter-aop so I'm not sure what to do next at this point

The relevant part of my Spring xml looks like this

        xmlns:aop="http://www.springframework.org/schema/aop"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
       default-init-method="initialize" default-destroy-method="destroy">
    <context:annotation-config />

    <aop:aspectj-autoproxy />

    <bean class="org.springframework.retry.annotation.RetryConfiguration" />

I am just trying to be able to use a @Retryable annotation before one of my methods

@dsyer
Copy link
Member

dsyer commented Feb 21, 2019

Sound like you need to read up on Spring AOP (and probably stop using <aop:aspectj-autoproxy/>). Anyway this is kind of unrelated to the original (closed) issue.

@Ghilteras
Copy link

Ghilteras commented Feb 21, 2019

I only use Spring AOP because it's needed by Spring Retry and I don't have a @Configuration class so I need to do it with xml. Not sure why I should stop using <aop:aspectj-autoproxy/>

Will file a new issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants