Exception in thread "main" javax.naming.CommunicationException. Root exception
is java.net.ConnectException: t3s://localhost:7002: Destination unreachable; nes
ted exception is:
java.net.SocketException: [Security:090464]Problem accessing private key
; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:199)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:291)
at weblogic.jndi.Environment.getContext(Environment.java:164)
at weblogic.jndi.Environment.getInitialContext(Environment.java:143)
at SSLJNDIClient.main(SSLJNDIClient.java:32)
the JNDI client program is as follow:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import weblogic.jndi.Environment;
import weblogic.security.PEMInputStream;
import java.io.InputStream;
import java.io.FileInputStream;
public class SSLJNDIClient
{
public static void main(String[] args) throws Exception
{
Context context = null;
try
{
Environment env = new Environment();
// set connection parameters
env.setProviderUrl("t3s://localhost:7002");
// The next two set methodes are optional if you are using
// a UserNameMapper interface.
env.setSecurityPrincipal("epsecure");
env.setSecurityCredentials("sybmultbuf");
InputStream key = new FileInputStream("/tmp/testkey.der");
InputStream cert = new FileInputStream("/tmp/testcert.der");
// wrap input streams if key/cert are in pem files
//key = new PEMInputStream(key);
//cert = new PEMInputStream(cert);
env.setSSLClientCertificate(new InputStream[] { key, cert});
env.setInitialContextFactory(Environment.DEFAULT_INITIAL_CONTEXT_FACTORY);
context = env.getInitialContext();
Object myEJB = (Object) context.lookup("myEJB");
}
finally
{
if (context != null) context.close();
}
}
}
testkey.der and testcert.der were generated by the weblogic CertGen utility, what
am I missing here? please help.
thanks, xiaohong
Pavel.
Change request CR133267 has been filed on this issue.
- Neil