Skip to Content
author's profile photo Former Member
Former Member

Creating an Initial Context failed

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 24, 2005 at 03:50 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.