类找不到异常 Caused by: java.lang.NoClassDefFoundError

  错误原因:在部署应用的时候,服务器报错,Caused by: java.lang.ClassNotFoundException: org.quartz.impl.JobDetailImpl,某个类找不到,找到对应的包发现明明某个jar已经引进去了,在仔细一看发现有三个类似的jar, com.alibaba.external:opensymphony.quartz,opensymphony:quartz,org.quartz-scheduler:quartz。实际上我希望的包,是org.quartz-scheduler:quartz,里面有我希望的org.quartz.impl.JobDetailImpl类,但是发现一个问题opensymphony.quartz,opensymphony:quartz里面也有org.quartz.impl包但是没有JobDetailImpl类,但是JVM在加载类的时候并没有指定用哪个jar,比如加载到opensymphony:quartz的org.quartz.impl包,但是没有发现JobDetailImpl,然后就报错了。

  解决方法:用mvn dependency:tree  获取依赖树,找到哪些包间接引用了,com.alibaba.external:opensymphony.quartz,opensymphony:quartz排除

            <exclusions>
                <exclusion>
                    <groupId>com.alibaba.external</groupId>
                    <artifactId>opensymphony.quartz</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>opensymphony</groupId>
                    <artifactId>quartz</artifactId>
                </exclusion>
            </exclusions>

  然后引入org.quartz-scheduler:quartz即可。

时间: 2024-10-29 19:10:22

类找不到异常 Caused by: java.lang.NoClassDefFoundError的相关文章

异常:Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.log4jdbc.Properties

参考文章: 使用Log4jdbc-log4j2监听MyBatis中运行的SQL和Connection 使用 log4jdbc格式化输出SQL,maven配置如下: <dependency> <groupId>org.bgee.log4jdbc-log4j2</groupId> <artifactId>log4jdbc-log4j2-jdbc4</artifactId> <version>1.16</version> <

Caused by: java.lang.NoClassDefFoundError: com/tansuosoft/discoverx/common/Config

1.错误描述 Caused by: java.lang.NoClassDefFoundError: com/tansuosoft/discoverx/common/Config at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(Se

Caused by: java.lang.NoClassDefFoundError:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.example.new_oa.identity.se

多线程AsyncTask中使用Jsoup 报错Caused by: java.lang.NoClassDefFoundError: org.jsoup.Jsoup

代码如下,在多线程AsyncTask类中的doInBackground调用Jsoup protected String doInBackground(String... params) { // TODO Auto-generated method stub Log.i(TAG, "doInBackground(Params... params) called"); try { Document doc=Jsoup.connect(params[0]).get(); Elements

Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContext

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.linewell.wechat.WechatApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.spri

Eclipse中使用recyclerview时出现Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable

转自: http://blog.csdn.net/chenleicpp/article/details/46848785 程序崩溃,错误提示: Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable 原因: 在eclipse中使用RecyclerView,编译没有问题,但是运行时候会出现如下错误,百思不得其解,又说v4包与v7包版本不一致,有说没有导入v7-compat包的,经反

Caused by: java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-10 23:28:16 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext

1.错误描述 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/smp]] at java.util.concurre

Caused by: java.lang.NoClassDefFoundError: org/apache/neethi/AssertionBuilderFactory

1.错误描述 严重: StandardWrapper.Throwable org.apache.cxf.bus.extension.ExtensionException at org.apache.cxf.bus.extension.Extension.tryClass(Extension.java:167) at org.apache.cxf.bus.extension.Extension.getClassObject(Extension.java:179) at org.apache.cxf