[jBPM] - NullPointerException while executing knowledgeSession.getProcessInstance
by sc_boss
sc_boss [https://community.jboss.org/people/sc_boss] created the discussion
"NullPointerException while executing knowledgeSession.getProcessInstance"
To view the discussion, visit: https://community.jboss.org/message/799131#799131
--------------------------------------------------------------
I'm looking at some code here in 5.4.0 (jbpm-flow/5.4.0.Final/jbpm-flow-5.4.0.Final-sources.jar):
org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.readProcessInstance(MarshallerReaderContext)
it goes like this on line 373:
Process process = ruleBase.getProcess( processId );
if ( ruleBase != null ) {
processInstance.setProcess( process );
}
Isn't this code incorrect? If rule base were to be null it would have failed on the first line itself.
May be the code should be:
if ( *process* != null ) {
processInstance.setProcess( process );
}
Not sure.
I guess I'm running into this issue when i try to load the process instance:
ProcessInstance pid = ksession.getProcessInstance(16);
java.lang.NullPointerException
at org.jbpm.process.instance.impl.ProcessInstanceImpl.setProcess(ProcessInstanceImpl.java:62)
at org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.readProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:375)
at org.jbpm.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:142)
at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:91)
at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:206)
at org.drools.common.AbstractWorkingMemory.getProcessInstance(AbstractWorkingMemory.java:1116)
at org.drools.impl.StatefulKnowledgeSessionImpl.getProcessInstance(StatefulKnowledgeSessionImpl.java:297)
at org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:48)
at org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:25)
at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:373)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getProcessInstance(CommandBasedStatefulKnowledgeSession.java:125)
at com.sample.ProcessTest.main(ProcessTest.java:64)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799131#799131]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss Tools] - BrowserSim FAQ
by Yahor Radtsevich
Yahor Radtsevich [https://community.jboss.org/people/yradtsevich] modified the document:
"BrowserSim FAQ"
To view the document, visit: https://community.jboss.org/docs/DOC-18100
--------------------------------------------------------------
*Q: What is BrowserSim ?*
*A:* BrowserSim is a Browser Simulator which primarily is intended for having a quick, easy and multi-platform way of testing if your webapp will render and behave correctly on a mobile device.
*Q: How does BrowserSim works ?*
*A:* It wraps a WebKit browser and makes it respond and send work like a mobile browser by spoofing content and media request headers.
*
Q: What do I need to run BrowserSim?*
*A:* The requirements for different platforms are as listed below:
* Windows:* Only 32-bit Eclipse/JBDS is supported;
* JBoss Tools 4.0.0.Beta2/JBDS 6.0.0.Beta2 and below: Apple http://www.filehippo.com/download_quicktime_player/12346/ QuickTime 7.72.80.56 or http://www.filehippo.com/download_itunes_32/12531/ iTunes 10.6.3 must be installed (they contain Apple Application Support 2.1 which provides WebKit engine for BrowserSim). Also see https://issues.jboss.org/browse/JBIDE-13044 this jira.
* JBoss Tools 4.0.0.CR1/JBDS 6.0.0.CR1 and above: http://support.apple.com/kb/DL1531 Apple Safari must be installed (it provides WebKit engine for BrowserSim).
* Linux:* WebKitGTK 1.2.0 or newer must be installed and available in the library load path.
* This should be available on RHEL and Ubuntu by default, if not use your package manager to install libwebkitgtk
* Mac OS X* It just works.
*Q: How to add BrowserSim to the toolbar?*
*A:* Go to Window → Customize Perspective and select "BrowserSim" under "Command Groups Availability". Then it becomes available in the global toolbar via the "phone" icon:
https://community.jboss.org/servlet/JiveServlet/showImage/102-18100-14-18... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-18100-1...
*Q: Can I use the browser as a replacement for testing on a real phone or emulator?*
*A:* Browsersim make it easy to test basic layout questions/issues on any platform without having to install a platform specifc emulator or manually try use a phone.
That said it is not 100% reliable since there are so many different brands/versions of phones there will be differences in behavior, thus no, BrowserSim does not replace real or emulated phone testing.
For full verfication/testing you should test on a real phone.
*Q: BrowserSim shows an error message saying that JRE 7 is not supported on Windows and does not run (with JBoss Tools 4.0.0.Alpha2 and above).*
*A:* There is an incompatibility between some versions of JRE 7 and BrowserSim on Windows. To workaround this, please do the following:
1. Install JRE/JDK 6 or JDK 7 (but not JRE 7).
2. Add the next lines at the beginning of your eclipse.ini or jbdevstudio.ini:
-vm
PATH_TO_JAVA_INSTALLATION_DIRECTORY\bin\javaw.exe
*Q: BrowserSim shows the *"No more handles [Failed to load the swt-webkit library]"* error message and does not run (with JBoss Tools *4.0.0.Alpha*1 and below).*
*A:* There is an incompatibility between some versions of JRE/JDK 7 and BrowserSim on Windows. To workaround this, please do the following:
1. Install JRE/JDK 6 (but not JRE/JDK 7).
2. Add the next lines at the beginning of your eclipse.ini or jbdevstudio.ini:
-vm
PATH_TO_JAVA_INSTALLATION_DIRECTORY\bin\javaw.exe
*Q: How can I launch BrowserSim without firing up eclipse?*
*A:* We are considering to create a Jenkins build for standalone BrowserSim in the future. For now you may use the following steps to build it manually:
1. git clone git://github.com/jbosstools/jbosstools-vpe.git
2. cd jbosstools-vpe/products
3. mvn clean install
4. Run BrowserSim:* Windows/Linux: java -jar browsersim-standalone/target/application/browsersim.jar
* Mac OS X: java -XstartOnFirstThread -jar browsersim-standalone/target/application/browsersim.jar
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-18100]
Create a new document in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 10 months
[Datasource Configuration] - Error to create an oracle Datasource
by tatupirsa tatu
tatupirsa tatu [https://community.jboss.org/people/tatupirsa] created the discussion
"Error to create an oracle Datasource"
To view the discussion, visit: https://community.jboss.org/message/799337#799337
--------------------------------------------------------------
Hi,
I'm trying to create a new Oracle Datasource throught admin console in Jboss 5.1.0.GA in Rhel 6.2, but it seems me an error:
-- The datasource is:
JNDI Name: jdbc/appDS
username: app_user
JDBC Driver Class: oracle.jdbc.driver.OracleDriver
Connection URL: jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=server1-vip.salud.psis)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=server2-vip.salud.psis)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=APP_BD))))
-- The console error:
Failed to add Resource (see app server log for additional details): java.lang.RuntimeException:Failed to process template. -> java.lang.RuntimeException:java.io.IOException: Can not find a free port for use. -> java.io.IOException:Can not find a free port for use.
-- The error log:
2013-02-25 10:10:43,887 WARN [org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator]
(ResourceContainer.invoker.nonDaemon-2) Cannot create String name from non-Simple property:
ManagedProperty{jndi-name,jndiName,metaType=SimpleMetaType:java.lang.String}, value=null
2013-02-25 10:10:44,832 ERROR [org.rhq.plugins.jbossas5.ApplicationServerComponent]
(ResourceContainer.invoker.nonDaemon-2) Unable to apply template [LocalTxDataSourceTemplate]
to create ManagedComponent of type ComponentType{type=DataSource, subtype=LocalTx}.
java.lang.RuntimeException: Failed to process template.
-- In debug mode shows that:
2013-02-25 10:31:40,599 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57186 already in use. Will try another.
2013-02-25 10:31:40,600 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57187 already in use. Will try another.
2013-02-25 10:31:40,600 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57188 already in use. Will try another.
2013-02-25 10:31:40,600 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57189 already in use. Will try another.
2013-02-25 10:31:40,600 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57190 already in use. Will try another.
2013-02-25 10:31:40,600 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57191 already in use. Will try another.
...
2013-02-25 10:31:40,607 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57234 already in use. Will try another.
2013-02-25 10:31:40,607 DEBUG [org.jboss.remoting.transport.PortUtil] (ResourceContainer.invoker.nonDaemon-2) port 57235 already in use. Will try another.
Theses ports are not in use actually.
Any ideas?
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799337#799337]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[jBPM] - Set up jBPM 5.4 Final Installer to use MySQL - or how to run section 3.7 of the User Guide
by iahi1998
iahi1998 [https://community.jboss.org/people/iahi1998] modified the document:
"Set up jBPM 5.4 Final Installer to use MySQL - or how to run section 3.7 of the User Guide"
To view the document, visit: https://community.jboss.org/docs/DOC-48374
--------------------------------------------------------------
I've started using jBPM 5.4 a couple weeks ago. It's my first forray into jBPM and I am slowly working through the user guide. I go to http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609 3.7. 10-Minute Tutorial: Using your own database with jBPM and got stuck.
First of all, credits. I thank https://community.jboss.org/people/thomas.setiabudi Thomas Setiabudi for posting the wonderful article titled https://community.jboss.org/docs/DOC-47975 Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS which I used for inspiration.
Second, shameless plug - https://sites.google.com/site/insearchofbpm/home/jbpm/on-ubuntu-desktop-1... my forray into jBPM which I will update as I make my way through the user guide.
And, last, but not least, the information,
My OS Ubuntu Desktop 12.04. If you are using Windows, be aware that you will have to rewrite paths with the backslashes "\" appropriate for your system..
The article is split into four steps:
* Set up MySQL
* Set up jBPM
* Install jBPM
* Run the demo using your own Database
*
#Set_up_MySQL Set up MySQL
*
#Set_up_jBPM Set up jBPM
**
#buildproperties_ build.properties
**
#buildxml build.xml
**
#dbjbpmpersistenceJPA2xml db/jbpm-persistence-JPA2.xml
**
#dbtaskpersistenceJPA2xml db/task-persistence-JPA2.xml
**
#standalonexml standalone.xml
**
#taskserviceresourcesMETAINFpersistencexml task-service/resources/META-INF/persistence.xml
**
#libjbpmgwtconsoleserver540FinalEE6warWEBINFclassesMETAINFpersistencexml lib/jbpm-gwt-console-server-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
**
#libjbpmhumantaskwar540FinalEE6warWEBINFclassesMETAINFpersistencexml lib/jbpm-human-task-war-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
*
#Install_jBPM Install jBPM
*
#Run_the_demo_using_your_own_Database Run the demo using your own Database
h1. Set up MySQL
With MySQL installed, log in as the root user and run the following commands from the mysql> prompt:
mysql> CREATE SCHEMA IF NOT EXISTS jbpm5;
mysql> CREATE USER 'jbmp5'@'localhost' IDENTIFIED BY 'jbpm5';
mysql> GRANT ALL PRIVILEGES ON jbpm5.* TO 'jbpm5'@'localhost';
mysql> CREATE SCHEMA IF NOT EXISTS task;
mysql> CREATE USER 'task'@'localhost' IDENTIFIED BY 'task';
mysql> GRANT ALL PRIVILEGES ON task.* TO 'task'@'localhost;
h1. Set up jBPM
First, run
ant clean.demo
Second, you will have to change the following files:
* build.properties
* build.xml
* db/jbpm-persistence-JPA2.xml
* db/task-persistence-JPA2.xml
* standalone.xml
* task-service/resources/META-INF/persistence.xml
* lib/jbpm-gwt-console-server-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
* lib/jbpm-human-task-war-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
h2. build.properties
Change
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
db.name=h2
db.driver.jar.name=${db.name}.jar
db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${...
#other options are mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=${db.name}-connector-java.jar
# db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
To
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
# db.name=h2
# db.driver.jar.name=${db.name}.jar
# db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${...
#other options are mysql
db.name=mysql
db.driver.module.prefix=com/mysql
db.driver.jar.name=${db.name}-connector-java.jar
db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
h2. build.xml
In
<!-- Start Demo -->
<target name="start.demo" depends="start.h2,start.jboss,start.eclipse" />
<!-- Start Demo (Eclipse) -->
<target name="start.demo.eclipse" depends="start.h2,start.eclipse" />
<!-- Start Demo (No Eclipse)-->
<target name="start.demo.noeclipse" depends="start.h2,start.jboss" />
<!-- Stop Demo -->
<target name="stop.demo" depends="stop.h2,stop.jboss" />
Add
<!-- Start Demo -->
<target name="start.demo" depends="start.h2,start.jboss,start.eclipse" />
<!-- Start Demo (DB) -->
<target name="start.demo.db" depends="start.jboss, start.eclipse" />
<!-- Start Demo (DB, No Eclipse) -->
<target name="start.demo.db.noeclipse" depends="start.jboss" />
<!-- Start Demo (Eclipse) -->
<target name="start.demo.eclipse" depends="start.h2,start.eclipse" />
<!-- Start Demo (No Eclipse)-->
<target name="start.demo.noeclipse" depends="start.h2,start.jboss" />
<!-- Stop Demo -->
<target name="stop.demo" depends="stop.h2,stop.jboss" />
<!-- Stop Demo (DB)-->
<target name="stop.demo.db" depends="stop.jboss" />
h2. db/jbpm-persistence-JPA2.xml
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
h2. db/task-persistence-JPA2.xml
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
h2. standalone.xml
Change
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:h2:~/jbpm</connection-url>
<driver>h2</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>sa</user-name>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
To
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/jbpm5</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>jbpm5</user-name>
<password>jbpm5</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
h2. task-service/resources/META-INF/persistence.xml
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:mysql:://localhost:3306/task" />
<property name="hibernate.connection.username" value="task"/>
<property name="hibernate.connection.password" value="task"/>
h2. lib/jbpm-gwt-console-server-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
To edit this file, take advantage of the GUI. Navigate to the .war file using Nautilus and rely on File Roller to open the .war file. File Roller should come pre-installed on Ubuntu Desktop 12.04. Once you're inside the .war file, you can use gedit to open persistence.xml. When you save, File Roller will ask if you want to update the archive and you must. On Window, 7-Zip can be used to open the .war file.
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
h2. lib/jbpm-human-task-war-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
To edit this file, take advantage of the GUI. Navigate to the .war file using Nautilus and rely on File Roller to open the .war file. File Roller should come pre-installed on Ubuntu Desktop 12.04. Once you're inside the .war file, you can use gedit to open persistence.xml. When you save, File Roller will ask if you want to update the archive and you must. On Window, 7-Zip can be used to open the .war file.
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
h1. Install jBPM
Run
ant install.demo
This will install the jBPM demo and pull all the appropriate drivers and files for MySQL.
h1. Run the demo using your own Database
To start the demo you can run
ant start.demo.db
or
ant start.demo.db.noeclipse
To stop the demo, run
ant stop.demo.db
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-48374]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 10 months