I have 2 project:
1) Client – Android
2) Server – Google App Engine
At server-side I have class Entity that is called as Profile.
I included it in buildpath of the client the server project.
I’m creating a new instance of the profile in the client sending it to the server and storing it in JPA DB.
at the server side
after specific time I send from the server vector with all the clients in the server to the user.
The problems is:
when I’m adding the build path of the Profile I get:
The project was not built since its build path is incomplete. Cannot find the class file for javax.jdo.spi.PersistenceCapable.
The type javax.jdo.spi.PersistenceCapable cannot be resolved. It is indirectly referenced from required .class files
So in the client I’m adding the jdo2-api-2.3-eb.jar.
and the problem seems disappear.
But at runtime when I’m sending the Profile Vector form the server to the client I get:
java.io.InvalidClassException: javax.jdo.identity.LongIdentity; Incompatible class (SUID): javax.jdo.identity.LongIdentity: static final long serialVersionUID =2472141538875317527L; but expected javax.jdo.identity.LongIdentity: static final long serialVersionUID =2940818939440220368L;
that I believe is caused by jdo2-api-2.3-eb.jar that i added.
So I’m asking how to do this correctly? I understand that Maven or Ant can solve this problem but it seems very messy. Is there any old way by just using basic Eclipse to solve this? If Not I’ll appreciate other solution that comes with good tutorial.
I would use a non-binary format for transporting the data, such as JSON or XML. Trying to use binary serialization is going to lead to headaches, even once you get your build path problem sorted out and even if you use a more simple “transport” bean objects. For example, when you want to udpate either the client or the server, you have to keep them perfectly in sync (the JARs), you can’t have an old client communicate with a new server (or vice versa) without a LOT of extra work. But by using JSON or XML, the client and server can evolve somewhat independently.
Working with either XML or JSON on Android is very straightforward, same for Java EE (server).