org.springframework.beans.factory.BeanCreationException,导入java.util.Arrays无法解析数组无法解析

时间:2016-10-21 01:20:45

标签: java spring

the code of the FileUploadDaoImpl.java我在导入一个旧的java项目时遇到了一个问题。它是由Spring和mybatis创建的。我不知道为什么它不起作用?谁可以帮助我。这是过度补救流程中的第一个问题。非常感谢大家。

信息:初始化Spring root WebApplicationContext 2016-10-21 09:07:29,663 ERROR [com.alibaba.druid.pool.DruidAbstractDataSource] - 不推荐使用maxIdle log4j:ERROR没有名为[logfile]的appender的输出流或文件集。 2016-10-21 09:07:31,335 INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-1} inited 2016-10-21 09:07:40,569 INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-1}已关闭 2016-10-21 09:07:40,569 ERROR [org.springframework.web.context.ContextLoader] - 上下文初始化失败 org.springframework.beans.factory.BeanCreationException:在文件[E:\ javaProject.metadata.me_tcat \ webapps \ pre \ WEB-INF \ classes \ com \ app \ pub \ service \ impl中定义的名称为'fileUpLoadImpl'的bean创建时出错\ FileUpLoadImpl.class]:bean的实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化bean类[com.app.pub.service.impl.FileUpLoadImpl]:构造函数抛出异常;嵌套异常是java.lang.Error:未解决的编译问题:     导入java.util.Arrays无法解析     数组无法解析

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1037)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:983)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

引起:org.springframework.beans.BeanInstantiationException:无法实例化bean类[com.app.pub.service.impl.FileUpLoadImpl]:构造函数抛出异常;嵌套异常是java.lang.Error:未解决的编译问题:     导入java.util.Arrays无法解析     数组无法解析

at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030)
... 37 more

引起:java.lang.Error:未解决的编译问题:     导入java.util.Arrays无法解析     数组无法解析

at com.app.pub.service.impl.FileUpLoadImpl.<init>(FileUpLoadImpl.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
... 39 more

2016-10-21 09:07:40,569 ERROR [org.springframework.web.context.ContextLoader] - 上下文初始化失败 org.springframework.beans.factory.BeanCreationException:在文件[E:\ javaProject.metadata.me_tcat \ webapps \ pre \ WEB-INF \ classes \ com \ app \ pub \ service \ impl中定义的名称为'fileUpLoadImpl'的bean创建时出错\ FileUpLoadImpl.class]:bean的实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化bean类[com.app.pub.service.impl.FileUpLoadImpl]:构造函数抛出异常;嵌套异常是java.lang.Error:未解决的编译问题:     导入java.util.Arrays无法解析     数组无法解析

1 个答案:

答案 0 :(得分:1)

在日食中:

右键单击Project - &gt;构建路径 - &gt;配置构建路径 - &gt;构建路径 - &gt;图书馆 - &gt;选择jdk 1.8。

MyEclipse的:

1)转到窗口&gt;偏好&gt; Java&gt;已安装的JRE&gt;点击添加&gt;选择标准VM,然后单击下一步&gt;选择JDK 1.7目录,然后单击Finish。

2)点击完成将在“已安装的JRE”部分下列出JDK1.8。选择列出的JDK 1.8,然后单击“确定”。 3)转到窗口&gt;偏好&gt; Java&gt;编译器&gt;从“编译器合规级别”下拉列表中选择1.8,然后单击“应用”和“确定”

我相信可以在MyEclipse上做类似的事情。