[EJB3] - Cannot make my maven test client to speak with my EJB, missing jar?
by eildosa
eildosa [https://community.jboss.org/people/eildosa] created the discussion
"Cannot make my maven test client to speak with my EJB, missing jar?"
To view the discussion, visit: https://community.jboss.org/message/735377#735377
--------------------------------------------------------------
Hi, here is my problem, I made an EJB with maven and 2 test clients,
* a test client without maven, only added jnp-client and the EJB to it's class path, work like a charm
* a test client using MAVEN, added the EJB through the POM and jnp-client, does not work
this is my EJB :
[img] http://img11.hostingpics.net/pics/480421EJB1.png http://img11.hostingpics.net/pics/480421EJB1.png[/img]
it's POM :
[code]
<project xmlns=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thongvan.mp</groupId>
<artifactId>MyFirstMavenEjb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ejb</packaging>
<name>MyFirstMavenEjb</name>
<url> http://maven.apache.org http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<!-- setting default EJB2 to EJB3 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.1</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
[/code]
this is my first test client, the one without maven wich has no problem whatsoever to speak with the EJB
[img] http://img11.hostingpics.net/pics/974963EJB0.png http://img11.hostingpics.net/pics/974963EJB0.png[/img]
this is my second test client, using maven, it cannot speak with the EJB, all I'm getting is :
[code]
Context lookup finished
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference cannot be cast to com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb
at com.thongvan.mp.TestClientMavenEjb.App.main(App.java:27)
[/code]
[img] http://img11.hostingpics.net/pics/651692EJB2.png http://img11.hostingpics.net/pics/651692EJB2.png[/img]
It's POM :
[code]
<project xmlns=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thongvan.mp</groupId>
<artifactId>TestClientMavenEjb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TestClientMavenEjb</name>
<url> http://maven.apache.org http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- pour la dependance jnp-client, besoin de la version 5.0.3.GA -->
<repositories>
<repository>
<id>Jboss</id>
<url> https://repository.jboss.org/nexus/content/repositories/releases/ https://repository.jboss.org/nexus/content/repositories/releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnp-client</artifactId>
<version>5.0.3.GA</version>
</dependency>
<dependency>
<groupId>com.thongvan.mp</groupId>
<artifactId>MyFirstMavenEjb</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
[/code]
Both clients have the same main :
[code]
public static void main( String args[] ) throws NamingException
{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
Context ctx = new InitialContext(env);
System.out.println("Context lookup finished");
TestMavenEjb proxy = (TestMavenEjb)(ctx.lookup("TestMavenEjbBean/remote-com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb"));
System.out.println(proxy.getClass());
System.out.println("do something!");
proxy.doSomething();
}
[/code]
So, anybody has even the slightest idea about why the maven test client is not working?
Jboss 5.1.0.GA
Eclipse indigo
Maven 3.0.4
Also I did some poking around by printing a toString on both context lookup here is what I got :
[b]Maven project (not working)[/b]
Reference Class Name: Proxy for: com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb
Type: ProxyFactoryKey
Content: ProxyFactory/MyFirstMavenEjb/TestMavenEjbBean/TestMavenEjbBean/remote
Type: EJB Container Name
Content: jboss.j2ee:jar=MyFirstMavenEjb.jar,name=TestMavenEjbBean,service=EJB3
Type: Proxy Factory is Local
Content: false
Type: Remote Business Interface
Content: com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb
Type: Remoting Host URL
Content: socket://localhost:3873/
[b]regular project (working)[/b]
Proxy to jboss.j2ee:jar=MyFirstMavenEjb.jar,
name=TestMavenEjbBean,
service=EJB3 implementing [interface com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/735377#735377]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months
[jBPM] - Intermittently pending human task come across a missing jbpm parent process in jBPM 5.2
by Dev S
Dev S [https://community.jboss.org/people/devinderpal] created the discussion
"Intermittently pending human task come across a missing jbpm parent process in jBPM 5.2"
To view the discussion, visit: https://community.jboss.org/message/752342#752342
--------------------------------------------------------------
Env: Jboss 7.1.0, mysql DB, Redhat 5.5, jBPM 5.2
When I thought I'm getting pretty good with jBPM and our application is about to be released, i came across this tough bug during extensive testing.
Intermittently we're facing that pending human task has missing parent process instance and it results in nullpointerexception while completing that human task.
I ran below SQL query to confirm this:
select t.id, t.processInstanceId from Task t where t.processInstanceId not in (select distinct(InstanceId) from ProcessInstanceInfo);
+----+-------------------+
| id | processInstanceId |
+----+-------------------+
| 33 | 20 |
| 43 | 20 |
| 47 | 20 |
| 53 | 20 |
| 57 | 20 |
+----+-------------------+
Same code works fine most of the time. So I think it's not problem with our code but some bug in jBPM. MinaTaskServer is being used for our implementation.
Also we use JTA persistence for jBPM core engine and RESOURCE_LOCAL for human task. We have to use RESOURCE_LOCAL for human task because JTA can't be used due to another jBPM bug.
If I reinitialize the database, then everything works fine for a while but again I run into this problem.
Please let us know how we can fix it, if anyone knows solution. I was about to create a blocker JIRA issue but thought let's first get community opinion on this.
Exception stack trace is attached.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/752342#752342]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months
[jBPM] - SignalEvent issue in jBPMConsole
by Herman Post
Herman Post [https://community.jboss.org/people/hbpost] created the discussion
"SignalEvent issue in jBPMConsole"
To view the discussion, visit: https://community.jboss.org/message/757107#757107
--------------------------------------------------------------
We have run into an issue with jbpmConsole that we do not understand. The sample code runs as expected in eclipse but does not run the same in jbpmConsole. (project attached running jBPM 5.3/Drools 5.4)
The sample demonstrates starting two different processes in the same kSession and having one process signal an event in the other process.
The sample code in ProcessApp creates an instance of Hello.bpmn which blocks waiting for a SignalEvent. It then creates an instance of DataDriveProcess.bpmn which has a single action node that calls kcontext.getKnowledgeRuntime().signalEvent("TestSignal", false);
In eclipse this works fine and the Hello process terminates when it receives the SignalEvent from DataDriveProcess.
If these processes are uploaded to Guvnor and packaged, and then started in jbpmConsole, Hello process does not receive the SignalEvent. It can be made to work though, if you start the Hello process, note the processInstanceId, then edit the DataDriveProcess in Guvnor to call signalEvent("TestSignal", false, 8) with the explicit processInstanceId, and rebuild and start DataDriveProcess.
So to summarize, signalEvent in 'broadcast' mode, without a specific processInstanceId does not appear to work in jbpmConsole, but does work in eclipse.
We also tried to iterate through all of the process instances from the Action node in jbpmConsole and just SignalEvent on each, but no other process instances are visible. They are visible in eclipse.
Thanks,
Herm
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/757107#757107]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months
[jBPM] - JBPM HUMAN TASK, TASK SERVER
by RSTVMA LDHYAGF
RSTVMA LDHYAGF [https://community.jboss.org/people/mab1990.amu] created the discussion
"JBPM HUMAN TASK, TASK SERVER"
To view the discussion, visit: https://community.jboss.org/message/746278#746278
--------------------------------------------------------------
Hello,
can someone please help me with this: I created my JBPM project with some human task in but when i try to run it this error pops out:
| 0 | 05/07 11:17:53,531[main] ERROR workitem.wsht.GenericHTWorkItemHandler.executeWorkItem -
Thu Jul 05 11:17:53 WAT 2012: Error when creating task on task server for work item id 1. Error reported by task server: Task operation request timed out |
java.lang.RuntimeException: Task operation request timed out
| | at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118) |
| | at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:145) |
| | at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70) |
| | at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:105) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164) |
| | at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49) |
| | at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41) |
| | at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124) |
| | at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35) |
| | at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188) |
| | at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303) |
| | at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168) |
| | at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:138) |
| | at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1082) |
| | at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320) |
| | at com.principal.PrincipalProcess.main(PrincipalProcess.java:30) |
Process Started..........
I don't know if i have to set something in order to connect to the server, because i have set the IpAddress and the port but still from the localhost:8080/jbpm-console i can't see my processes i only see the evaluation.bpmn that i got from the jbpm-installer folder
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/746278#746278]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months