问题
I have an old appfuse project, running Spring 2.0, and Java 1.6, and I'm trying to get Transaction annotation support (and other annotations) running.
But, when I add this to our class:
@Transactional
public class ... {
}
We get an ant compile issue, like:
[javac] symbol: class Transactional
[javac] @Transactional
[javac] ^
How do I tell ant which Spring transactions it should be using?
回答1:
This looks like a simple import problem to me. Have you imported the class org.springframework.transaction.annotation.Transactional
:
import org.springframework.transaction.annotation.Transactional
Annotations are classes which must be imported to be used (without using their fully qualified name), just as any other class.
来源:https://stackoverflow.com/questions/7141032/spring-2-0-annotations-and-ant