java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
at java.lang.Runtime.removeShutdownHook(Runtime.java:239)
at com.documents4j.job.ConverterAdapter.deregisterShutdownHook(ConverterAdapter.java:121)
at com.documents4j.job.ConverterAdapter.cleanUp(ConverterAdapter.java:107)
at com.documents4j.job.ConverterAdapter.shutDown(ConverterAdapter.java:98)
at com.documents4j.job.LocalConverter.shutDown(LocalConverter.java:109)
at com.documents4j.job.ConverterAdapter$ConverterShutdownHook.run(ConverterAdapter.java:134)
After tracing the source code, I found that the converter in documents4j needs to be shut down after it is used up, but the corresponding shutdown method is not found in the local package. I used reflection and closed the converter, but when I ended my program, it would still turn off the office word program in my computer.
My app closes MS office word app and throw an IllegalStateException, when I stop my app.
Exception:
After tracing the source code, I found that the converter in documents4j needs to be shut down after it is used up, but the corresponding shutdown method is not found in the local package. I used reflection and closed the converter, but when I ended my program, it would still turn off the office word program in my computer.
The reflection code is :
How to code so that not close my Office Word program?