Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

<ejb-ref> related question

0 views
Skip to first unread message

Yonatan Taub

unread,
Jun 4, 2003, 11:45:58 AM6/4/03
to
I've developed a stateful session ejb. It has the following entry in
"ejb-jar.xml":

...
<session>
<display-name>L2CustomerBroker</display-name>
<ejb-name>L2CustomerBroker</ejb-name>
<home>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</home>
<remote>com.brighthaul.ste.server.brokers.L2CustomerBroker</remote>

<ejb-class>com.brighthaul.ste.server.brokers.L2CustomerBrokerBean</ejb-class
>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>

<ejb-ref-name>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</ejb-re
f-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</home>
<remote>com.brighthaul.ste.server.brokers.L2CustomerBroker</remote>
<ejb-link>L2CustomerBroker</ejb-link>
</ejb-ref>
</session>
...

Its matching entry in "weblogic-ejb-jar.xml" is:


...
<weblogic-enterprise-bean>
<ejb-name>L2CustomerBroker</ejb-name>
<stateful-session-descriptor>
<stateful-session-clustering/>
<allow-concurrent-calls>true</allow-concurrent-calls> <!-- Is this
right?!! -->
</stateful-session-descriptor>
<transaction-descriptor/>
<reference-descriptor>
<ejb-reference-description>

<ejb-ref-name>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</ejb-re
f-name>
<jndi-name>L2CustomerBroker</jndi-name>
</ejb-reference-description>
</reference-descriptor>
<jndi-name>L2CustomerBroker</jndi-name>
</weblogic-enterprise-bean>
...


When a simple test application tries to locate the *L2CustomerBroker* bean
via:

...
context.lookup("com.brighthaul.ste.server.brokers.L2CustomerBroker");
...

a NamingException is thrown:

javax.naming.NameNotFoundException: Unable to resolve
'com.brighthaul.ste.server.brokers.L2CustomerBrokerHome' Resolved: ''
Unresolved:'com' ; remaining name
'com.brighthaul.ste.server.brokers.L2CustomerBroker'
at
weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
java:109)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
:263)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
:230)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown
Source)
at
weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
at
weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at
com.brighthaul.ste.common.util.EJBHomeFactory.lookUpHome(EJBHomeFactory.java
:77)
at
com.brighthaul.ste.server.brokers.DeleteMe.main(DeleteMe.java:15)
Exception in thread "main"


What am I doing wrong?
I'm able to locate the home interface via the "usual" way (looking up
"L2CustomerBroker").

Slava Imeshev

unread,
Jun 4, 2003, 1:38:45 PM6/4/03
to
Hi Yonatan,

Replace

com.brighthaul.ste.server.brokers.L2CustomerBroker

in ejb-ref-name with

ejb/com.brighthaul.ste.server.brokers.L2CustomerBroker

and use


context.lookup("java:comp/ejb/com.brighthaul.ste.server.brokers.L2CustomerBr
oker");

in your code to look up the bean

Hopr this helps.

Regards,

S;ava Imeshev

"Yonatan Taub" <jona...@brighthaul.com> wrote in message
news:3ede...@newsgroups.bea.com...

Michael Kovacs

unread,
Jun 5, 2003, 1:15:05 AM6/5/03
to
Hey Slava and Yonatan,

I think you mean
context.lookup("java:comp/env/ejb/com.brighthaul.ste.server.brokers.L2Custom
erBroker");

java:comp/env is the prefix for references

--
Michael Kovacs
Senior Software Engineer
BEA Systems
"Slava Imeshev" <ime...@yahoo.com> wrote in message
news:3ede2d2a$1...@newsgroups.bea.com...

Yonatan Taub

unread,
Jun 5, 2003, 3:55:43 AM6/5/03
to
I've tried different combinations but failed.
Is it legal for a bean to refer to itself in the <ejb-ref>?
The lookup I'm performing is done from a standalone application. Does the
<ejb-ref> allow that or is it just for co-located beans on the server?


If you can provide me with some sample code I would greatly appreciate it.

"Michael Kovacs" <nom...@foo.com> wrote in message

Slava Imeshev

unread,
Jun 6, 2003, 12:36:01 AM6/6/03
to
Hi Michael,

Thanks for correction, I did mean java:comp/env/ejb.

Regards,

Slava Imeshev

"Michael Kovacs" <nom...@foo.com> wrote in message

0 new messages