Spring Boot with devtools call SOAP API
Asked Answered
C

1

3

I am deploy an project Spring Boot, using devtools(spring-boot-devtools) and call a Soap service. I generate the Soap class into /src/main/resources/templates/generated and add this folder as Source Code. Because when call this Soap service, its have a problem:

java.lang.IllegalArgumentException: ...ClassV11PortType referenced from a method is not visible from class loader

So, I was add the spring-devtools.properties file to /src/main/resources/META-INF/spring-devtools.properties and add this line to spring-devtools.properties file:

restart.exclude.mygeneratedclasses=/[packageOfGeneratedClass].class

Then now, I can call the SOAP service successful. But now, my project cannot reload automatically when i modified some code. I was try to edit some code anywhere and save but not luck, my project doesnot reload.

Cough answered 6/5, 2019 at 2:13 Comment(0)
T
2

Instead of excluding generated files, you can try to include JAR responsible for loading these classes into restart classloader (used in spring-devtools).

For dependency com.sun.xml.ws:jaxws-rt:2.3.2-1, update /src/main/resources/META-INF/spring-devtools.properties like this:

restart.include.jax=/jaxws-rt.*\.jar

Github issue reference: Devtools cannot be use with jaxws-ri #19379

Trespass answered 7/4, 2020 at 20:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.