java.lang.NoClassDefFoundError: org.eclipse.core.runtime.RegistryFactory
我正在尝试在 Java 中使用 DataObjects:
DataFactory factory = DataFactory.INSTANCE;
在一个 java 项目中使用:
import commonj.sdo.DataObject;
我收到此错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.core.runtime.RegistryFactory
at org.eclipse.core.internal.runtime.InternalPlatform.getRegistry(InternalPlatform.java:671)
at org.eclipse.core.runtime.Platform.getExtensionRegistry(Platform.java:867)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry.loadServiceProviders(ServiceProviderRegistry.java:167)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry$1.run(ServiceProviderRegistry.java:88)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry.getServiceProviders(ServiceProviderRegistry.java:86)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry.getServiceProvider(ServiceProviderRegistry.java:101)
at com.ibm.ws.sca.resources.loader.ClassLoaderRegistry.<clinit>(ClassLoaderRegistry.java:59)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.ibm.ws.sca.internal.container.impl.ContainerImpl.<clinit>(ContainerImpl.java:356)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.ibm.ws.sca.internal.container.impl.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:70)
at com.ibm.ws.sca.internal.container.Container.<clinit>(Container.java:111)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
I'm trying to use DataObjects in Java:
DataFactory factory = DataFactory.INSTANCE;
in one java Project using:
import commonj.sdo.DataObject;
And I'm getting this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.core.runtime.RegistryFactory
at org.eclipse.core.internal.runtime.InternalPlatform.getRegistry(InternalPlatform.java:671)
at org.eclipse.core.runtime.Platform.getExtensionRegistry(Platform.java:867)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry.loadServiceProviders(ServiceProviderRegistry.java:167)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry$1.run(ServiceProviderRegistry.java:88)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry.getServiceProviders(ServiceProviderRegistry.java:86)
at com.ibm.wsspi.sca.extensions.ServiceProviderRegistry.getServiceProvider(ServiceProviderRegistry.java:101)
at com.ibm.ws.sca.resources.loader.ClassLoaderRegistry.<clinit>(ClassLoaderRegistry.java:59)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.ibm.ws.sca.internal.container.impl.ContainerImpl.<clinit>(ContainerImpl.java:356)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.ibm.ws.sca.internal.container.impl.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:70)
at com.ibm.ws.sca.internal.container.Container.<clinit>(Container.java:111)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您使用进程服务器吗?我很确定 com.ibm.ws.sca.internal.container.impl.ContainerImpl 是一个 Process Server 类...
Are you using Process Server? I'm pretty sure com.ibm.ws.sca.internal.container.impl.ContainerImpl is a Process Server class...
我认为该应用程序是基于EMF SDO?
您可以在 IDE 中将应用程序作为 Eclipse 应用程序运行,而不是 Java 应用程序,因为该应用程序需要 OSGi 包加载机制来在运行时加载所需的包(即 org.eclipse.core.runtime)。
I think the application is based on EMF SDO?
Instead of Java application, you may run your application as a Eclipse application in your IDE, because the application require OSGi bundle loading mechanism to load the required bundle (i.e. org.eclipse.core.runtime) in the runtime.
当我尝试从 JUnit 实例化 BOFactory 类时,我遇到了类似的问题。我可以通过将 org-eclipse-equinox-registry.jar 文件以及 SDO jar 文件添加到我的项目中来解决这个问题。
另请参阅:Junit:创建 BOFactory 实例时出现异常< /a>
I faced a similar issue when trying to instantiate the BOFactory class from JUnit. I was able to resolve it by adding
org-eclipse-equinox-registry.jar
files to my projects, along with the SDO jar files.See also: Junit : Exception while creating BOFactory instance