[JBoss Seam] - Re: iText (PDF) support in Seam
by norman.richards@jboss.com
You want the CLIENT to sign the PDF? That doesn't really make sense to me - you'll have to explain a bit more. Why wouldn't the user just download the PDF and sign it with his tools? (we could support leaving a blank signature field for that) If the users signature is to have any validity, the user should not be sending his private key across to the server to remotely sign something. I definitely need some convincing here.
On the keystore location, the normal practice in JBoss for any key usage is to have the keystore in the conf directory. It seems to have worked well for all uses of keys in JBoss so far. I need to move the keystore configuration out of view file and into a separate component, but other than that I'm very comfortable with the keystore choices. (well, I would also like to give the option of using a JBoss security domain to completely externalize the configuration)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007923#4007923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007923
19 years, 2 months
[JBoss jBPM] - Timer Problem
by colsona
I deployed the attached process definition an ran it usin the attached JobQueueBean. The process executes to the wait state and appears to create the timer. I found that the timer never fired. In step tracing the timer creation I found the following methid in the Jboss source:
public void createTimer(Timer timer) {
// this wont work cause the process instance is not yet saved
schedulerSession.saveTimer(timer);
}
I also found the timer service wasn't deployed by default. I changed our app startup bean to create the timer service and confirmed it was running. It was unable to find any timers in the database which is needed for proper timer operation. We checked the DB tables ourselves and found that it was empty. We need to know if this is a defect which we need to get resolved immediately or if we have configured wrong and need to reconfigure.
The process definition:
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1" name="FileEvent">
| <start-state name="start">
| <transition name="" to="Is file complete"></transition>
| </start-state>
| <decision name="Is file complete">
| <handler class="com.spss.batch.queue.handlers.CheckFileComplete"/>
| <transition name="true" to="Start job process"/>
| <transition name="false" to="false"></transition>
| </decision>
| <state name="false">
| <timer duedate="10 seconds" name="Wait For File" repeat="false" transition="Is file complete">
| <action class="com.spss.batch.queue.actions.FileEventTimerAction"/>
| </timer>
| <transition name="File isn't complete" to="Is file complete"></transition>
| </state>
| <node name="Start job process">
| <event type="node-enter">
| <action class="com.spss.batch.queue.actions.StartJobProcess"></action>
| </event>
| <transition name="end" to="end1"></transition>
| </node>
| <end-state name="end1">
| <event type="node-enter">
| <action name="doTask"></action>
| </event>
| </end-state>
| </process-definition>
|
The calling bean:
| package com.spss.batch.queue;
|
| import java.io.File;
|
| import javax.ejb.EJB;
| import javax.ejb.Stateless;
|
| import org.apache.log4j.Logger;
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.db.GraphSession;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.jbpm.graph.exe.Token;
|
| @Stateless(name="BatchJobQueue", description="Job Queue Session Bean",mappedName="BatchJobQueue")
| public class BatchJobQueueBean implements BatchJobQueue{
| Logger log = Logger.getLogger(BatchJobQueue.class);
|
| @EJB
| ProcessController controller;
|
| JbpmContext context = null;
| GraphSession graphSession = null;
|
| public void addJob(File watchFile, File fileID){
| //JobTask task = JobTaskFactory.createJobTask(watchFile);
| //JobQueue.getInstance().addJob(task);
| try{
| createBusinessProcess(watchFile, fileID);
| // controller.createBusinessProcessDefinition();
| // controller.createProcessInstance();
| // controller.signalProcess();
| }catch(Exception ex){
| log.error("Unable to start process!",ex);
| throw new RuntimeException("Error starting job prcoess instance!",ex);
| }
| }
| private void initContext(){
| log.info("Getting jBPM context..");
| context = JbpmConfiguration.getInstance().createJbpmContext();
| log.info("Getting Graph Session..");
| graphSession = context.getGraphSession();
| }
| public long createBusinessProcess(File watch, File fileID) throws Exception {
| initContext();
| //JbpmContext context = ManagedJbpmContext.instance();
| log.info("Looking up process definition...");
| //ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("HelloWorld");
| ProcessDefinition processDefinition = null;
| if(processDefinition==null){
| log.info("Creating process definition...");
| String helloWorldName = "PROCESS_DEFINITIONS/FileEvent/processdefinition.xml";
| processDefinition = ProcessDefinition.parseXmlResource(helloWorldName);
| log.info("Saving process definition...");
| //context.deployProcessDefinition(processDefinition);
| graphSession.saveProcessDefinition(processDefinition);
| }
| log.info("Creating process instance...");
| ProcessInstance processInstance = processDefinition.createProcessInstance();
| long processID = processInstance.getId();
| JobTask task = JobTaskFactory.createJobTask(watch,fileID);
| processInstance.getContextInstance().createVariable(JobTask.JOB_TASK, task);
| log.info("Saving process instance..");
| context.save(processInstance);
| log.info("Closing context..");
| context.close();
| log.info("Process created!");
| return processID;
| }
| public void signalBusinessProcess(long processID){
| initContext();
| log.info("Looking up process instance...");
| ProcessInstance processInstance = context.loadProcessInstance(processID);
| log.info("Getting root token");
| Token token = processInstance.getRootToken();
| log.info("Signaling root token..");
| token.signal();
| //log.info("Ending root token..");
| //token.end();
| }
|
| }
|
Action listener:
| package com.spss.batch.queue.actions;
|
| import org.jbpm.graph.def.ActionHandler;
| import org.jbpm.graph.exe.ExecutionContext;
|
| public class FileEventTimerAction implements ActionHandler {
|
| public void execute(ExecutionContext executionContext) throws Exception {
| executionContext.getNode().leave(executionContext);
| }
|
| }
|
| package com.spss.batch.queue.handlers;
|
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.graph.node.DecisionHandler;
|
| import com.spss.batch.queue.JobTask;
|
| public class CheckFileComplete implements DecisionHandler {
|
| public String decide(ExecutionContext executionContext) throws Exception {
| JobTask task = (JobTask)executionContext.getProcessInstance().getContextInstance().getVariable(JobTask.JOB_TASK);
| System.out.println("CheckFileComplete: Processing task: "+task);
| if(task.isReady()){
| return Boolean.TRUE.toString();
| }else{
| return Boolean.FALSE.toString();
| }
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007922#4007922
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007922
19 years, 2 months
[JBoss jBPM] - Process variable class cast exception after signal()
by jglan
I have a process running fine until it reaches wait-state.
Each action node gets and sets some process variable without any problem.
The next action node (after the wait-state) throws class cast exception when attempting to get the same process variable (which was no problem in the nodes before the wait-state)
Is there any problem known in this area ?
I use a lot JMS i.e. the signal is send from some JMS thread via calling some SLSB.
I use jbpm 3.1.2
anonymous wrote :
| Here is some output of the logging when everything works fine:
| (2 process instances retrieving 'control' variable)
|
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] contextInstanceId=0
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] contextInstanceId=0
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] retrieving control variable : control processInstanceId=62
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] retrieving control variable : control processInstanceId=63
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] class of context var=class .....common.jbpm.ProcessVariableProteinIDControl
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] class of context var=class .....common.jbpm.ProcessVariableProteinIDControl
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] retrieving context variable : context processInstanceId=62
| 2007-01-29 18:10:25,625 DEBUG [.....jbpm.handler.ActionHandlerTemplate] retrieving context variable : context processInstanceId=63
|
After sending the signal the same steps (getting the variable) gives the following:
the class returned from context.getContextInstance().getVariable has changed and obviously cannot be cast to the type expected (which was working before).
Also getContextInstance().getId() now has a value > 0 for some reason...
anonymous wrote :
| 2007-01-29 18:10:25,969 DEBUG [org.jbpm.graph.def.GraphElement] event 'before-signal' on 'State(waitforSlot)' for 'Token(/)'
| 2007-01-29 18:10:25,969 DEBUG [org.jbpm.graph.def.GraphElement] event 'before-signal' on 'State(waitforSlot)' for 'Token(/)'
| 2007-01-29 18:10:25,969 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-leave' on 'State(waitforSlot)' for 'Token(/)'
| 2007-01-29 18:10:25,969 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-leave' on 'State(waitforSlot)' for 'Token(/)'
| 2007-01-29 18:10:25,969 DEBUG [org.jbpm.graph.def.GraphElement] event 'transition' on 'Transition()' for 'Token(/)'
| 2007-01-29 18:10:25,969 DEBUG [org.jbpm.graph.def.GraphElement] event 'transition' on 'Transition()' for 'Token(/)'
| 2007-01-29 18:10:25,984 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-enter' on 'Node(pullResult)' for 'Token(/)'
| 2007-01-29 18:10:25,984 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-enter' on 'Node(pullResult)' for 'Token(/)'
| 2007-01-29 18:10:25,984 DEBUG [.....jbpm.handler.PullResultActionHandler] pullResultActionHandler starting...
| 2007-01-29 18:10:25,984 DEBUG [.....jbpm.handler.PullResultActionHandler] pullResultActionHandler starting...
| 2007-01-29 18:10:26,000 DEBUG [.....jbpm.handler.ActionHandlerTemplate] contextInstanceId=114
| 2007-01-29 18:10:26,000 DEBUG [.....jbpm.handler.ActionHandlerTemplate] contextInstanceId=115
| 2007-01-29 18:10:26,000 DEBUG [.....jbpm.handler.ActionHandlerTemplate] retrieving control variable : control processInstanceId=63
| 2007-01-29 18:10:26,000 DEBUG [.....jbpm.handler.ActionHandlerTemplate] retrieving control variable : control processInstanceId=62
| 2007-01-29 18:10:26,000 DEBUG [.....jbpm.handler.ActionHandlerTemplate] class of context var=class org.jbpm.bytes.ByteArray$$EnhancerByCGLIB$$c35f0bd6
| 2007-01-29 18:10:26,000 DEBUG [.....jbpm.handler.ActionHandlerTemplate] class of context var=class org.jbpm.bytes.ByteArray$$EnhancerByCGLIB$$c35f0bd6
| 2007-01-29 18:10:26,000 ERROR [.....jbpm.handler.ActionHandlerTemplate] Got Exception executing node action. processInstanceId=62
| java.lang.ClassCastException: org.jbpm.bytes.ByteArray$$EnhancerByCGLIB$$c35f0bd6 cannot be cast to .....common.jbpm.ProcessVariableProteinIDControl
| at .....jbpm.handler.ActionHandlerTemplate.execute(ActionHandlerTemplate.java:45)
| at .....jbpm.handler.PullResultActionHandler.execute(PullResultActionHandler.java:35)
| at org.jbpm.graph.def.Action.execute(Action.java:123)
| 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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
| at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$226d945.execute()
| at org.jbpm.graph.def.Node.execute(Node.java:328)
| at org.jbpm.graph.def.Node.enter(Node.java:316)
| 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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$864c9e11.enter()
| at org.jbpm.graph.def.Transition.take(Transition.java:119)
| at org.jbpm.graph.def.Node.leave(Node.java:383)
| 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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$864c9e11.leave()
| at org.jbpm.graph.exe.Token.signal(Token.java:174)
| at org.jbpm.graph.exe.Token.signal(Token.java:123)
| 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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
| at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$32db44a5.signal()
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:217)
| at .....services.control.WorkflowServiceImpl$JbpmSignaler.doInJbpm(WorkflowServiceImpl.java:155)
| at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:86)
| at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
| at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
| at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:79)
| at .....services.control.WorkflowServiceImpl.handleSendSignal(WorkflowServiceImpl.java:217)
| at .....services.control.WorkflowServiceBase.sendSignal(WorkflowServiceBase.java:53)
| 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)
|
| ...
| ...
| ...
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007918#4007918
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007918
19 years, 2 months
[JBossWS] - enumerations in jboss ws...
by mwiles
I have an xsd which has an enumeration type:
<xsd:simpleType name="IncomeTypeEnum">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="pension" id="pension"/>
<xsd:enumeration value="salary" />
</xsd:restriction>
</xsd:simpleType>
The mapping snippet for that enum looks like this:
<java-xml-type-mapping>
<java-type>za.co.sanlam.employeebenefits.IncomeTypeEnum</java-type>
<root-type-qname xmlns:rtq="http://sanlam.co.za/employeebenefits/dto/1">rtq:IncomeTypeEnum</root-type-qname>
<qname-scope>simpleType</qname-scope>
<variable-mapping>
<java-variable-name>pension</java-variable-name>
<xml-element-name>pension</xml-element-name>
</variable-mapping>
<variable-mapping>
<java-variable-name>salary</java-variable-name>
<xml-element-name>salary</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
But when I deploy the web service I get the following error:
19:10:45,359 ERROR [MainDeployer] Could not start deployment: file:/C:/usr/jboss-4.0.5.GA/server/default/tmp/deploy/tmp50100EAR.ear-contents/EJB.jar
org.jboss.ws.WSException: Attribute pension found in jaxrpc-mapping but not in the schema: {http://sanlam.co.za/employeebenefits/dto/1}IncomeTypeEnum
at org.jboss.ws.jaxb.SchemaBindingBuilder.processXmlAttributeName(SchemaBindingBuilder.java:260)
at org.jboss.ws.jaxb.SchemaBindingBuilder.processNonArrayType(SchemaBindingBuilder.java:207)
at org.jboss.ws.jaxb.SchemaBindingBuilder.processJavaXmlTypeMapping(SchemaBindingBuilder.java:147)
at org.jboss.ws.jaxb.SchemaBindingBuilder.bindSchemaToJava(SchemaBindingBuilder.java:119)
at org.jboss.ws.jaxb.SchemaBindingBuilder.buildSchemaBinding(SchemaBindingBuilder.java:99)
at org.jboss.ws.metadata.ServiceMetaData.getSchemaBinding(ServiceMetaData.java:332)
at org.jboss.ws.metadata.ServiceMetaData.eagerInitialize(ServiceMetaData.java:400)
at org.jboss.ws.metadata.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:147)
at org.jboss.ws.server.ServiceEndpoint.start(ServiceEndpoint.java:106)
at org.jboss.ws.server.ServiceEndpointManager.startServiceEndpoint(ServiceEndpointManager.java:529)
at org.jboss.ws.deployment.ServiceEndpointDeployer.start(ServiceEndpointDeployer.java:144)
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:104)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
Has anyone done enumerations with jboss and could shed some light on what is going on? I
The java code for the enumration is as follows...
It does not seem as this is the problem as if I remove the java class, the error persists.
public class IncomeTypeEnum {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected IncomeTypeEnum(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
};
public static final java.lang.String _pension = "pension";
public static final java.lang.String _salary = "salary";
public static final IncomeTypeEnum pension = new IncomeTypeEnum(_pension);
public static final IncomeTypeEnum salary = new IncomeTypeEnum(_salary);
public java.lang.String getValue() { return _value_;}
public static IncomeTypeEnum fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
IncomeTypeEnum enum = (IncomeTypeEnum)
_table_.get(value);
if (enum==null) throw new java.lang.IllegalArgumentException();
return enum;
}
public static IncomeTypeEnum fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
}
I've tried everything to find the answer to my problem but just can't get anything. Hopefully it's quite a simple solution.
Michael Wiles
Java Developer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007917#4007917
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007917
19 years, 2 months