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.
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();
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.
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?
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…