开发者

Cant understand my java.io.InvalidClassException: javax.swing.JComponent

开发者 https://www.devze.com 2023-03-08 04:27 出处:网络
I am using serialization to communicate with my server. This way My applet retrieves a JTree created in the server. In eclipse and appletViewer my applet works perfectly but when I try to launch my ap

I am using serialization to communicate with my server. This way My applet retrieves a JTree created in the server. In eclipse and appletViewer my applet works perfectly but when I try to launch my applet from my server I got this error on my console

java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = 5858390075012080263, local class serialVersionUID = -1030230214076481435

I tried to get serialVersionUID for every class of my project with serialver but none of them have serialVersionUID = 5858390075012080263.

the error is occuring when I try to deserialize my object . In addition to this ,the error says

java.io.InvalidClassException: javax.swing.JComponent.

How to determine the JComponent that causes this error? Is it my JTree? How can I set the serialVersionUID? By creating a class that extends thi开发者_Go百科s JComponent and set the serialVersionUID?


Problem solved. I have 4 different JREs on my system. It was a problem with the JVM itself not my classes. Now I use the same JRE everywhere and everything works fine .

0

精彩评论

暂无评论...
验证码 换一张
取 消