2011-11-14 9 views
2

私は次のように使用しています:<tx:annotation-driven />エラーが発生しました

view plaincopy to clipboardprint?

<?xml version="1.0" encoding="UTF-8"?> 
    <beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:task="http://www.springframework.org/schema/task" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation="http://www.springframework.org/schema/task 
    http://www.springframework.org/schema/task/spring-task-3.0.xsd 
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
      http://www.springframework.org/schema/tx 
     http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
      http://www.springframework.org/schema/context 
      http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

      <tx:annotation-driven/> 

、それが与えているエラーは、次のとおりです。

@Repository("chatSessionDAO") 
@Transactional 
public class ChatSessionDAO extends MercerChatDAO { 

    /** mySessionFactory */ 
    @Autowired 
    @Qualifier("mySessionFactory") 
    private LocalSessionFactoryBean mySessionFactory; 

    /** chatAlertsDO */ 
    @Autowired 
    @Qualifier("chatAlertsDO") 
    private MHRContChatAlertsDO chatAlertsDO; 

    /** 
    * Method to retrieve chat session objects for a particular id 
    * 
    * @param chatSessionQO 
    * @return 
    * @throws MercerException 
    */ 
    public List<?> retrieveSessionInfo(ChatSessionQO chatSessionQO) throws MercerException { 
     Criteria criteria = null; 
     List<?> lstReturn = null; 
     try { 

      long chatSessionId = chatSessionQO.getChatSessionId(); 
      Long chatSessionIdLong = new Long(chatSessionId); 
      log.info("creating criteria for chatsession"); 
      SessionFactory sessionFactory = mySessionFactory.getObject(); 
      Session session = sessionFactory.getCurrentSession(); 
      criteria = session.createCriteria(MHRContChatSessionDO.class, "chatSession").add(
        Restrictions.eq("id", chatSessionIdLong)); 
      if (criteria != null) { 
       lstReturn = processQuery(criteria); 
      } 

     } catch (Exception e) { 
      log.error("error :::", e); 
      throw new MercerException("No transaction"); 
     } 
     return lstReturn; 
    } 

.....他のそのような方法

興味深い:ここ

Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'chatSessionDAO' 
defined in file [/local/jboss-eap-4.2/jboss-as/server/mercer02/deploy/mercerhr.ear/mercer.war/WEB-INF/classes/com/mercer/chat/app/dao/ChatSessionDAO.class]: 
Initialization of bean failed; 
nested exception is java.lang.VerifyError: 
(class: com/mercer/chat/app/dao/ChatSessionDAO$$EnhancerByCGLIB$$c2bd3f90$$FastClassByCGLIB$$bc114739, 
method: invoke signature: (ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;) Inconsistent stack height 2 != 1 

は私のChatSessionDAOクラスです私のローカルマシン(jdk 1.5、spring 3.0.3、hibernate 3.0、windows OS、jboss)で同じことをしているときに、それはprobまったく同じですが、同じものがリモートマシン上で実行され、残りのすべてがUnixであるOSを受け入れる場合、上記のエラーが発生します。今この問題についてどうやって行くのですか?

+0

全く同じJDKビルド、まったく異なるOSですか?アプリはUnix JDKでコンパイルされていますか?一度同じエラーが発生しますか? –

+0

まあまあ同じJDKちょっと違うOS .... Unix JDKの下でコンパイルされているアプリ..本当に..同じエラーが再び発生している。また、@ TransactionはAOPでのみ使用することを意図していますか? – user972418

答えて

0

JBossとSpringがChatSessionDAOのバイトコードとまったく同じ部分を操作しているようです。回避策として

、あなたがそれを実行することができます。このエラーを取り除くために

-Xverify:none 

また、私は二つのことを行うことをお勧めします:ポストそれJBossのforum上(jboss-eap-4.2のバグかもしれない)

  • はDAOのレベルで取引しないでください

    • =>は常に、サービス層を好みます原子が必要な作業単位を明確に定義しているため、
  • 関連する問題