[JBoss JIRA] Commented: (JBPM-681) GraphElement.raiseException results in Exception with Java EE
by Bernd Ruecker (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-681?page=comments#action_12418491 ]
Bernd Ruecker commented on JBPM-681:
------------------------------------
Damn, the "node.hbm.xml" was not changed (maybe forgotten by me?). So this is still an issue in jbpm 3.2.3 with nodes... Solved in head.
> GraphElement.raiseException results in Exception with Java EE
> -------------------------------------------------------------
>
> Key: JBPM-681
> URL: http://jira.jboss.com/jira/browse/JBPM-681
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Affects Versions: jBPM 3.1.1
> Environment: Java EE with JTA
> Reporter: Bernd Ruecker
> Assigned To: Tom Baeyens
> Priority: Critical
> Fix For: jBPM jPDL 3.2.2
>
>
> If you
> - invoke a SessionBean in a jbpm action
> - jBPM and the SessionBean run in the same JTA transaction
> - a Exception occurs
> Then the Transaction is marked for rollback from the EJB-Container when the Exception occurs in the SessionBean.
> Now jBPM wants to handle the Exception (see http://docs.jboss.com/jbpm/v3/userguide/processmodelling.html#exceptionha...):
> When an exception occurs in a delegation class, the process element parent hierarchy is serached for an appropriate exception-handler. When it is found, the actions of the exception-handler are executed
> But becaue the transaction is already marked for rollback, a call to Hibernate (lazy loading?) results in a exception:
> 7:14:29,875 INFO [DefaultLoadEventListener] Error performing load command
> org.hibernate.exception.GenericJDBCException: Cannot open connection
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103
> )
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
> at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
> at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
> at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
> at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
> at org.hibernate.loader.Loader.doQuery(Loader.java:661)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
> at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
> at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
> at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
> at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2821)
> at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.jav
> a:370)
> at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:351)
> at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:122)
> at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:81)
> at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871)
> at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:829)
> at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
> at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:160)
> at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$cb896060.equals(<generated>)
> at org.jbpm.util.EqualsUtil.equals(EqualsUtil.java:30)
> at org.jbpm.graph.def.GraphElement.equals(GraphElement.java:418)
> at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
> at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$78d101e.equals(<generated>)
> at org.jbpm.graph.def.Transition.getParent(Transition.java:204)
> at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:338)
> at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:248)
> at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:212)
> at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:182)
> at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:166)
> at org.jbpm.graph.def.Transition.take(Transition.java:106)
> at org.jbpm.graph.def.Node.leave(Node.java:382)
> at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:198)
> at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
> at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$cb896060.leave(<generated>)
> at org.jbpm.graph.exe.Token.signal(Token.java:174)
> at org.jbpm.graph.exe.Token.signal(Token.java:145)
> at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
> at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$fae2cddc.signal(<generated>)
> at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:420)
> at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:359)
> at org.jbpm.taskmgmt.exe.TaskInstance$$FastClassByCGLIB$$cb2c21af.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
> at org.jbpm.taskmgmt.exe.TaskInstance$$EnhancerByCGLIB$$cbd8230f.end(<generated>)
> at com.camunda.toolkit.jbpm.service.AdminServicesImpl.endTask(AdminServicesImpl.java:1452)
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 6 months
[JBoss JIRA] Created: (JBPM-1257) Basic node sequence
by Thomas Diesler (JIRA)
Basic node sequence
-------------------
Key: JBPM-1257
URL: http://jira.jboss.com/jira/browse/JBPM-1257
Project: JBoss jBPM
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Reporter: Thomas Diesler
Assigned To: Thomas Diesler
Fix For: jBPM jPDL 3.2.4
String jpdl =
"<process-definition>" +
" <start-state>" +
" <transition to='stateA' />" +
" </start-state>" +
" <state name='stateA'>" +
" <transition to='end' />" +
" </state>" +
" <end-state name='end' />" +
"</process-definition>";
public void testBasicSequence() throws Exception {
// Locate the ProcessEngine
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
// Create a ProcessDefinition through the ProcessDefinitionManager
ProcessDefinitionManager pdm = engine.getProcessDefinitionManager();
ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
// Create a ProcessInstance through the ProcessInstanceManager
ProcessInstanceManager pim = engine.getProcessInstanceManager();
ProcessInstance pi = pim.createProcessInstance(pd);
// Create an Execution through the ExecutionManager
ExecutionManager pem = engine.getExecutionManager();
Execution ex = pem.createExecution(pi);
// Signal the execution
ex.signal();
// Verify the nodes
Node expNode = pd.findNode("stateA");
Node wasNode = ex.getNode();
assertEquals(expNode, wasNode);
assertEquals(expNode.getName(), wasNode.getName());
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 6 months
[JBoss JIRA] Resolved: (JBPM-696) Field Instanciator problems
by Alejandro Guizar (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-696?page=all ]
Alejandro Guizar resolved JBPM-696.
-----------------------------------
Fix Version/s: jBPM jPDL 3.2.4
(was: jBPM jPDL 3.2 alpha 2)
(was: jBPM 3.1.3)
Resolution: Done
Added support for concrete collection implementations to FieldInstantiator, plus support for interfaces SortedSet and SortedMap
> Field Instanciator problems
> ---------------------------
>
> Key: JBPM-696
> URL: http://jira.jboss.com/jira/browse/JBPM-696
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Affects Versions: jBPM 3.1.1
> Environment: WinXP, Linux running on JBoss Application Server 4.0.3SP1, JDK1.5.0_06
> Reporter: Shai Bentin
> Assigned To: Alejandro Guizar
> Priority: Minor
> Fix For: jBPM jPDL 3.2.4
>
>
> The method getValue() is see two problems, one is jdk5 related the other is just an idea.
> In jdk5 doing if (type.isAssignableFrom(Set.class)) and such yields a 'false' even when it is supposed to be true...
> if we would write the same if in reverse:
> Set.class.isAssignableFrom(type) we will ge the desired reuslt.
> The other issue is, if we know the super type why do we impose a specific implementation, i.e. if we have a Collection, why do we impose an ArrayList. We have the user's type and we know it is of type collection so why don't we instanciate the requested type....
> Here is how I propose to write this method:
> public static Object getValue(Class type, Element propertyElement) {
> // parse the value
> Object value = null;
> try {
>
> if ( type == String.class ) {
> value = propertyElement.getText();
> } else if ( (type==Integer.class) || (type==int.class) ) {
> value = new Integer( propertyElement.getTextTrim() );
> } else if ( (type==Long.class) || (type==long.class) ) {
> value = new Long( propertyElement.getTextTrim() );
> } else if ( (type==Float.class ) || (type==float.class) ) {
> value = new Float( propertyElement.getTextTrim() );
> } else if ( (type==Double.class ) || (type==double.class) ) {
> value = new Double( propertyElement.getTextTrim() );
> } else if ( (type==Boolean.class ) || (type==boolean.class) ) {
> value = Boolean.valueOf( propertyElement.getTextTrim() );
> } else if ( (type==Character.class ) || (type==char.class) ) {
> value = new Character( propertyElement.getTextTrim().charAt(0) );
> } else if ( (type==Short.class ) || (type==short.class) ) {
> value = new Short( propertyElement.getTextTrim() );
> } else if ( (type==Byte.class ) || (type==byte.class) ) {
> value = new Byte( propertyElement.getTextTrim() );
> } else if (List.class.isAssignableFrom(type)) {
> value = getCollection(propertyElement, (List)type.newInstance());
> } else if (Set.class.isAssignableFrom(type)) {
> value = getCollection(propertyElement, (Set)type.newInstance());
> } else if (Collection.class.isAssignableFrom(type)) {
> value = getCollection(propertyElement, (Collection)type.newInstance());
> } else if (Map.class.isAssignableFrom(type)) {
> value = getMap(propertyElement, (Map)type.newInstance());
> } else if ( type==Element.class ) {
> value = propertyElement;
> } else {
> Constructor constructor = type.getConstructor(new Class[]{String.class});
> if ( (propertyElement.isTextOnly())
> && (constructor!=null) ) {
> value = constructor.newInstance(new Object[]{propertyElement.getTextTrim()});
> }
> }
> } catch (Exception e) {
> log.error("couldn't parse the bean property value '" + propertyElement.asXML() + "' to a '" + type.getName() + "'" );
> throw new JbpmException( e );
> }
> return value;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 6 months
[JBoss JIRA] Reopened: (JBPM-696) Field Instanciator problems
by Alejandro Guizar (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-696?page=all ]
Alejandro Guizar reopened JBPM-696:
-----------------------------------
Assignee: Alejandro Guizar (was: Tom Baeyens)
I see problems with both the current code and your proposed fix.
The current code fails for the declaration below, because it will try to assign a HashMap to a Hashtable.
Hashtable keyCodes;
The proposed fix actually makes things worse because the following declaration is the common case. Class.newInstance() fails for interfaces.
Map keyCodes;
The definitive solution should address both scenarios.
> Field Instanciator problems
> ---------------------------
>
> Key: JBPM-696
> URL: http://jira.jboss.com/jira/browse/JBPM-696
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Affects Versions: jBPM 3.1.1
> Environment: WinXP, Linux running on JBoss Application Server 4.0.3SP1, JDK1.5.0_06
> Reporter: Shai Bentin
> Assigned To: Alejandro Guizar
> Priority: Minor
> Fix For: jBPM jPDL 3.2 alpha 2, jBPM 3.1.3
>
>
> The method getValue() is see two problems, one is jdk5 related the other is just an idea.
> In jdk5 doing if (type.isAssignableFrom(Set.class)) and such yields a 'false' even when it is supposed to be true...
> if we would write the same if in reverse:
> Set.class.isAssignableFrom(type) we will ge the desired reuslt.
> The other issue is, if we know the super type why do we impose a specific implementation, i.e. if we have a Collection, why do we impose an ArrayList. We have the user's type and we know it is of type collection so why don't we instanciate the requested type....
> Here is how I propose to write this method:
> public static Object getValue(Class type, Element propertyElement) {
> // parse the value
> Object value = null;
> try {
>
> if ( type == String.class ) {
> value = propertyElement.getText();
> } else if ( (type==Integer.class) || (type==int.class) ) {
> value = new Integer( propertyElement.getTextTrim() );
> } else if ( (type==Long.class) || (type==long.class) ) {
> value = new Long( propertyElement.getTextTrim() );
> } else if ( (type==Float.class ) || (type==float.class) ) {
> value = new Float( propertyElement.getTextTrim() );
> } else if ( (type==Double.class ) || (type==double.class) ) {
> value = new Double( propertyElement.getTextTrim() );
> } else if ( (type==Boolean.class ) || (type==boolean.class) ) {
> value = Boolean.valueOf( propertyElement.getTextTrim() );
> } else if ( (type==Character.class ) || (type==char.class) ) {
> value = new Character( propertyElement.getTextTrim().charAt(0) );
> } else if ( (type==Short.class ) || (type==short.class) ) {
> value = new Short( propertyElement.getTextTrim() );
> } else if ( (type==Byte.class ) || (type==byte.class) ) {
> value = new Byte( propertyElement.getTextTrim() );
> } else if (List.class.isAssignableFrom(type)) {
> value = getCollection(propertyElement, (List)type.newInstance());
> } else if (Set.class.isAssignableFrom(type)) {
> value = getCollection(propertyElement, (Set)type.newInstance());
> } else if (Collection.class.isAssignableFrom(type)) {
> value = getCollection(propertyElement, (Collection)type.newInstance());
> } else if (Map.class.isAssignableFrom(type)) {
> value = getMap(propertyElement, (Map)type.newInstance());
> } else if ( type==Element.class ) {
> value = propertyElement;
> } else {
> Constructor constructor = type.getConstructor(new Class[]{String.class});
> if ( (propertyElement.isTextOnly())
> && (constructor!=null) ) {
> value = constructor.newInstance(new Object[]{propertyElement.getTextTrim()});
> }
> }
> } catch (Exception e) {
> log.error("couldn't parse the bean property value '" + propertyElement.asXML() + "' to a '" + type.getName() + "'" );
> throw new JbpmException( e );
> }
> return value;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 6 months