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] [Commented] (CONFIGURATION-685) Implicit external dependency on DynaBean while loading a config
Date Fri, 22 Dec 2017 11:47:00 GMT

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

Bruno P. Kinoshita commented on CONFIGURATION-685:
--------------------------------------------------

Hi Fabien,

I believe the project has some runtime dependencies that you need to manually add to your
pom.xml if you use certain features (from what I recall from using & working on the component).

Take a look here to see if that covers your issue. I believe it's covered by the beanutils
dep in that table?

http://commons.apache.org/proper/commons-configuration/dependencies.html

Bruno

> Implicit external dependency on DynaBean while loading a config
> ---------------------------------------------------------------
>
>                 Key: CONFIGURATION-685
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-685
>             Project: Commons Configuration
>          Issue Type: Bug
>            Reporter: Fabien Renaud
>
> 100% repro.
> Getting an exception: DynaBean not found when trying to load an apache config file.
> Exception:
> {code}
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:264)
>         at com.sun.proxy.$Proxy0.<clinit>(Unknown Source)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>         at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
>         at org.apache.commons.configuration2.builder.fluent.Parameters.createParametersProxy(Parameters.java:307)
>         at org.apache.commons.configuration2.builder.fluent.Parameters.fileBased(Parameters.java:186)
>         at com.example.App.main(App.java:13)
> Caused by: java.lang.ClassNotFoundException: org.apache.commons.beanutils.DynaBean
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>         ... 11 more
> {code}
> when running:
> {code}
> package com.example;
> import org.apache.commons.configuration2.YAMLConfiguration;
> import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
> import org.apache.commons.configuration2.builder.fluent.Parameters;
> import org.apache.commons.configuration2.ex.ConfigurationException;
> class App {
>   public static void main(String[] args) throws ConfigurationException {
>     Parameters params = new Parameters();
>     FileBasedConfigurationBuilder<YAMLConfiguration> builder1 = new FileBasedConfigurationBuilder<>(YAMLConfiguration.class)
>       .configure(params.fileBased().setFileName("file.yml"));
>     YAMLConfiguration conf = builder1.getConfiguration();
>   }
> }
> {code}
> with build.gradle:
> {code}
> apply plugin: 'java'
> apply plugin: 'application'
> mainClassName = "com.example.App"
> repositories {
>     jcenter()
> }
> dependencies {
>   compile group: 'org.apache.commons', name: 'commons-configuration2', version: '2.2'
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message