wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Applet to servlet communication does not work in weblogic 9.2.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Applet to servlet communication does not work in weblogic 9.2.4" Watch "Applet to servlet communication does not work in weblogic 9.2.4" New topic
Author

Applet to servlet communication does not work in weblogic 9.2.4

Sangeetha Davey
Greenhorn

Joined: May 10, 2011
Posts: 5
I have an applet and am communicating to the servlet to create files in the server and client directories.
This is fine in weblogic 9.2. But when I downloaded weblogic 9.2 MP4 (Maintenace pack 4), this throws a stacktrace.
Here is the code:
URL url = new URL(surl);
in = new BufferedReader(new InputStreamReader(url.openStream()));

The stacktrace is: invalid stream header: 0D0A0D0A

The url is something like: http://xxx:7001/esm/esm?flowlet=com.emax.flow.fulfillment.general.M308_OrderListFlowlet&navaction=gridAppletStatus&gridname=M308

If I paste the url into a separate browser it is fine.

This is driving me crazy since this works in weblogic 9.2 So, what changed between weblogic 9.2 and weblogic 9.2.4. I see that the jrockit/java version has changed. Is it something to do with that? Is it a security configuration?
Your help is much appreciated. Thanks in advance.
Bal Mark
Greenhorn

Joined: Sep 27, 2002
Posts: 19
Hey Sangeetha,

Did you get anywhere with this? In finding the cause?

I came across the same problem and have had to put in a work around, the problem for me was the applet wasn't using sessionid from its containing page

For the work around, I ended up setting up an applet parameter that's set with the pages jsessionid, then inside the applet, when creating a url, setting the connection myConnection.setRequestProperty("Cookie", "JSESSIONID=" + sessionid);
Bal Mark
Greenhorn

Joined: Sep 27, 2002
Posts: 19
hmm instead of doing this, adding the line
<cookie-http-only>false</cookie-http-only>
to the service-descriptor in your weblogic.xml might help

It appears the reason for this is in 9.2 MP4 this is defaulted to true.. which means applets can't take the cookie info when they make requests.
I'm still looking for definative proof on the weblogic/oracle site to confirm this, but this'd also explain how my workaround in previous post worked too.

Sangeetha Davey
Greenhorn

Joined: May 10, 2011
Posts: 5
Thanks so much. That was it. Thank You Thank you!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet to servlet communication does not work in weblogic 9.2.4
 
Similar Threads
Weblogic 9.2 and custom JAAS config
JSP to Servlet - where is the code ?
jsp's generated servlet - where is it?
JSP to Servlet - where is the code ?
No longer able to connect to JNDI Datasource