commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DBCP-469) getter/setter for connectionInitSqls have different types
Date Thu, 27 Oct 2016 10:52:58 GMT

     [ https://issues.apache.org/jira/browse/DBCP-469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Bruno P. Kinoshita resolved DBCP-469.
-------------------------------------
    Resolution: Duplicate
      Assignee: Bruno P. Kinoshita

See DBCP-471. The only difference is that in this case we have Apache Aries Blueprint, and
not Spring. In this case, would be good to find a way to fix the issue in Blueprint.

> getter/setter for connectionInitSqls have different types
> ---------------------------------------------------------
>
>                 Key: DBCP-469
>                 URL: https://issues.apache.org/jira/browse/DBCP-469
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 2.1, 2.2, 2.1.1
>         Environment: karaf 3.0.6, datasource configured via blueprint.
>            Reporter: Jens Kleemann
>            Assignee: Bruno P. Kinoshita
>            Priority: Minor
>
> Using blueprint to setup BasicManagedDatasource fails because  getter/setter for connectionInitSqls
have different types. 
> {noformat}
> csi-ds-derby-embedded (281)
> ---------------------------
> Status: Failure
> Blueprint
> 23.08.16 13:22
> Exception:
> Error setting property: PropertyDescriptor <name: connectionInitSqls, getter: class
org.apache.commons.dbcp2.BasicDataSource.getConnectionInitSqls(), setter: [class org.apache.commons.dbcp2.BasicDataSource.setConnectionInitSqls(interface
java.util.Collection)]
> org.osgi.service.blueprint.container.ComponentDefinitionException: Error setting property:
PropertyDescriptor <name: connectionInitSqls, getter: class org.apache.commons.dbcp2.BasicDataSource.getConnectionInitSqls(),
setter: [class org.apache.commons.dbcp2.BasicDataSource.setConnectionInitSqls(interface java.util.Collection)]
>         at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:939)
>         at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:905)
>         at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:886)
>         at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)
>         at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
>         at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>         at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
>         at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:247)
>         at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:682)
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:377)
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>         at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
>         at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: At least
one Setter method has to match the type of the Getter method for property connectionInitSqls
>         at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.findMethodByClass(ReflectionUtils.java:708)
>         at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.findSetter(ReflectionUtils.java:687)
>         at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:627)
>         at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:380)
>         at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:937)
>         ... 23 more
> {noformat}
> blueprint fragment used:
> {code:xml}
> 	<bean id="dataSource" class="org.apache.commons.dbcp2.managed.BasicManagedDataSource">
> 		<property name="transactionManager" ref="jtaTransactionManager" />
> 		<property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" />
> 		<property name="url" value="jdbc:derby:${db.location}/csids;create=true" />
> 		<property name="maxTotal" value="${db.connectionPoolMaxActive}" />
> 		<property name="initialSize" value="${db.connectionPoolMaxIdle}"/>
> 		<property name="maxIdle" value="${db.connectionPoolMaxIdle}" />
> 		<property name="connectionInitSqls">
> 			<list>
> 				<value>set isolation READ COMMITTED</value>
> 			</list>
> 		</property>
> 	</bean>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message