[jBPM Development] - NPE when initiating StatefulKnowledgeSession
by Andrey Svalov
Andrey Svalov [https://community.jboss.org/people/ligett] created the discussion
"NPE when initiating StatefulKnowledgeSession"
To view the discussion, visit: https://community.jboss.org/message/755228#755228
--------------------------------------------------------------
Hi! I've been desperately trying to fix this code:
Environment: JBOSS AS 7.1.1
JBPM 5.3.0.Final
trying to run in the production mode, so using JTA.
public String getSomeText() {
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
EntityManagerFactory emf =
Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
// env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.TRANSACTION_MANAGER, getTransactionManager() );
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
int sessionId = ksession.getId();
ksession.startProcess( "MyProcess" );
ksession.dispose();
return "OK - new + " + sessionId;
}
public TransactionManager getTransactionManager() {
try {
TransactionManager result = (TransactionManager) new InitialContext()
.lookup("java:jboss/TransactionManager");
logger.debug("Transaction Manager found: " + (result != null));
return result; // always returns NOT null, so this one is OK
} catch (NamingException e) {
e.printStackTrace();
logger.error("failed!", e);
return null;
}
}
The error looks like this:
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:143)
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67)
org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
net.processmanager.DAO.bp.BusinessProcesses.getSomeText(BusinessProcesses.java:50)
net.processmanager.viewcontroller.JBPMTestAction.populateText(JBPMTestAction.java:42)
net.processmanager.viewcontroller.JBPMTestAction.list(JBPMTestAction.java:30)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
java.lang.Thread.run(Thread.java:662)
java.lang.reflect.InvocationTargetException
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129)
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67)
org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
net.processmanager.DAO.bp.BusinessProcesses.getSomeText(BusinessProcesses.java:50)
net.processmanager.viewcontroller.JBPMTestAction.populateText(JBPMTestAction.java:42)
net.processmanager.viewcontroller.JBPMTestAction.list(JBPMTestAction.java:30)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
java.lang.Thread.run(Thread.java:662)
java.lang.NullPointerException
org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory.isJoinableJtaTransaction(CMTTransactionFactory.java:63)
org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory.isJoinableJtaTransaction(CMTTransactionFactory.java:39)
org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.isTransactionJoinable(TransactionCoordinatorImpl.java:295)
org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1205)
org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:178)
org.hibernate.ejb.EntityManagerImpl.(EntityManagerImpl.java:89)
org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:179)
org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:174)
org.drools.persistence.jpa.JpaPersistenceContextManager.getApplicationScopedPersistenceContext(JpaPersistenceContextManager.java:55)
org.drools.persistence.SingleSessionCommandService.(SingleSessionCommandService.java:144)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129)
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67)
org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
net.processmanager.DAO.bp.BusinessProcesses.getSomeText(BusinessProcesses.java:50)
net.processmanager.viewcontroller.JBPMTestAction.populateText(JBPMTestAction.java:42)
net.processmanager.viewcontroller.JBPMTestAction.list(JBPMTestAction.java:30)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
java.lang.Thread.run(Thread.java:662)
If I run in USER_TRANSACTION (non-JTA) mode then the error looks more like here: https://community.jboss.org/thread/174386 https://community.jboss.org/thread/174386
I attached pom.xml and persistence.xml
Please help!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/755228#755228]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 9 months
[JBoss Transactions Development] - Re: JBoss Transaction Not Active - EJB 2.1 in JBOSS EAP 5.1.2
by Rodel Talampas
Rodel Talampas [https://community.jboss.org/people/limacon] created the discussion
"Re: JBoss Transaction Not Active - EJB 2.1 in JBOSS EAP 5.1.2"
To view the discussion, visit: https://community.jboss.org/message/755343#755343
--------------------------------------------------------------
Hi Mike,
Getting back to you again. We identified the issue of the problem but we are stucked on what direction to go. The original developers of the code put in some logic (db handling) on the ejbPassivate callback method. In this method (which you see above) has a indirect call to getConnection which causes the error.
public void ejbPassivate()
{
......// SOME CODE HERE {
* *JobJDBCMgr* m_mgr = (JobJDBCMgr) getJDBCManager();*
byte[] rawActiveJob = null;
try
{
rawActiveJob = m_activeJob.toByteArray();
}
catch( IOException e )
{
throw new EJBException( e );
}
*m_mgr.updateWithActiveJob(getJobData(), rawActiveJob, getId() );*
......// SOME CODE HERE
}
else
......// SOME CODE HERE
}
......// SOME CODE HERE
}
Most of the ejbCallBack methods have their own method variable JobJDBCMgr. I tried to create CLASS level JDBC manager and it did solve the problem.. (*TEMPORARILY*). This solution is working for some logic flow but NOT for all business logic (processes that takes around few seconds (10 secs or more)). Why I created a Class level variable - I want to retain the instance of the JobJDBCMgr Object when the Bean is pushed into the POOL.
Do you have any idea on how to resolve this issue? My timeout is set to a very high value (42000).
Hoping for your reply.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/755343#755343]
Start a new discussion in JBoss Transactions Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 9 months
[JBoss Tools Development] - Developing for JBoss Tools
by Rob Stryker
Rob Stryker [https://community.jboss.org/people/rob.stryker] modified the document:
"Developing for JBoss Tools"
To view the document, visit: https://community.jboss.org/docs/DOC-21381
--------------------------------------------------------------
JBoss Tools is a large conglomerate of plugins and components from many different locations. This page will help committers and hackers navigate the process of setting up a development environment, contribute patches, and navigate any approval processes required.
*Development Environment*
The first thing any developers will want to know is https://community.jboss.org/docs/DOC-18124 How to set up your development environment. This involves choosing which eclipse you'll want to install, your choices of java, subversion, eclipse target platform, which parts of the svn tree to checkout, and how to run tests from inside your IDE.
*Building JBoss Tools
*
Not all contributors will want to go through the trouble, but, if you really want to make sure your changes work the same in PDE's runtime environment (inside eclipse) as they do from a tycho build, which is the build system we use, you'll also want to try to build your project via the command line. You'll be able to set up your first builds by reading How to build JBoss Tools with Maven 3 (https://community.jboss.org/docs/DOC-16604). All committers are expected to build their component locally and verify the tests still pass before committing any major patches.
Sometimes, running your test suite in PDE vs in Tycho (command line build) have different results in the test suite. This is unfortunate, but it *does* happen. If you're getting inconsistant results, and really need to figure out what's going wrong, you'll want to read about https://community.jboss.org/docs/DOC-15209 Using Eclipse for Remote Debugging Tycho Build.
*Submitting / Committing patches*
All commits should reference a jira. All committers are required to have a jira target in every svn commit message. This helps keep our history easy to trace back through when searching for regressions. This helps keep us aware of what use cases caused the regression, and what to look out for and re-test when reverting or re-fixing an issue. Without a jira reference, if "fixing" one regression might create a new one, we'll have no way to find out why the change was committed in the first place, or what the change thought it was fixing.
In general, the process for submitting / committing a patch is:
1) Open a jira describing the bug
2) Attach the patch to the jira.
3) If you are a core developer,
a) simply commit the patch. Otherwise,
b) assign the issue to the component lead asking for approval and assistence in committing.
4) Resolve the issue as "done". Make sure to target the fix version accurately.
Try to make sure your description, or at least a closing comment, reference exactly how to replicate the issue, so that QE can verify that the issue is fixed. This also helps maintain the integrity of our code.
*What happens after a commit?*
For those very curious contributors, core developers, or testers, This Image (/servlet/JiveServlet/downloadImage/102-18462-4-18759/HowWeBuild_Diagram.png) shows what happens in our infrastructure upon a commit. In short, a hudson jobs get kicked off to build the component, and rebuild any components that depend on it, and push all changes to update sites. You can get a good look at what update sites are used and where over at this (https://community.jboss.org/docs/DOC-18462) article. Knowing what update site to use is very useful for anyone using bleeding-edge nightly builds.
*Documentation*
Committers and component owners are expected to keep their documentation up to date.They will also need to learn how to https://community.jboss.org/docs/DOC-13341 Build their Documentation.
*Other development tasks*
Working with branches is also a bit complicated, since our build system may (depending on the flags used) install items into your maven repository. The Working with Branches (https://community.jboss.org/docs/DOC-17497) article will be very helpful here.
*
*
There are other more complicated development tasks that require much more approvals than a simple commit. Creating or removing top-level components from our svn tree have processes associated with them (or will soon ;) ). Moving plugins, tests, or features between components also require such approvals.
*
*
1) Adding a new top-level component: Approval Process and Technical Process (TODO)
2) Adding a plugin, feature, or test, to a component: Approval Processt (https://community.jboss.org/docs/DOC-21382) and Technical Process (https://community.jboss.org/docs/DOC-18373) (TODO)
3) Deleting a plugin, feature, or test, from a component: Approval Process and Technical Process (TODO)
4) Deleting a top-level component: Approval Proces and Technical Process (TODO)
5) Moving a plugin, feature, or test, from one component to another: Approval Process and Technical Process (TODO)
6) Adding a different component as a dependency to your component. Approval Process and Technical Process (TODO)
7) Addition of external dependencies requiring an adjustment to target platform: Approval Process and Technical Process (TODO)
Some of these tasks may not seem complicated, but, they still require wide distribution and notification on the proper mailing lists, and in some cases, followup jiras to the build team. While adding a component as a dependency to your plugin might seem simple, it has the potential to cause circular dependencies, or simply cause extra builds and waste resources. Often, the build team needs to be alerted to these changes to adjust their cascading builds scripts and properly position your jobs where they belong.
*Maintenance and Rampdown procedures*
*
*
Maintenance releases typically contain only bug-fixes, with no additional features. While there is no official process declared yet, in general, maintenance patches require approval from PM or at the very least another committer on the same component. During rampdown for a major release, such as during candidate releases, similar restrictions are in place. Look here for more information in the future.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-21381]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 9 months
[JBoss Tools Development] - Approval Process for Adding A Plugin and or Feature To An Existing Component
by Rob Stryker
Rob Stryker [https://community.jboss.org/people/rob.stryker] created the document:
"Approval Process for Adding A Plugin and or Feature To An Existing Component"
To view the document, visit: https://community.jboss.org/docs/DOC-21382
--------------------------------------------------------------
Adding a plugin or feature to an existing component requires some level of consensus on why the plugin is needed. In general, the component lead will be given plenty of space to manage their plugins as they wish, however, many plugins have been poorly defined in the past, leading to entire features or plugins holding only a few classes that could easily be stored in a new package of an existing plugin.
When requesting approval for a new plugin, please fill out the following template and paste it into the appropriate jira:
*Request Template*
*
*
1) Explain the scope of the new plugin. This scope will be binding throughout the life of the plugin. (ex: a plugin for integration of plugin X and plugin Y, or, a standalone service to be accessible by others through an interface that does xyz). This scope must be specific enough to avoid dumping-ground plugins tht grow with no limit, but also not be so restrictive as to make the plugin so narrowly defined that it is not useful.
2) Is there any other plugin in the same component with an overlapping scope? If so, which plugins?
3) If there is an overlap, is there some technical reason the new plugin or feature is required?
4) If there is no technical reason for the new plugin, would the code fit more appropriately inside an existing plugin instead?
5) What is the expected size of the plugin, now and in the future. (ie, one or two classes to provide a dialog to the user, or, many classes providing a model for xyz and will grow as new features are added, or, unlimited home for all utilities depending on (some subset) of eclipse packages. )
6) What are the expected upstream dependencies of the plugin (webtools, gef, astools, org.eclipse.team, etc)
7) Give a brief technical overview.
*Get Approvals*
*
*
Once these questions are answered, approvals are to be requested from:
1) The component lead, and
2) The project management
Approvals must be granted in the form of a +1 on the jira. To acquire the project management approvals, you may choose to assign the task to a project manager, or email the jbosstools-dev list. Alerting the lists for every new plugin is not required, but is a very nice gesture. You may find contributors come out to add some of their code to a new more central location after hearing about the new plugin and it's pre-defined scope.
Typically, approvals for new plugins or features will not be granted during a "rampdown" period, as we get close to a major release, without some strong technical issues requriing the creation of a new plugin.
Once these approvals are granted, you will want to move on to the https://community.jboss.org/docs/DOC-18373 Technical Side of adding a new plugin and feature.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-21382]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 9 months
[JBoss Tools Development] - Adding a Plugin (and/or Feature) To An Existing Component
by Rob Stryker
Rob Stryker [https://community.jboss.org/people/rob.stryker] modified the document:
"Adding a Plugin (and/or Feature) To An Existing Component"
To view the document, visit: https://community.jboss.org/docs/DOC-18373
--------------------------------------------------------------
+First, read this document on how to build JBoss Tools components locally: https://community.jboss.org/docs/DOC-16604 https://community.jboss.org/wiki/HowtoBuildJBossToolswithMaven3+
| *+Before adding a complete new feature to JBoss Tools announce the addition on jbosstools-dev <jbosstools-dev(a)lists.jboss.org > with reasons WHY+* *+a new feature is needed and what new (if any) dependencies it will bring in. New dependencies need to be added to the target platforms, and thus should be reported in JIRA for tracking and task assignment purposes.+*
*+Note too that new features will often start in+ JBoss Tools +but NOT be included in+ JBoss Developer Studio +until they have had time to mature. If your new feature needs to be in both offerings, please be sure to explain WHY when contacting the above mailing list.+* |
h2. Adding a new plugin or feature to JBoss Tools
Now that you can build your component, you can easily add a new plugin to that component. Here's how.
0. Make sure your new plugin compiles in your workspace. Ensure your MANIFEST.MF contains all references/includes/requirements you need. Be sure to set the correct Bundle-RequireExecutionEnvironment (eg., JDK5 or JDK6).
1. When you are satisfied, you can commit your new plugin project to SVN.
cd ~/trunk/as/plugins; \
svn add org.jboss.ide.eclipse.as.rse.core; \
svn ci -m "JBIDE-123456 Initial commit of new as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core
2. Next, add a pom.xml file to the root of your new project.
You can use m2eclipse to help w/ this if you have it installed; otherwise copy from another existing plugin project and edit appropriately. The version of the pom should match the version in the manifest.mf. Note that 3.2.0.qualifier (in MANIFEST.MF) is equivalent to 3.2.0-SNAPSHOT in the pom.xml.
3. Build your plugin:
cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core; \
mvn3 clean install
4. If your component's new plugin builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:
vi ~/trunk/as/plugins/pom.xml
5. To ensure that your plugin is available on the update site, be sure that it is contained in at least one feature's feature.xml.
vi ~/trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
6. If necessary, create a new feature to contain the new plugin - easiest approach is to copy an existing feature project, and string-replace the various files until it suits your needs. Don't forget to update .project and other hidden files.
svn add org.jboss.ide.eclipse.as.new.feature; \
svn ci -m "JBIDE-123456 Initial commit of new as.new feature" org.jboss.ide.eclipse.as.new.feature
7. If your component's new feature builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:
vi ~/trunk/as/features/pom.xml
h3. Verifying your new feature/plugin can be built and installed:
8. Next, ensure that the feature appears in all appropriate JBoss Tools update sites:
vi ~/trunk/as/site/category.xml # (the component's update site)
+
+
+ and one of the following+
vi ~/trunk/build/aggregate/site/site.xml # (the JBoss Tools aggregate update site)
vi ~/trunk/build/aggregate/coretests-site/site.xml # (the JBoss Tools aggregate update site for test plugins)
+
+
+ or one of these two sites:+
vi ~/trunk/build/aggregate/soa-site/site/site.xml # (the JBoss Tools aggregate update site for SOA Tooling)
vi ~/trunk/build/aggregate/soatests-site/site/site.xml # (the JBoss Tools aggregate update site for SOA Tooling test plugins)
+ Note: for *AS, and any DEPENDENCIES of AS,* you MAY want to add your new feature to this site too, if and only if astools makes use of that plugin / feature:+
vi ~/trunk/build/aggregate/webtools-site/site.xml # (the JBoss Tools aggregate update site for WTP adapters)
9. Finally, build the sites locally to ensure the XML is valid and the contents appear correctly. You can then install the new feature from the sites into Eclipse or JBDS to verify it runs as expected (no missing dependencies which prevent the plugin from being activated, no missing metadata such as description, provider, license or copyright while installing, etc.)
cd ~/trunk/as/; mvn clean install; # then point Eclipse at ~/trunk/as/site/target/repository/
+ and+
cd ~/trunk/build/aggregate/site; mvn clean install; # then point Eclipse at ~/trunk/build/aggregate/site/target/site/
h2.
h2. Adding a new plugin or feature to JBoss Developer Studio
10. Next, ensure that the feature appears in all appropriate JBoss Developer Studio update site:
vi ~/devstudio/trunk/product/site/site.xml # (the JBoss Developer Studio aggregate update site)
vi ~/devstudio/trunk/product-soa/site/site.xml # (the JBoss Developer Studio aggregate update site for SOA Tooling)
11. If you added a new feature, be sure that the feature is included in the JBDS feature (or wrapped inside another feature) so that it will appear in the installer.
vi ~/devstudio/trunk/product/features/com.jboss.jbds.product.feature/feature.xml
h3.
h3. Verifying your new feature/plugin can be built and installed:
12. Finally, build the sites locally to ensure the XML is valid and the contents appear correctly. You can then install the new feature from the sites into Eclipse or JBDS to verify it runs as expected (no missing dependencies which prevent the plugin from being activated, no missing metadata such as description, provider, license or copyright while installing, etc.)
*
*
cd ~/devstudio/trunk/product; mvn clean install -f pom-site-and-product.xml; # then point JBDS at
# ~/devstudio/trunk/product/features/com.jboss.jbds/target/repository/ (search for "Branded Product" feature, *com.jboss.jbds.all*)*
+ or+
cd ~/devstudio/trunk/product-soa; mvn clean install; # then point JBDS at ~/devstudio/trunk/product-soa/site/target/site/
+* - The product site in ~/devstudio/trunk/product/site/target/site/ does not contain the "Branded Product" feature, *com.jboss.jbds.all*, so you cannot use that site to update an existing JBDS install, only an Eclipse install.+
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-18373]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 9 months
[JBoss Tools Development] - Developing for JBoss Tools
by Rob Stryker
Rob Stryker [https://community.jboss.org/people/rob.stryker] modified the document:
"Developing for JBoss Tools"
To view the document, visit: https://community.jboss.org/docs/DOC-21381
--------------------------------------------------------------
JBoss Tools is a large conglomerate of plugins and components from many different locations. This page will help committers and hackers navigate the process of setting up a development environment, contribute patches, and navigate any approval processes required.
*Development Environment*
The first thing any developers will want to know is https://community.jboss.org/docs/DOC-18124 How to set up your development environment. This involves choosing which eclipse you'll want to install, your choices of java, subversion, eclipse target platform, which parts of the svn tree to checkout, and how to run tests from inside your IDE.
*Building JBoss Tools
*
Not all contributors will want to go through the trouble, but, if you really want to make sure your changes work the same in PDE's runtime environment (inside eclipse) as they do from a tycho build, which is the build system we use, you'll also want to try to build your project via the command line. You'll be able to set up your first builds by reading How to build JBoss Tools with Maven 3 (https://community.jboss.org/docs/DOC-16604). All committers are expected to build their component locally and verify the tests still pass before committing any major patches.
Sometimes, running your test suite in PDE vs in Tycho (command line build) have different results in the test suite. This is unfortunate, but it *does* happen. If you're getting inconsistant results, and really need to figure out what's going wrong, you'll want to read about https://community.jboss.org/docs/DOC-15209 Using Eclipse for Remote Debugging Tycho Build.
*Submitting / Committing patches*
All commits should reference a jira. All committers are required to have a jira target in every svn commit message. This helps keep our history easy to trace back through when searching for regressions. This helps keep us aware of what use cases caused the regression, and what to look out for and re-test when reverting or re-fixing an issue. Without a jira reference, if "fixing" one regression might create a new one, we'll have no way to find out why the change was committed in the first place, or what the change thought it was fixing.
In general, the process for submitting / committing a patch is:
1) Open a jira describing the bug
2) Attach the patch to the jira.
3) If you are a core developer,
a) simply commit the patch. Otherwise,
b) assign the issue to the component lead asking for approval and assistence in committing.
4) Resolve the issue as "done". Make sure to target the fix version accurately.
Try to make sure your description, or at least a closing comment, reference exactly how to replicate the issue, so that QE can verify that the issue is fixed. This also helps maintain the integrity of our code.
*What happens after a commit?*
For those very curious contributors, core developers, or testers, This Image (/servlet/JiveServlet/downloadImage/102-18462-4-18759/HowWeBuild_Diagram.png) shows what happens in our infrastructure upon a commit. In short, a hudson jobs get kicked off to build the component, and rebuild any components that depend on it, and push all changes to update sites. You can get a good look at what update sites are used and where over at this (https://community.jboss.org/docs/DOC-18462) article. Knowing what update site to use is very useful for anyone using bleeding-edge nightly builds.
*Documentation*
Committers and component owners are expected to keep their documentation up to date.They will also need to learn how to https://community.jboss.org/docs/DOC-13341 Build their Documentation.
*Other development tasks*
Working with branches is also a bit complicated, since our build system may (depending on the flags used) install items into your maven repository. The Working with Branches (https://community.jboss.org/docs/DOC-17497) article will be very helpful here.
*
*
There are other more complicated development tasks that require much more approvals than a simple commit. Creating or removing top-level components from our svn tree have processes associated with them (or will soon ;) ). Moving plugins, tests, or features between components also require such approvals.
*
*
1) Adding a new top-level component: Approval Process and Technical Process (TODO)
2) Adding a plugin, feature, or test, to a component: Approval Process and Technical Process (https://community.jboss.org/docs/DOC-18373) (TODO)
3) Deleting a plugin, feature, or test, from a component: Approval Process and Technical Process (TODO)
4) Deleting a top-level component: Approval Proces and Technical Process (TODO)
5) Moving a plugin, feature, or test, from one component to another: Approval Process and Technical Process (TODO)
6) Adding a different component as a dependency to your component. Approval Process and Technical Process (TODO)
7) Addition of external dependencies requiring an adjustment to target platform: Approval Process and Technical Process (TODO)
Some of these tasks may not seem complicated, but, they still require wide distribution and notification on the proper mailing lists, and in some cases, followup jiras to the build team. While adding a component as a dependency to your plugin might seem simple, it has the potential to cause circular dependencies, or simply cause extra builds and waste resources. Often, the build team needs to be alerted to these changes to adjust their cascading builds scripts and properly position your jobs where they belong.
*Maintenance and Rampdown procedures*
*
*
Maintenance releases typically contain only bug-fixes, with no additional features. While there is no official process declared yet, in general, maintenance patches require approval from PM or at the very least another committer on the same component. During rampdown for a major release, such as during candidate releases, similar restrictions are in place. Look here for more information in the future.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-21381]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 9 months