File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Java Products and Servers and the fly likes Sybase JNDI lookup woes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Sybase JNDI lookup woes" Watch "Sybase JNDI lookup woes" New topic

Sybase JNDI lookup woes

Yoo-Jin Lee
Ranch Hand

Joined: Nov 01, 2000
Posts: 119
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:
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 {
Context jndiContext = getSybInitialContext();
if(jndiContext !=null) {
System.out.println("Context Not Null");
} else {
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) {
public static InitialContext getSybInitialContext() throws NamingException
java.util.Properties p = new java.util.Properties();
// Sybase implementation of 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);
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....
[ January 04, 2002: Message edited by: Yoo-Jin Lee ]
Steven De Groote

Joined: Nov 23, 2006
Posts: 16
I'm having the exact same problem but with EAServer 5.2.0
Has anyone found a solution?


Web developer / SCEA / Owner
I agree. Here's the link:
subject: Sybase JNDI lookup woes
It's not a secret anymore!