嵌入在HTML中的JAVA Applet在操作过程中挂起

时间:2011-11-21 12:11:13

标签: java web-services applet jax-ws

我在一台计算机上运行了一个Web服务,我想通过Applet访问该Web服务。独立的Applet可以完美运行,没有打嗝。但是当我将该applet嵌入到html文件中时,真正的问题就开始了。由于一些客户端限制,我需要将applet嵌入到Html文件中。当我打开html页面但不访问Web服务时,applet会启动。

我知道必须对Applet进行签名,以便它可以访问所有可用的资源。我已经签了Jar但它仍然挂起。为了解决这个问题,我想到了监控从客户端到运行Web服务的服务器的网络流量。我发现了一些差异......

当我运行独立的JAVA Applet(JAR文件)时:它调用确切的Web服务链接并获取响应。另一个最重要的事情是,它调用javaw.exe和完美的POST请求(第3个请求如下所示)。

javaw.exe   172.22.1.98 SANKET-BA4C8C90     TCP TCP:Flags=...A..S., SrcPort=HTTP Alternate(8080), DstPort=3868, PayloadLen=0, Seq=271218130, Ack=957649749, Win=65535 ( Scale factor not supported ) = 65535    {TCP:1, IPv4:15}

javaw.exe   SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...., SrcPort=3868, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=957649749, Ack=271218131, Win=65535 (scale factor 0x0) = 65535    {TCP:1, IPv4:15}

javaw.exe   SANKET-BA4C8C90     172.22.1.98 HTTP    HTTP:Request, POST /LEDLabServer/services/Blink     {HTTP:2, TCP:1, IPv4:15}

javaw.exe   172.22.1.98 SANKET-BA4C8C90     TCP TCP:Flags=...A...., SrcPort=HTTP Alternate(8080), DstPort=3868, PayloadLen=0, Seq=271218131, Ack=957650035, Win=65249 (scale factor 0x0) = 65249    {TCP:1, IPv4:15}

javaw.exe   SANKET-BA4C8C90     172.22.1.98 SOAP    SOAP:xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   {HTTP:2, TCP:1, IPv4:15}

javaw.exe   172.22.1.98 SANKET-BA4C8C90     SOAP    SOAP:xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   {HTTP:2, TCP:1, IPv4:15}

javaw.exe   172.22.1.98 SANKET-BA4C8C90     TCP TCP:Flags=...A...F, SrcPort=HTTP Alternate(8080), DstPort=3868, PayloadLen=0, Seq=271218757, Ack=957650351, Win=64933 (scale factor 0x0) = 64933    {TCP:1, IPv4:15}

javaw.exe   SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...., SrcPort=3868, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=957650351, Ack=271218758, Win=64909 (scale factor 0x0) = 64909    {TCP:1, IPv4:15}

javaw.exe   SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...F, SrcPort=3868, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=957650351, Ack=271218758, Win=64909 (scale factor 0x0) = 64909    {TCP:1, IPv4:15}

当我运行嵌入在HTML文件中的相同applet时:我得到明显的结果,其中它调用java.exe并调用Get与Web服务的不正确链接(指向serviceexception.class而不是POST / LEDLabServer / services / Blink)< / p>

java.exe    SANKET-BA4C8C90     172.22.1.98 HTTP    HTTP:Request, GET /LEDLabServer/sampleBlinkProxy/javax/xml/rpc/ServiceException.class   {HTTP:110, TCP:109, IPv4:15}

java.exe    172.22.1.98 SANKET-BA4C8C90     HTTP    HTTP:Response, HTTP/1.1, Status: Not found, URL: /LEDLabServer/sampleBlinkProxy/javax/xml/rpc/ServiceException.class    {HTTP:110, TCP:109, IPv4:15}

java.exe    SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...., SrcPort=3899, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=3129701517, Ack=3474193866, Win=64243 (scale factor 0x0) = 64243  {TCP:109, IPv4:15}
java.exe    SANKET-BA4C8C90     172.22.1.98 HTTP    HTTP:Request, GET /LEDLabServer/sampleBlinkProxy/javax/xml/rpc/ServiceException.class   {HTTP:110, TCP:109, IPv4:15}

java.exe    172.22.1.98 SANKET-BA4C8C90     HTTP    HTTP:Response, HTTP/1.1, Status: Not found, URL: /LEDLabServer/sampleBlinkProxy/javax/xml/rpc/ServiceException.class    {HTTP:110, TCP:109, IPv4:15}

java.exe    SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...., SrcPort=3899, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=3129701767, Ack=3474195158, Win=65535 (scale factor 0x0) = 65535  {TCP:109, IPv4:15}

java.exe    SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...F, SrcPort=3899, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=3129701767, Ack=3474195158, Win=65535 (scale factor 0x0) = 65535  {TCP:109, IPv4:15}

java.exe    172.22.1.98 SANKET-BA4C8C90     TCP TCP:Flags=...A...., SrcPort=HTTP Alternate(8080), DstPort=3899, PayloadLen=0, Seq=3474195158, Ack=3129701768, Win=64535 (scale factor 0x0) = 64535  {TCP:109, IPv4:15}

java.exe    172.22.1.98 SANKET-BA4C8C90     TCP TCP:Flags=...A...F, SrcPort=HTTP Alternate(8080), DstPort=3899, PayloadLen=0, Seq=3474195158, Ack=3129701768, Win=64535 (scale factor 0x0) = 64535  {TCP:109, IPv4:15}

java.exe    SANKET-BA4C8C90     172.22.1.98 TCP TCP:Flags=...A...., SrcPort=3899, DstPort=HTTP Alternate(8080), PayloadLen=0, Seq=3129701768, Ack=3474195159, Win=65535 (scale factor 0x0) = 65535  {TCP:109, IPv4:15}

PS:我正在使用JAXRPC进行Web服务。

有人可以帮我吗?

1 个答案:

答案 0 :(得分:1)

问题在您的日志中非常明显:

HTTP:响应,HTTP / 1.1,状态:未找到,URL:/LEDLabServer/sampleBlinkProxy/javax/xml/rpc/ServiceException.class

您没有在正确的位置安装类文件,因此浏览器无法找到它们。