【问题标题】:java.util.arrays cannot be resolvedjava.util.arrays 无法解析
【发布时间】:2014-08-21 17:01:28
【问题描述】:

我有一个运行良好的春季项目。 我更新了我机器上的java平台(通过自动的java更新通知)

更新后,我在编码时出现蓝屏,现在我无法在 Tomcat 上部署解决方案,因为我一直遇到此错误:

Aug 21, 2014 5:25:21 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arepScreeningController' defined in file [E:\ORQR\css\code\IDE\webapps\AfDB-CSS\WEB-INF\classes\com\gcap\css\controller\ArepScreeningController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.gcap.css.controller.ArepScreeningController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
    The import java.util.Arrays cannot be resolved
    Arrays cannot be resolved
    Arrays cannot be resolved

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.gcap.css.controller.ArepScreeningController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
    The import java.util.Arrays cannot be resolved
    Arrays cannot be resolved
    Arrays cannot be resolved

    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
    ... 20 more
Caused by: java.lang.Error: Unresolved compilation problems: 
    The import java.util.Arrays cannot be resolved
    Arrays cannot be resolved
    Arrays cannot be resolved

    at com.gcap.css.controller.ArepScreeningController.<init>(ArepScreeningController.java:10)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
    ... 22 more

当我检查控制器时,我发现: import java.util.Arrays; 在我的项目中现在无法解决!

对解决这个问题的一点帮助将不胜感激!

谢谢!

【问题讨论】:

标签: java spring spring-mvc javabeans


【解决方案1】:

这可能是一个漫长的过程,但由于您在此之前出现蓝屏,因此可能是 Java 安装已损坏。创建一个新的基础项目并尝试使用其中的Arrays,如果问题仍然存在,请重新安装Java;如果不是你有一些配置问题,它可能来自 Maven 或类似的,如果你正在使用这些。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-28
    • 1970-01-01
    • 2014-03-16
    • 2015-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多