I have a module which use java webservices (JAX-WS) in Client and Gateway scope.
Works fine with Ignition 7.9.9 / Java 8 (Client/Gateway scope)
This module don’t have any external dependency for webservices.
I upgraded to Ignition 7.9.10-beta / Java 9 on the Gateway (I use the JRE 9 provided by the client launcher) Does the gateway Ignition 7.9.10 support Java 9 ???
From Java 9, java webservices (JAX-WS) have been remove from JRE http://openjdk.java.net/jeps/320
and we need to add external dependency to run theses webservices.
I’ve tried to add various dependencies to replace those that are not packaged with JRE 9.
Following this :
But when my module create the webservice I always have the following error (Gateway Scope) :
javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
if I add this in Ignition.conf, it solve the issue for the gateway scope,
but not in the client scope…is it possible to do the same whith args for the clientlauncher.exe ???
…Yes, seem just putting the parameter at the end do the job…
the same module give the same error, despide of the dependecies for JAX-WS and more :
javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
at javax.xml.ws.spi.FactoryFinder$1.createException(FactoryFinder.java:61)
at javax.xml.ws.spi.FactoryFinder$1.createException(FactoryFinder.java:58)
at javax.xml.ws.spi.ServiceLoaderUtil.newInstance(ServiceLoaderUtil.java:103)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:112)
at javax.xml.ws.spi.Provider.provider(Provider.java:96)
at javax.xml.ws.Service.(Service.java:112)
at javax.xml.ws.Service.create(Service.java:765)
at com.bouyguesenergiesservices.ignition.common.videoviewer.onvif.OnvifDeviceAction.actionCreateDevicePort(OnvifDeviceAction.java:174)
at com.bouyguesenergiesservices.ignition.common.videoviewer.onvif.OnvifDeviceAction$1.run(OnvifDeviceAction.java:84)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:503)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at javax.xml.ws.spi.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:90)
at javax.xml.ws.spi.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:123)
at javax.xml.ws.spi.ServiceLoaderUtil.newInstance(ServiceLoaderUtil.java:101)
... 7 common frames omitted
Try adding a src/main/resources/META-INF/services/javax.xml.ws.spi.Provider file containing the value com.sun.xml.ws.spi.ProviderImpl (note the lack of internal in that package).
Make sure this file ends up in the META-INF folder in the JAR of your built module.
Thanks @Kevin.Herron , I added the file in the common jar loaded for CDG scope. I think this file is at the right place in the jar : when I unzip it in the modl, can you confirm it’s ok or not ???
I have still the same error. Did I miss something ???
javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
at javax.xml.ws.spi.FactoryFinder$1.createException(FactoryFinder.java:61)
at javax.xml.ws.spi.FactoryFinder$1.createException(FactoryFinder.java:58)
at javax.xml.ws.spi.ServiceLoaderUtil.newInstance(ServiceLoaderUtil.java:103)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:112)
at javax.xml.ws.spi.Provider.provider(Provider.java:96)
at javax.xml.ws.Service.(Service.java:112)
at javax.xml.ws.Service.create(Service.java:765)
at com.bouyguesenergiesservices.ignition.common.videoviewer.onvif.OnvifMediaAction.actionCreateMediaPort(OnvifMediaAction.java:222)
at com.bouyguesenergiesservices.ignition.common.videoviewer.onvif.OnvifMediaAction$1.run(OnvifMediaAction.java:81)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:503)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at javax.xml.ws.spi.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:90)
at javax.xml.ws.spi.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:123)
at javax.xml.ws.spi.ServiceLoaderUtil.newInstance(ServiceLoaderUtil.java:101)
I don’t think you need it, it looks like jaxws-rt jar already has it.
There’s probably some issue with ClassLoaders here. I’d try running this in IDE in debug mode and breakpointing in javax.xml.ws.spi.FactoryFinder#find(String, String)
Maybe the context ClassLoader needs to be set or unset when you try to instantiate a service.
It needs to happen immediately before the call to create a WebService otherwise you might be setting the context ClassLoader on the wrong thread or it could get reset by some other code.