获取ClassNotFoundException org.eclipse.persistence.jpa.rs.resources.MetadataResource [英] Getting ClassNotFoundException org.eclipse.persistence.jpa.rs.resources.MetadataResource
问题描述
我正在尝试浏览JPA-RS教程,例如:
http://java.dzone.com/articles/introducing-eclipselink-jpa-rs 或
http://www.eclipse.org/eclipselink/documentation/2.5/solutions/restful_jpa.htm
但在尝试部署(使用maven和glassfish插件)后,我的glassfish上的应用程序出现以下错误堆栈跟踪:
<$ p $
org.eclipse.persistence.jpa.rs.resources.MetadataResource at
org.glassfish [/ rest] .web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1783)at
org.eclipse.persistence.jpa上的org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633
) .rs.service.JPARSApplication(J PARSApplication.java:62)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(本地方法)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at
...
我在导入的依赖关系中找不到该类:
<依赖性>
< groupId> javax< / groupId>
< artifactId> javaee-api< / artifactId>
< version> 7.0< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> org.eclipse.persistence< / groupId>
< artifactId> eclipselink< / artifactId>
< version> 2.5.0< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> javax.ws.rs< / groupId>
< artifactId> javax.ws.rs-api< / artifactId>
< version> 2.0.1< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> org.eclipse.persistence< / groupId>
< artifactId> org.eclipse.persistence.jpars< / artifactId>
< version> 2.6.0< / version>
< /依赖关系>
通过搜索该错误,我找不到与我分享同样问题的人。你能帮我解决这个问题吗?告诉我你是否需要更多关于项目的锥体/背景信息。
亲切的问候。 解决方案使用同一版本的eclipselink依赖关系:或者 eclipselink
和 org.eclipse.persistence.jpars
应该是2.6.0或两者都应该是2.5.0。
使用2.6.0 org.eclipse.persistence.jpa。 rs.resources.MetadataResource
位于eclipselink.jar中
I'm trying to walk through the JPA-RS tutorials like:
http://java.dzone.com/articles/introducing-eclipselink-jpa-rs or
http://www.eclipse.org/eclipselink/documentation/2.5/solutions/restful_jpa.htm
But after trying to deploy (using the maven and glassfish plugin) the application on my glassfish I get the following error stacktrace:
WebModule[/rest]Servlet /rest threw load() exception java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.rs.resources.MetadataResource at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1783) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633 ) at org.eclipse.persistence.jpa.rs.service.JPARSApplication.(JPARSApplication.java:62) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at ...
I do not find the class in my imported dependencies:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpars</artifactId>
<version>2.6.0</version>
</dependency>
By searching for that error, I getting no one who is sharing the same problem with me. Are you able to help me by getting an solution for that problem? Tell me if you need more conext/background information about the project.
Kind regards.
Use your eclipselink dependencies of the same version: either both eclipselink
and org.eclipse.persistence.jpars
should be 2.6.0 or both should be 2.5.0.
When using 2.6.0 org.eclipse.persistence.jpa.rs.resources.MetadataResource
is in the eclipselink.jar
这篇关于获取ClassNotFoundException org.eclipse.persistence.jpa.rs.resources.MetadataResource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!