简体   繁体   English

尽管jar位于类路径中,但由于缺少类而抛出异常-JERSEY

[英]Exception thrown due missing class though jar is in classpath, REST - JERSEY

I'm using Jersey for REST apps, i'm getting this NoClassDefException for the class AbstractRuntimeDelegate though i have the following Jars in my classpath.... 我将Jersey用于REST应用程序,尽管我在类路径中有以下Jars,但我却为类AbstractRuntimeDelegate获得了NoClassDefException ....

  • commons-httpclient-3.1.jar commons-httpclient-3.1.jar
  • List item 项目清单
  • javax.ws.rs.jar javax.ws.rs.jar
  • jersey-core-1.9.1-sources.jar jersey-core-1.9.1-sources.jar
  • jersey-server-1.1.2-ea.jar jersey-server-1.1.2-ea.jar

That class is in the jersey-core-1.9.1-sources.jar as i can see from here 该类在jersey-core-1.9.1-sources.jar中,正如我从此处看到的那样
http://www.jarvana.com/jarvana/inspect/com/sun/jersey/jersey-core/1.9.1/jersey-core-1.9.1-sources.jar?folder=com/sun/jersey/core/spi/factory/ http://www.jarvana.com/jarvana/inspect/com/sun/jersey/jersey-core/1.9.1/jersey-core-1.9.1-sources.jar?folder=com/sun/jersey/core/ SPI /工厂/

Have you ever had this kind of issue? 您遇到过这种问题吗? Any advice? 有什么建议吗?

Thank you 谢谢

Piece of exception: 例外:

Exception in thread "bq-main" java.lang.NoClassDefFoundError: com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:73)

我认为您应该使用jersey-core-1.9.1.jar而不是其源jar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM