8的可嵌入EJB容器

8的可嵌入EJB容器

本文介绍了无法创建WebSphere 8的可嵌入EJB容器-NoClassDefFoundError HpelHelper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WebSphere 8的可嵌入EJB容器使用JUnit4为我的EJB编写一些单元测试。我的IDE是RAD 8。

I am using the embeddable EJB container of WebSphere 8 to write some unit tests for my EJBs with JUnit4. My IDE is the RAD 8.

这是我的简单测试代码段:

Here is my simple test code snippet:

 

    Map properties = new HashMap();
    properties.put(EJBContainer.PROVIDER,
                "com.ibm.websphere.ejbcontainer.EmbeddableContainerProvider");
    EJBContainer ec = EJBContainer.createEJBContainer(properties);

我收到一个NoClassDefFoundError:

I get a NoClassDefFoundError:

    java.lang.NoClassDefFoundError: com/ibm/ejs/ras/hpel/HpelHelper
at com.ibm.ejs.ras.RasHelper.getThreadId(RasHelper.java:1760)
at com.ibm.ejs.ras.RasEvent6$1.initialValue(RasEvent6.java:101)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:152)
at java.lang.ThreadLocal.get(ThreadLocal.java:142)
at com.ibm.ejs.ras.RasEvent6.<init>(RasEvent6.java:292)
at com.ibm.ejs.ras.MessageEvent6.<init>(MessageEvent6.java:203)
at com.ibm.ejs.ras.Tr.fireMessageEvent(Tr.java:1555)
at com.ibm.ejs.ras.Tr.warning(Tr.java:1207)
at com.ibm.ws.naming.java.javaNameSpaceImpl.localNameSpaceInit(javaNameSpaceImpl.java:347)
at com.ibm.ws.naming.java.javaNameSpaceImpl.init(javaNameSpaceImpl.java:267)
at      com.ibm.ws.naming.java.javaURLInitialContextFactory.getInitialContext(javaURLInitialContextFactory.java:156)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:247)
at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:318)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:348)
at javax.naming.InitialContext.internalInit(InitialContext.java:286)
at javax.naming.InitialContext.<init>(InitialContext.java:211)
at com.ibm.ejs.csi.DefaultComponentMetaData.initializeJavaNameSpace(DefaultComponentMetaData.java:150)
at com.ibm.ejs.csi.DefaultComponentMetaData.<init>(DefaultComponentMetaData.java:122)
at com.ibm.ejs.csi.DefaultComponentMetaData.<clinit>(DefaultComponentMetaData.java:94)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at com.ibm.ws.threadContext.ComponentMetaDataAccessorImpl.<init>(ComponentMetaDataAccessorImpl.java:59)
at com.ibm.ws.threadContext.ComponentMetaDataAccessorImpl.<clinit>(ComponentMetaDataAccessorImpl.java:54)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at com.ibm.ws.threadContext.JavaNameSpaceAccessorImpl.<init>(JavaNameSpaceAccessorImpl.java:56)
at com.ibm.ws.threadContext.JavaNameSpaceAccessorImpl.<clinit>(JavaNameSpaceAccessorImpl.java:48)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.initNaming(EmbeddableContainer.java:353)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.initialize(EmbeddableContainer.java:454)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.open(EmbeddableContainer.java:428)
at com.ibm.websphere.ejbcontainer.EmbeddableContainer.newContainer(EmbeddableContainer.java:382)
at com.ibm.websphere.ejbcontainer.EmbeddableContainerProvider.createEJBContainer(EmbeddableContainerProvider.java:75)

我找不到com / ibm / ejs /类的jar ras / hpel / HpelHelper。

I can not find a jar with the class com/ibm/ejs/ras/hpel/HpelHelper anywhere.

这是我的课程路径:

C:\workspaces\irad8\JSF2.0Test\MyEJBPrj\ejbModule;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.wccm.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.emf.jar;
C:\Program Files\IBM\WebSphere\AppServer\dev\JavaEE\6.0\j2ee.jar;
C:\Program Files\IBM\WebSphere\AppServer\lib\mail-impl.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.runtime.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.ejbportable.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.admin.core.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.admin.services.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.portletcontainer.jar;
C:\Program Files\IBM\WebSphere\AppServer\lib\bootstrap.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.sib.server.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.sip.container.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.sip.interface.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.jsf.myfaces.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.webcontainer.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.wsadie\marshall.jar;
C:\Program Files\IBM\WebSphere\AppServer\lib\ffdcSupport.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.wsadie\wsatlib.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.runtime.dist.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.headers.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.pcf.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jmqi.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.connector.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.commonservices.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\dhbcore.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.common.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.commonj.sdo.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.ecore.change.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.ecore.sdo.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.ecore.xmi.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.ecore.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.wsdl4j.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.wsfp.main.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.jackson.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.xlxp.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.jaxrs.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\javax.j2ee.jaxrs.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.jaxrs.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.vajava.jar;
C:\Program Files\IBM\WebSphere\AppServer\lib\rsadbutils.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.jpa.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.commonj-twm.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.prereq.soap.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\org.apache.tuscany.sca.api.jar;
C:\Program Files\IBM\WebSphere\AppServer\dev\sca\1.0\sca_api.jar;
C:\Program Files\IBM\WebSphere\AppServer\dev\xml\xmlapi.jar;
C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.batch.runtime.jar;
C:\Program Files\IBM\WebSphere\AppServer\tivoli\tam\PD.jar;
C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mqjms.jar;
C:\Program Files (x86)\IBM\SDPShared\plugins\org.junit_4.8.1.v4_8_1_v20100427-1100\junit.jar;
C:\Program Files (x86)\IBM\SDPShared\plugins\org.hamcrest.core_1.1.0.v20090501071000.jar;
C:\Program Files\IBM\WebSphere\AppServer\runtimes\com.ibm.ws.ejb.embeddableContainer_8.0.0.jar;
/C:/Program Files/IBM/SDP/configuration/org.eclipse.osgi/bundles/1486/1/.cp/;
/C:/Program Files/IBM/SDP/configuration/org.eclipse.osgi/bundles/1484/1/.cp/;
/C:/Program Files/IBM/SDP/configuration/org.eclipse.osgi/bundles/1485/1/.cp/


推荐答案

WebSphere可嵌入EJB容器中包含的RAS不使用HPEL。此错误消息表示您的类路径上的某些JAR正在使用其他RAS。您应该除去除 C:\Program Files\IBM\WebSphere\AppServer\runtimes\com.ibm.ws.ejb.embeddableContainer_8.0.0.‌jar 以外的所有WebSphere JAR。 code>。

The RAS included in the WebSphere embeddable EJB container does not use HPEL. This error message implies that some JAR on your classpath is using a different RAS. You should remove all WebSphere JARs except C:\Program Files\IBM\WebSphere\AppServer\runtimes\com.ibm.ws.ejb.embeddableContainer_8.0.0.‌​jar.

这篇关于无法创建WebSphere 8的可嵌入EJB容器-NoClassDefFoundError HpelHelper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 01:21