chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <f...@apache.org>
Subject Re: Is Android client library thread-safe
Date Thu, 09 Oct 2014 15:19:07 GMT
Hi Brian,

The Android library is supposed to be thread-safe. Your stack trace 
doesn't really provide a hint how this is OpenCMIS related.
ObjectType objects are read-only. They are created and never change. I 
would be surprised if there is a threading issue.

There has been a race condition in a different place (CMIS-769 [1]), 
which has been fixed in 0.11.0.
If you can, please upgrade to 0.12.0. It's easier for us to locate 
issues in the last version.


- Florian



[1] https://issues.apache.org/jira/browse/CMIS-769


> Hi,
> 
> We are using the Android client library (OpenCMIS version 0.10.0) to
> develop a CMIS Consumer App.  If a user uses the App to upload a
> document and, while the upload is progressing, views another object's
> properties, the App sometimes crashes with a
> java.util.ConcurrentModificationException.  We believe it is caused by
> multiple threads accessing
> org.apache.chemistry.opencmis.client.api.ObjectType.  Is this because
> the class is not thread-safe?  Is there anything we can do to protect
> our App from this exception while being able to access the library
> from multiple threads?  Would upgrading to version 0.11 or 0.12 help?
> 
> 10-01 22:44:45.981: E/AndroidRuntime(27060): FATAL EXCEPTION: main
> 10-01 22:44:45.981: E/AndroidRuntime(27060):
> java.util.ConcurrentModificationException
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:347)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:376)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:374)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.util.HashMap.writeObject(HashMap.java:993)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.lang.reflect.Method.invoke(Method.java:525)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1053)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.util.HashMap.writeObject(HashMap.java:995)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.lang.reflect.Method.invoke(Method.java:525)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1053)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.util.HashMap.writeObject(HashMap.java:995)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.lang.reflect.Method.invoke(Method.java:525)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1053)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
> 10-01 22:44:45.981: E/AndroidRuntime(27060): at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
> ...
> 
> ... Brian ...

Mime
View raw message