cuiyi's blog(崔毅 crazycy)

记录点滴 鉴往事之得失 以资于发展
数据加载中……

JBoss5 for Java5 vs JBoss for Java6

最近在客户服务器上遇到了不少麻烦事,环境是JBoss5 + Java6;

第一个事情是,2个数据库的写操作在同一个事务(Transaction)中,本地开发环境和公司的集成测试环境运转都很好;但是在客户机器上:

2013-05-06 19:10:49,957 WARN  [org.jboss.tm.usertx.UserTransactionRegistry] (http-0.0.0.0-8380-1) Error notifying listener org.jboss.resource.connectionmanager.CachedConnectionManager@1187172 of userTransactionStarted

java.lang.IllegalStateException: Trying to change transaction TransactionImple < ac, BasicAction: -53e5e9f0:e87f:51878ef5:b3c status: ActionStatus.RUNNING > in enlist!

            at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:623)
            at org.jboss.resource.connectionmanager.TxConnectionManager.transactionStarted(TxConnectionManager.java:394)
            at org.jboss.resource.connectionmanager.CachedConnectionManager.userTransactionStarted(CachedConnectionManager.java:350)
            at org.jboss.tm.usertx.UserTransactionRegistry.userTransactionStarted(UserTransactionRegistry.java:119)

            at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:141)

            at org.springframework.transaction.jta.JtaTransactionManager.doJtaBegin(JtaTransactionManager.java:863)

            at org.springframework.transaction.jta.JtaTransactionManager.doBegin(JtaTransactionManager.java:820)

            at org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:423)
            at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:347)
            at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
            at com.jc.cxc.ws.ax.process.CxCAXWsSendingProcessorR1$$EnhancerByCGLIB$$4481d594.saveDBI_IntegrationQueueCcxc2axSmry(<generated>)
            at com.jc.cxc.ws.ax.process.CxCAXWsSendingProcessorR1.documentProcess(CxCAXWsSendingProcessorR1.java:1022)

第二个事情是依然是类似的,在本地机和集成测试机上工作很好,在客户服务器上就提示错误:
java.lang.reflect.InvocationTargetException

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
                at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
                at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
                at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
                at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
                at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at com.jc.cxc.web.filter.SessionManageProcessingFilter.doFilter(SessionManageProcessingFilter.java:100)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at com.justcommodity.cxc.servlets.filters.CxcUsernamePasswordAuthenticationFilter.doFilter(CxcUsernamePasswordAuthenticationFilter.java:42)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at com.justcommodity.cxc.servlets.filters.GeneralFilter.doFilter(GeneralFilter.java:66)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError: org.jboss.resource.adapter.jdbc.jdk5.WrappedStatementJDK5.isClosed()Z
                at com.justcommodity.security.AutoAuthentication.initAuthenticationInfo(AutoAuthentication.java:75)
                at com.jc.springframework.security.context.CxcAuthentication.autoAuthenticationInfo(CxcAuthentication.java:28)
                at com.jc.cxc.ws.transrisk.service.CxcTransriskSenderR1.sendTransRiskData(CxcTransriskSenderR1.java:456)
                at com.justcommodity.cxc.jsp.admin.integration.transrisk.TransactionAction.sentTRData(TransactionAction.java:138)
                 50 more


最终发现了是用Jboss for Java5的version在Java6环境中。
检查的方式是:

To know if which JBoss 5 installed, check boot.log
- For jboss-5.1.0.GA-jdk6.zip file, the log will show date=200905221634
e.g
    20:34:31,522 INFO [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)
 

- For JDK5 compiled version you would see date=200905221053:
e.g 
    21:48:35,141 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)

posted on 2013-07-12 14:59 crazycy 阅读(1845) 评论(0)  编辑  收藏 所属分类: JavaEE技术


只有注册用户登录后才能发表评论。


网站导航: