0

データ オブジェクトをファイルにシリアライズし、サーブレット内でそのオブジェクトを読み取ろうとしました。

    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)

私のコードは

FileInputStream fin;
    try
    {
        fin = new FileInputStream( "G:\\search\\webapp\\DataManager\\WSList" );
        ObjectInputStream ois = new ObjectInputStream( fin );
        InfoRpc newObj = ( InfoRpc ) ois.readObject();
        newObj.getCategories();
        ois.close();
        return newObj;
    }
    catch ( FileNotFoundException e )
    {
        e.printStackTrace();
    }
    catch ( IOException e )
    {
        e.printStackTrace();
    }
    catch ( ClassNotFoundException e )
    {
        e.printStackTrace();
    }

何か案が ?

4

0 に答える 0