RE: [JBoss-user] EJB reference to external EJB

2003-06-18 Thread Burns, Jamie
Title: RE: [JBoss-user] EJB reference to external EJB





Thanks for your replies Scott and Dan.


My understanding of what is being said...


I have an EJB 1 in EAR A that wants to reference EJB 2 in EAR B where both EARs are deployed in the same VM. According to the EJB spec, l cant use local interfaces to do this because the specs ejb-local-ref doesnt accomdate this. According to the EJB spec, l CAN use remote interfaces to do this because ejb-ref does accomodate this.

When l use remote interfaces to create the link between the two EJB's, l use ejb-ref in EJB 1's ejb-jar.xml to reference the remote interface of EJB 2. I also use ejb-ref/jndi-name in EJB 1's jboss.xml to reference the JNDI name in the global namespace of EJB 2's remote interface.

Because both applications are in the same VM, JBoss uses the local interfaces of EJB 2 instead of the remote interfaces.

So EJB 1's deployment descriptors would be,


[ejb-jar.xml]


entity
 ejb-nameEJB1/ejb-name
 ...
 ejb-ref
 ejb-ref-nameejb/EJB2/ejb-ref-name
 ejb-ref-typeSession/ejb-ref-type
 homecom.company.EJB2RemoteHome/home
 remotecom.company.EJB2Remote/remote
 /ejb-ref
/entity 


[jboss.xml]


entity
 ejb-nameEJB1/ejb-name
 ...
 ejb-ref
 ejb-ref-nameejb/EJB2/ejb-ref-name
 jndi-nameEJB2RemoteHome/jndi-name
 /ejb-ref
/entity



And EJB 2's descriptors would be,


[ejb-jar.xml]

session 
 ejb-nameEJB2/ejb-name
 homecom.company.EJB2RemoteHome/home
 remotecom.company.EJB2Remote/remote
 ...
/session


[jboss.xml]

session
 ejb-nameEJB2/ejb-name
 jndi-nameEJB2RemoteHome/jndi-name
 ...
/session



Is this correct?


Thanks



-Original Message-
From: Scott M Stark [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, June 17, 2003 4:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] EJB reference to external EJB



This cannot be done, the ejb-link has to refer to an ejb in the same application. The
overhead introduced by the remote interface is optimized away by default so its a
minor performance issue when the caller and callee are in the same vm.



Scott Stark
Chief Technology Officer
JBoss Group, LLC



- Original Message - 
From: Burns, Jamie 
To: '[EMAIL PROTECTED]' 
Sent: Tuesday, June 17, 2003 4:37 AM
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.



  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.
***





RE: [JBoss-user] EJB reference to external EJB

2003-06-18 Thread Danny . Yates
Title: Message



Seems 
pretty straight to me.


