cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an Initial Context failed

Former Member
0 Kudos

Dear Community

Let me aslk you with following problems:

I would like to call MailSend Service of WAS 6.20 by an standalone client. Therefore

I created a intial context which pointed to naming service of WAS 6.20.

I used following properties:

intial context factory = "com.inqmy.services.jndi.InitialContextFactoryImpl"

security principal = "Administrator"

security credentials = ""

provider url = "10.48.16.1:3011"

domain = true

If I run client I still get an intial context object. But when try to

lookup for RemoteObject "MailSession" I get an following exception:

11:14:34,053 WARN [NamingContext] Failed to connect to

speepsv1.walldorf.de:3011

javax.naming.CommunicationException: Failed to retrieve stub from

server speepsv1.walldorf.de:3011. Root exception is

java.io.StreamCorruptedException: invalid stream header

Next I will find concerning code snippet:

Properties properties = new Properties();

properties.put

(Context.INITIAL_CONTEXT_FACTORY, "com.inqmy.services.jndi.InitialContex

tFactoryImpl");

properties.put(Context.SECURITY_PRINCIPAL, "Administrator");

properties.put(Context.SECURITY_CREDENTIALS, "");

properties.put(Context.PROVIDER_URL, "10.48.16.1:3011");

properties.put("domain", "true");

InitialContext ctx = new InitialContext(properties);

Object o = ctx.lookup("java:comp/env/mail/MailSession");

sess = (Session) javax.rmi.PortableRemoteObject.narrow(o,

Session.class);

I do not have any idea solving this problem and would like to ask for any help.

Thanks & Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Annemarie,

the exception says that when the client retrieved a serialized object from the server (here: when trying to receive the stub) it is checked and indentified as c.

This can be a real network problem, but this is unprobable if the exception is always thrown at the same time. It can also be some "artificial" network problem, that content is filtered any something happens by that (strange erroneous firewall).

What I would try (even if it <i>should</i> not lead to success, but who knows) if: Are you on a JDK 1.3.1 on client side? If your are on 1.4.X or 1.5, there at least is the possibility that things go wrong depending on that version "conflict".

Hope it helps

Detlev