Hi.
I need to create instances of one process deployed and runing on Jboss 5.1, from one Java app, so what are the steps for achieve this (please,if someone can explain me step by step I appreciate that) ?
(Using Bonita BPM 6.2.1 - Jboss 5.1)
Regards
Hi,
is this documentation not enough? http://documentation.bonitasoft.com/create-your-first-project-maven
Gabriel
Hi Gabriel.
My scenario is diferent; My process is already deployed and running in Jboss 5.1, so I want to create instances from that process deployed via JAVA.
When I trying create the platform with the below code I get one exception:
Code:
private static void createPlatform() throws BonitaException {
// login as platform administrator
PlatformSession session = doPlatformLogin(PLATFORM_ADMIN, PLATFORM_PASSWORD);
try {
System.out.println("Creating and initializing the platform ...");
// create and initialize the platform
getPlatformAPI(session).createAndInitializePlatform();
System.out.println("Platform created and initialized!");
System.out.println("Starting node ...");
// start the node (make scheduler service to start)
getPlatformAPI(session).startNode();
System.out.println("Node started!");
} finally {
// logout
doPlatformLogout(session);
}
}
Exception:
Exception in thread "main" org.bonitasoft.engine.exception.BonitaRuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actorMappingService' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-actor-mapping-impl.xml]: Cannot resolve reference to bean 'persistenceService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceService' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-persistence-hibernate.xml]: Cannot resolve reference to bean 'sequenceManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sequenceManager' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-sequence-impl.xml]: Cannot resolve reference to bean 'bonitaSequenceManagerDSJNDI' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-transaction-api-impl.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:122)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88)
at com.sun.proxy.$Proxy0.login(Unknown Source)
at org.bonita.example.BPMClient.doPlatformLogin(BPMClient.java:137)
at org.bonita.example.BPMClient.createPlatform(BPMClient.java:106)
at org.bonita.example.BPMClient.main(BPMClient.java:53)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actorMappingService' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-actor-mapping-impl.xml]: Cannot resolve reference to bean 'persistenceService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceService' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-persistence-hibernate.xml]: Cannot resolve reference to bean 'sequenceManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sequenceManager' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-sequence-impl.xml]: Cannot resolve reference to bean 'bonitaSequenceManagerDSJNDI' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-transaction-api-impl.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
at org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext.<init>(AbsoluteFileSystemXmlApplicationContext.java:41)
at org.bonitasoft.engine.service.impl.SpringPlatformFileSystemBeanAccessor.initializeContext(SpringPlatformFileSystemBeanAccessor.java:81)
at org.bonitasoft.engine.service.impl.SpringPlatformFileSystemBeanAccessor.getContext(SpringPlatformFileSystemBeanAccessor.java:72)
at org.bonitasoft.engine.service.impl.SpringPlatformFileSystemBeanAccessor.getService(SpringPlatformFileSystemBeanAccessor.java:67)
at org.bonitasoft.engine.service.impl.SpringPlatformServiceAccessor.getPlatformLoginService(SpringPlatformServiceAccessor.java:98)
at org.bonitasoft.engine.api.impl.PlatformLoginAPIImpl.login(PlatformLoginAPIImpl.java:52)
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.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:292)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:217)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:105)
... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceService' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-persistence-hibernate.xml]: Cannot resolve reference to bean 'sequenceManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sequenceManager' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-sequence-impl.xml]: Cannot resolve reference to bean 'bonitaSequenceManagerDSJNDI' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 33 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sequenceManager' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-sequence-impl.xml]: Cannot resolve reference to bean 'bonitaSequenceManagerDSJNDI' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bonitaSequenceManagerDSJNDI' defined in file [C:\BonitaBPMCommunity-6.2.1-JBoss-5.1.0.GA\bonita\server\platform\conf\services\cfg-bonita-ds.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 57 more
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 64 more
What could be wrong ? :-(
Hi,
If your process is already deployed, why do you create the platform ? It's already existed normally. An if your bundle is already started, the node too.
You need to login with your tenant in first, get the APISession :
final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
final APISession session = loginAPI.login(userName, password);
Then, get the ProcessAPI, and call the method to start a process instance :
final ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session);
<p>
final ProcessInstance processInstance = processAPI.startProcess(yourProcessDefinition.getId());</p>
Best regards,
Céline