[EJB3] - EntityManager in a @Service
by Andrea Polci
Andrea Polci [http://community.jboss.org/people/apolci] created the discussion
"EntityManager in a @Service"
To view the discussion, visit: http://community.jboss.org/message/600535#600535
--------------------------------------------------------------
I'm trying to write a @Service that need access to an EntityManager.
I'll use the service throw the JMX console.
The problem is that I can't find a way to inject the entity manager into the service.
This is a simplified version of my code:
public inteface MyManager {
public void method(String argument);
}
@Service(objectName="xxxx:service=myservice")
public class MyMBean implements MyManager {
@PersistenceContext(unitName="my-persistence-unit")
private EntityManager em;
public void method(String argument) {
// code using em
}
}
The service get exposed throgh the jmx console, but em is always null.
I tried to @Inject an entity manager configured in a @Producer, but i get the same result.
I'm using JBoss AS 6.0.0 Final
Thanks for any help,
Andrea
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/600535#600535]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[jBPM] - Problem using REST interface
by satish polasi
satish polasi [http://community.jboss.org/people/satishpolasi] created the discussion
"Problem using REST interface"
To view the discussion, visit: http://community.jboss.org/message/600525#600525
--------------------------------------------------------------
Hi,
I have my jbpm-console application running on one profle jbpm on 9090 port and my application running on another profile default on 8080 port. I run both the consoles on JbossEAP5.1 server.
I have created one bpmn process and deployed on to JBPM engine and I can login to jbpm-cosole application as admin/admin and start the process.
My requirement here is, I need to do the same process from my application running on 8080 port. For that i am making a call to this URL http://localhost:9090/gwt-console-server/rs/process/definition/ http://localhost:9090/gwt-console-server/rs/process/definition/{id}/new_i... to start the process. Where {id} is the processid(InstallSR) of my bpmn process.
Here is my code
PostMethod post = new PostMethod( http://localhost:9090/gwt-console-server/rs/process/definition/InstallSR/...); http://localhost:9090/gwt-console-server/rs/process/definition/InstallSR/...);
try {
post.addRequestHeader("Accept", "application/json");
int result = httpClient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: ");
System.out.println(post.getResponseBodyAsString());
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
post.releaseConnection();
}
When i call my above codel I see the following output as below and I don't see any thing printed on my human task servie or jbpm application server console.
Response status code: 200
Response body:
<html>
<head>
<title>HTTP 401</title> <!-- Do not remove -->
</head>
<body>
<form method="POST" action="j_security_check">
<center/>
<br><br>
<div style="font-family:sans-serif;border:1px solid black; width:270;padding:15px;">
<h2>BPM Console Server</h2>
<table with=250>
<tr>
<td>Username:</td>
<td><input type="text" name="j_username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="j_password"></td>
</tr>
<tr>
<td></td>
<td align=right><input type="submit"/></td>
</tr>
</table>
</div>
</form>
</body>
</html>
Can any one help me out on this, what I need to do to start a new process instance by calling rest url.
Thanks a lot in advance
Thanks,
Satish.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/600525#600525]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[jBPM] - Drools 5.x + jBPM 5.x + Hibernate 3.6.x + Postgres 9.x
by Krešimir Popović
Krešimir Popović [http://community.jboss.org/people/kresimir_popovic] created the discussion
"Drools 5.x + jBPM 5.x + Hibernate 3.6.x + Postgres 9.x"
To view the discussion, visit: http://community.jboss.org/message/600522#600522
--------------------------------------------------------------
Hello,
has anyone knows if jBPM was tested with Hibernate 3.6.x (part of JBoss 6.x) ?
I just want to know if JBPM 5.x tested with hibernate 3.6.x ? Hibernate team has done some changes since hibernate 3.5.x regarding bytea / oid data type handling.
http://programmingbulls.com/postgresql-bytea-vs-oid-large-object http://programmingbulls.com/postgresql-bytea-vs-oid-large-object
http://stackoverflow.com/questions/3677380/proper-hibernate-annotation-fo... http://stackoverflow.com/questions/3677380/proper-hibernate-annotation-fo...
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4876 http://opensource.atlassian.com/projects/hibernate/browse/HHH-4876
This is the error I get when I execute Mina task client method: getTasksAssignedAsPotentialOwner
15:16:19,690 INFO [hr.bpmsolutions.printinghouse.services.actions.humantask.HumanTaskAction] tmp:0
15:16:19,690 INFO [hr.bpmsolutions.printinghouse.services.actions.humantask.HumanTaskAction] tasksAssignedAsPotentialOw
ner - END
15:16:19,694 INFO [STDOUT] Hibernate:
15:16:19,695 INFO [STDOUT] insert
15:16:19,695 INFO [STDOUT] into
15:16:19,695 INFO [STDOUT] SessionInfo
15:16:19,695 INFO [STDOUT] (lastModificationDate, rulesByteArray, startDate, OPTLOCK, id)
15:16:19,696 INFO [STDOUT] values
15:16:19,696 INFO [STDOUT] (?, ?, ?, ?, ?)
15:16:19,708 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: 42804
*15:16:19,709 ERROR [org.hibernate.util.JDBCExceptionReporter] ERROR: column "rulesbytearray" is of type oid but expressi*
*on is of type bytea*
* Hint: You will need to rewrite or cast the expression.*
Position: 100
15:16:19,711 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with ses
sion: org.hibernate.exception.SQLGrammarException: could not insert: [org.drools.persistence.info.SessionInfo]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) [:3.6.0.Final]
I get also the same thing for processinstanceinfo --> COLUMN processinstancebytearray
Problematic Enttity classes:
org.drools.persistence.processinstance.ProcessInstanceInfo
org.drools.persistence.processinstance.SessionInfo
Maybe what is needed to do is to use annotation @Type(type="org.hibernate.type.PrimitiveByteArrayBlobType") for *processinstancebytearray* and *rulesbytearray entity fields?*
Best Regards,
Krešimir
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/600522#600522]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[jBPM] - Timer boundary event on WorkItemNode
by Alex Pavlov
Alex Pavlov [http://community.jboss.org/people/rushproject] created the discussion
"Timer boundary event on WorkItemNode"
To view the discussion, visit: http://community.jboss.org/message/600495#600495
--------------------------------------------------------------
jBPM 5 does not allow attaching timer boundary events to WorkItemNode. The following fragment:
<receiveTask completionQuantity="1" id="_2_1_21" implementation="##WebService" instantiate="false"
isForCompensation="false" messageRef="ID_30607364_7317_2206_0052_000400200024"
name="Receive confirmation" startQuantity="1">
<incoming>_2_1_22</incoming>
<outgoing>_2_1_25</outgoing>
</receiveTask>
<boundaryEvent attachedToRef="_2_1_21" id="_2_1_21_1" name="48 Hours">
<outgoing>_2_1_21_2</outgoing>
<timerEventDefinition id="ID_22607364_7317_2206_0052_000400200027">
<timeCycle>P48H</timeCycle>
</timerEventDefinition>
</boundaryEvent>
results in exception:
java.lang.ClassCastException: org.jbpm.workflow.core.node.WorkItemNode cannot be cast to org.jbpm.workflow.core.node.CompositeContextNode
while executing this line (ProcessHandler.java, line #280):
CompositeContextNode compositeNode = (CompositeContextNode) attachedNode;
Both CompositeContextNode and WorkItemNode extend StateBasedNode class, which defines addTimer() - the only method called from ProcessHandler while processing timer boundary event. In other words, changing the offending line to
StateBasedNode compositeNode = (StateBasedNode) attachedNode;
will compile and will not result in run time exception. However, will it run? In other words, would it be sufficient to enable timer boundary events for work item nodes?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/600495#600495]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years