COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream

Hi there. I’m encountering an intermittent issue when running Java code from within Notes that calls URLs. The URL is reached and activity at the server end is processed, but the response is being blocked by Notes. Results in the following error:

at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:727)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:654)
at COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream(HttpURLConnection.java:411)
at JavaAgent.NotesMain(JavaAgent.java:23)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)

If this code is run in RAD/Eclipse there are no problems so the code is fine. As I say it was all working then suddenly not…then a few days later it works again. Now it’s been down for a week or so. Very frustrating.

I have tried:

  • all 3 security settings on the agent

  • Altered the What Others Do for Applets in Security for all users

-Tried a Clean Notes Install

No joy, though. Does anyone have an idea of what it may be?

BTW: The URLs being called are valid internal IBM ones.

Subject: New reply to: COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream

I would try this first as a test:

http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllFlatWeb/d628323139e3020685257920004a5ccb?OpenDocument http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllFlatWeb/d628323139e3020685257920004a5ccb?OpenDocument

If Java policy is not at fault I would open a ticket in support.

An alternate test/workaround would be to import java.net.HttpUrlConnection to overide the JEmpower classes.

You may have to install jars in this case, but I often use this solution when something work in Eclipse but not in Designer.

Subject: COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream

Hi Sam - thanks for replying…here’s the full trace:

java.lang.NullPointerException
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:727)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:654)
at COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream(HttpURLConnection.java:411)
at JavaAgent.NotesMain(JavaAgent.java:25)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)

The NullPointer refers to the HttpUrlConnection.responseMessage which is null and the HttpUrlConnection.responseCode which is -1.

This line is successfully (by checking target server log) → HttpURLConnection urlcon = (HttpURLConnection) url.openConnection();
But this throws the exception as the response is blocked → InputStream stream = urlcon.getInputStream();

Subject: Was this error fixed? “COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream”

Hi Matthew, I would like to ask is this issue has been resolved? Would like to know the solution you’ve applied because we are also having same issue.

Would appreciate your soonest reply.

Regards,

Barbara

Subject: Thanks, Marc!

Marc, thank you for saving the few hairs that are left in my head. And I confirm that your observation is correct. Opening the Java Console first causes this error.

Life is weird…

Thanks again

Sam

Subject: COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream

Hi Matthew,

It looks like the name of the Java exception itself is missing from the top of the exception stack you posted.

Can you send a reply with a complete stack including the name of the exception you are throwing? or is this all the output you’re receiving for some reason?

Thanks,

Sam

Subject: New reply to: COM.ibm.JEmpower.applet.http.HttpURLConnection.getInputStream

Subject: Solved (almost)

Had the same problem last night with a java agent that worked flawlessly on a Notes 7 client. After installing version 9 on a new computer and running the same agent, sometimes it would work and at other times I would receive that (impossible) NullPointerException

After trying every possible solution, changing security settings and java permissions, I realized that my agent was working if I didn’t start the Java Debug Console prior to launching the agent the first time after staring Notes.

What I found out was that, if you

  • Start Notes

  • Open the java debug console

  • launch the agent

  • You get a NulPointerException
    On the other hand, if I :

  • Start Notes

  • Launch the agent

  • Open the Java debug console

  • Success
    Subsequent launch of the Java agent will return the same result no matter if the debug console is open or not. All that matters is the first time…

OMG this is weird. Took me all night to finally understand how to “solve” my problem…

Please IBM fix this stupid bug.

Hope it helps.