java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>()

tip

I downgraded to spark-notebook scala 2.10 with hadoop 2.6.0 then it worked. Finally switched to Apache Drill, works like a charm for diverse datasets.


rp

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • This bug exist in latest head checkout a couple of days before I created this bug. Test Case: <bean id="map" class="java.util.HashMap"/> <bean id="unmodifiableMap" class="java.util.Collections" factory-method="unmodifiableMap"> <constructor-arg ref="map"/> </bean> <bean id="unmodifiableMap2" class="java.util.Collections" factory-method="unmodifiableMap" lazy-init="false"> <constructor-arg ref="unmodifiableMap"/> </bean> Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'unmodifiableMap2' defined in ServletContext resource [/WEB-INF/spring-contexts/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.Collections$UnmodifiableMap]: No default constructor found; nested exception is java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.Collections$UnmodifiableMap]: No default constructor found; nested exception is java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getDeclaredConstructor(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:149) at org.springframework.beans.PropertyTypeConverter.convertToTypedMap(PropertyTypeConverter.java:316) at org.springframework.beans.PropertyTypeConverter.convertIfNecessary(PropertyTypeConverter.java:188) at org.springframework.beans.PropertyTypeConverter.convertIfNecessary(PropertyTypeConverter.java:124) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:792) at org.springframework.beans.factory.support.AbstractBeanFactory.doTypeConversionIfNecessary(AbstractBeanFactory.java:673) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:371) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:235) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:520) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:373) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:241) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:152) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:155) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    via by Mike Youngstrom,
  • This bug exist in latest head checkout a couple of days before I created this bug. Test Case: <bean id="map" class="java.util.HashMap"/> <bean id="unmodifiableMap" class="java.util.Collections" factory-method="unmodifiableMap"> <constructor-arg ref="map"/> </bean> <bean id="unmodifiableMap2" class="java.util.Collections" factory-method="unmodifiableMap" lazy-init="false"> <constructor-arg ref="unmodifiableMap"/> </bean> Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'unmodifiableMap2' defined in ServletContext resource [/WEB-INF/spring-contexts/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.Collections$UnmodifiableMap]: No default constructor found; nested exception is java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.Collections$UnmodifiableMap]: No default constructor found; nested exception is java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getDeclaredConstructor(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:149) at org.springframework.beans.PropertyTypeConverter.convertToTypedMap(PropertyTypeConverter.java:316) at org.springframework.beans.PropertyTypeConverter.convertIfNecessary(PropertyTypeConverter.java:188) at org.springframework.beans.PropertyTypeConverter.convertIfNecessary(PropertyTypeConverter.java:124) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:792) at org.springframework.beans.factory.support.AbstractBeanFactory.doTypeConversionIfNecessary(AbstractBeanFactory.java:673) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:371) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:235) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:520) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:373) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:241) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:152) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:155) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    via by Mike Youngstrom,
  • in dspace.conf, if set search.analyzer = org.apache.lucene.analysis.cn.ChineseAnalyzer if will fail with #ant fresh-install ..... [java] 2012-05-09 17:02:18,195 ERROR org.dspace.search.DSIndexer @ Unable t o create index directory: c:\dspace180/search [java] 2012-05-09 17:02:18,203 FATAL org.dspace.search.DSIndexer @ anonymou s:no_context:no_search_analyzer:search.analyzer=org.apache.lucene.analysis.cn.Ch ineseAnalyzer [java] java.lang.NoSuchMethodException: org.apache.lucene.analysis.cn.Chine seAnalyzer.<init>(org.apache.lucene.util.Version) [java] at java.lang.Class.getConstructor0(Class.java:2706) [java] at java.lang.Class.getDeclaredConstructor(Class.java:1985) [java] at org.dspace.search.DSIndexer.getAnalyzer(DSIndexer.java:635) [java] at org.dspace.search.DSIndexer.openIndex(DSIndexer.java:914) [java] at org.dspace.search.DSIndexer.<clinit>(DSIndexer.java:225) [java] java.lang.ExceptionInInitializerError [java] Caused by: java.lang.IllegalStateException: java.lang.NoSuchMethodEx ception: org.apache.lucene.analysis.cn.ChineseAnalyzer.<init>(org.apache.lucene. util.Version) [java] at org.dspace.search.DSIndexer.getAnalyzer(DSIndexer.java:644) [java] at org.dspace.search.DSIndexer.openIndex(DSIndexer.java:914) [java] at org.dspace.search.DSIndexer.<clinit>(DSIndexer.java:225) [java] Could not find the main class: org.dspace.search.DSIndexer. Program will exit. [java] Exception in thread "main" If I don't set .ChineseAnalyzer before install, ant build successful, and then I edit the dspace.conf set it to use ChineseAnalyzer, same error message will got when use #dspace index-init
    via by Gary LAM,
  • in dspace.conf, if set search.analyzer = org.apache.lucene.analysis.cn.ChineseAnalyzer if will fail with #ant fresh-install ..... [java] 2012-05-09 17:02:18,195 ERROR org.dspace.search.DSIndexer @ Unable t o create index directory: c:\dspace180/search [java] 2012-05-09 17:02:18,203 FATAL org.dspace.search.DSIndexer @ anonymou s:no_context:no_search_analyzer:search.analyzer=org.apache.lucene.analysis.cn.Ch ineseAnalyzer [java] java.lang.NoSuchMethodException: org.apache.lucene.analysis.cn.Chine seAnalyzer.<init>(org.apache.lucene.util.Version) [java] at java.lang.Class.getConstructor0(Class.java:2706) [java] at java.lang.Class.getDeclaredConstructor(Class.java:1985) [java] at org.dspace.search.DSIndexer.getAnalyzer(DSIndexer.java:635) [java] at org.dspace.search.DSIndexer.openIndex(DSIndexer.java:914) [java] at org.dspace.search.DSIndexer.<clinit>(DSIndexer.java:225) [java] java.lang.ExceptionInInitializerError [java] Caused by: java.lang.IllegalStateException: java.lang.NoSuchMethodEx ception: org.apache.lucene.analysis.cn.ChineseAnalyzer.<init>(org.apache.lucene. util.Version) [java] at org.dspace.search.DSIndexer.getAnalyzer(DSIndexer.java:644) [java] at org.dspace.search.DSIndexer.openIndex(DSIndexer.java:914) [java] at org.dspace.search.DSIndexer.<clinit>(DSIndexer.java:225) [java] Could not find the main class: org.dspace.search.DSIndexer. Program will exit. [java] Exception in thread "main" If I don't set .ChineseAnalyzer before install, ant build successful, and then I edit the dspace.conf set it to use ChineseAnalyzer, same error message will got when use #dspace index-init
    via by Gary LAM,
  • springMVC upload file exception
    via Stack Overflow by Marco Sun
    ,
    • java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableMap.<init>() at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getDeclaredConstructor(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:149) at org.springframework.beans.PropertyTypeConverter.convertToTypedMap(PropertyTypeConverter.java:316) at org.springframework.beans.PropertyTypeConverter.convertIfNecessary(PropertyTypeConverter.java:188) at org.springframework.beans.PropertyTypeConverter.convertIfNecessary(PropertyTypeConverter.java:124) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:792) at org.springframework.beans.factory.support.AbstractBeanFactory.doTypeConversionIfNecessary(AbstractBeanFactory.java:673) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:371) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:235) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:520) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:373) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:241) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:152) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:155) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    109 more bugmates