473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Client-server

22
Hi All,
i'm implementing client & server in my java application. in which client and server both have same class structure which they want to access . client wants some data related to its class member, and server provide those data at that time by writting the object of similar class to client.. client reads that object of class and that data.....
but problem is that ....they are working very well when client and server are in same folder but if client and server in different folders then client generates "java.io.InvalidClassException: EventLogEntry1; local class incompatible: stream classdesc serialVersionUID = 1522077819643630823, local class serialVersionUID = -6720342929791393780"...error at run time where EventLogEntry1 is the class name in both client & server...so please give me the solution if u have....
-thanks
Mar 25 '08 #1
5 1503
talonx
18
Hi All,
i'm implementing client & server in my java application. in which client and server both have same class structure which they want to access . client wants some data related to its class member, and server provide those data at that time by writting the object of similar class to client.. client reads that object of class and that data.....
but problem is that ....they are working very well when client and server are in same folder but if client and server in different folders then client generates "java.io.InvalidClassException: EventLogEntry1; local class incompatible: stream classdesc serialVersionUID = 1522077819643630823, local class serialVersionUID = -6720342929791393780"...error at run time where EventLogEntry1 is the class name in both client & server...so please give me the solution if u have....
-thanks
Hello,
The error means that you have two different versions of the same class (EventLogEntry1) - one on the server side, the other on the client side. When one side of the socket tries to read the serialized class and load the class definition that it has, it turns out to be different than the one that the other side has sent over the socket.
To explain further, different versions of the same class means you have changed something in the class (field, method signature etc) and compiled it, and put it on the classpath of either the server or the client. While the other side has the older compiled class file. (This is also evident from your own statement as to when it works).

The solution is to have the same versions of your classes on both client and server.
You might also want to read up on Java object serialization.

Hope this helps.

Regards
talonx
Mar 25 '08 #2
Navdip
22
Hello,
The error means that you have two different versions of the same class (EventLogEntry1) - one on the server side, the other on the client side. When one side of the socket tries to read the serialized class and load the class definition that it has, it turns out to be different than the one that the other side has sent over the socket.
To explain further, different versions of the same class means you have changed something in the class (field, method signature etc) and compiled it, and put it on the classpath of either the server or the client. While the other side has the older compiled class file. (This is also evident from your own statement as to when it works).

The solution is to have the same versions of your classes on both client and server.
You might also want to read up on Java object serialization.

Hope this helps.

Regards
talonx
Hi..Talonx
This is navdip.....i read your response & thanks to help...but as u wrote different version of class means there is mismatching of classes...but i gave same structure of classes in both client and server...only difference is that i took a constructor in server side to initialize their data...then should i remove that constructor..
Mar 26 '08 #3
Navdip
22
Thanks .....yaar i have removed the constructor fron server side And now its working... please keep in touch
Mar 26 '08 #4
Navdip
22
Hi..Talonx
This is navdip.....i read your response & thanks to help...but as u wrote different version of class means there is mismatching of classes...but i gave same structure of classes in both client and server...only difference is that i took a constructor in server side to initialize their data...then should i remove that constructor..


Hi..Talonx...
i have removed that constructor from server side now its working properly....Thanks a lot..
Mar 26 '08 #5
talonx
18
Hi..Talonx...
i have removed that constructor from server side now its working properly....Thanks a lot..
Good to know it helped.
Cheers!
- talonx
Mar 26 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
5
by: Paul H | last post by:
How do you folks get a reliable and complete brief of what is required before development starts? I am forever going back to a client once a project has started saying "Hang on, now that I've...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
11
by: pshindle | last post by:
We have several machines currently running the DB2 V7 Run-time Client that we would like to actually be running the App Dev Client. To 'upgrade' (within the same version) this client software can...
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
11
by: Wayne | last post by:
I am a one man enterprise and have been asked by a prospective client what happens to their database regarding ongoing changes etc if I get hit by a bus. Obviously my databases are distributed...
1
by: WebServiceSecurity | last post by:
The issue involves the following technologies: - 1. .NET 2.0 Framework 2. WSE2.0 (WS-Security) 3. X.509 certificates 4. BEA Weblogic 8.1.5
3
by: rjha94 | last post by:
Hi I just installed the runtime client on my windows machine. when i go inside the SQLLIB\bin folder i can see db2.exe. is it possible to use this db2 bundled with runtime client for command line...
4
MMcCarthy
by: MMcCarthy | last post by:
http://bytes.com/images/howtos/projectscope_blocks.jpgAs a freelance IT consultant for over 10 years, I’ve come to appreciate well defined project scopes. A project scope is a common understanding...
11
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.