You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Hendy Irawan (JIRA)" <ji...@apache.org> on 2012/08/15 02:21:38 UTC

[jira] [Comment Edited] (ARIES-904) Blueprint throws java.util.ConcurrentModificationException when starting bundle

    [ https://issues.apache.org/jira/browse/ARIES-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434689#comment-13434689 ] 

Hendy Irawan edited comment on ARIES-904 at 8/15/12 11:20 AM:
--------------------------------------------------------------

Probably a useful snippet of the Blueprint XML.

I'm using JPA via EntityManagerFactory (cannot use jpa:context due to #ARIES-796 ), with CM PropertyPlaceholder as follows :

{code}
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
	xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
	xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0
        http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
        http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0 http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0
        http://aries.apache.org/xmlns/jpa/v1.0.0 http://aries.apache.org/xmlns/jpa/v1.0.0
        http://aries.apache.org/xmlns/transactions/v1.0.0 http://aries.apache.org/xmlns/transactions/v1.0.0">

	<cm:property-placeholder persistent-id="id.co.bippo.commerce" update-strategy="reload">
		<cm:default-properties>
			<cm:property name="auth.ldap.uri" value="ldap://localhost:10389"/>
			<cm:property name="auth.ldap.bind.dn" value="uid=admin,ou=system"/>
			<cm:property name="auth.ldap.bind.password" value="secret"/>
			<cm:property name="auth.ldap.basedn" value="ou=users,dc=dev,dc=berbatik,dc=com"/>
			
			<cm:property name="image.dav.uri" value="http://berbatik_dev:bippo@dav.berbatik.annafi.dev/"/>
			<cm:property name="image.public.uri" value="http://dav.berbatik.annafi.dev/"/>
			<cm:property name="image.mongo.uri" value="mongodb://127.0.0.1:27017/berbatik_dev_image"/>
			
			<cm:property name="booking.mongo.uri" value="mongodb://127.0.0.1:27017/berbatik_dev"/>
			
			<cm:property name="magento.apiuser" value="sysadmin"/>
			<cm:property name="magento.apikey" value="admin123"/>
			<cm:property name="magento.baseurl" value="http://www.berbatik.annafi.dev/"/>
		</cm:default-properties>
	</cm:property-placeholder>
	
	<reference id="magentoEmf" interface="javax.persistence.EntityManagerFactory"
				filter="(osgi.unit.name=magento)"/>
	<bean id="magentoEm" factory-ref="magentoEmf" factory-method="createEntityManager" destroy-method="close"/>
				
	<bean id="productDao" class="id.co.bippo.magento.jpa.dao.ProductDao">
		<!-- jpa:context unitname="magento" property="em" # see https://issues.apache.org/jira/browse/ARIES-796 /-->
		<property name="em" ref="magentoEm"/>
		<tx:transaction method="*" value="Required" />
	</bean>

	<service ref="productDao" auto-export="class-hierarchy">
		<service-properties>
			<entry key="clientId" value="berbatik"/>
			<entry key="tenantEnv" value="dev"/>
			<entry key="tenantId" value="berbatik"/>
			<entry key="namespace" value=""/>
		</service-properties>
	</service>

</blueprint>
{code}

Commenting this line:

{code}
<property name="em" ref="magentoEm"/>
{code}

makes the ConcurrentModificationException go away. (of course the bean will not work now... but I hope this is a clue)
                
      was (Author: ceefour):
    Probably a useful snippet of the Blueprint XML.

I'm using JPA via EntityManagerFactory (cannot use jpa:context due to #ARIES-796 ), with CM PropertyPlaceholder as follows :

{code}
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
	xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
	xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0
        http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
        http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0 http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0
        http://aries.apache.org/xmlns/jpa/v1.0.0 http://aries.apache.org/xmlns/jpa/v1.0.0
        http://aries.apache.org/xmlns/transactions/v1.0.0 http://aries.apache.org/xmlns/transactions/v1.0.0">

	<cm:property-placeholder persistent-id="id.co.bippo.commerce" update-strategy="reload">
		<cm:default-properties>
			<cm:property name="auth.ldap.uri" value="ldap://localhost:10389"/>
			<cm:property name="auth.ldap.bind.dn" value="uid=admin,ou=system"/>
			<cm:property name="auth.ldap.bind.password" value="secret"/>
			<cm:property name="auth.ldap.basedn" value="ou=users,dc=dev,dc=berbatik,dc=com"/>
			
			<cm:property name="image.dav.uri" value="http://berbatik_dev:bippo@dav.berbatik.annafi.dev/"/>
			<cm:property name="image.public.uri" value="http://dav.berbatik.annafi.dev/"/>
			<cm:property name="image.mongo.uri" value="mongodb://127.0.0.1:27017/berbatik_dev_image"/>
			
			<cm:property name="booking.mongo.uri" value="mongodb://127.0.0.1:27017/berbatik_dev"/>
			
			<cm:property name="magento.apiuser" value="sysadmin"/>
			<cm:property name="magento.apikey" value="admin123"/>
			<cm:property name="magento.baseurl" value="http://www.berbatik.annafi.dev/"/>
		</cm:default-properties>
	</cm:property-placeholder>
	
	<reference id="magentoEmf" interface="javax.persistence.EntityManagerFactory"
				filter="(osgi.unit.name=magento)"/>
	<bean id="magentoEm" factory-ref="magentoEmf" factory-method="createEntityManager" destroy-method="close"/>
				
	<bean id="productDao" class="id.co.bippo.magento.jpa.dao.ProductDao">
		<!-- jpa:context unitname="magento" property="em" # see https://issues.apache.org/jira/browse/ARIES-796 /-->
		<property name="em" ref="magentoEm"/>
		<tx:transaction method="*" value="Required" />
	</bean>

	<service ref="productDao" auto-export="class-hierarchy">
		<service-properties>
			<entry key="clientId" value="berbatik"/>
			<entry key="tenantEnv" value="dev"/>
			<entry key="tenantId" value="berbatik"/>
			<entry key="namespace" value=""/>
		</service-properties>
	</service>

</blueprint>
{code}

Commenting this line:

{code}
<property name="em" ref="magentoEm"/>
{code}

makes the ConcurrentModificationException go away.
                  
> Blueprint throws java.util.ConcurrentModificationException when starting bundle
> -------------------------------------------------------------------------------
>
>                 Key: ARIES-904
>                 URL: https://issues.apache.org/jira/browse/ARIES-904
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-core-0.3.2
>            Reporter: Hendy Irawan
>
> I'm not sure what combination exactly causes this, but current state of my project (which is unfortunately already quite complex) can always trigger this bug.
> Probably related to #FELIX-3242.
> {code}
> 2012-08-15 07:09:45,081 | ERROR | rint Extender: 1 | BlueprintContainerImpl           | container.BlueprintContainerImpl  364 | 9 - org.apache.aries.blueprint - 0.3.2 | Unable to start blueprint container for bundle id.co.bippo.commerce.core
> java.util.ConcurrentModificationException
>         at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:390)[:1.7.0_03]
>         at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:401)[:1.7.0_03]
>         at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1067)[:1.7.0_03]
>         at org.apache.aries.blueprint.container.RecipeBuilder.createRepository(RecipeBuilder.java:87)[9:org.apache.aries.blueprint:0.3.2]
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:495)[9:org.apache.aries.blueprint:0.3.2]
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:320)[9:org.apache.aries.blueprint:0.3.2]
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:230)[9:org.apache.aries.blueprint:0.3.2]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_03]
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_03]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_03]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_03]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_03]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_03]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_03]
>         at java.lang.Thread.run(Thread.java:722)[:1.7.0_03]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira