• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sybase JNDI lookup woes

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've successfully deployed an ejb jar to Sybase (Jaguar 4.0) through JBuilder 6 Enterprise but cannot get a client to lookup the ejb successfully. I can get a context but get the following exception:
Errorjavax.naming.NamingException [Root exception is com.sybase.ejb.CosNaming.NamingContextPackage.NotFound]
Anyone have any ideas?
Here's the client code:
<code>
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
import java.util.*;
import welcome.*;

public class Client {
private static Enterprise1Home enterprise1Home = null;
private static Enterprise1 enterprise1 = null;
public static void main(String[] args) {
try {
System.out.println("Trying:");
Context jndiContext = getSybInitialContext();
if(jndiContext !=null) {
System.out.println("Context Not Null");
} else {
System.out.println(jndiContext.getClass());
System.out.println("Null Context");
}
Object obj= jndiContext.lookup("Jaguar/Enterprise1");
if (obj !=null) {
System.out.println("Object Not Null");
}else {
System.out.println("Null Object");
}
enterprise1Home = (Enterprise1Home) PortableRemoteObject.narrow(obj, Enterprise1Home.class);
if(enterprise1Home != null){
System.out.println("Home available");
}
} catch(Exception e) {
System.out.println("Error"+e);
}
}
public static InitialContext getSybInitialContext() throws NamingException
{
java.util.Properties p = new java.util.Properties();
// Sybase implementation of InitialContextFactory
p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sybase.ejb.InitialContextFactory");
// URL for the Server's IIOP port
p.put(Context.PROVIDER_URL, "iiop://localhost:9000");
p.put(Context.SECURITY_PRINCIPAL, "jagadmin");
p.put(Context.SECURITY_CREDENTIALS, "");
// Now create an InitialContext that uses the properties
return new InitialContext(p);
}
}
</code>
---------------------------
Jaguar Server startup
....
2 Phase Commit Option Licensed
Clustering Option Licensed
High Availability Option Licensed
Application Integrator for CICS Option Licensed
Invalid listen port number: 8787
Transport dt_socket failed to initialize, rc = -1.
FATAL ERROR in native method: No transports initialized
Starting services...
Accepting connections.
Exception in thread "Thread-5"
///-----------------------
Manoj had a similar problem at sybase.public.easerver.j2ee JNDI lookup problems. The solution was a combo of wrong JNDI name and a patch for JBuilder 5. I'm using JBuilder 6 so would think the patch would be included and tried every combo of the JNDI name possible....
Yoo-Jin.
[ January 04, 2002: Message edited by: Yoo-Jin Lee ]
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having the exact same problem but with EAServer 5.2.0
Has anyone found a solution?

Thanks,
Steven
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic