Title: Message
Hi,
 
I'm not up on the spec per se, but my understanding is that local references should only be used in the same JAR file (or EAR file) - essentially, within the same classloader.
 
I believe that in cases such as this JBoss essentially uses local references any way, so the overhead should be minimal.
 
Dan.
 
--
Danny Yates
 
-----Original Message-----
From: Burns, Jamie [mailto:[EMAIL PROTECTED]
Sent: 17 June 2003 12:37
To: '[EMAIL PROTECTED]'
Subject: RE: [JBoss-user] EJB reference to external EJB

Ok. That works. Thanks Dan.
 
Now l am using remote interfaces between applications in the same VM. In this situation l want the performance benefits of using local interfaces.
 
Ive had a look in the EJB spec and there doesnt seem to be anything in there to say an application cant have a local ref to an EJB in another application in the same VM. Im assuming the ejb-link element is available as a convenience.
 
Is anyone able to provide some ejb-jar.xml and jboss.xml that shows an EJB in one application with a local ref to an EJB in another application in the same VM?
 
Thanks.
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 17, 2003 10:31 AM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] EJB reference to external EJB

Hi,
 
I would guess you should be using a remote reference, not a local reference.
 
Rgds,
 
Dan.
 
--
Danny Yates
 
-----Original Message-----
From: Burns, Jamie [mailto:[EMAIL PROTECTED]
Sent: 16 June 2003 17:33
To: [EMAIL PROTECTED]
Subject: [JBoss-user] EJB reference to external EJB

Im trying to link an EJB to an EJB deployed in another application within JBoss. JBoss Administration and Developement (2nd Ed) says under "EJB References with jboss.xml and jboss-web.xml" (pg 110 of Naming on JBoss...)
 
"The ejb-link element cannot be used to refer to EJB's in another enterprise application. If your ejb-ref needs to access an external EJB, you can specify the jndi name of the deployed EJB home using the jboss.xml ejb-ref/jndi-name element"
 
So l have used the following in jboss.xml
 
<entity>
  <ejb-name>HistoryEntity</ejb-name>
  <jndi-name>HistoryEntityRemoteHome</jndi-name>
  <local-jndi-name>HistoryEntityLocalHome</local-jndi-name>
  <ejb-local-ref>
    <ejb-local-ref-name>ejb/SequenceSession</ejb-local-ref-name>
    <jndi-name>SequenceSessionLocalHome</jndi-name>
  </ejb-local-ref>
</entity>
 
In my ejb-jar.xml l have
 
<entity >
  <ejb-name>HistoryEntity</ejb-name>
...
  <ejb-local-ref >
    <ejb-ref-name>ejb/SequenceSession</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.newellandbudge.commons.ejb.common.SequenceSessionLocalHome</local-home>
    <local>com.newellandbudge.commons.ejb.common.SequenceSessionLocal</local>
  </ejb-local-ref>
</entity>
 
The SequenceSession EJB is defined in the jboss.xml and ejb-jar.xml of another EAR as
 
[jboss.xml]
 
<session>
  <ejb-name>SequenceSession</ejb-name>
  <jndi-name>SequenceSessionRemoteHome</jndi-name>
  <local-jndi-name>SequenceSessionLocalHome</local-jndi-name>
</session>
 
 
[ejb-jar.xml]
 
<session >
  <ejb-name>SequenceSession</ejb-name>
  <home>com.newellandbudge.commons.ejb.common.SequenceSessionRemoteHome</home>
  <remote>com.newellandbudge.commons.ejb.common.SequenceSessionRemote</remote>
  <local-home>com.newellandbudge.commons.ejb.common.SequenceSessionLocalHome</local-home>
  <local>com.newellandbudge.commons.ejb.common.SequenceSessionLocal</local>
  <ejb-class>com.newellandbudge.commons.ejb.SequenceSessionBean</ejb-class>
  <session-type>Stateless</session-type>
...
</session>
 
When the EAR with HistoryEntity is deployed l get following DeploymentException
 
16:48:23,812 WARN  [ServiceController] Problem starting service jboss.j2ee:jndiName=HistoryEntityRemoteHome,service=EJB
org.jboss...deployment.DeploymentException: Local references currently require ejb-link
        at org.jboss.ejb.Container.setupEnvironment(Container.java:876)
        at org.jboss.ejb.Container.startService(Container.java:568)
        at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:325)
        at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController...java:966)
        at $Proxy11.start(Unknown Source)
 
Firstly, the message in this exception seems to contradict the statement about the ejb-link element.
 
Secondly, the EJB spec says that the ejb-link element can only be used to link to another EJB in the same ejb-jar or another jar in the same application. If l follow the advise of the DeploymentException my deployment fails because the SequenceSession EJB is not in the same ejb-jar or application as my HistoryEntity EJB.
 
I cant see a way forward with this situation. I dont want to have to deploy the SequenceSession EJB in every application that uses it. What is the solution to this problem? Or could someone shed some more light on the use of ejb-ref/jndi-name in jboss.xml?
 
(Im using JBoss 3.2.1)
 
Thanks
********************************************************************************
  This electronic mail system is used for information purposes and is
  not intended to form any legal contract or binding agreement.
  The content is confidential and may be legally privileged. Access
  by anyone other than the addressee(s) is unauthorised and any
  disclosure, copying, distribution or any other action taken in
  reliance on it is prohibited and maybe unlawful

  All incoming and outgoing e-mail communications and attachments
  are scanned automatically by software designed to detect and remove
  any material containing viruses or other unauthorised content.  While
  we undertake best endeavours to ensure that this content checking
  software is up to date, recipients should take steps to assure themselves
  that e-mails received are secure.
***************************************************************************************


_____________________________________________________________________

Notice to recipient:

The information in this internet e-mail and any attachments is confidential and may be privileged. It is intended solely for the addressee. If you are not the intended addressee please notify the sender immediately by telephone. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.


When addressed to external clients any opinions or advice contained in this internet e-mail are subject to the terms and conditions expressed in any applicable governing terms of business or client engagement letter issued by the pertinent Bank of America group entity.


If this email originates from the U.K. please note that Bank of America, N.A., London Branch, Banc of America Securities Limited and Banc of America Futures Incorporated are regulated by the Financial Services Authority.

_____________________________________________________________________



********************************************************************************
  This electronic mail system is used for information purposes and is
  not intended to form any legal contract or binding agreement.
  The content is confidential and may be legally privileged. Access
  by anyone other than the addressee(s) is unauthorised and any
  disclosure, copying, distribution or any other action taken in
  reliance on it is prohibited and maybe unlawful

  All incoming and outgoing e-mail communications and attachments
  are scanned automatically by software designed to detect and remove
  any material containing viruses or other unauthorised content.  While
  we undertake best endeavours to ensure that this content checking
  software is up to date, recipients should take steps to assure themselves
  that e-mails received are secure.
***************************************************************************************


_____________________________________________________________________

Notice to recipient:

The information in this internet e-mail and any attachments is confidential and may be privileged. It is intended solely for the addressee. If you are not the intended addressee please notify the sender immediately by telephone. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.


When addressed to external clients any opinions or advice contained in this internet e-mail are subject to the terms and conditions expressed in any applicable governing terms of business or client engagement letter issued by the pertinent Bank of America group entity.


If this email originates from the U.K. please note that Bank of America, N.A., London Branch, Banc of America Securities Limited and Banc of America Futures Incorporated are regulated by the Financial Services Authority.

_____________________________________________________________________



Reply via email to