[JBoss Web Services] - Re: EJB-Web Service built with wsconsume will not deploy on JBoss
by Alessio Soldano
Alessio Soldano [http://community.jboss.org/people/asoldano] created the discussion
"Re: EJB-Web Service built with wsconsume will not deploy on JBoss"
To view the discussion, visit: http://community.jboss.org/message/631508#631508
--------------------------------------------------------------
> I am losing my mind on this. I have been all over Google looking at annotated examples of supposed web services built on EJBs. I am now reduced to frantically trying this and trying that, once again. Seems to be a regular occurence on the JBoss learning curve. And nothing works.
The jbossws testsuite includes many examples that are tested before any release, so they work for sure. Starting from them and looking at the authoritative documentation is a good idea.
This said, the problem here might be related to the way the application is packaged, can you tell that? Btw, I see [1] where the same issue is caused by a descriptor in a wrong position as a consequence of an error in a book.
> Nothing gets me over the hump of this @#$%^&* "WARNING [config] Unable to process deployment descriptor for context '/jbsv-ejb'". I have no idea what it doesn't like.
I assume the deployment is failing for you after the WARNING, isn't it? Can you give some futher details on the exception you get?
> I can't find any complete example containing all the following elements:
>
> 1. "Hello World" Web Service built with top-down model from wsconsume from wsdl.
> 2. Deployed as EJB3 using annotations on JBoss 5.1 server.
>
> The examples in the JBossWS Testsuite that use EJB3 all use Style.RPC, which I can't use. Is that the problem? Does JBossWS support Style.DOCUMENT with EJB3? I see examples that use Style.DOCUMENT in pojo Web Services, but none in EJB.
Of course document/literal syle is supported [2], both with EJB3 and POJO. The fact the tests in the jbossws testsuite all use rpc/literal is kind of a coincidence (most of them have been derived from the first ones by copying over the endpoint interface / impl, as that was probably not relevant for the test and keeping it as simple as possible was the important thing).
> Or maybe it's this:
> https://issues.jboss.org/browse/JBPAPP-6806 https://issues.jboss.org/browse/JBPAPP-6806 ?
No. Moreover that's a JBPAPP jira, so it refers to the JBoss Enterprise Application Platform. I assume you're using the 5.1.0.GA community version of JBoss, aren't you?
Regarding the need for ejb-jar.xml, yes, that's optional.
Again, try starting by the jbossws testsuite, pick something that is as close as possible to what you need and start changing what you need. Proceeding step by step might also help in finding where your problem is.
[1] http://community.jboss.org/thread/146501 http://community.jboss.org/thread/146501
[2] http://community.jboss.org/docs/DOC-13972#DocumentLiteral http://community.jboss.org/wiki/JBossWS-UserGuide#DocumentLiteral
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/631508#631508]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[EJB3] - OneToMany bidirectional with composite PKs
by Pasquale Imbemba
Pasquale Imbemba [http://community.jboss.org/people/pi4630] created the discussion
"OneToMany bidirectional with composite PKs"
To view the discussion, visit: http://community.jboss.org/message/631562#631562
--------------------------------------------------------------
Hi,
I kindly ask for help for mapping OneToMany bidirectional with ManyToOne. Consider the following (for the sake of semplicity):
I have two tables, FOO and BAR. Foo has a PK which is named "ID". BAR has a composite PK, which is made of ID_FOO (i.e. it's the FK to FOO) and ID.
For both tables, there're the realitve entites, namely Foo and Bar.
Foo has the field id annotated with @Id and contains a field of type Bar (say 'bar') which has the @OneToMany mapped by "foo" - which is the field of the Bar class. On this field (foo) of the Bar class, I have @ManyToOne and @JoinColumn(name="ID_FOO") annotated. Foo also has the composite primary key field fooPk of type FooPK, with @EmbeddedId annotated. The FooPK refers to the two fields, i.e. the ones mapping ID and ID_FOO.
With this config, I get the error "org.hibernate.MappingException: Repeated column in mapping for entity:" Foo. when deploying.
If I change the configuration, and use only OneToMany JoinColumn on ID_FOO on the Foo entity bean and delete the reference back on the Bar entity, it works - but of course, I can't navigate from Bar to Foo...
So, how do I config the OneToMany bidirectionally, when the "weak" table/class has a composite primary key?
Thanks,
~pasquale
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/631562#631562]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[jBPM] - How to detect crashed process instance in jbpm 4.1 ?
by Elisabeth Müller
Elisabeth Müller [http://community.jboss.org/people/muellere] created the discussion
"How to detect crashed process instance in jbpm 4.1 ?"
To view the discussion, visit: http://community.jboss.org/message/630266#630266
--------------------------------------------------------------
We are using JBPM 4.1 and need to implement some kind of recovery logic to cope with the problem of crashed process instances.
The application is a server application resposible to execute various workflows. We are using the persistence layer which assures that process states are saved to the database.
In case the application crashes, e.g. because of a hardware failure we need to restart the application and resume the various activities which have been in progress when the application crashed.
Since there is no automatism available, a process instance of a workflow will recover in its last saved state and will not continue until I trigger an appropriate transistion.
So far so good. My problem is no the following:
I need to find the crashed activities of process instances.
My current idea is:
* check all process instances which are not suspended or ended
* check whether type of last activity is state or task
* if this is not the case check whether activity is currently locked by another jbpm instance
But how to do this. Will the method "isActive" work also in case the activity was locked before by the jbpm instance which crashed ? How is the optimistic locking implemented ? Does this work similar to "selectForUpdate" in the database and disappears when the instance has crashed ?
Hopefully anyone can help,
Elisabeth
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630266#630266]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[jBPM] - fail to fire a rule task~~ frustrated
by Guo-Guang Chiou
Guo-Guang Chiou [http://community.jboss.org/people/taitung.wilbert] created the discussion
"fail to fire a rule task~~ frustrated"
To view the discussion, visit: http://community.jboss.org/message/631470#631470
--------------------------------------------------------------
http://community.jboss.org/servlet/JiveServlet/showImage/2-631470-17155/t... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-631470-171...
I defined a process as the above.
between 2 script task there is a rule task.
here is my rule content. it's very simple.
============================================================
#created on: 2011/10/11
#list any import classes here.
import org.drools.runtime.process.WorkflowProcessInstance;
#declare any global variables here
rule rule1
ruleflow-group "validate"
when
then
System.out.println( "TEST RULE ^^^" );
end
=============================================================
and process content is as following.
========================================================================================================
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<process processType="Private" isExecutable="true" id="testrule" name="TestRule" tns:packageName="defaultPackage" >
<!-- nodes -->
<startEvent id="_1" name="StartProcess" />
<scriptTask id="_2" name="Script" scriptFormat="http://www.java.com/java" >
<script>System.out.println("Before rule\n");
org.drools.runtime.StatefulKnowledgeSession ksession =
(org.drools.runtime.StatefulKnowledgeSession)
kcontext.getKnowledgeRuntime();
ksession.fireAllRules();
System.out.println("After rule\n");</script>
</scriptTask>
<businessRuleTask id="_3" name="Rule" g:ruleFlowGroup="validate" >
</businessRuleTask>
<endEvent id="_4" name="End" >
<terminateEventDefinition/>
</endEvent>
<scriptTask id="_5" name="Script" scriptFormat="http://www.java.com/java" >
<script>System.out.println("DONE");</script>
</scriptTask>
<!-- connections -->
<sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
<sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
<sequenceFlow id="_5-_4" sourceRef="_5" targetRef="_4" />
<sequenceFlow id="_3-_5" sourceRef="_3" targetRef="_5" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="testrule" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="16" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_2" >
<dc:Bounds x="96" y="16" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="208" y="16" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" >
<dc:Bounds x="432" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" >
<dc:Bounds x="320" y="16" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_1-_2" >
<di:waypoint x="40" y="40" />
<di:waypoint x="136" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_2-_3" >
<di:waypoint x="136" y="40" />
<di:waypoint x="248" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_5-_4" >
<di:waypoint x="360" y="40" />
<di:waypoint x="456" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_3-_5" >
<di:waypoint x="248" y="40" />
<di:waypoint x="360" y="40" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
========================================================================================================
in the first script task.
I have a code snippet to call fireAllRules in order to trigger rule task to work.
==================================================================
System.out.println("Before rule\n");
org.drools.runtime.StatefulKnowledgeSession ksession =
(org.drools.runtime.StatefulKnowledgeSession)
kcontext.getKnowledgeRuntime();
ksession.fireAllRules();
System.out.println("After rule\n");
===================================================================
and then I deployed all these artifacts to Guvnor repository by using Gnvnor plugin in eclipse.
the I open a browser to http://localhost:8080/jbpm-console to start a process.
i have been trying many ways to try to fire a rule task to work.
however,
It always stops at rule task and can not mve to next script task.
I don't know why it goes this way.
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-631470-171... (http://community.jboss.org/servlet/JiveServlet/showImage/2-631470-17156/S...)
log file is attached.
any suggest and help will be appreciated.
Guo-Guang
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/631470#631470]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[jBPM] - About jBPM5.1 ProcessInstance and HumanTask persisit
by Gao jie
Gao jie [http://community.jboss.org/people/super_man.sh] created the discussion
"About jBPM5.1 ProcessInstance and HumanTask persisit"
To view the discussion, visit: http://community.jboss.org/message/630762#630762
--------------------------------------------------------------
Dear All,
I'm use MySQL for persist ProcessInstance and ProcessInstance and HumanTask Object.This is the code:
public static final void main(String[] args) {
TaskClient taskClient = new TaskClient(new MinaTaskClientConnectorExt("MinaConnector",
new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
taskClient.connect("127.0.0.1", 9123);
//init datasource.......
KnowledgeBase kbase = readKnowledgeBase();
EntityManagerFactory emf =Persistence.createEntityManagerFactory("org.jbpm.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
// create a new knowledge session that uses JPA to store the runtime state
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env );
//StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(1, kbase, null, env);
//StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
WSHumanTaskHandler taskHandler=new WSHumanTaskHandler();
taskHandler.setClient(taskClient);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);
Map params = new HashMap();
params.put("userId", "krisv");
params.put("description", "Need a new laptop computer");
ksession.startProcess("com.sample.humantask", params);
ksession.dispose();
taskClient.disconnect();
}
This main methd execute is ok,then I found ProcessInstance and Human info is in MySQL(in sessioninfo and task tables).Next,I write complete the task code as below:
public static final void main(String[] args) {
TaskClient taskClient = new TaskClient(new MinaTaskClientConnectorExt("MinaConnector",
new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
taskClient.connect("127.0.0.1", 9123);
//init datasource......
KnowledgeBase kbase = readKnowledgeBase();
EntityManagerFactory emf =Persistence.createEntityManagerFactory("org.jbpm.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
// create a new knowledge session that uses JPA to store the runtime state
StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(1, kbase, null, env);
BlockingTaskSummaryResponseHandler taskSummaryHandler = new BlockingTaskSummaryResponseHandler();
List<String> groups = new ArrayList<String>();
groups.add("sales");
taskClient.getTasksAssignedAsPotentialOwner("sales-rep", groups, "en-UK", taskSummaryHandler);
TaskSummary task1 = taskSummaryHandler.getResults().get(0);
BlockingTaskOperationResponseHandler taskOperationHandler = new BlockingTaskOperationResponseHandler();
taskClient.claim(task1.getId(), "sales-rep", groups, taskOperationHandler);
taskOperationHandler = new BlockingTaskOperationResponseHandler();
taskClient.start(task1.getId(), "sales-rep", taskOperationHandler);
taskOperationHandler.waitTillDone(1000);
taskOperationHandler = new BlockingTaskOperationResponseHandler();
Map<String, Object> results = new HashMap<String, Object>();
results.put("comment", "Agreed, existing laptop needs replacing");
results.put("outcome", "Accept");
ContentData contentData = new ContentData();
contentData.setAccessType(AccessType.Inline);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream out;
try {
out = new ObjectOutputStream(bos);
out.writeObject(results);
out.close();
contentData = new ContentData();
contentData.setContent(bos.toByteArray());
contentData.setAccessType(AccessType.Inline);
} catch (IOException e) {
e.printStackTrace();
}
taskClient.complete(task1.getId(), "sales-rep", contentData, taskOperationHandler);
taskOperationHandler.waitTillDone(1000);
ksession.signalEvent("Signal",null);
ksession.dispose();
taskClient.disconnect();
}
Execute the code,The task will be completed.
I want to the ProcessInstance Continue to flow after task complete.So I write
|
| ksession.signalEvent("Signal",null); |
But the processInstance not continue to flow, Please help me!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630762#630762]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[JBoss Web Services] - Strategy for dealing with "WARNING [config] Unable to process deployment descriptor for context"
by Steve Cohen
Steve Cohen [http://community.jboss.org/people/stevecoh4] created the discussion
"Strategy for dealing with "WARNING [config] Unable to process deployment descriptor for context""
To view the discussion, visit: http://community.jboss.org/message/631343#631343
--------------------------------------------------------------
I am still a newbie here and trying for the first time to deploy a simple trial ejb web-service on WebSphere AS 5.1. I can successfully deploy a web-module web service but the ejb one fails with "WARNING [config] Unable to process deployment descriptor for context".
This message is not very helpful. I would expect to see in the logs somewhere an explanation or stack trace indicating what about my ejb the server finds objectionable. I did some experimenting with adding some more logging but I haven't found the right combination of loggers to expose more information.
Is more information available in the logs, and if so, which logger should I boost the log output of?
Or is there another strategy I could pursue to figure out what is wrong? Undoubtedly, I've done something wrong but I am not given the tools to help me find out what that is. I am less interested in the specific solution than in finding out the best way to discover that solution.
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/631343#631343]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[jBPM] - Re: How to Complete a WorkItem using REST API
by analamala
analamala [http://community.jboss.org/people/analamala] created the discussion
"Re: How to Complete a WorkItem using REST API"
To view the discussion, visit: http://community.jboss.org/message/631454#631454
--------------------------------------------------------------
Thank you Chris. Your feedback is again very valuable. I took approach 1 and everything worked perfectly at the end. Here is what I did.
* gwt-console-server\WEB-INF\lib\jbpm-gwt-core-5.1.0.Final.jar\org\jbpm\integration\console\CommandDelegate.java. Added the following method.
public void completeWorkItem(String workItemId,
Map<String,Object> results) {
ksession.getWorkItemManager().completeWorkItem(
new Long(workItemId).longValue(), results);
}
* gwt-console-server\WEB-INF\lib\jbpm-gwt-core-5.1.0.Final.jar\org\jbpm\integration\console\ProcessManagement.java. Added the following two methods
public void completeWorkItem(String workItemId) {
delegate.completeWorkItem(workItemId, null);
}
@Override
public void completeWorkItem(String workItemId, Map<String,Object> results) {
delegate.completeWorkItem(workItemId, results);
}
* gwt-console-server\WEB-INF\lib\gwt-console-server-integration-2.1.jar\org\jboss\bpm\console\server\integration\ProcessManagement.java. Added the following method.
void completeWorkItem(String workItemId, Map<String,Object> results);
* Finally I integrated all the changes into gwt-console-server\WEB-INF\classes\org\jboss\bpm\console\server\ProcessMgmtFacade.java. Added the following REST method.
@POST
@Path("definition/{id}/ctr_component_complete")
@Produces("application/json")
public Response ctrComponentComplete(@PathParam("id") String definitionId,
@FormParam("workitemID") String workItemID) {
try {
getProcessManagement().completeWorkItem(workItemID, null);
return createJsonResponse("SUCCESS");
} catch (Throwable t) {
throw new WebApplicationException(t, 500);
}
}
I deployed my changes and was SUCCESSFULLY able to verify that the jbpm-console web application state and the diagram highlighting are updating as expected.
Thanks for your help again.
-Ajay
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/631454#631454]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months