Spring Boot with devtools call SOAP API

耗尽温柔 提交于 2020-07-19 06:37:16

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/55998022/spring-boot-with-devtools-call-soap-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!