Java ClassNotFoundException:JUnit测试中的com.ibm.ejs.ras.hpel.HpelHelper(使用thinclient)
我有JUnit测试(有些人会称之为“集成测试”),它测试REST服务的文件上传/下载。我正在使用来自standart Websphere 8.5库的Apache WINK:Java ClassNotFoundException:JUnit测试中的com.ibm.ejs.ras.hpel.HpelHelper(使用thinclient),java,maven,junit,websphere,apache-wink,Java,Maven,Junit,Websphere,Apache Wink,我有JUnit测试(有些人会称之为“集成测试”),它测试REST服务的文件上传/下载。我正在使用来自standart Websphere 8.5库的Apache WINK: ClientConfig config = new ClientConfig(); LtpaAuthSecurityHandler secHandler = new LtpaAuthSecurityHandler(); secHandler.setUserName(user); secHandler.setPassword(
ClientConfig config = new ClientConfig();
LtpaAuthSecurityHandler secHandler = new LtpaAuthSecurityHandler();
secHandler.setUserName(user);
secHandler.setPassword(password);
secHandler.setSSLRequired(false);
config.handlers(secHandler);
RestClient client = new RestClient(config);
但我有个例外:
java.lang.ClassNotFoundException:com.ibm.ejs.ras.hpel.HpelHelper
我正在使用以下测试依赖项:
<dependency>
<groupId>com.ibm.was</groupId>
<artifactId>com.ibm.ws.jpa.thinclient</artifactId>
<version>8.5.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
com.ibm.was
com.ibm.ws.jpa.thinclient
8.5.0.2
测试
朱尼特
朱尼特
4.11
测试
我错过了什么?被测试的代码在部署到WebSphere上时可以正常工作,但不能作为使用thinclient的独立junit测试(或主函数)工作。我遇到了相同的异常,在添加以下内容后得到了解决
<dependency>
<groupId>com.ibm.jaxws</groupId>
<artifactId>thinclient</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
com.ibm.jaxws
瘦顾客
8.0.0
假如
我遇到了相同的错误。为了修复它,我添加了以下依赖项:
<classpathentry kind="lib" path="lib/com.ibm.jaxws.thinclient_8.5.0.jar"/>
<classpathentry kind="lib" path="lib/com.ibm.ws.admin.client_8.5.0.jar"/>
<classpathentry kind="lib" path="lib/com.ibm.ws.webservices.thinclient_8.5.0.jar"/>
有一个类似的答案-@AntonNovopashin并不完全正确。那里的OP不使用Maven。你插入了什么文件?