[EJB 3.0] - @EJB annotation doesn't lookup globally JBoss
by estiedi
Hi,
I have 2 ear's, say earA and earB. I have a session bean (say SessionA) that needs to call a method on a session bean (say SessionB) in earB.
I implemented this like this:
| @Stateless
| public class SessionBeanA implements SessionBeanALocal {
| @EJB(mappedName="earB/SessionBeanB/local")
| SessionBeanB beanB;
| ...
|
which is exactly how it appears in the JNDI view.
However, during execution, the beanB variable is always null.
I have tried all possible formats for the mapped name, it never works:
"SessionBeanB/local"
"earB/SessionBeanB"
"SessionBeanB"
...
It works fine if beanB is in the same ear as beanA. It also works fine if I do a classical lookup :
| InitialContext initCtx = new InitialContext();
| SessionBeanB beanB= (SessionBeanB)initCtx.lookup("earB/SessionBeanB/local");
|
If I understand the EJB3 docs well, it should be no issue that the beanB is in another ear, or is it?
anonymous wrote :
| Rules for the @EJB annotation
|
| * The @EJB annotation also has a mappedName() attribute. The specification leaves this a vendor specific metadata, but JBoss recognizes mappedName() as the global JNDI name of the EJB you are referencing. If you have specified a mappedName(), then all other attributes are ignored and this global JNDI name is used for binding.
| * If you specify @EJB with no attributes defined:
|
| @EJB ProcessPayment myEjbref;
|
| Then the following rules apply:
| o The EJB jar of the referencing bean is contained in is search for another EJB with the same interface. If there are more than one EJB that publishes same business interface, throw an exception, if there is one, use that one.
| o Search the EAR for EJBs that publish that interface. If there are duplicates, throw an exception, otherwise return that one.
| o Search globally in JBoss for an EJB of that interface. Again, if duplicates, throw an exception
| * @EJB.beanName() corresponds to <ejb-link>. If the beanName() is defined, then use the same algorithm as @EJB with no attributes defined except use the beanName() as a key in the search. An exception to this rule is if you use the ejb-link '#' syntax. The '#' syntax allows you to put a relative path to a jar in the EAR where the EJB you are referencing lives. See spec for more details
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034937#4034937
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034937
19 years
[JBoss jBPM] - (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help req
by ygiriyap
Hi All ...
(Note: I am working with JBPM 3.2)
I am not able to get the decision node make a proper decision based on static values or the task variables by defining the conditions in the decision node(processdefinition.xml file).
(I could get this working using a handler class to make my decisions,though)
I expect this to be a trivial issue.I am posting this after searching the forum trying out different things and for some reasons not able to get this thro.
USE CASE:-
step1: Am reading 2 variables in a task node.
step2: I have a decision node.Where,based on the values of variables I need to take any of the three paths.
| <decision name="DN_P1CompareP2">
| <transition name="TN_P1LesserP2" to="TN_P1LesserP2">
| <condition><![CDATA[#{P1 < P1}]]></condition>
| </transition>
| <transition name="TN_P1GreaterP2" to="TN_P1GreaterP2">
| <condition><![CDATA[#{P1 > P1}]]></condition>
| </transition>
| <transition name="TN_P1EqualsP2" to="TN_P1CompareP2Else">
| </transition>
| </decision>
|
Somehow ... always it takes the first transition.This means the conditions are not getting evaluated properly.
Note:- As it was mentioned by Ronald in one of the threads ... I have defined the type of the variables P1 and P2 as "Integer" in the form.xhtml
I am fighting for 3 days to know where I have gone wrong.
Please let me know how to describe the decision using static values or process/task variables in the decision node.
Thanks in advance.
--Yash
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034927#4034927
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034927
19 years
[JBoss jBPM] - Re: JBPM 3.2 - Mailing process - Exception during deployment
by mputz
Yash,
you receive the NPE because you don't have an actors attribute in your mail action. In the docu, 16.1.1 it says
anonymous wrote : There are two attribute to specify recipients: actors and to. The to attribute should resolve to a semicolon separated list of email addresses. The actors attribute should resolve to a semicolon separated list of actorIds. Those actorIds will be resolved to email addresses with by means of address resolving.
Although to me it sounds more like one has to specify actors OR to, if you look at the code both are getting checked. I've tried with your process, altered only this
<mail name="M_MailAction" to="martin(a)mputz.de" actors="ernie" template="jbpm.mail.templates.xml">
and I don't get an error.
Martin
btw, regarding your JIRA entry, not only the hibernate mapping for org.jbpm.graph.action.MailAction is missing, but also for org.jbpm.graph.node.MailNode
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034924#4034924
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034924
19 years