2010-07-07 66 views
2

我是GlassFish的新手,我們公司最近將一箇舊系統從JBoss 2遷移到了GlassFish v3。幾乎一切工作正常,但我們與PostGres(V8.1)XADataSource有連接問題。我們有一個數據庫條目來保存站點的運行模式,每個請求都會提取這些信息來驗證它們是否請求有效的頁面。Glassfish中PostgreSQL XADataSource的連接問題

但是,如果多個用戶嘗試這樣做,則會失敗。這在運行PostGres 7.2的JBoss下從未發生過。這裏是主要的罪犯:

sai.mbz.util.GeneralFailureException: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.RemoteException: sai.mbz.dat.generic.GenericDAOException: Exception caught in DAO: java.lang.RuntimeException: Got exception during XAResource.end: org.postgresql.xa.PGXAException: tried to call end without corresponding start call; nested exception is: 
    sai.mbz.util.GeneralFailureException: sai.mbz.dat.generic.GenericDAOException: Exception caught in DAO: java.lang.RuntimeException: Got exception during XAResource.end: org.postgresql.xa.PGXAException: tried to call end without corresponding start call 
    at sai.mbz.control.admin.AdminControllerWebImpl.getParmInfo(Unknown Source) 
    at sai.mbz.control.web.RequestProcessor.processRequest(Unknown Source) 
    at org.apache.jsp.Main_jsp._jspService(Main_jsp.java from :74) 
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406) 
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483) 
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) 
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) 
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) 
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) 
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) 
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226) 
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) 
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) 
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) 
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) 
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) 
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) 
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) 
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) 
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) 
    at com.sun.grizzly.ContextTask.run(ContextTask.java:69) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) 
    at java.lang.Thread.run(Thread.java:619) 

有人可以幫助新手出來嗎?

+0

請更新您的問題,以包括**完整的堆棧跟蹤(包括所有根本原因)。 – BalusC 2010-07-07 17:04:00

+0

Offtopic:PostgreSQL 8.1版今年將成爲EOL。您應該開始遷移。 http://wiki.postgresql.org/wiki/PostgreSQL_Release_Support_Policy – 2010-07-08 07:09:55

+0

發佈政策已移至官方網站:http://www.postgresql.org/support/versioning/ – 2012-04-12 04:46:27

回答

1

異常堆棧指示在調用XAResource.end時沒有活動狀態的XA事務。

什麼是不明確的是你如何管理交易?你真的需要一個XA數據源嗎?如果你不這樣做,我會建議配置一個非XA(即資源本地)數據源。