[JBoss jBPM] - Easy One : Creating Testcase Swimlane Assignments
by JerWah
Ok,
I apologize in advance. I have been searching around for hours and haven't come up with anything, since this has got to be something easy, I can only conclude that I am being stupid.
So I am trying to setup a very simple Junit testcase for a process which includes a couple of task nodes assigned to a swimlane.
I setup things using the eclipse "Process Project" template, which it nicely sets up a hibernate.cfg.xml to pointing to:
jdbc:hsqldb:mem:.
(One time use memory db??)
When I run my testcase I get the DelegationException below which I am quite sure is because it can't find the user I specified in the swimlane
So the question is, how do I set it up so that the users get added each time I run the JUnit test?
| org.jbpm.graph.def.DelegationException
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:208)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.getInitializedSwimlaneInstance(TaskMgmtInstance.java:176)
| at org.jbpm.taskmgmt.exe.TaskInstance.assign(TaskInstance.java:192)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:148)
| at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:167)
| at org.jbpm.graph.def.Node.enter(Node.java:316)
| at org.jbpm.graph.def.Transition.take(Transition.java:119)
| at org.jbpm.graph.def.Node.leave(Node.java:383)
| at org.jbpm.graph.def.Node.leave(Node.java:358)
| at org.jbpm.graph.node.Fork.execute(Fork.java:134)
| at org.jbpm.graph.def.Node.enter(Node.java:316)
| at org.jbpm.graph.def.Transition.take(Transition.java:119)
| at org.jbpm.graph.def.Node.leave(Node.java:383)
| at org.jbpm.graph.node.StartState.leave(StartState.java:70)
| at org.jbpm.graph.exe.Token.signal(Token.java:174)
| at org.jbpm.graph.exe.Token.signal(Token.java:123)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:217)
| at org.kbtoys.jrw.SimpleTest.testProcess(SimpleTest.java:25)
| 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:585)
| at junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.framework.TestSuite.runTest(TestSuite.java:208)
| at junit.framework.TestSuite.run(TestSuite.java:203)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: couldn't resolve assignment expression 'user(grover)'
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:97)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentDelegation(TaskMgmtInstance.java:217)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:193)
| ... 35 more
| Caused by: java.lang.RuntimeException: no active JbpmContext for resolving assignment expression'user(grover)'
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.getExpressionSession(ExpressionAssignmentHandler.java:109)
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:69)
| ... 37 more
|
|
Thanks!
Jeremy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966837#3966837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966837
19 years, 8 months
[JBoss/Spring Integration] - JNDI implementation returned null used Jboss jndi
by chikai_sz
Jboss version: jboss-4.0.3SP1
Spring version: 1.2.6
Hibernate version: 3.0.5
I configured the mysql-ds.xml in Jboss deploy directory which had deployed my application:
mysql-ds.xml ->
<local-tx-datasource>
<jndi-name>jdbc/plato</jndi-name>
<connection-url>jdbc:mysql://localhost:3307/plato</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
root
<exception-sorter-class-name>
org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
</exception-sorter-class-name>
<type-mapping>mySQL</type-mapping>
</local-tx-datasource>
The configuration files in plato.ear\META-INF listed as below:
application.xml ->
<web-uri>plato.war</web-uri>
<context-root>plato</context-root>
jboss-app.xml ->
<jboss-app>
platoEntity.har
</jboss-app>
The platoEntity.har existed in plato.ear and there was a jboss-service.xml existed in platoEntity.har/META-INF directory:
jboss-service.xml ->
java:/jdbc/plato
java:/hibernate/SessionFactory
org.hibernate.dialect.MySQLInnoDBDialect
org.hibernate.cache.HashtableCacheProvider
true
And I inject the jndi object in applicationContext-hibernate.xml that existed in WEB-INF directory:
applicationContext-hibernate.xml ->
<bean id="sessionFactory" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
java:/hibernate/SessionFactory
Error occured when I start jboss server:
21:00:50,000 INFO [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/SessionFactory]
21:00:50,046 INFO [TomcatDeployer] deploy, ctxPath=/plato, warUrl=.../deploy/plato.ear/plato.war/
21:00:50,406 INFO [WebappClassLoader] validateJarFile(D:\Application Server\jboss-4.0.3SP1\server\default\.\deploy\plato.ear\plato.war\WEB-INF\lib\jsdk23.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
21:00:50,953 INFO [ContextLoader] Root WebApplicationContext: initialization started
21:00:50,953 INFO [[/plato]] Loading Spring root WebApplicationContext
21:00:51,437 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [WEB-INF/applicationContext-hibernate.xml]
21:00:53,859 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [WEB-INF/applicationContext-service.xml]
21:00:54,328 INFO [WebClassPathXmlApplicationContext] Bean factory for application context [org.framework.core.web.spring.WebClassPathXmlApplicationContext;hashCode=2438443]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,sessionFactory,transactionManager,userDAO,platoMessagesDAO,mediaDAO,attachmentDAO,friendDAO,groupDAO,lovePassDAO,flirtContentDAO,favoriteDAO,adminUserDAO,adminPermissionDAO,systemDAO,engagementDAO,appointmentDAO,orderDAO,mailEngine,mailSender,velocityEngine,mailMessage,mailManager,txProxyTemplate,cacheManagerService,userManager,platoMessagesManager,mediaManager,attachmentManager,friendManager,groupManager,lovePassManager,flirtContentManager,favoriteManager,adminUserManager,adminPermissionManager,engagementManager,appointmentManager,orderManager,systemManager]; root of BeanFactory hierarchy
21:00:54,406 INFO [WebClassPathXmlApplicationContext] 40 beans defined in application context [org.framework.core.web.spring.WebClassPathXmlApplicationContext;hashCode=2438443]
21:00:54,734 INFO [PropertyPlaceholderConfigurer] Loading properties file from class path resource [main.properties]
21:00:54,812 INFO [CollectionFactory] JDK 1.4+ collections available
21:00:54,843 INFO [WebClassPathXmlApplicationContext] Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@ced1ac]
21:00:54,859 INFO [WebClassPathXmlApplicationContext] Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@1d66aa9]
21:00:54,875 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,sessionFactory,transactionManager,userDAO,platoMessagesDAO,mediaDAO,attachmentDAO,friendDAO,groupDAO,lovePassDAO,flirtContentDAO,favoriteDAO,adminUserDAO,adminPermissionDAO,systemDAO,engagementDAO,appointmentDAO,orderDAO,mailEngine,mailSender,velocityEngine,mailMessage,mailManager,txProxyTemplate,cacheManagerService,userManager,platoMessagesManager,mediaManager,attachmentManager,friendManager,groupManager,lovePassManager,flirtContentManager,favoriteManager,adminUserManager,adminPermissionManager,engagementManager,appointmentManager,orderManager,systemManager]; root of BeanFactory hierarchy]
21:00:55,171 WARN [SessionFactoryObjectFactory] Not found: 4028818a0d2bab35010d2bab4fb00000
21:00:55,171 INFO [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,sessionFactory,transactionManager,userDAO,platoMessagesDAO,mediaDAO,attachmentDAO,friendDAO,groupDAO,lovePassDAO,flirtContentDAO,favoriteDAO,adminUserDAO,adminPermissionDAO,systemDAO,engagementDAO,appointmentDAO,orderDAO,mailEngine,mailSender,velocityEngine,mailMessage,mailManager,txProxyTemplate,cacheManagerService,userManager,platoMessagesManager,mediaManager,attachmentManager,friendManager,groupManager,lovePassManager,flirtContentManager,favoriteManager,adminUserManager,adminPermissionManager,engagementManager,appointmentManager,orderManager,systemManager]; root of BeanFactory hierarchy}
21:00:55,171 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [WEB-INF/applicationContext-hibernate.xml]: Can't resolve reference to bean 'sessionFactory' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [WEB-INF/applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is javax.naming.NamingException: JNDI object with [java:/hibernate/SessionFactory] not found: JNDI implementation returned null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [WEB-INF/applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is javax.naming.NamingException: JNDI object with [java:/hibernate/SessionFactory] not found: JNDI implementation returned null
javax.naming.NamingException: JNDI object with [java:/hibernate/SessionFactory] not found: JNDI implementation returned null
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:125)
Who encounter the problem same as me and help me, thanks you!!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966836#3966836
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966836
19 years, 8 months
[JBoss jBPM] - first deployment problems
by maddogmooney
newbie warning: i've been going through the docs and example webapp for a while now, and i've held off on other questions to rtfm... but i can't figure this one out as it seems to be different in the latest version compared to the getting started wiki.
i've created a reasonably simple process as my first process outside of the example webapp. when i try to deploy, i get the following error in the server log:
org.jboss.deployment.DeploymentException: url file:/D:/chris/jbpm-starters-kit-3.1.2/jbpm-starters-kit-3.1.2/jbpm-server/server/default/conf/jboss-service.xml could not be opened, does it exist?
There is however a file with this name in ...jbpm-server/server/jbpm/conf ... do i need to copy or customise something to get this working?
Also, there is an error in the eclipse log where an IOException is raised because the server returns a 500. I'm not sure which issue is dependent on the other, but I have a feeling if I fix the config files, then the 500 error will go away also.
Thanks in advance for your help and apologies if I have re-raised an issue or asked this in the wrong place.
Cheers,
Chris
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966835#3966835
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966835
19 years, 8 months
[JBossCache] - Is TreeCache Serializable?
by suppyam
Is it??? If it is not, does that mean I cannot use JBoss Caching OUTSIDE of an application server? Currently, here is the error that I get when I do execute it out of an app server -
| Caused by: javax.naming.ConfigurationException [Root exception is java.rmi.MarshalException: error marshalling return; nested exception is:
| java.io.NotSerializableException: org.jboss.cache.TreeCache]
| at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:45)
| at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:77)
| at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:418)
| at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
| at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:359)
| at javax.naming.InitialContext.lookup(InitialContext.java:347)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966828#3966828
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966828
19 years, 8 months