Details
-
Bug
-
Resolution: Obsolete
-
Low
-
None
-
None
Description
NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.
Hello Atlassian,
In one of my plugins i have noticed an incompatibility with xstream 1.3.1 and JDK 1.7 which caused one of my plugins based on the JIRA provided version to fail. The problem is fixed with xtream 1.4.4 so i'd like to ask you to provide this jar with JIRA 6.0. The following code used to work with JDK 1.6
XStream x = new XStream() a = new Allowed("a","b") s = x.toXML(a) x.fromXML(s)
where class Allowed is defined as
public class Allowed { private String users; private String groups; public Allowed(String users, String groups) { this.users = users; if (this.users == null) this.users = ""; this.groups = groups; if (this.groups == null) this.groups = ""; } public String getUsers() { return users; } public String getGroups() { return groups; } public String toString() { return "Users=>[" + users + "] Groups=>[" + groups+"]"; } }
Now likely xstream 1.3.1 does not support anymore the deserialization under JDK 1.7 if there is no non-arg constructor. This used to work JDK with 1.6.x . One gets the following error in the fromXML method:
javax.script.ScriptException: com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.xxx.xxxx.Allowed as it does not have a no-args constructor : Cannot construct com.xxx.xxxx.Allowed as it does not have a no-args constructor ---- Debugging information ---- message : Cannot construct com.xxx.xxxx.Allowed as it does not have a no-args constructor cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException cause-message : Cannot construct com.xxx.xxxx.Allowed as it does not have a no-args constructor class :com.xxx.xxxx.Allowed required-type : com.xxx.xxxx.Allowed path : /com.xxx.xxxx.Allowed line number : 1 -------------------------------
After i had replaced xstream-1.3.1.jar by xstream-1.4.4.jar everything works fine with all JDKs. It looks like currently JIRA does not use xstream as I do but as a precaution it might also be in Atlassians interest to update it
Attachments
Issue Links
- is related to
-
CONFSERVER-7278 Upgrade project dependencies to use XStream 1.2
- Closed
- relates to
-
JRACLOUD-32823 xstream-1.3.1.jar provided with 5.2/6.0 is not compatible with JDK 1.7
- Closed