jQuery in Action, 3rd edition
The moose likes EJB and other Java EE Technologies and the fly likes javax.naming. NameNotFoundException :  remaining name: env/posturl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "javax.naming. NameNotFoundException :  remaining name: env/posturl" Watch "javax.naming. NameNotFoundException :  remaining name: env/posturl" New topic

javax.naming. NameNotFoundException : remaining name: env/posturl

Sriram Hari

Joined: Jul 15, 2008
Posts: 1
Here is my code piece
try {
HashMap theMap=new HashMap();
Object ref=null;
TestHarnessHome harnessHome=null;
Environment env = new Environment();

Context ctx=env.getInitialContext();
Context ctx1 = new InitialContext();
String val = (String)ctx1.lookup("java:comp/env/posturl");
ref = ctx.lookup("TestHarnessEJB");
TestHarness test=harnessHome.create();
theMap.put("Order.Status", "P");

I am trying to lookup two things here

1.EJB JNDI Name which is ctx.lookup("TestHarnessEJB");
2.Environment entry in ejb-jar.xml -ctx1.lookup("java:comp/env/posturl");

First one is a success whereas the second one is a failure with the below exception
javax.naming.NameNotFoundException: remaining name: env/posturl
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:64)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyCo
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.synchronoss.util.testharness.ejb.Client.main(Client.java:109)

I am testing the deployed ejb from a stand alone java program.

Here is an excerpt from ejb-jar.xml
and the excerpt from weblogic-ejb-jar.xml
I dont understand whats causing the problem.I am trying for the solution for more than 2 days..someone help please
[ July 15, 2008: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63227

"hello boys", please check your private messages for an important administrative matter.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: javax.naming. NameNotFoundException : remaining name: env/posturl
It's not a secret anymore!