简体   繁体   中英

Is there a way localy publish Webservice Endpoints With IBM JRE

I'm trying to write a test for a Webservice using the approach described at http://antoniogoncalves.org/2012/10/24/no-you-dont-need-to-mock-your-soap-web-service-to-test-it/

But on calling Endpoint.publish I get the following exception

java.lang.NoClassDefFoundError: com.ibm.ffdc.impl.Ffdc
    at com.ibm.ffdc.Manager.<clinit>(Unknown Source)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:235)
    at com.ibm.ws.ffdc.FFDCFilter.processException(FFDCFilter.java:82)
    at com.ibm.ws.webservices.engine.components.logger.LogFactory$2.run(LogFactory.java:159)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
    at com.ibm.ws.webservices.engine.components.logger.LogFactory.createLogFactory(LogFactory.java:141)
    at com.ibm.ws.webservices.engine.components.logger.LogFactory.<clinit>(LogFactory.java:98)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:235)
    at com.ibm.ws.webservices.engine.soap.MessageFactoryImpl.<clinit>(MessageFactoryImpl.java:103)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:235)
    at com.ibm.ws.webservices.engine.soap.SAAJMetaFactoryImpl.newMessageFactory(SAAJMetaFactoryImpl.java:56)
    at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:143)
    at com.sun.xml.internal.ws.api.SOAPVersion.<init>(SOAPVersion.java:179)
    at com.sun.xml.internal.ws.api.SOAPVersion.<clinit>(SOAPVersion.java:84)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:235)
    at com.sun.xml.internal.ws.api.BindingID.<clinit>(BindingID.java:336)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:235)
    at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:104)
    at javax.xml.ws.Endpoint.publish(Endpoint.java:181)
    at <junit stuff>
Caused by: java.lang.ClassNotFoundException: com.ibm.ffdc.impl.Ffdc
    at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
    at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:701)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:680)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:663)
    ... 48 more

Which is I assume because I'm running in an IBM JRE (Websphere 8.0.x) (Thx for the condolence)

Can I use Endpoint.publish in a IBM JRE, without starting a complete Websphere?

The test or the JRE configuration that produced this stack trace has somehow included com.ibm.ws classes that are shipped with Websphere. If you have removed all reference to Websphere classes from your test, then you could get a standalone JRE with no Websphere changes to test with. You can download for AIX, Linux or z/OS from:

https://www.ibm.com/developerworks/java/jdk/

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