我是靠谱客的博主 跳跃微笑,最近开发中收集的这篇文章主要介绍java.lang.NoClassDefFoundError: javax/activation/DataSource 奇怪异常,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
奇怪的异常:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sendMail' defined in URL [file:/E:/apache-tomcat-5.5.20/webapps/pics/WEB-INF/classes/application-service.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/activation/DataSource
Caused by:
java.lang.NoClassDefFoundError: javax/activation/DataSource
Caused by:
java.lang.NoClassDefFoundError: javax/activation/DataSource
---------------------------------------------------------------------------------
在网上查了下 有类似的问题
ERROR - ContextLoader.initWebApplicationContext(203) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xfire.typeMappingRegistry' defined in class path resource [org/codehaus/xfire/spring/xfire.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/activation/DataSource
============看到没,在定义bean name为'xfire.typeMappingRegistry' 路径资源[org/codehaus/xfire/spring/xfire.xml]出错,,
则你的DataSource不能建立,,我不知道你applicationContext.xml中的配置,及xfire.xml文件,,,是什么,,,只能说这些了,,你在好好看看这几个出错的地方.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xfire.typeMappingRegistry' defined in class path resource [org/codehaus/xfire/spring/xfire.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/activation/DataSource
============看到没,在定义bean name为'xfire.typeMappingRegistry' 路径资源[org/codehaus/xfire/spring/xfire.xml]出错,,
则你的DataSource不能建立,,我不知道你applicationContext.xml中的配置,及xfire.xml文件,,,是什么,,,只能说这些了,,你在好好看看这几个出错的地方.
----------------------------------------------------------------------------------
在项目的WEB-INF/lib中的确有activation.jar,但却总报这个错误。直到后来将activation.jar包拷贝到tomcat的common/lib下才算解决。
ps:应该只是加载次序的不同,但似乎tomcat处理的方式很奇怪
转载于:https://blog.51cto.com/fluagen/148779
最后
以上就是跳跃微笑为你收集整理的java.lang.NoClassDefFoundError: javax/activation/DataSource 奇怪异常的全部内容,希望文章能够帮你解决java.lang.NoClassDefFoundError: javax/activation/DataSource 奇怪异常所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复