It's me ... again :-)
Ok, i tried a different approach.
I've got a SessionBean A and a SessionBean B.
Have to use IIOP as stated above.
My ejb-jar.xml looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <ejb-jar version="2.1"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
| <display-name>MyStuff-ejb</display-name>
|
| <enterprise-beans>
| <session>
| <display-name>B</display-name>
| <ejb-name>B</ejb-name>
| <home>mypkg.BHome</home>
| <remote>mypkg.B</remote>
| <ejb-class>mypkg.BBean</ejb-class>
| <session-type>Stateful</session-type>
| <transaction-type>Container</transaction-type>
| </session>
| <session>
| <display-name>A</display-name>
| <ejb-name>A</ejb-name>
| <home>mypkg.AHome</home>
| <remote>mypkg.A</remote>
| <ejb-class>mypkg.ABean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| <ejb-ref>
| <ejb-ref-name>ejb/A</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>mypkg.AHome</home>
| <remote>mypkg.A</remote>
| <ejb-link>A</ejb-link>
| </ejb-ref>
| </session>
| </enterprise-beans>
|
| <assembly-descriptor>
| <container-transaction>
| <method>
| <ejb-name>B</ejb-name>
| <method-name>*</method-name>
| </method>
| <trans-attribute>Required</trans-attribute>
| </container-transaction>
| <container-transaction>
| <method>
| <ejb-name>A</ejb-name>
| <method-name>*</method-name>
| </method>
| <trans-attribute>Required</trans-attribute>
| </container-transaction>
| </assembly-descriptor>
| </ejb-jar>
|
My jboss.xml looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <jboss>
| <enterprise-beans>
|
| <session>
| <ejb-name>A</ejb-name>
| <jndi-name>mystuff/A</jndi-name>
| <invoker-bindings>
| <invoker>
| <invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>
| </invoker>
| </invoker-bindings>
| </session>
|
| <session>
| <ejb-name>B</ejb-name>
| <jndi-name>mystuff/B</jndi-name>
| <invoker-bindings>
| <invoker>
| <invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>
| </invoker>
| </invoker-bindings>
| </session>
|
| </enterprise-beans>
| </jboss>
A makes use of B, so i have to look it up in order to invoke.
In ABean, I've tried to look up B via
Context ctx = new InitialContext()
followed by either
"ctx.lookup("java:comp/env/ejb/VFMSession")" or "ctx.lookup(
"mystuff/B" )", but none works.
How to get a reference to BHome??!
Should I change my jndi.properties?
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
|
| #java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962413#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...