2

I'm using FindBugs 2.0.2. While validating my project with findbugs i'm getting following errors:

In class com.vo.Account
Field com.vo.Account.startDat
Actual type javax.xml.datatype.XMLGregorianCalendar
In Account.java
Class com.vo.Account defines non-transient non-serializable instance field startDat
This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods.  Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field.

and also

class com.demo.AccountResources relies on internal api classes
This class makes use of internal api classes. As these classes are not documented, nor externally released as part of the api, they are subject to change or removal. You should not be using these classes.

Packages that shouldn't be used are:
com.sun.xxx
org.apache.xerces.xxx
org.apache.xalan.xxx

how do I fix these errors? thanks in advance

epoch
  • 16,396
  • 4
  • 43
  • 71
nag
  • 31
  • 1
  • 4
  • 2
    1. Make the calendar transient. 2. Don't use classes in those packages, although I think FindBugs is wrong about all three of them. It should only complain about sun.* packages. There are many classes in com.sun.* that are public APIs, for example the JNDI context factories. – user207421 Apr 25 '14 at 15:09
  • if i make it as transient i can't send throw network and i can't get the vale in deserialization so is it right solution for the issue? – nag Apr 28 '14 at 08:45

0 Answers0