-- 
Danny Yates


  
  -Original Message-From: Burns, Jamie 
  [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 
  10:48To: '[EMAIL PROTECTED]'Subject: RE: 
  [JBoss-user] EJB reference to external EJB
  Thanks for your replies Scott and Dan. 
  My understanding of what is being said... 
  I have an EJB 1 in EAR A that wants to reference EJB 2 in EAR 
  B where both EARs are deployed in the same VM. According to the EJB spec, l 
  cant use local interfaces to do this because the specs ejb-local-ref doesnt 
  accomdate this. According to the EJB spec, l CAN use remote interfaces to do 
  this because ejb-ref does accomodate this.
  When l use remote interfaces to create the link between the 
  two EJB's, l use ejb-ref in EJB 1's ejb-jar.xml to reference the remote 
  interface of EJB 2. I also use ejb-ref/jndi-name in EJB 1's jboss.xml to 
  reference the JNDI name in the global namespace of EJB 2's remote 
  interface.
  Because both applications are in the same VM, JBoss uses the 
  local interfaces of EJB 2 instead of the remote interfaces.
  So EJB 1's deployment descriptors would be, 
  [ejb-jar.xml] 
  entity  
  ejb-nameEJB1/ejb-name  
  ...  ejb-ref  
  ejb-ref-nameejb/EJB2/ejb-ref-name  
  ejb-ref-typeSession/ejb-ref-type  
  homecom.company.EJB2RemoteHome/home  
  remotecom.company.EJB2Remote/remote  /ejb-ref /entity 
  
  [jboss.xml] 
  entity  
  ejb-nameEJB1/ejb-name  
  ...  ejb-ref  
  ejb-ref-nameejb/EJB2/ejb-ref-name  
  jndi-nameEJB2RemoteHome/jndi-name  /ejb-ref /entity 
  
  And EJB 2's descriptors would be, 
  [ejb-jar.xml]  session   
  ejb-nameEJB2/ejb-name  
  homecom.company.EJB2RemoteHome/home  remotecom.company.EJB2Remote/remote 
   ... /session 
  
  [jboss.xml]  session  
  ejb-nameEJB2/ejb-name  
  jndi-nameEJB2RemoteHome/jndi-name  ... /session  
  Is this correct? 
  Thanks 
  -Original Message- From: 
  Scott M Stark [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, June 17, 2003 4:52 PM To: [EMAIL PROTECTED] Subject: 
  Re: [JBoss-user] EJB reference to external EJB 
  This cannot be done, the ejb-link has to refer to an ejb in 
  the same application. The overhead introduced by the 
  remote interface is optimized away by default so its a minor performance issue when the caller and callee are in the same 
  vm. 
   Scott 
  Stark Chief Technology Officer JBoss Group, LLC  
  - Original Message - From: 
  Burns, Jamie To: '[EMAIL PROTECTED]' 
  Sent: Tuesday, June 17, 2003 4:37 AM 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. 
  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

RE: [JBoss-user] EJB reference to external EJB

2003-06-18 Thread David Jencks
JBoss still uses the remote interfaces of ejb 2 (that is what you ask for)
but the invocation has local interface semantics since, inside the vm,
objects are not copied by jboss on a call through the remote interfaces.

david jencks


On 2003.06.18 05:47 Burns, Jamie wrote:
 Thanks for your replies Scott and Dan.
 
 My understanding of what is being said...
 
 I have an EJB 1 in EAR A that wants to reference EJB 2 in EAR B where
 both
 EARs are deployed in the same VM. According to the EJB spec, l cant use
 local interfaces to do this because the specs ejb-local-ref doesnt
 accomdate
 this. According to the EJB spec, l CAN use remote interfaces to do this
 because ejb-ref does accomodate this.
 
 When l use remote interfaces to create the link between the two EJB's, l
 use
 ejb-ref in EJB 1's ejb-jar.xml to reference the remote interface of EJB
 2. I
 also use ejb-ref/jndi-name in EJB 1's jboss.xml to reference the JNDI
 name
 in the global namespace of EJB 2's remote interface.
 
 Because both applications are in the same VM, JBoss uses the local
 interfaces of EJB 2 instead of the remote interfaces.
 
 So EJB 1's deployment descriptors would be,
 
 [ejb-jar.xml]
 
 entity
   ejb-nameEJB1/ejb-name
   ...
   ejb-ref
 ejb-ref-nameejb/EJB2/ejb-ref-name
 ejb-ref-typeSession/ejb-ref-type
 homecom.company.EJB2RemoteHome/home
 remotecom.company.EJB2Remote/remote
   /ejb-ref
 /entity 
 
 [jboss.xml]
 
 entity
   ejb-nameEJB1/ejb-name
   ...
   ejb-ref
 ejb-ref-nameejb/EJB2/ejb-ref-name
 jndi-nameEJB2RemoteHome/jndi-name
   /ejb-ref
 /entity
 
 
 And EJB 2's descriptors would be,
 
 [ejb-jar.xml]
  
 session 
   ejb-nameEJB2/ejb-name
   homecom.company.EJB2RemoteHome/home
   remotecom.company.EJB2Remote/remote
   ...
 /session
 
 [jboss.xml]
  
 session
   ejb-nameEJB2/ejb-name
   jndi-nameEJB2RemoteHome/jndi-name
   ...
 /session
  
 
 Is this correct?
 
 Thanks
 
 
  -Original Message-
 From: Scott M Stark [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 17, 2003 4:52 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [JBoss-user] EJB reference to external EJB
 
 
 This cannot be done, the ejb-link has to refer to an ejb in the same
 application. The
 overhead introduced by the remote interface is optimized away by default
 so
 its a
 minor performance issue when the caller and callee are in the same vm.
 
 
 Scott Stark
 Chief Technology Officer
 JBoss Group, LLC
 
 
 - Original Message - 
 From: Burns, Jamie 
 To: '[EMAIL PROTECTED]' 
 Sent: Tuesday, June 17, 2003 4:37 AM
 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.
 
 
   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.
 ***
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN
 HTML
 HEAD
 META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=us-ascii
 META NAME=Generator CONTENT=MS Exchange Server version 5.5.2653.12
 TITLERE: [JBoss-user] EJB reference to external EJB/TITLE
 /HEAD
 BODY
 
 PFONT SIZE=2Thanks for your replies Scott and Dan./FONT
 /P
 
 PFONT SIZE=2My understanding of what is being said.../FONT
 /P
 
 PFONT SIZE=2I have an EJB 1 in EAR A that wants to reference EJB 2 in
 EAR B where both EARs are deployed in the same VM. According to the EJB
 spec, l cant use local interfaces to do this because the specs
 ejb-local-ref doesnt accomdate this. According to the EJB spec, l CAN use
 remote interfaces to do this because ejb-ref does accomodate
 this./FONT/P
 
 PFONT SIZE=2When l use remote

RE: [JBoss-user] EJB reference to external EJB

2003-06-17 Thread Danny . Yates
Title: Message



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:33To: [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-nameHistoryEntity/ejb-namejndi-nameHistoryEntityRemoteHome/jndi-namelocal-jndi-nameHistoryEntityLocalHome/local-jndi-nameejb-local-ref 
  ejb-local-ref-nameejb/SequenceSession/ejb-local-ref-namejndi-nameSequenceSessionLocalHome/jndi-name/ejb-local-ref
  /entity
  
  In my ejb-jar.xml 
  l have
  
  entity 
   
  ejb-nameHistoryEntity/ejb-name
  ...
  ejb-local-ref  
  ejb-ref-nameejb/SequenceSession/ejb-ref-nameejb-ref-typeSession/ejb-ref-typelocal-homecom.newellandbudge.commons.ejb.common.SequenceSessionLocalHome/local-homelocalcom.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-nameSequenceSession/ejb-namejndi-nameSequenceSessionRemoteHome/jndi-namelocal-jndi-nameSequenceSessionLocalHome/local-jndi-name
  /session
  
  
  [ejb-jar.xml]
  
  session 
   
  ejb-nameSequenceSession/ejb-name
   
  homecom.newellandbudge.commons.ejb.common.SequenceSessionRemoteHome/home 
  remotecom.newellandbudge.commons.ejb.common.SequenceSessionRemote/remote 
  local-homecom.newellandbudge.commons.ejb.common.SequenceSessionLocalHome/local-home 
  localcom.newellandbudge.commons.ejb.common.SequenceSessionLocal/local 
  ejb-classcom.newellandbudge.commons.ejb.SequenceSessionBean/ejb-class 
  session-typeStateless/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=EJBorg.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 deploythe 
  SequenceSession EJBin 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 

RE: [JBoss-user] EJB reference to external EJB

2003-06-17 Thread Danny . Yates
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:37To: '[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 AMTo: [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:33To: [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-nameHistoryEntity/ejb-namejndi-nameHistoryEntityRemoteHome/jndi-namelocal-jndi-nameHistoryEntityLocalHome/local-jndi-nameejb-local-ref 
  ejb-local-ref-nameejb/SequenceSession/ejb-local-ref-namejndi-nameSequenceSessionLocalHome/jndi-name/ejb-local-ref
  /entity
  
  In my 
  ejb-jar.xml l have
  
  entity 
   
  ejb-nameHistoryEntity/ejb-name
  ...
  ejb-local-ref  
  ejb-ref-nameejb/SequenceSession/ejb-ref-nameejb-ref-typeSession/ejb-ref-typelocal-homecom.newellandbudge.commons.ejb.common.SequenceSessionLocalHome/local-homelocalcom.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-nameSequenceSession/ejb-namejndi-nameSequenceSessionRemoteHome/jndi-namelocal-jndi-nameSequenceSessionLocalHome/local-jndi-name
  /session
  
  
  [ejb-jar.xml]
  
  session 
   
  ejb-nameSequenceSession/ejb-name
   
  homecom.newellandbudge.commons.ejb.common.SequenceSessionRemoteHome/home 
  remotecom.newellandbudge.commons.ejb.common.SequenceSessionRemote/remote 
  local-homecom.newellandbudge.commons.ejb.common.SequenceSessionLocalHome/local-home 
  localcom.newellandbudge.commons.ejb.common.SequenceSessionLocal/local 
  ejb-classcom.newellandbudge.commons.ejb.SequenceSessionBean/ejb-class 
  session-typeStateless/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=EJBorg.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.in