ConcurentModExc in DefaultDataBindingExtensionPoint 
----------------------------------------------------

                 Key: TUSCANY-2085
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2085
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Data Binding Runtime
    Affects Versions: Java-SCA-1.1
            Reporter: Scott Kurz
            Priority: Minor
             Fix For: Java-SCA-Next


Get an exception like the following, 

java.util.ConcurrentModificationException
at java.util.AbstractList$SimpleListIterator.next(Unknown Source)at 
org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint.introspectType(DefaultDataBindingExtensionPoint.java:223)
at 
org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSFaultExceptionMapper.introspectFaultDataType(JAXWSFaultExceptionMapper.java:214)
at 
org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor.introspectFaultTypes(JAXWSJavaInterfaceProcessor.java:178)
at 
org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor.visitInterface(JAXWSJavaInterfaceProcessor.java:90)
at 
org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceIntrospectorImpl.introspectInterface(JavaInterfaceIntrospectorImpl.java:91)

as this thread, A, is in a for-loop looping through 'databindings'

 public boolean introspectType(DataType dataType, Annotation[] annotations, 
boolean isException) {
        loadDataBindings();
        for (DataBinding binding : databindings) {

while another thread, B, is still in loadDataBindings() and is still adding to 
the databindings ArrayList.

I'm working around this by putting a lock around the whole body  of 
loadDataBindings()

    private final byte[] loadingLock = new byte[0];
    ...
    private void loadDataBindings() {
        synchronized (loadingLock) {
            if (loadedDataBindings)
                return;
           ...
       }
   }

Another option might be to change addDataBinding() to look at the 'bindings' 
Map before adding to 'databindings'.   

I'll attach a patch and leave it for a second opinion.  


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to