• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

weblogic6.1 - JNDI name  RSS feed

 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI:
I installed weblogic6.1 on winNT. I wrote all the EJB code - Hello, I defined the JNDI name Which is 'HelloHome'
in weblogic-ejb-jar.xml.
but when I run the EJB Client, I got the following error:

javax.naming.NameNotFoundException: Unable to resolve HelloHome. Resolved: '' Un
resolved:'HelloHome' ; remaining name ''
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundR
equest.java:85)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:253)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:220)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy0.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.etco.af.tests.hello.HelloTest.main(Unknown Source)
I really don't know what happen. Any difference of directories
between weblogic6.1 and weblogic6.0?
Please help!!!
Sarah
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls post your ejb-jar.xml and weblogic-ejb-jar.xml and the piece of code where you try to recover the jndi context, cause problably something is wrong with it, I use WL6.1 and don�t have problems with jndi.
If you post it we�re gonna be able to help you.
regards.
 
Author
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't register your bean appropriately in the JNDI. Check for the names in the deployment descriptors.
Cheers,
Matjaz

------------------
Matjaz Juric
Author of Professional EJB
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!
I use MyProxy instead of Hello. Here is the code:
1. ejb-jar.xml:
<?xml version="1.0"?>
< !DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>MyProxyEJB</ejb-name>
<home>com.etco.af.tests.hello.MyProxyHome</home>
<remote>com.etco.af.tests.hello.MyProxy</remote>
<ejb-class>com.etco.af.tests.hello.MyProxyBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MyProxyEJB</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
2. weblogic-ejb-jar.xml:
<?xml version="1.0"?>
< !DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>MyProxyEJB</ejb-name>
<caching-descriptor>
<max-beans-in-cache>100</max-beans-in-cache>
</caching-descriptor>
<jndi-name>MyProxyHome</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
3. piece of Client code:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
try {
InitialContext ic = new InitialContext(env);
System.out.println("Got context");
System.out.println("ic = " + ic);
//Error message Here:
Object ref = ic.lookup("MyProxyHome");
--error message:
javax.naming.NameNotFoundException: Unable to resolve MyProxyHome. Resolved: ''
Unresolved:'MyProxyHome' ; remaining name ''
at weblogic.rmi.internal.AbstractOutboundRequest.sendReceive(AbstractOut
boundRequest.java:90)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:247)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:225)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNod
e_WLStub.java:121)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.etco.af.tests.hello.MyProxyClientTest.main(Unknown Source)
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
try to change the DOC type from your weblogic-ejb-jar.xml to:
< !DOCTYPE weblogic-ejb-jar PUBLIC <br /> '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN' <br /> 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
and also if it does not work try to make a straigth cast(I know this is out of the specs, but as you know it�s a java type and not a CORBA object you can do so) to the home tipe of your bean in the lookup method as:
EJBHome home = (EJBHome) ctx.lookup("JNDI_NAME");
if this doesn�t work you can send me the code at:
mmaia@mrbrasilia.com.br or mmaia@linkexpress.com.br
and I�ll take a look for you.
regards.
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all!
Marcos, I modified my code as you suggested but still
doesn't work, same error message. Then I wrote a small
simple Hello code which works fine. In MyProxy code,
I need to use dynamic proxy class, that maybe the reason
cause the problem. But I don't know why. Do you have any
idea it or some samples of dynamic proxy class? Thanks
again!
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebLogic 6.1 cames with a proxy servlet and all you need to do is configure it�w war.xml dd, take a look at: http://e-docs.bea.com/wls/docs61/adminguide/http_proxy.html#112633

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!