Caused by: java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector


六月 22, 2017 5:04:08 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
六月 22, 2017 5:04:09 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
17:04:09,070  INFO ContextLoader:305 - Root WebApplicationContext: initialization started
17:04:09,258  INFO XmlWebApplicationContext:581 - Refreshing Root WebApplicationContext: startup date [Thu Jun 22 17:04:09 CST 2017]; root of context hierarchy
17:04:09,333  INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext.xml]
17:04:09,731  INFO PropertySourcesPlaceholderConfigurer:172 - Loading properties file from class path resource [jdbc.properties]
17:04:09,813  WARN XmlWebApplicationContext:549 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
17:04:09,818 ERROR ContextLoader:351 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:775)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
	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:5099)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1548)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1512)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1748)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:333)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1370)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
	at java.lang.Class.getConstructor0(Class.java:2803)
	at java.lang.Class.getDeclaredConstructor(Class.java:2053)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
	... 27 more
Caused by: java.lang.ClassNotFoundException: com.mchange.v2.ser.Indirector
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734)
	... 33 more
六月 22, 2017 5:04:09 下午 org.apache.catalina.core.StandardContext listenerStart
严重: 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 'dataSource' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:775)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
	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:5099)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1548)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1512)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1748)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:333)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1370)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
	at java.lang.Class.getConstructor0(Class.java:2803)
	at java.lang.Class.getDeclaredConstructor(Class.java:2053)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
	... 27 more
Caused by: java.lang.ClassNotFoundException: com.mchange.v2.ser.Indirector
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734)
	... 33 more
六月 22, 2017 5:04:09 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
六月 22, 2017 5:04:09 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/shop2] startup failed due to previous errors
六月 22, 2017 5:04:09 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
六月 22, 2017 5:04:09 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
严重: The web application [/shop2] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
六月 22, 2017 5:04:14 下午 org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
信息: Illegal access: this web application instance has been stopped already.  Could not load .  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.



解决办法:

            添加  mchange-commons-java-0.2.3.4.jar  即可







### Java程序中`com.google.zxing.WriterException`类找不到问题解决方案 当遇到`java.lang.NoClassDefFoundError: com/google/zxing/WriterException`错误时,这通常意味着在运行时JVM无法找到指定的类文件。此类问题可能由多种原因引起。 #### 1. 检查Maven依赖配置 确保项目中的POM.xml文件已正确引入ZXing库的相关依赖项[^2]: ```xml <dependencies> <!-- ZXing Core --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.2.1</version> </dependency> <!-- ZXing JavaSE --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.2.1</version> </dependency> </dependencies> ``` #### 2. 清理并重新构建项目 有时IDE缓存可能导致某些更改未生效。建议执行以下操作来清理环境: - 使用命令行工具或集成开发环境中提供的功能清除本地仓库缓存; - 执行`mvn clean install`指令强制下载最新版本的依赖包; - 如果仍然存在问题,则尝试删除`.m2/repository/com/google/zxing/*`目录下的所有内容后再重试安装过程。 #### 3. 验证编译路径设置 确认项目的classpath已经包含了上述两个jar文件的位置。可以通过打印系统属性`java.class.path`来进行验证: ```java System.out.println(System.getProperty("java.class.path")); ``` 如果输出结果里缺少必要的条目,则需调整构建脚本或者IDE配置以包含这些资源。 #### 4. 排除冲突的依赖关系 多个不同版本的相同库可能会相互干扰而导致加载失败。可以利用Maven Dependency Plugin插件分析当前工程所使用的全部第三方组件及其层次结构,并排除不必要的重复声明: ```shell mvn dependency:tree -Dverbose=true ``` 对于任何可疑的对象,可以在pom.xml内显式指明要忽略特定范围内的替代品: ```xml <exclusions> <exclusion> <groupId>*</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> ``` 通过以上措施应该能够有效解决因缺失`com.google.zxing.WriterException`而引发的各种异常情况。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值