简体   繁体   中英

ClassNotFoundException: com.ibm.ejs.ras.hpel.HpelHelper in JUnit test (with thinclient)

I have JUnit test (some would call that 'integration test) that test the REST service for file upload/download. I'm using Apache WINK from standart Websphere 8.5 libraries:

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);

But I get the exception:

java.lang.ClassNotFoundException: com.ibm.ejs.ras.hpel.HpelHelper

I'm using the following test dependencies:

<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>

What I'm missing here? The tested code works fine when deployed on WebSphere, but doesn't work as stand-alone junit test (or main function) that uses thinclient..

I encountered the same error. To fix it I added these dependencies:

<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"/>

I was getting same exception and it got resolved after I have added following.

  <dependency>
     <groupId>com.ibm.jaxws</groupId>
     <artifactId>thinclient</artifactId>
     <version>8.0.0</version>
     <scope>provided</scope>
  </dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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