Tuesday, January 13, 2009

JBPM_ID_USER

While helping a coworker set up jBPM I learned that part of the create script for jBPM 3.3.0.GA is missing. The user part. You can't log in without it.

This post from JBoss' forums has the solution.

Here's the missing create statements :
create table JBPM_ID_GROUP (ID_ number(19,0) not null, CLASS_ char(1 char) not null, NAME_ varchar2(255 char), TYPE_ varchar2(255 char), PARENT_ number(19,0), primary key (ID_));
create table JBPM_ID_MEMBERSHIP (ID_ number(19,0) not null, CLASS_ char(1 char) not null, NAME_ varchar2(255 char), ROLE_ varchar2(255 char), USER_ number(19,0), GROUP_ number(19,0), primary key (ID_));
create table JBPM_ID_PERMISSIONS (ENTITY_ number(19,0) not null, CLASS_ varchar2(255 char), NAME_ varchar2(255 char), ACTION_ varchar2(255 char));
create table JBPM_ID_USER (ID_ number(19,0) not null, CLASS_ char(1 char) not null, NAME_ varchar2(255 char), EMAIL_ varchar2(255 char), PASSWORD_ varchar2(255 char), primary key (ID_));
create table JBPM_JOB (ID_ number(19,0) not null, CLASS_ char(1 char) not null, VERSION_ number(10,0) not null, DUEDATE_ timestamp, PROCESSINSTANCE_ number(19,0), TOKEN_ number(19,0), TASKINSTANCE_ number(19,0), ISSUSPENDED_ number(1,0), ISEXCLUSIVE_ number(1,0), LOCKOWNER_ varchar2(255 char), LOCKTIME_ timestamp, EXCEPTION_ varchar2(4000 char), RETRIES_ number(10,0), NAME_ varchar2(255 char), REPEAT_ varchar2(255 char), TRANSITIONNAME_ varchar2(255 char), ACTION_ number(19,0), GRAPHELEMENTTYPE_ varchar2(255 char), GRAPHELEMENT_ number(19,0), NODE_ number(19,0), primary key (ID_));
For the jbpm-console app to work run the following inserts as well :
INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');
INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');
INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');
INSERT INTO JBPM_ID_USER VALUES(4,'U','shipper','shipper@sample.domain','shipper');
INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);
INSERT INTO JBPM_ID_GROUP VALUES(2,'G','manager','security-role',NULL);
INSERT INTO JBPM_ID_GROUP VALUES(3,'G','hr','organisation',NULL);
INSERT INTO JBPM_ID_GROUP VALUES(4,'G','admin','security-role',NULL);
INSERT INTO JBPM_ID_GROUP VALUES(5,'G','user','security-role',NULL);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,2);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,2,4);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,3,4);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,2,5);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,5);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,4,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,4,5);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,5);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,3,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,'boss',2,1);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(12,'M',NULL,NULL,1,1);

Tuesday, January 6, 2009

Seam-Gen and the TestNG plugin

Here's an interesting heads up to running SeamTest classes inside Eclipse.

I was having some problems getting my tests, extending SeamTest, to run with the Eclipse TestNG plugin. I found this post on seamframework.org which states,

"the Eclipse Run dialog to start the TestNG test will only be viable if you have a Seam Web Project created from JBoss Tools"

I used Seam-Gen instead of JBoss Tools for my project. I ran the tests from ant and they worked.

Monday, January 5, 2009

Seam 2.1.0 RefCard from Dzone

DZone has a refcard for Seam 2.1.0. Registration is required for download.

I've found these things to be useful.

Friday, January 2, 2009

SeamTest and Eclipse TestNG plugin

I encountered a small problem running a new SeamTest with Eclipse' TestNG plugin. The error was :

DEBUG [main] (KernelFactory.java:86) - Starting JBoss Kernel construction...
DEBUG [main] (KernelFactory.java:112) - Completed JBoss Kernel construction. Duration: 381 milliseconds
FAILED CONFIGURATION: @BeforeSuite startSeam
org.jboss.deployers.spi.DeploymentException: Unable to find bootstrap file: conf/bootstrap-beans.xml in classpath
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:181)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025)
at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916)
at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
... Removed 15 stack frames
The solution is pretty simple.

Open up the run configuration (the arrow next to the run button and choose "Run Configurations...")
The most recently run test should be highlighted. If not select it.
Choose the "Classpath" tab in the right side of the pane.
Click "User Entries" which should be in the center pane.
Click "Advanced' -> "Add Folders" -> OK and navigate to the "bootstrap" folder.
Click "Add Jars" and navigate to the "lib/test" folder and add all three jars.




Ok.