[JBoss jBPM] - Task Not Being Created?
by jed204
I've been banging my head on this one and would like someone else (if they have some time) to take a look...
I've been using jBPM for general process and have just recently being trying to use some of the tasks. I've run into a problem and not sure why.
Basically, the problem I'm having is when I use a process definition from the database I can't get a task to be created. I can see the task node hit but no task is created. Using a process defintiion from a test case I can create a process and the task is created. Here are the two different methods of creating the same task:
| /** Creates a test process using the coded definition */
| public void startTestProcess()
| {
| logger.info("Starting Test Process via Coded Definition");
|
| // Create a test process definition
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
| "<process-definition name='the baby process'>" +
| " <start-state name='start'>" +
| " <transition name='baby cries' to='t'/>" +
| " </start-state>" +
| " <task-node name='t'>" +
| " <task name='change nappy'>" +
| " <assignment class='com.ider.Process.NappyAssignmentHandler'/>" +
| " </task>" +
| " <transition to='end'/>" +
| " </task-node>" +
| " <end-state name='end'/>" +
| "</process-definition>"
| );
|
| // Create the process
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
| // Signal the root token
| Token token = processInstance.getRootToken();
| token.signal();
|
| logger.info("Token Node: " + token.getNode());
|
| }
|
|
| /** Creates a new process based on a process definition name */
| public void startNewProcess(String processName)
| {
| JbpmContext jbpmContext = (JbpmConfigurationStatic.jbpmConfiguration).createJbpmContext();
| try {
| logger.info("Starting Process via Definition [" + processName + "]");
|
| // Load a process definition from the database
| ProcessDefinition myDef = jbpmContext.getGraphSession().findLatestProcessDefinition(processName);
|
| // Create the process
| ProcessInstance newProcess = new ProcessInstance(myDef);
|
| // Signal the root token
| Token token = newProcess.getRootToken();
| token.signal();
|
| logger.info("Token Node: " + token.getNode());
|
| jbpmContext.save(newProcess);
|
| } finally {
| jbpmContext.close();
| }
| }
|
One called right after another yields the following logs:
|
| processAdmin.startTestProcess();
| processAdmin.startNewProcess("Test");
|
|
anonymous wrote :
| Created via Coded Definition:
| -----------------------------
| 18:03:37,875 INFO [UserAdminScreen] Starting Test Process via Coded Definition
| 18:03:37,875 DEBUG [GraphElement] event 'process-start' on 'ProcessDefinition(the baby process)' for 'Token(/)'
| 18:03:37,875 DEBUG [GraphElement] event 'before-signal' on 'StartState(start)' for 'Token(/)'
| 18:03:37,875 DEBUG [GraphElement] event 'node-leave' on 'StartState(start)' for 'Token(/)'
| 18:03:37,890 DEBUG [GraphElement] event 'transition' on 'Transition(baby cries)' for 'Token(/)'
| 18:03:37,890 DEBUG [GraphElement] event 'node-enter' on 'TaskNode(t)' for 'Token(/)'
| 18:03:37,890 DEBUG [GraphElement] event 'task-create' on 'Task(change nappy)' for 'Token(/)'
| 18:03:37,890 DEBUG [GraphElement] event 'task-assign' on 'Task(change nappy)' for 'Token(/)'
| 18:03:37,890 DEBUG [GraphElement] event 'after-signal' on 'StartState(start)' for 'Token(/)'
| 18:03:37,890 INFO [UserAdminScreen] Token Node: TaskNode(t)
|
|
| Created via DB Definition:
| --------------------------
| 18:03:41,015 INFO [UserAdminScreen] Starting Process via Definition [Test]
| 18:03:41,015 DEBUG [DbPersistenceServiceFactory] creating persistence service
| 18:03:41,015 DEBUG [DbPersistenceService] creating hibernate session
| 18:03:41,015 DEBUG [DbPersistenceService] beginning hibernate transaction
| 18:03:41,015 DEBUG [GraphElement] event 'process-start' on 'ProcessDefinition(Test)' for 'Token(/)'
| 18:03:41,015 DEBUG [GraphElement] event 'before-signal' on 'StartState(start)' for 'Token(/)'
| 18:03:41,015 DEBUG [GraphElement] event 'node-leave' on 'StartState(start)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'transition' on 'Transition(baby cries)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'node-enter' on 'TaskNode(t)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'node-leave' on 'TaskNode(t)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'transition' on 'Transition(248adb)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'node-enter' on 'EndState(end)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'process-end' on 'ProcessDefinition(Test)' for 'Token(/)'
| 18:03:41,031 DEBUG [GraphElement] event 'after-signal' on 'StartState(start)' for 'Token(/)'
| 18:03:41,031 INFO [UserAdminScreen] Token Node: EndState(end)
|
I see in the log where the coded definition creates the task but the definition from the db skips over. I just deployed the process to the database, it looks like the coded one:
| <process-definition xmlns="" name="Test">
| <start-state name="start">
| <transition name="baby cries" to="t"/>
| </start-state>
| <task-node name="t">
| <task name="change nappy">
| <assignment class="com.ider.Process.NappyAssignmentHandler"/>
| </task>
| <transition to="end"/>
| </task-node>
| <end-state name="end"/>
| </process-definition>
|
btw, the NappyAssignmentHandler is straight from the examples.
Clearly, I've done something wrong...anyone care to take a guess?
Thanks in advance for any help!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978023#3978023
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978023
19 years, 8 months
[Security & JAAS/JBoss] - JAAS not prompting for username pwd on Linux 3 with JBoss4.0
by VAkuthota
Hi,
JAAS is not working on Linux, I deployed the application in JBoss, but it is bypassing the security manager and directly going to welcome/home page. It never prompts for the username and password. and not throwing any error also.
But the same application war file, without changing anything, if i deploy on Windows system, it works fine.
Here is the system details :
Linux System Info :
RedHat Enterprise Linux 3 (Update 4)
Kernal Version : 2.4.21-27.0.2.ELsmp
JBoss Version
jboss-4.0.3-sp1.1.EL30.i386.rpm
JDK Version
ibm-java2-i386-sdk-5.0-0.0.i386.rpm
To test it, i even tested with sample jaas application.
In login-config.xml
<application-policy name = "jaasproject">
| <authentication>
| <login-module code = "org.jboss.security.ClientLoginModule"
| flag = "required">
| </login-module>
| <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
| flag = "required">
| <module-option name="usersProperties">users.properties</module-option>
| <module-option name="rolesProperties">roles.properties</module-option>
| </login-module>
| </authentication>
| </application-policy>
In JBOSS_HOME/client/auth.conf file
jaasproject
| {
| org.jboss.security.ClientLoginModule required;
| org.jboss.security.auth.spi.UsersRolesLoginModule required;
| };
In JBOSS_HOME/server/standard/conf/auth.conf file
jaasproject
| {
| org.jboss.security.ClientLoginModule required;
| org.jboss.security.auth.spi.UsersRolesLoginModule required;
| };
In jboss-web.xml file
<jboss-web>
| <security-domain>java:/jaas/jaasproject</security-domain>
| <context-root>/jaasproject</context-root>
| </jboss-web>
In jndi.properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
In web.xml
| <web-app >
| <display-name>jaasproject</display-name>
| <welcome-file-list>
| <welcome-file>home.jsp</welcome-file>
| </welcome-file-list>
|
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>jsp</web-resource-name>
| <description>Declarative security tests</description>
| <url-pattern>*.jsp</url-pattern>
| <http-method>HEAD</http-method>
| <http-method>GET</http-method>
| <http-method>POST</http-method>
| <http-method>PUT</http-method>
| <http-method>DELETE</http-method>
| </web-resource-collection>
|
|
| <auth-constraint>
| <role-name>ReadOnly</role-name>
| </auth-constraint>
|
| <user-data-constraint>
| <description>no description</description>
| <transport-guarantee>NONE</transport-guarantee>
| </user-data-constraint>
|
| </security-constraint>
|
|
| <login-config>
| <auth-method>FORM</auth-method>
| <form-login-config>
| <form-login-page>/login.jsp</form-login-page>
| <form-error-page>/error.jsp</form-error-page>
| </form-login-config>
| </login-config>
|
| <security-role>
| <description>A user allowed to invoke echo methods</description>
| <role-name>ReadOnly</role-name>
| </security-role>
|
| <security-role>
| <description>A user allowed to invoke echo methods</description>
| <role-name>FullAccess</role-name>
| </security-role>
|
| </web-app>
and my login.jsp
| <%@ page contentType="text/html; charset=UTF-8" %>
| <%@ page language="java" %>
| <html >
| <HEAD>
| <TITLE></TITLE>
| <!-- To prevent caching -->
| <%
| response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
| response.setHeader("Pragma","no-cache"); // HTTP 1.0
| response.setDateHeader ("Expires", -1); // Prevents caching at the proxy server
| %>
| <SCRIPT>
| function submitForm() {
| var frm = document. logonForm;
|
| // Check if all the required fields have been entered by the user before
| // submitting the form
| if( frm.j_username.value == "" ) {
| alert("Pls Enter user name");
| frm.j_username.focus();
| return ;
| }
|
| if( frm.j_password.value == "" ) {
| alert("Pls enter password");
| frm.j_password.focus();
| return ;
| }
| frm.submit();
| }
| </SCRIPT>
| </HEAD>
| <BODY>
| <!-- FORM name="logonForm" action="home.jsp" METHOD=POST -->
| <form method="POST" action='<%= response.encodeURL( "j_security_check" ) %>'>
| <TABLE width="100%" border="0" cellspacing="0" cellpadding=
| "1" bgcolor="white">
| <TABLE width="100%" border="0" cellspacing=
| "0" cellpadding="5">
| <TR align="center">
| <TD align="right" class="Prompt"></TD>
| <TD align="left">
| UserName : <INPUT type="text" name="j_username" maxlength=20>
| </TD>
| </TR>
| <TR align="center">
| <TD align="right" class="Prompt"> </TD>
| <TD align="left">
| Password : <INPUT type="password"
| name="j_password" maxlength=20 >
| <BR>
| <TR align="center">
| <TD align="right" class="Prompt"> </TD>
| <TD align="left">
| <input type="submit" onclick="javascript:submitForm();" value="Login">
| </TD>
| </TR>
| </TABLE>
| </FORM>
| </BODY>
| </html>
|
|
users.properties, This and roles properties files i placed in WEB-INF/classes folder and also in /standard/conf/props folder
venu=venu@1234
| gopal=gopal@1234
and roles.properties
venu=ReadOnly,FullAccess
| venu.Roles=ReadOnly,FullAccess
| gopal=ReadOnly
| gopal.Roles=ReadOnly
Above are the configurations, This works fine in Windows system with all versions of the JBosss.
But it is not working, and simply going to welcome page without prompting for username and password on Linux Server.
I even tried with other JBoss 4.0.1 rpm package also.
Do i need to do any extra configuration on Linux and JBoss ??
Can anybody please help ??
Apreciate your help
Thanks in advance....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978019#3978019
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978019
19 years, 8 months