nested exception is java.lang.NoClassDefFoundError: com/google/gson/Gson

 gson的依赖如下:

 <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>1.7.1</version>
  </dependency

但由于gson的jar没有自动部署到tomcat下,所以将依赖添加属性<scope>runtime</scope>,即运行的时候去用这个包,则不会报错。

时间: 2024-10-04 17:58:45

nested exception is java.lang.NoClassDefFoundError: com/google/gson/Gson的相关文章

Java AOP nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice || Error creating bean with name &#39;org.springframework.aop.aspectj.AspectJPointcutAdvisor#0&#39; 两个异常解决办法

贴出applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://ww

Spring出现Unexpected exception parsing XML document from class path resource [applicationBeans.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/TargetSource异常

在自学Spring4的过程中,遇到了棘手的异常,一直找不到问题所在,后来经过对每个过程进行逐一排查之后,发现少了一个jar包:spring-aop-4.0.0.RELEASE.jar.完整的异常信息如下: Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from clas

could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException

? 版权声明:本文为博主原创文章,转载请注明出处 1.问题描述 搭建SSH框架启动报错如下: 六月 07, 2017 2:34:34 下午 org.springframework.web.context.ContextLoader initWebApplicationContext 严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating be

Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/Type

问题描述 将项目挂载到 Myeclipse 的 tomcat 上,启动 tomcat ,报错"Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/Type" 问题原因 缺少 jar 包 解决方案 第一种方案: 1.将需要的第三方包拷贝进libs 文件夹. 2.将引用的第三方包,添加进工作的build path -->工程上右键 --

Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/jms/JMSContext

参考链接 : https://blog.csdn.net/angus_Lucky/article/details/82811946?utm_source=blogxgwz7 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [spring/applicationContex

HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

今天在用idea搭建spring mvc时候报了这个错误,缺少jstl的依赖包.由于是使用的spring-core的依赖,而spring-core里面是有jstl的.这就郁闷了,最后是在自己的pom.xml里面又引入了jstl解决的 <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version&g

HTTP Status 500 - Could not open JDBC Connection for transaction; nested exception is java.lang.NoCl

HTTP Status 500 - Could not open JDBC Connection for transaction; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/sql/SqlUtils type Exception report message Could not open JDBC Connection for transaction; nested exception is java.l

Failed to introspect bean class [org.springframework.orm.hibernate5.LocalSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClass

依赖引入  错误可能版本 不对 Failed to introspect bean class [org.springframework.orm.hibernate5.LocalSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/hibernate/boot/m

Caused by: java.lang.NoClassDefFoundError: com/google/common/base/MoreObjects

环境:jdk1.8 开发工具:IDEA 说明:今天在做springboot集成swagger2的时候,在启动程序的时候,报错 报错信息: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-02-24 19:32:26.026 ERROR 8660 --- [ restartedMain] o.s.boot.Sp