[jboss-dev-forums] [Javassist Development] - java.io.EOFException

Sérgio Carvalho do-not-reply at jboss.com
Mon Sep 17 12:29:18 EDT 2012


Sérgio Carvalho [https://community.jboss.org/people/sergioffpc] created the discussion

"java.io.EOFException"

To view the discussion, visit: https://community.jboss.org/message/759981#759981

--------------------------------------------------------------
Hi,

I'm using javassist (3.16.1-GA) to change some existing classes and create new ones.

On the first stage I modify all my classes to inject new getters and setters for all declared fields, this works fine.

On the second stage I generate the new classes that invokes the getters and setters.

The problem is that most classes generate well and compile, but others raises the following exception.  Has anyone have this problem?

Source code is in here  http://pastebin.com/fnXKnwBr http://pastebin.com/fnXKnwBr

Thanks!

*EXCEPTION RAISED*

Exception in thread "main" java.lang.RuntimeException: java.io.EOFException
    at javassist.CtClassType.getClassFile2(CtClassType.java:204)
    at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:98)
    at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:84)
    at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:711)
    at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:688)
    at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
    at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
    at javassist.compiler.JvstTypeChecker.atMethodArgs(JvstTypeChecker.java:221)
    at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:709)
    at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:688)
    at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
    at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
    at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
    at javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
    at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
    at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
    at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
    at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
    at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
    at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
    at javassist.compiler.Javac.compileMethod(Javac.java:169)
    at javassist.compiler.Javac.compile(Javac.java:95)
    at javassist.CtNewMethod.make(CtNewMethod.java:74)
    at javassist.CtNewMethod.make(CtNewMethod.java:45)
    at pt.ptinovacao.pof.serializer.PofSerializeBuilder.createMethod(PofSerializeBuilder.java:126)
    at pt.ptinovacao.pof.serializer.PofSerializeBuilder.makeSerializerClass(PofSerializeBuilder.java:374)
    at pt.ptinovacao.pof.serializer.PofSerializeBuilder.buildSerializer(PofSerializeBuilder.java:112)
    at pt.ptinovacao.pof.serializer.PofSerializeBuilder.main(PofSerializeBuilder.java:58)
Caused by: java.io.EOFException
    at java.io.DataInputStream.readFully(DataInputStream.java:197)
    at java.io.DataInputStream.readFully(DataInputStream.java:169)
    at javassist.bytecode.CodeAttribute.<init>(CodeAttribute.java:108)
    at javassist.bytecode.AttributeInfo.read(AttributeInfo.java:81)
    at javassist.bytecode.MethodInfo.read(MethodInfo.java:528)
    at javassist.bytecode.MethodInfo.<init>(MethodInfo.java:87)
    at javassist.bytecode.ClassFile.read(ClassFile.java:793)
    at javassist.bytecode.ClassFile.<init>(ClassFile.java:114)
    at javassist.CtClassType.getClassFile2(CtClassType.java:191)
    ... 27 more
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/759981#759981]

Start a new discussion in Javassist Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2063]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120917/07721153/attachment.html 


More information about the jboss-dev-forums mailing list