users@glassfish.java.net

Applet unable to invoke http request to Glassfish

From: <glassfish_at_javadesktop.org>
Date: Fri, 26 Dec 2008 19:27:55 PST

We moved an app from JBoss to Glassfish but an Applet fails to work now. The Applet downloads and starts up, but fails to retrieves data. We coded the Applet to retrieve data by invoking a JSP which returns pipe delimited data to the Applet, rather than accessing the database directly.

This trick worked fine with JBoss, but with Glassfish even though the Applet assembles the URL perfectly and invokes it, the server behaves as if nothing happened. Glassfish's access log has NO record of the request. Why would this behave differently for Glassfish vs JBoss?

The Applet code invoking the request looks like this:
...
URL url = new URL("http://11.22.33.44:9999/appletQuery.jsp?querystring=select%20patientID%20from%20patient%20where%20lastname='Smith'");
BufferedReader input = new BufferedReader(new InputStreamReader(url.openStream() ) );
Vector buffer = new Vector();
String line;
while ((line = input.readLine()) != null) buffer.add(line);
input.close();
...

Launching of the Applet looks like this from JSP:

<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width=700 height=500 codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_01-windows-i586.cab#Version=1,4,0,0">
        <param name=CODE value="Print.class" >
        <param name=ARCHIVE value="Print.jar" >
        <param name="type" VALUE="application/x-java-applet;version=1.3">
        <param name="scriptable" VALUE="false">
        <param name="agency" value="<%=agencyCode%>">
        <param name="loginid" value="<%=loginid%>">
        <comment>
                <embed type="application/x-java-applet;version=1.3" loginid="<%=loginid%>" agency="<%=agencyCode%>" code="Print.class" archive value="Print.jar" width=700 height=500 scriptable=false
                        pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
                <noembed>
        </comment>
        alt="Your browser understands the &ltAPPLET&gt tag but isn't running the applet, for some reason."
        </noembed>
        </embed>
</object>

The debug output shows a valid URL is generated and invoked, but nothing happens. If we copy/paste the URL into the browser it runs fine, so we know the URL is good and we know the User session is good.

Does Glassfish have some sort of setting that would prevent an Applet from submitting a Request like this? I don't recall any such setting for JBoss and this has always worked for JBoss.

Thanks much for any ideas,
James
[Message sent by forum member 'jameshr' (jameshr)]

http://forums.java.net/jive/thread.jspa?messageID=323373