Java Glassfish Applet

Closed Posted Jan 6, 2009 Paid on delivery
Closed Paid on delivery

I 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("[[url removed, login to view]**appletQuery**.jsp?querystring=select%20patientID%20from%20patient%20where%20lastname='Smith'][1]");

BufferedReader input = new BufferedReader(new InputStreamReader([url removed, login to view]() ) );

Vector buffer = new Vector();

String line;

while ((line = [url removed, login to view]()) != null) [url removed, login to view](line);

[url removed, login to view]();

## Deliverables

I 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("[[url removed, login to view]**appletQuery**.jsp?querystring=select%20patientID%20from%20patient%20where%20lastname='Smith'][1]");

BufferedReader input = new BufferedReader(new InputStreamReader([url removed, login to view]() ) );

Vector buffer = new Vector();

String line;

while ((line = [url removed, login to view]()) != null) [url removed, login to view](line);

[url removed, login to view]();

...

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][2]">

? ? ? ? <param name=CODE value="[url removed, login to view]" >

? ? ? ? <param name=ARCHIVE value="[url removed, login to view]" >

? ? ? ? <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="[url removed, login to view]" archive value="[url removed, login to view]" width=700 height=500 scriptable=false

? ? ? ? ? ? ? ? ? ? ? ? pluginspage="[http://**java**.[url removed, login to view]][3]">

? ? ? ? ? ? ? ? <noembed>

? ? ? ? </comment>

? ? ? ? alt="Your browser understands the <**APPLET**> 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.

Code?

**try**

** **

{

queryString =

"select * from tableA";

String update = urlheader+

"[url removed, login to view]"+queryString;

[url removed, login to view](

"querystring: "+update);

url =

**new** URL(update);

BufferedReader input =

**new** BufferedReader(

**new** InputStreamReader([url removed, login to view]() ) );

String line;

**while** ( (line = [url removed, login to view]()) != **null**)

{

[url removed, login to view](line);

//[url removed, login to view](line);

}

[url removed, login to view]();

}

**catch** (MalformedURLException mal)

{

info =

"Data Error: "+[url removed, login to view]();

}

**catch** (IOException io)

{

info =

"Data Error: "+[url removed, login to view]();

}

Vector retData =

**new** Vector();

**for** (**int** i=0; i<[url removed, login to view](); i++)

{

String tmpLine = (String)[url removed, login to view](i);

?

[url removed, login to view](tmpLine);

**if** ([url removed, login to view]()>5)

{

**if** ([url removed, login to view](0,5).equals("ERROR"))

{

info = tmpLine;

**break**;

}

?

}

String row[] = parseRow(tmpLine);

**if** (row != **null** && [url removed, login to view] > 0) [url removed, login to view](row);

}

**if** (![url removed, login to view]("")) {

retval = **new** String[1][2];

retval[0][0] =

"ERROR";

retval[0][1] =

"Database Error: "+queryString;

**return** retval;

}

**if** ([url removed, login to view]() > 0)

{

String[] arow = (String[])[url removed, login to view](0);

[url removed, login to view](

"dbdata: "+arow);

retval =

**new** String[[url removed, login to view]()][[url removed, login to view]];

[url removed, login to view](retval);

}

//firePanelAction(ScheduleApplet, "ready", "changestatus",8);

**return** retval;

}

* * *This broadcast message was sent to all bidders on Wednesday Jan 7, 2009 10:46:04 AM:

Please review updated "other Requirements" section, as it has the actual code. Please bid if u know the problem.

Amazon Web Services Computer Security Engineering MySQL PHP Software Architecture Software Testing Web Hosting Web Security Website Management Website Testing

Project ID: #3519890

About the project

6 proposals Remote project Active Jan 15, 2009

6 freelancers are bidding on average $110 for this job

mrostan

See private message.

$72.25 USD in 14 days
(29 Reviews)
5.7
srisainaths

See private message.

$85 USD in 14 days
(24 Reviews)
4.5
docenttvw

See private message.

$34 USD in 14 days
(15 Reviews)
3.5
pensoftindia

See private message.

$382.5 USD in 14 days
(1 Review)
0.0
mohhmekk

See private message.

$42.5 USD in 14 days
(0 Reviews)
0.0
homedev

See private message.

$42.5 USD in 14 days
(0 Reviews)
0.0