Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot with devtools call SOAP API

I am deploying a Spring Boot project, using devtools (spring-boot-devtools) with a SOAP service. I generate the Soap class into the /src/main/resources/templates/generated folder, and add this folder as Source Code. When I call this SOAP service, there is a problem:

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

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

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

Then I can call the SOAP service successful. But now, my project cannot reload automatically when I modify some code. I was trying to edit some code anywhere and save it, but no luck; my project does not reload.

like image 537
user3611168 Avatar asked Nov 25 '25 19:11

user3611168


1 Answers

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

like image 192
pufface Avatar answered Nov 27 '25 07:11

pufface



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!