[
http://jira.jboss.com/jira/browse/JBPM-836?page=comments#action_12412267 ]
Alejandro Guizar commented on JBPM-836:
---------------------------------------
The EjbSchedulerService looks up an entry in the java:comp/env context which is only
available inside the command service bean. Any code running outside that bean will not be
able to retrieve the timer bean unless the local-jndi-name above is used.
The problem is, changing the EjbSchedulerService to use the local-jndi-name would render
it nonportable. A J2EE component can only reliably access the java:comp/env context.
Hence, a custom enterprise component that calls jBPM APIs and hits the scheduler service
needs to declare an ejb reference in ejb-jar.xml like this:
<session>
<ejb-name>MySessionBean</ejb-name>
<ejb-local-ref>
<ejb-ref-name>ejb/LocalTimerServiceBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>org.jbpm.scheduler.ejbtimer.LocalTimerServiceHome</local-home>
<local>org.jbpm.scheduler.ejbtimer.LocalTimerService</local>
</ejb-local-ref>
</session>
The custom component's jboss.xml descriptor links the above ejb reference to the
LocalTimerServiceHome bound to the local-jndi-name specified in
jbpm-enterprise.jar!/META-INF/jboss.xml.
<session>
<ejb-name>MySessionBean</ejb-name>
<ejb-local-ref>
<ejb-ref-name>ejb/LocalTimerServiceBean</ejb-ref-name>
<local-jndi-name>TimerServiceBean</local-jndi-name>
</ejb-local-ref>
</session>
Note that "global" JNDI names are confined to the JBoss-specific descriptors.
Nowhere in the Java code or the standard descriptors does a global JNDI name appear.
"ejb local timer lookup problem" in
EjbSchedulerService.java
------------------------------------------------------------
Key: JBPM-836
URL:
http://jira.jboss.com/jira/browse/JBPM-836
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2 beta 2
Environment: cvs trunk build, jboss AS 4.0.5GA, ejb3, jms messaging
deploying jbpm-enterprise.ear
Reporter: Chris Russell
Assigned To: Tom Baeyens
Fix For: jBPM jPDL 3.2.3
After deploying the jbpm-enterprise.ear to a jboss 4.0.5ga server getting an exception
when trying to signal a transition to the end state.
===EXCEPTION SEEN===
13:04:56,785 ERROR [ProcessInstanceBean$SignalTokenListener] Action threw an exception:
ejb local timer lookup problem
JNDI name lookup in EjbSchedulerService using incorrect name/and or the TimerServiceBean
not declared in
jboss.xml.
===CODE FIXES FOR EXCEPTION==
RCS file:
/cvsroot/jbpm/jbpm.3/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerService.java,v
retrieving revision 1.1
diff -r1.1 EjbSchedulerService.java
31c31,36
< LocalTimerServiceHome localTimerServiceHome = (LocalTimerServiceHome)
initial.lookup("java:comp/env/ejb/LocalTimerServiceBean");
---
>
>
> //RSC wrong name used
> //LocalTimerServiceHome localTimerServiceHome = (LocalTimerServiceHome)
initial.lookup("java:comp/env/ejb/LocalTimerServiceBean");
> //See also change to jboss.xml to include TimerServiceBean or this fix wont
work either.
> LocalTimerServiceHome localTimerServiceHome = (LocalTimerServiceHome)
initial.lookup("TimerServiceBean");
RCS file: /cvsroot/jbpm/jbpm.3/enterprise/src/main/resources/jar/META-INF/jboss.xml,v
retrieving revision 1.2
diff -r1.2 jboss.xml
12a13,20
> <!-- RSC ADDED THIS -->
> <session>
> <ejb-name>TimerServiceBean</ejb-name>
> <jndi-name>ejb/TimerServiceBean</jndi-name>
> <local-jndi-name>TimerServiceBean</local-jndi-name>
> </session>
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira