`
sanry
  • 浏览: 37127 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

web项目改成spring boot maven 引入jar包不一致启动报错

阅读更多

 

        mavn 部署引入jar包不对,不提示找不到jar包,而是提示:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

Error creating bean with name 'auditProcessAction': Unsatisfied dependency expressed through field 'auditProcessService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditProcessService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class xxx等信息。

       费了好大劲,一点一点的注释代码才找到是原来代码用的json包没有引入,重新增加了pom依赖关系才解决:

<dependency>

    <groupId>org.json</groupId>

    <artifactId>json</artifactId>

    <version>20180130</version>

</dependency>

 .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.0.RELEASE)

2018-12-29 14:25:40,347 INFO  bai.boss.App [line:50]- Starting App on zgh-pc with PID 7900 (D:\eclipse-workspace\boss\target\classes started by admin in D:\eclipse-workspace\boss)
2018-12-29 14:25:40,350 INFO  bai.boss.App [line:675]- No active profile set, falling back to default profiles: default
2018-12-29 14:25:42,684 INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer [line:90]- Tomcat initialized with port(s): 8080 (http)
2018-12-29 14:25:42,705 INFO  org.apache.coyote.http11.Http11NioProtocol [line:173]- Initializing ProtocolHandler ["http-nio-8080"]
2018-12-29 14:25:42,717 INFO  org.apache.catalina.core.StandardService [line:173]- Starting service [Tomcat]
2018-12-29 14:25:42,718 INFO  org.apache.catalina.core.StandardEngine [line:173]- Starting Servlet Engine: Apache Tomcat/9.0.12
2018-12-29 14:25:42,740 INFO  org.apache.catalina.core.AprLifecycleListener [line:173]- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_191\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\NetSarang;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Skype\Phone\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Java\jdk1.8.0_191\bin;C:\Program Files\Java\jdk1.8.0_191\jre\bin;D:\apache-maven-3.6.0\bin\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;;c:\program files\esafenet\cobra docguard client;.]
2018-12-29 14:25:43,439 INFO  org.apache.jasper.servlet.TldScanner [line:173]- At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-12-29 14:25:43,448 INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] [line:173]- Initializing Spring embedded WebApplicationContext
2018-12-29 14:25:43,449 INFO  org.springframework.web.context.ContextLoader [line:285]- Root WebApplicationContext: initialization completed in 3053 ms
2018-12-29 14:25:43,480 INFO  org.springframework.boot.web.servlet.ServletRegistrationBean [line:186]- Servlet dispatcherServlet mapped to [/]
2018-12-29 14:25:43,487 INFO  org.springframework.boot.web.servlet.FilterRegistrationBean [line:248]- Mapping filter: 'characterEncodingFilter' to: [/*]
2018-12-29 14:25:43,488 INFO  org.springframework.boot.web.servlet.FilterRegistrationBean [line:248]- Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-12-29 14:25:43,488 INFO  org.springframework.boot.web.servlet.FilterRegistrationBean [line:248]- Mapping filter: 'formContentFilter' to: [/*]
2018-12-29 14:25:43,489 INFO  org.springframework.boot.web.servlet.FilterRegistrationBean [line:248]- Mapping filter: 'requestContextFilter' to: [/*]
2018-12-29 14:25:43,709 WARN  org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext [line:554]- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auditProcessAction': Unsatisfied dependency expressed through field 'auditProcessService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditProcessService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [bai.boss.action.bss.audit.AuditProcessService] from ClassLoader [sun.misc.Launcher$AppClassLoader@2a139a55]
2018-12-29 14:25:43,713 INFO  org.apache.catalina.core.StandardService [line:173]- Stopping service [Tomcat]
2018-12-29 14:25:43,771 INFO  org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener [line:142]- 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-12-29 14:25:43,792 ERROR org.springframework.boot.SpringApplication [line:858]- Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auditProcessAction': Unsatisfied dependency expressed through field 'auditProcessService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditProcessService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [bai.boss.action.bss.audit.AuditProcessService] from ClassLoader [sun.misc.Launcher$AppClassLoader@2a139a55]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at bai.boss.App.main(App.java:11)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditProcessService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [bai.boss.action.bss.audit.AuditProcessService] from ClassLoader [sun.misc.Launcher$AppClassLoader@2a139a55]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:265)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1236)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1151)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1239)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1166)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
	... 19 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to introspect Class [bai.boss.action.bss.audit.AuditProcessService] from ClassLoader [sun.misc.Launcher$AppClassLoader@2a139a55]
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:248)
	... 31 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/json/JSONException
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662)
	... 34 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 38 common frames omitted

 

0
0
分享到:
评论

相关推荐

    spring-boot 所有jar包

    这些jar包是构建Spring Boot应用的基础,它们使得开发者可以在不创建完整Maven或Gradle项目的情况下,快速运行和调试Spring Boot应用。只需将这些jar添加到类路径中,并提供一个主类继承自`SpringApplication`,就...

    Springboot 打Jar包,Maven完美解决本地Jar包自动打入Springboot Jar包中

    通过以上步骤,我们可以轻松地将自定义的或第三方的Jar包安装到本地Maven仓库,并在Spring Boot项目中使用它们。这种方式不仅简化了项目的构建流程,还提高了开发效率。希望本文能帮助大家更好地理解和掌握Spring ...

    spring boot 框架搭建 maven项目

    - **创建可执行JAR**:通过Maven命令行或者IDE中的构建功能,使用`spring-boot-maven-plugin`插件创建可执行的JAR包。 ```bash mvn clean package ``` - **运行JAR**:使用Java命令行运行生成的JAR文件。 ```...

    spring-boot2.1.14 离线maven jar包

    将Spring Boot 2.1.14的jar包放入本地Maven仓库,开发者可以在不连接互联网的情况下进行项目的构建和运行。 "repository"这个压缩包子文件的名称,通常在Maven项目中指的是存储库,它包含了一系列的jar包和其他依赖...

    springboot工程jar包加密

    "springboot工程jar包加密"这个话题就是关于如何确保Spring Boot应用的jar文件不被未经授权的人员访问或篡改。 首先,了解为什么要对jar包进行加密是必要的。jar文件本质上是包含类文件、资源和元数据的压缩文件,...

    009 maven插件spring-boot-maven-plugin

    Spring Boot Maven Plugin 是一个 Maven 插件,用于简化 Spring Boot 项目的构建和打包过程。该插件提供了许多有用的功能,例如重新打包可执行的存档、自定义层配置、继承 Starter 父 POM 等。 插件概述 Spring ...

    springboot(web项目,非maven)

    标题中的“springboot(web项目,非maven)”指的是一个基于Spring Boot框架构建的Web应用程序,但它不是使用Maven作为构建工具。Spring Boot简化了Java Web应用的开发过程,提供了快速构建可运行的应用程序的方式,而...

    maven包,spring boot的maven包,用于离线搭建工程

    标题提到的“maven包,spring boot的maven包”,指的是包含Spring Boot相关依赖的Maven仓库文件。这些文件通常以`.jar`或`.pom`格式存在,存储在`repository`目录下,用于离线环境下搭建Spring Boot工程。离线搭建...

    详解spring boot引入外部jar包的坑

    通过以上步骤,我们可以成功地将外部 Jar 包引入到 Spring Boot 项目中,并且在 Maven 打包时也可以正确地将 Jar 包包含在生成的包中。 在 Spring Boot 项目中引入外部 Jar 包需要注意以上几点,以免陷入坑中,同时...

    springBoot非maven项目所需jar包

    电脑暂时没有装maven,最近突发奇想,向在搭建一个spring boot非maven项目,折腾了两个小时,下载jar包冲突问题居多,最后结合网上博客,整理了一份spring boot所需的jar包,亲测没有问题

    spring-boot 2.7.10 jar包

    spring-boot 2.7.10 jar包

    spring boot 第三方jar包抽离方案

    #### 2.1 Spring Boot外部加载jar包启动 Spring Boot允许通过`-Dloader.path`参数加载外部lib目录下的jar包。例如,执行`java -Dloader.path="lib/" -jar app.jar`即可启动应用,并使用lib目录中的jar包。 #### ...

    spring_boot maven关联的所有jar

    在描述中提到的"spring_boot 所有的关联jar",指的是Spring Boot项目中所依赖的各种库文件,这些jar文件包含了Spring Boot框架本身、其核心组件、测试支持、以及与数据库和NoSQL存储相关的依赖。这些jar是构建和运行...

    pit1_spring boot之 maven install 报错[Maven]1

    在Spring Boot项目中,`maven install` 是一个常见的构建步骤,它用于将项目打包成可部署的格式,如JAR或WAR,并将其安装到本地Maven仓库。然而,当出现错误 `[ERROR] Failed to execute goal org.springframework....

    maven本地引入tongweb7的jar包的方法

    "tongweb-spring-boot-starter"和"tongweb-spring-boot-websocket"这两个jar包是TongWeb为Spring Boot应用程序提供的启动器和WebSocket支持。 以下是引入TongWeb到Maven本地仓库的步骤: 1. **手动安装JAR到本地...

    spring boot 入门,maven打成jar包,运行例子

    spring boot 入门例子, 打成jar包,直接运行.快速入门,学习spring bootspring boot 入门例子, 打成jar包,直接运行.快速入门,学习spring boot

    示例源码_SpringBoot踩坑记录:IDEA+MAVEN本地 jar 包打包及引入使用_Qc20201223.zip

    在本压缩包文件"示例源码_SpringBoot踩坑记录:IDEA+MAVEN本地 jar 包打包及引入使用_Qc20201223.zip"中,我们聚焦于SpringBoot项目开发过程中的一些常见问题,特别是涉及到IDEA(IntelliJ IDEA)和MAVEN的本地jar包...

    springboot+maven打包demo【将依赖与配置文件打包到jar包外部】

    在本文中,我们将深入探讨如何使用Spring Boot和Maven来构建一个项目,使得依赖和配置文件被打包到jar包外部,以实现更加灵活的项目管理。这个方法对于那些需要根据不同环境进行定制配置或者频繁更新配置的应用来说...

    spring-boot-maven的web完整项目框架

    **Spring Boot Maven Web 完整项目框架详解** Spring Boot 是由 Pivotal 团队提供的全新框架,其设计目标是用来简化新 Spring 应用的初始搭建以及开发过程。它集成了大量的常用组件,如数据源、JPA、WebSocket、...

    在eclipse中不使用maven创建springboot工程所需jar包

    在不使用Maven的情况下,在Eclipse中创建Spring Boot工程,你需要手动管理依赖的jar包。以下是一些关于这些jar包及其在Spring Boot项目中的作用的关键知识点: 1. **jboss-logging-3.3.0.Final.jar**:这是一个日志...

Global site tag (gtag.js) - Google Analytics