zoukankan      html  css  js  c++  java
  • 部署项目后,抛出一片异常

    1.首先明确代码没有问题,用很简单的代码测试即可

    2.异常:

    org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.naarchi.microdecoration.serviceImpl.AdminServiceImpl] for bean with name 'adminServiceImpl' defined in file [C:software omcatapache-tomcat-7.0.68webappsmy-decorationWEB-INFclassescom aarchimicrodecorationserviceImplAdminServiceImpl.class]: problem with class file or dependent class; nested exception is Java.lang.UnsupportedClassVersionError: com/naarchi/microdecoration/serviceImpl/AdminServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.naarchi.microdecoration.serviceImpl.AdminServiceImpl)
     at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1355)
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
     at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)
     at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975)
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:752)
     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
     at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
     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: java.lang.UnsupportedClassVersionError: com/naarchi/microdecoration/serviceImpl/AdminServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.naarchi.microdecoration.serviceImpl.AdminServiceImpl)
     at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3122)
     at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1340)
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1827)
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClass

    。。。。。。。。。。。。。。。。。(太多,就不弄完了)

    3.解决方案,我用的事jdk1.8,果断换了1.7,然后OK了

    (1).首先是安装jdk1.7

    (2).配置环境变量

    (3).修改eclipse里面的jre

      (A).Windows->Preferences->java->Installed JREs->Add...->Standard VM("next")->第一排Directory...->找到安装位置下的文件夹,确定->apply

      (B).重新更新一下server里面的tomcat("有时候换了jdk后会显示找不到jre")

        Windows->server->Runtime Environm->Add->Next->Finish

    4.如果以上方案没有能解决存在的问题,欢迎加好友讨论:2318645572

  • 相关阅读:
    第三篇:一个Spark推荐系统引擎的实现
    第二篇:使用Spark对MovieLens的特征进行提取
    第一篇:使用Spark探索经典数据集MovieLens
    第十一篇:Map/Reduce 工作机制分析
    docker 导入导出镜像
    pycharm激活
    jenkins + sonar 安装配置
    jenkins webhook 配置
    python3 学习
    Kubernetes 详解
  • 原文地址:https://www.cnblogs.com/wx-ym-good/p/7151533.html
Copyright © 2011-2022 走看看