0

与启动应用程序相比,熟悉Webstart(javaws.exe)开始差异的任何人。使用java.exe或javaw.exe关于流?ObjectInputStream中的EOFException仅在Webstart不是由java(w).exe发生?

这是使用Webstart的时我只得到异常:

java.io.EOFException 
    at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) 
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source) 
    at java.io.ObjectInputStream.readStreamHeader(Unknown Source) 
    at java.io.ObjectInputStream.<init>(Unknown Source) 
    at fasttools.jtools.dss.api.core.remoting.thinclient.RemoteSocketChannel.<init>(RemoteSocketChannel.java:77) 

我就是这样设置在两侧的连接

//==Server side== 
//Thread{ 
Socket mClientSocket = cServSock.accept(); 
new DssServant(mClientSocket).start(); 
//} 

DssServant(Socket socket) throws DssException { 
    try { 
    OutputStream mOutputStream = new BufferedOutputStream(socket.getOutputStream()); 
    cObjectOutputStream = new ObjectOutputStream(mOutputStream); 
    cObjectOutputStream.flush(); //publish streamHeader 
    InputStream mInputStream = new BufferedInputStream(socket.getInputStream()); 
    cObjectInputStream = new ObjectInputStream(mInputStream); 
    .. 
    } catch (IOException e) { 
    .. 
    } 
    .. 
} 

//==Client side== 
public RemoteSocketChannel(String host, int port, IEventDispatcher eventSubscriptionHandler) throws DssException { 
    cHost = host; 
    port = (port == 0 ? DssServer.PORT : port); 
    try { 
    cSocket = new Socket(cHost, port); 

    OutputStream mOutputStream = new BufferedOutputStream(cSocket.getOutputStream()); 
    cObjectOut = new ObjectOutputStream(mOutputStream); 
    cObjectOut.flush(); //publish streamHeader 
    InputStream mInputStream = new BufferedInputStream(cSocket.getInputStream()); 
    cObjectIn = new ObjectInputStream(mInputStream); 

    } catch (IOException e) { 
    .. 
    } 
    .. 
} 

[编辑] Webstart的控制台说: Java Web Start 1.6.0_19 使用JRE版本1.6.0_19-b04 Java HotSpot(TM)客户端VM

服务器运行同样1.6u19

[编辑] JNLP包含:

<?xml version="1.0" encoding="utf-8"?> 

<jnlp spec="1.0+" codebase="http://127.0.0.1:8080/"> 
    <information> 
    <title>..</title> 
    <vendor>..</vendor> 
    <homepage href="http://127.0.0.1:8080/index.html"/> 
    <description>..</description> 
    <icon href="/jws/.."/> 
    <icon kind="splash" href="/jws/...jpg"/> 
    <offline-allowed/> 
    </information> 

    <security> 
    <all-permissions/> 
    </security> 

    <resources> 
    <j2se version="1.6+" initial-heap-size="128M" max-heap-size="512M"/> 
    <jar href="http://127.0.0.1:8080/lib/xx.jar"/> 
    <jar href="http://127.0.0.1:8080/lib/yy.jar"/> 
    </resources> 

    <application-desc main-class=".."> 
    <argument>-host</argument>  <argument>127.0.0.1</argument> 
    <argument>-port</argument>  <argument>4359</argument> 
    <argument>-httpport</argument> <argument>8080</argument> 
    </application-desc> 
</jnlp> 

感谢

回答

0

oH mY !!

我找到了问题所在。 由从现有程序复制的servlet生成的JNLP文件,提供了port-nr参数。但端口号没有更正.. 提供的端口是(现有)安全套接字..我的应用程序使用非安全套接字!

多么awfull错误