• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my code piece
try {
HashMap theMap=new HashMap();
Object ref=null;
TestHarnessHome harnessHome=null;
Environment env = new Environment();
env.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
//env.setProviderUrl("t3://10.7.6.93:7777");
env.setProviderUrl("t3://127.0.0.1:7001");
env.setSecurityPrincipal("system");
env.setSecurityCredentials("security");

Context ctx=env.getInitialContext();
Context ctx1 = new InitialContext();
String val = (String)ctx1.lookup("java:comp/env/posturl");
System.out.println("val=="+val);
ref = ctx.lookup("TestHarnessEJB");
harnessHome=(TestHarnessHome)PortableRemoteObject.narrow(ref,Class.forName("com.synchronoss.util.testharness.ejb.TestHarnessHome"));
TestHarness test=harnessHome.create();
theMap.put("Order.Status", "P");
test.process(theMap);
}

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
ntextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
ava:130)
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
<env-entry>
<description>posturl</description>
<env-entry-name>posturl</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>testtt</env-entry-value>
</env-entry>
and the excerpt from weblogic-ejb-jar.xml
<weblogic-enterprise-bean>
<ejb-name>TestHarnessEJB</ejb-name>
<jndi-name>TestHarnessEJB</jndi-name>
</weblogic-enterprise-bean>
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 ]
 
Sheriff
Posts: 67641
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"hello boys", please check your private messages for an important administrative matter.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic