我正在使用 Windows 10 上的阴影 jar 测试各种使用 Documents4j 的方法。我使用以下内容:
SERVER: documents4j-server-standalone-1.1.5-shaded.jar
Command Line: java -jar %~dp0documents4j-server-standalone-1.1.5-shaded.jar http://localhost:9998 -L%~dp0server-log.log -Vall
CLIENT: documents4j-client-standalone-1.1.5-shaded.jar
Command Line: java -jar %~dp0documents4j-client-standalone-1.1.5-shaded.jar http://localhost:9998 -L%~dp0client-log.log -Vall
在客户端控制台中,我输入 0 和完整的文件路径,即C:\temp2\Sample.docx
然后显示此消息:预定转换:C:\temp2\Sample.docx -> C:\temp2\Sample.docx.txt
当独立服务器以登录用户身份启动时转换成功,但以管理员权限启动时失败(未生成转换文件)。
以下是日志摘录(附件):
客户端日志
Line 2220
FAILED [ADMINISTRATOR]
2021-04-03 13:39:02,731 WARN [main] c.documents4j.standalone.StandaloneClient - Converter com.documents4j.job.RemoteConverter@475b7792 is not operational
SUCCESSFUL [USER]
2021-04-03 13:54:49,694 INFO [main] c.documents4j.standalone.StandaloneClient - Converter com.documents4j.job.RemoteConverter@160c3ec1 is operational
服务器日志
LIne 303
FAILED [ADMINISTRATOR]
2021-04-03 13:39:01,862 TRACE [grizzly-http-server-0] c.d.c.msoffice.MicrosoftWordBridge - Execute no-argument script C:\Users\GRAEME~1.PTB\AppData\Local\Temp\1617419299961-0\word_assert1520023368.vbs
2021-04-03 13:39:01,862 DEBUG [grizzly-http-server-0] org.zeroturnaround.exec.ProcessExecutor - Executing [cmd, /S, /C, ""C:\Users\GRAEME~1.PTB\AppData\Local\Temp\1617419299961-0\word_assert1520023368.vbs""] in C:\Users\GRAEME~1.PTB\AppData\Local\Temp\1617419299961-0.
2021-04-03 13:39:01,872 DEBUG [grizzly-http-server-0] org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=18600, exitValue="not exited"]
2021-04-03 13:39:01,873 TRACE [Thread-4] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@4e48de90 started.
2021-04-03 13:39:01,873 TRACE [Thread-5] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@786a36ca started.
2021-04-03 13:39:02,150 TRACE [Thread-4] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@4e48de90 finished.
2021-04-03 13:39:02,150 TRACE [Thread-5] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@786a36ca finished.
2021-04-03 13:39:02,153 DEBUG [WaitForProcess-Process[pid=18600, exitValue="not exited"]] org.zeroturnaround.exec.WaitForProcess - Process[pid=18600, exitValue=-6] stopped with exit code -6
SUCCESSFUL [USER]
2021-04-03 13:54:48,260 TRACE [grizzly-http-server-1] c.d.c.msoffice.MicrosoftWordBridge - Execute no-argument script C:\Users\GRAEME~1.PTB\AppData\Local\Temp\1617420258290-0\word_assert59744299.vbs
2021-04-03 13:54:48,261 DEBUG [grizzly-http-server-1] org.zeroturnaround.exec.ProcessExecutor - Executing [cmd, /S, /C, ""C:\Users\GRAEME~1.PTB\AppData\Local\Temp\1617420258290-0\word_assert59744299.vbs""] in C:\Users\GRAEME~1.PTB\AppData\Local\Temp\1617420258290-0.
2021-04-03 13:54:48,317 DEBUG [grizzly-http-server-1] org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=1724, exitValue="not exited"]
2021-04-03 13:54:48,318 TRACE [Thread-5] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@11cbcb1c started.
2021-04-03 13:54:48,318 TRACE [Thread-4] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@2c99b36 started.
2021-04-03 13:54:48,750 TRACE [Thread-4] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@2c99b36 finished.
2021-04-03 13:54:48,750 TRACE [Thread-5] o.zeroturnaround.exec.stream.StreamPumper - org.zeroturnaround.exec.stream.StreamPumper@11cbcb1c finished.
2021-04-03 13:54:48,753 DEBUG [WaitForProcess-Process[pid=1724, exitValue="not exited"]] org.zeroturnaround.exec.WaitForProcess - Process[pid=1724, exitValue=3] stopped with exit code 3
此外,启动独立客户端时会出现这些警告:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/C:/documents4j/documents4j-server-standalone-1.1.5-shaded.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release