# Java webservices (JAX-WS) with Ignition 7.9.10 and Java 9

**URL:** <https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849>\
**Category:** Module Development\
**Created:** [November 14, 2018, 1:53pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849 "2018-11-14T13:53:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 14, 2018, 1:53pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/1 "2018-11-14T13:53:54Z")

</div>

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](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 :

> <https://stackoverflow.com/questions/48204141/replacements-for-deprecated-jpms-modules-with-java-ee-apis/48204154#48204154>

But when my module create the webservice I always have the following error (Gateway Scope) :

```auto
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,

```auto
wrapper.java.additional.7=--add-modules=java.se.ee
```

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

```auto
clientlauncher.exe gateway.addr=127.0.0.1:8088:8043 retries=3 scope=C project=MODULES windowmode=fullscreen --add-modules=java.se.ee
```

**I’m looking too for a better solution working too for Java 11 / Ignition 8.0…**

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 14, 2018, 10:10pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/2 "2018-11-14T22:10:06Z")

</div>

With Ignition 8 - Java 11,

the same module give the same error, despide of the dependecies for JAX-WS and more :

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

```

dependency added for all scopes in the module :

```auto
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.4.0-b180830.0359</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>2.3.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.4.0-b180830.0438</version>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-ri</artifactId>
            <version>2.3.1</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.3.1</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>rt</artifactId>
            <version>2.3.1</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.3.1</version>
        </dependency>
```

Is there anythings else in Ignition class loader process to explain this error ???

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 14, 2018, 11:46pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/3 "2018-11-14T23:46:41Z")

</div>

Wild guess here, but:

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.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 2:12pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/4 "2018-11-15T14:12:44Z")

</div>

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

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9a1b1456a23a15c1e6a5ac5a3eba15b96d2b1562.png)

I have still the same error. Did I miss something ???

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 2:16pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/5 "2018-11-15T14:16:02Z")

</div>

> [@mazeyrat](#):
>
> I have still the same error. Did I miss something ???

Looks right to me... I don't know if you missed anything, it was just a guess :-/

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 2:23pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/6 "2018-11-15T14:23:01Z")

</div>

> [@Kevin.Herron](#):
>
> 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.

If I have still com.sun.xml. **internal**.ws.spi.ProviderImpl in my error og, I suppose that the file had not be used ?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 2:30pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/7 "2018-11-15T14:30:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 3:36pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/8 "2018-11-15T15:36:58Z")

</div>

When I debug, on the line with eception, I obtain this :  
I don’t find javax.xml.ws.spi.FactoryFinder#find(String, String) ???

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a5209c614d74dbc961ea6b7ff97e881e8c6af52f.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 3:38pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/9 "2018-11-15T15:38:27Z")

</div>

It’s part of the `jaxws-api` jar, do you have that in your module?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 3:42pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/10 "2018-11-15T15:42:03Z")

</div>

Sorry, when I step into line with the exception, I found the classLoader

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c923654aaf96ed83eb6e25dae75c040be5e845a6.png)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/11565596f3532bab23d05801b58228154cc3fce3.png)

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 3:43pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/11 "2018-11-15T15:43:08Z")

</div>

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/80323eecb0439e125c0807538c29f943b63d47df.png)  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a21e79cfb4875ce00b6a3028901b880cb6921982.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 3:45pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/12 "2018-11-15T15:45:38Z")

</div>

Try setting the context ClassLoader to be your module’s ClassLoader or null?

```auto
Thread.currentThread().setContextClassLoader(MyModuleHook.class.getClassLoader());

```

Set that before you try to make a web service or whatever leads down that code path.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 3:48pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/13 "2018-11-15T15:48:22Z")

</div>

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a7591eb80ce43879efdd52991c1967c9272fcac0.png)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/973b516f90a9410c30a4be4c5b24626c92fef33a.png)

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 3:55pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/14 "2018-11-15T15:55:07Z")

</div>

> [@Kevin.Herron](#):
>
> javax.xml.ws.spi.FactoryFinder

I've tried it in the GatewayHook::setup but I've still the issue 😫

```auto
    @Override
    public void setup(GatewayContext gatewayContext) {
        logger.info("setup()");
        this.context = context;
        Thread.currentThread().setContextClassLoader(GatewayHook.class.getClassLoader());
        
    }
```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 3:57pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/15 "2018-11-15T15:57:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 4:07pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/16 "2018-11-15T16:07:30Z")

</div>

There is now an error with ignition **lib/core/gateway/axis-saaj-1.4.jar**

Error Attached.  
[old\_SAAJ.txt](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6b440153b2de4b33ae90989001a77ae722edb71e.txt) (6.1 KB)

I will PM a link to DL my module source code if you could have a look at the at the POM.  
I probably attached to many dependencies for WS ?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 4:09pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/17 "2018-11-15T16:09:05Z")

</div>

Try deleting `axis-saaj-1.4.jar` from the `lib/core/gateway` folder of your Ignition install.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 4:23pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/18 "2018-11-15T16:23:14Z")

</div>

No more Error on startup !!! 😀  
but the designer don’t start anymore 😱

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/722edcfed3d8ff43df351b3849059b9063e3960a.png)

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 15, 2018, 4:27pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/19 "2018-11-15T16:27:49Z")

</div>

Not sure it was linked…  
Designer don’t start if I put axis-saaj-1.4.jar in lib/core/gateway and restart the GW

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2018, 4:28pm UTC](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849/20 "2018-11-15T16:28:23Z")

</div>

Enable the Java console and launch again, get the logs

[Next page](https://forum.inductiveautomation.com/t/java-webservices-jax-ws-with-ignition-7-9-10-and-java-9/20849.md?page=2)
