Re[5]: [JBoss-user] help with bounding entity bean
Btw, how can I use the general context search, i.e. java:/comp/env/... AS use ejb-ref or ejb-local-ref in your web.xml Just to see that I am sure(please correct me and ofc any explanation is appreciated). the ejb-ref and ejb-local-ref work also with local/HandlerBean meaning I still a re-map from local/HandlerBean to something else. The ejb-ref and friends as far as I know is used together with the session bean. In my case I could access the bean without using the ejb-ref (I found it`s name from the jmx-console). (can anyone shed some light in this area?). Also, I am not sure how to use java:/comp/env/. I`ve tried the official docs but I keep on missing it - any docs relevant is really appreciated(this topic in particular - the whole j2ee docs are huge). Basically, I would like to know how the java:/comp/env/ is mapped into JBoss JNDI. P.S. my mail is reaching the list with a huge delay. I don`t know why but that`s why the discussion is so asynchronous. AS --- AS This SF.net email is sponsored by: Scholarships for Techies! AS Can't afford IT training? All 2003 ictp students receive scholarships. AS Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. AS www.ictp.com/training/sourceforge.asp AS ___ AS JBoss-user mailing list AS [EMAIL PROTECTED] AS https://lists.sourceforge.net/lists/listinfo/jboss-user -- Thanks, costinmailto:[EMAIL PROTECTED] --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: Re[5]: [JBoss-user] help with bounding entity bean
Just to see that I am sure(please correct me and ofc any explanation is appreciated). the ejb-ref and ejb-local-ref work also with local/HandlerBean meaning I still a re-map from local/HandlerBean to something else. The ejb-ref and friends as far as I know is used together with the session bean. In my case I could access the bean without using the ejb-ref (I found it`s name from the jmx-console). (can anyone shed some light in this area?). Okay, each component [application, web context, ejb, ] you deply will have its own Context. It will be located at java:/comp/env. Now if you are looking for something that is bound to java:/comp/env from with a servlet you have to put it there. You would put it there thru ejb-ref in your web.xml If you used java:/comp/env from within an EJB then you would need references in the ejb-jar.xml That is all true about local context. JBoss however has a global context. Where it binds your objects. I am not sure exactly what convention is when you do not provide those three optional xmls that I was talking about in my earlier post, but those are basically needed to provide connections. So jboss.xml will bind your ejbs into the global context so that other components [apps] can reference it (in their local java:/comp/env; jbossweb.xml will do similar job for your web app. Okay just to give you some example, suppose we have a bean Facade: ejb-jar.xml session description![CDATA[Facade Bean]]/description ejb-nameFacade/ejb-name homeedu.columbia.law.tas.ejb.FacadeHome/home remoteedu.columbia.law.tas.ejb.Facade/remote ejb-classedu.columbia.law.tas.ejb.FacadeEJB/ejb-class session-typeStateful/session-type transaction-typeContainer/transaction-type /session jboss.xml session ejb-nameFacade/ejb-name !-- note this is your global name for FacadeHome watch it referenced in jbossweb.xml -- jndi-nameejb/tas/FacadeHome/jndi-name /session web.xml !-- this is the declaration that will bind FacadeHome into the local context of your web application so that you can do InitialContext initialContext = new InitialContext(); try { java.lang.Object objRef = initialContext.lookup(java:/comp/env/ejb/Facade); return (edu.columbia.law.tas.ejb.FacadeHome) PortableRemoteObject.narrow( objRef, edu.columbia.law.tas.ejb.FacadeHome.class); } finally { initialContext.close(); } -- ejb-ref ejb-ref-nameejb/Facade/ejb-ref-name ejb-ref-typeEntity/ejb-ref-type homeedu.columbia.law.tas.ejb.FacadeHome/home remoteedu.columbia.law.tas.ejb.Facade/remote ejb-linkFacade/ejb-link /ejb-ref jbossweb.xml !-- finally this is where you connect your ejb/Facade to the global home -- ejb-ref ejb-ref-nameejb/Facade/ejb-ref-name !-- local name fo it -- jndi-nameejb/tas/FacadeHome/jndi-name !-- global context look at jboss.xml -- /ejb-ref That is about it. The only thing that I can not find in jmx-console is how do I see the env context of my web context it has to have one, but it might be Jetty hidden. So I have not found a way to browse it. Alex. --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: Re[5]: [JBoss-user] help with bounding entity bean
Is there a performance penalty if I have a local interface and I look it up using the local JNDI name versus specifying a reference? All of our EBs and accessed via SLBs. XDoclet drops a JNDI_NAME string in the home interface and use that to look up the bean starting with getInitialContext(). They also provide COMP_NAME which is the java:comp/env... thing but since we are not using ejb-ref we do not use that. P.S. does the specification prohibit the placement of local JNDI names in the global namespace? - Original Message - From: Aleksandr Shneyderman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 10:38 AM Subject: RE: Re[5]: [JBoss-user] help with bounding entity bean Just to see that I am sure(please correct me and ofc any explanation is appreciated). the ejb-ref and ejb-local-ref work also with local/HandlerBean meaning I still a re-map from local/HandlerBean to something else. The ejb-ref and friends as far as I know is used together with the session bean. In my case I could access the bean without using the ejb-ref (I found it`s name from the jmx-console). (can anyone shed some light in this area?). Okay, each component [application, web context, ejb, ] you deply will have its own Context. It will be located at java:/comp/env. Now if you are looking for something that is bound to java:/comp/env from with a servlet you have to put it there. You would put it there thru ejb-ref in your web.xml If you used java:/comp/env from within an EJB then you would need references in the ejb-jar.xml That is all true about local context. JBoss however has a global context. Where it binds your objects. I am not sure exactly what convention is when you do not provide those three optional xmls that I was talking about in my earlier post, but those are basically needed to provide connections. So jboss.xml will bind your ejbs into the global context so that other components [apps] can reference it (in their local java:/comp/env; jbossweb.xml will do similar job for your web app. Okay just to give you some example, suppose we have a bean Facade: ejb-jar.xml session description![CDATA[Facade Bean]]/description ejb-nameFacade/ejb-name homeedu.columbia.law.tas.ejb.FacadeHome/home remoteedu.columbia.law.tas.ejb.Facade/remote ejb-classedu.columbia.law.tas.ejb.FacadeEJB/ejb-class session-typeStateful/session-type transaction-typeContainer/transaction-type /session jboss.xml session ejb-nameFacade/ejb-name !-- note this is your global name for FacadeHome watch it referenced in jbossweb.xml -- jndi-nameejb/tas/FacadeHome/jndi-name /session web.xml !-- this is the declaration that will bind FacadeHome into the local context of your web application so that you can do InitialContext initialContext = new InitialContext(); try { java.lang.Object objRef = initialContext.lookup(java:/comp/env/ejb/Facade); return (edu.columbia.law.tas.ejb.FacadeHome) PortableRemoteObject.narrow( objRef, edu.columbia.law.tas.ejb.FacadeHome.class); } finally { initialContext.close(); } -- ejb-ref ejb-ref-nameejb/Facade/ejb-ref-name ejb-ref-typeEntity/ejb-ref-type homeedu.columbia.law.tas.ejb.FacadeHome/home remoteedu.columbia.law.tas.ejb.Facade/remote ejb-linkFacade/ejb-link /ejb-ref jbossweb.xml !-- finally this is where you connect your ejb/Facade to the global home -- ejb-ref ejb-ref-nameejb/Facade/ejb-ref-name !-- local name fo it -- jndi-nameejb/tas/FacadeHome/jndi-name !-- global context look at jboss.xml -- /ejb-ref That is about it. The only thing that I can not find in jmx-console is how do I see the env context of my web context it has to have one, but it might be Jetty hidden. So I have not found a way to browse it. Alex. --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user