Интеграция Struts 2 и Hibernate: AnnotationTransactionAttributeSource доступен только на Java 1.5 и выше.JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Интеграция Struts 2 и Hibernate: AnnotationTransactionAttributeSource доступен только на Java 1.5 и выше.

Сообщение Anonymous »

Я пытаюсь интегрировать Hibernate и Struts 2.
Это applicationContext.xml:
< pre class="lang-xml Prettyprint-override">




















classpath:hibernate.cfg.xml


org.hibernate.cfg.AnnotationConfiguration



${jdbc.dialect}
true










У меня уже есть jdbc.properties и я сохраняю своего клиента в DAO:
CustomerDAO:
public class CustomerDAO {
@Autowired
private SessionFactory sessionFactory;

public void persistAuthor(Customer customer) {
sessionFactory.getCurrentSession().save(customer);
}
}

Это класс Entity:
@Table(name="customer")
@Entity
public class Customer {
@Id
@GeneratedValue
private Integer id;
private String name;
private String password;
public Integer getId() {
return id;
}
//Getter/Setters//
}

Это мой класс Action:
public class CustomerAction extends ActionSupport {
private static final Logger logger = Logger.getLogger(CustomerAction.class);
Customer customer;
CustomerDAO customerdao;
private Integer id;
private String name;
private String password;

//GETTERS/SETTERS//

@Action(value="/customer", results={
@Result(name="success",location="/customerSuccess.jsp"),
})
public String execute() throws Exception {
logger.debug("Hello");
customer.setId(getId());
customer.setName(getName());
customer.setPassword(getPassword());
customerdao.persistAuthor(customer);
return SUCCESS;
}

Однако мне отображается это исключение.
Исключение:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is
java.lang.IllegalStateException: AnnotationTransactionAttributeSource is only available on Java 1.5 and higher
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)


Подробнее здесь: https://stackoverflow.com/questions/255 ... ce-is-only
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»