Spring 2.0 Annotations and ant

六月ゝ 毕业季﹏ 提交于 2020-01-07 04:28:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!