commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhuvanesh Mani (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEANUTILS-477) Warnings from FluentPropertyBeanIntrospector when creating a CombinedConfiguration from a CombinedConfigurationBuilder
Date Wed, 03 Feb 2016 22:29:40 GMT

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

Bhuvanesh Mani commented on BEANUTILS-477:
------------------------------------------

Oliver, Appreciate your help if you could provide logging configuration which needs to be
changed. I am using beta 2.0 commons-configuration library and this warning is so annoying.

My piece of code:
            private INIConfiguration config = null;
            FileBasedConfigurationBuilder<INIConfiguration> builder = new FileBasedConfigurationBuilder<INIConfiguration>(INIConfiguration.class)
                    .configure(params.hierarchical().setFileName(this.filePath).setExpressionEngine(engine));

            config = builder.getConfiguration();

> Warnings from FluentPropertyBeanIntrospector when creating a CombinedConfiguration from
a CombinedConfigurationBuilder
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-477
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-477
>             Project: Commons BeanUtils
>          Issue Type: Bug
>    Affects Versions: 1.9.2
>         Environment: Windows 7 x64, Java 1.7, Apache Commons Configuration 2.0-alpha2
>            Reporter: Richard Tearle
>              Labels: newbie
>
> When creating a CombinedConfiguration from a CombinedConfigurationBuilder we get a number
of warnings from FluentPropertyBeanIntrospector whilst it's trying to get PropertyDescriptors
for the following methods: AbstractConfiguration.setProperty and MultiWrapDynaBean.set. 
> Is there a way to suppress these warnings or some other fix, as our testers keep reporting
the warnings as errors.
> The following is a simple example of the code that should reproduce this issue:
> {code}
>     @Test
>     public void configurationTestExample() {
>         List<FileLocationStrategy> subs = Arrays.asList(
>                 new ProvidedURLLocationStrategy(),
>                 new FileSystemLocationStrategy(),
>                 new ClasspathLocationStrategy());
>         FileLocationStrategy strategy = new CombinedLocationStrategy(subs);
>         
>         Parameters params = new Parameters();
>         CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder()
>             .configure(
>                     params.fileBased()
>                         .setFile(new File("Configuration.unitTest.xml"))
>                         .setLocationStrategy(strategy)
>                         .setListDelimiterHandler(new DefaultListDelimiterHandler(';'))
>                     );
>         try {
>             CombinedConfiguration config = builder.getConfiguration();
>             config.hashCode();
>         } catch (org.apache.commons.configuration2.ex.ConfigurationException e) {
>             e.printStackTrace();
>         }
>         
>         assertTrue(true);
>     }
> {code}
> and here is the stack trace
> {code}
> 16:16:54,037  WARN xxx:[main] (FluentPropertyBeanIntrospector.java:146) - Error when
creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)!
Ignoring this property.
> java.beans.IntrospectionException: bad write method arg count: public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)
> 	at java.beans.PropertyDescriptor.findPropertyType(PropertyDescriptor.java:670)
> 	at java.beans.PropertyDescriptor.setWriteMethod(PropertyDescriptor.java:325)
> 	at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:138)
> 	at org.apache.commons.beanutils.FluentPropertyBeanIntrospector.createFluentPropertyDescritor(FluentPropertyBeanIntrospector.java:177)
> 	at org.apache.commons.beanutils.FluentPropertyBeanIntrospector.introspect(FluentPropertyBeanIntrospector.java:140)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.fetchIntrospectionData(PropertyUtilsBean.java:2234)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.getIntrospectionData(PropertyUtilsBean.java:2215)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:950)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.isWriteable(PropertyUtilsBean.java:1466)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.isPropertyWriteable(BeanHelper.java:521)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.initProperty(BeanHelper.java:357)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.initBeanProperties(BeanHelper.java:273)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.initBean(BeanHelper.java:192)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper$BeanCreationContextImpl.initBean(BeanHelper.java:669)
> 	at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.initBeanInstance(DefaultBeanFactory.java:162)
> 	at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.createBean(DefaultBeanFactory.java:116)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.createBean(BeanHelper.java:459)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.createBean(BeanHelper.java:479)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.createBean(BeanHelper.java:492)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.createResultInstance(BasicConfigurationBuilder.java:447)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.createResult(BasicConfigurationBuilder.java:417)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.getConfiguration(BasicConfigurationBuilder.java:285)
> 	at org.apache.commons.configuration2.builder.combined.CombinedConfigurationBuilder.getDefinitionConfiguration(CombinedConfigurationBuilder.java:746)
> 	at org.apache.commons.configuration2.builder.combined.CombinedConfigurationBuilder.createResultDeclaration(CombinedConfigurationBuilder.java:776)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.getResultDeclaration(BasicConfigurationBuilder.java:485)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.createResultInstance(BasicConfigurationBuilder.java:447)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.createResult(BasicConfigurationBuilder.java:417)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.getConfiguration(BasicConfigurationBuilder.java:285)
> 	at com.northgateps.nds.platform.util.configuration.ConfigurationFactoryTest.testSingletonPattern(ConfigurationFactoryTest.java:55)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at junit.framework.TestCase.runTest(TestCase.java:176)
> 	at junit.framework.TestCase.runBare(TestCase.java:141)
> 	at junit.framework.TestResult$1.protect(TestResult.java:122)
> 	at junit.framework.TestResult.runProtected(TestResult.java:142)
> 	at junit.framework.TestResult.run(TestResult.java:125)
> 	at junit.framework.TestCase.run(TestCase.java:129)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:252)
> 	at junit.framework.TestSuite.run(TestSuite.java:247)
> 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> 16:16:54,150  WARN xxx:[main] (FluentPropertyBeanIntrospector.java:146) - Error when
creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)!
Ignoring this property.
> java.beans.IntrospectionException: bad write method arg count: public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)
> 	at java.beans.PropertyDescriptor.findPropertyType(PropertyDescriptor.java:670)
> 	at java.beans.PropertyDescriptor.setWriteMethod(PropertyDescriptor.java:325)
> 	at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:138)
> 	at org.apache.commons.beanutils.FluentPropertyBeanIntrospector.createFluentPropertyDescritor(FluentPropertyBeanIntrospector.java:177)
> 	at org.apache.commons.beanutils.FluentPropertyBeanIntrospector.introspect(FluentPropertyBeanIntrospector.java:140)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.fetchIntrospectionData(PropertyUtilsBean.java:2234)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.getIntrospectionData(PropertyUtilsBean.java:2215)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:950)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.isWriteable(PropertyUtilsBean.java:1466)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.isPropertyWriteable(BeanHelper.java:521)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.initProperty(BeanHelper.java:357)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.initBeanProperties(BeanHelper.java:273)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.initBean(BeanHelper.java:192)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper$BeanCreationContextImpl.initBean(BeanHelper.java:669)
> 	at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.initBeanInstance(DefaultBeanFactory.java:162)
> 	at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.createBean(DefaultBeanFactory.java:116)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.createBean(BeanHelper.java:459)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.createBean(BeanHelper.java:479)
> 	at org.apache.commons.configuration2.beanutils.BeanHelper.createBean(BeanHelper.java:492)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.createResultInstance(BasicConfigurationBuilder.java:447)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.createResult(BasicConfigurationBuilder.java:417)
> 	at org.apache.commons.configuration2.builder.BasicConfigurationBuilder.getConfiguration(BasicConfigurationBuilder.java:285)
> 	at com.northgateps.nds.platform.util.configuration.ConfigurationFactoryTest.testSingletonPattern(ConfigurationFactoryTest.java:55)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at junit.framework.TestCase.runTest(TestCase.java:176)
> 	at junit.framework.TestCase.runBare(TestCase.java:141)
> 	at junit.framework.TestResult$1.protect(TestResult.java:122)
> 	at junit.framework.TestResult.runProtected(TestResult.java:142)
> 	at junit.framework.TestResult.run(TestResult.java:125)
> 	at junit.framework.TestCase.run(TestCase.java:129)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:252)
> 	at junit.framework.TestSuite.run(TestSuite.java:247)
> 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {code}
> and finally, here is the Configuration.unitTest.xml
> {code:xml}
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <configuration>
> 	<header>
> 		<result throwExceptionOnMissing="true"/>
> 	</header>
> 	<!-- properties for the unit tests -->
> 	<properties fileName="unitTest.properties" throwExceptionOnMissing="true" config-name="properties">
> 		<listDelimiterHandler
>         	config-class="org.apache.commons.configuration2.convert.DefaultListDelimiterHandler">
>         	<config-constrarg config-value=";"/>
>       	</listDelimiterHandler>
> 	</properties>
> </configuration>
> {code}



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

Mime
View raw message