- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在尝试使用procrun将documents4j安排为Windows服务以进行RTF到PDF的转换,但它不断抛出以下错误:
com.documents4j.throwables.ConversionInputException: The sent input is invalid
at com.documents4j.util.Reaction$ConversionInputExceptionBuilder.make(Reaction.java:159) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at com.documents4j.util.Reaction$ExceptionalReaction.apply(Reaction.java:75) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at com.documents4j.ws.ConverterNetworkProtocol$Status.resolve(ConverterNetworkProtocol.java:97) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at com.documents4j.job.WebserviceRequestFutureWrapper.handle(WebserviceRequestFutureWrapper.java:48) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at com.documents4j.job.WebserviceRequestFutureWrapper.get(WebserviceRequestFutureWrapper.java:38) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at com.documents4j.job.WebserviceRequestFutureWrapper.get(WebserviceRequestFutureWrapper.java:13) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at com.documents4j.job.AbstractFutureWrappingPriorityFuture.run(AbstractFutureWrappingPriorityFuture.java:78) ~[documents4j-client-standalone-0.3-SNAPSHOT-shaded.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_31]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_31]
我为 procrun 创建了以下 bat 文件
@echo off
set SELF=%CD%
set SERVICE_NAME=PCNService
set SERVICE_URL=
set PR_INSTALL=%SELF%\prunsrv.exe
set PRMGR_INSTALL=%SELF%\prunmgr.exe
@REM Service Log Configuration
set PR_LOGPREFIX=%SERVICE_NAME%
set PR_LOGPATH=%SELF%\logs
set PR_STDOUTPUT=auto
set PR_STDERROR=auto
set PR_LOGLEVEL=Debug
@REM Path to Java Installation
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll
set PR_CLASSPATH=%SELF%\documents4j-server-standalone-0.3-SNAPSHOT-shaded.jar
@REM JVM Configuration
set PR_JVMOPTIONS=
@REM Startup Configuration
set JETTY_START_CLASS=com.documents4j.standalone.StandaloneServer
set PR_STARTUP=auto
set PR_STARTMODE=java
set PR_STARTCLASS=%JETTY_START_CLASS%
set PR_STARTMETHOD=start
set PR_STARTPARAMS=http://localhost:9998
@REM Shutdown Configuration
set PR_STOPMODE=java
set PR_STOPCLASS=%JETTY_START_CLASS%
set PR_STOPMETHOD=stop
set PR_STOPPARAMS=
if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
:checkServiceCmd
if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == delete goto doDelete
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == monitor goto doMonitor
if /i %SERVICE_CMD% == run goto doRun
if /i %SERVICE_CMD% == console goto doConsole
echo Unknown parameter "%SERVICE_CMD%"
:displayUsage
echo.
echo Usage: service.bat install/start/stop/delete
goto end
:doInstall
rem Install the service
echo Installing the service '%SERVICE_NAME%' ...
%PR_INSTALL% //IS//%SERVICE_NAME% ^
--DisplayName="%SERVICE_NAME%" ^
--Install="%PR_INSTALL%" ^
--Startup="%PR_STARTUP%" ^
--LogPath="%PR_LOGPATH%" ^
--LogPrefix="%PR_LOGPREFIX%" ^
--LogLevel="%PR_LOGLEVEL%" ^
--StdOutput="%PR_STDOUTPUT%" ^
--StdError="%PR_STDERROR%" ^
--JavaHome="%JAVA_HOME%" ^
--Jvm="%PR_JVM%" ^
--JvmMs="" ^
--JvmMx="" ^
--JvmSs="" ^
--JvmOptions="%PR_JVMOPTIONS%" ^
--Classpath="%PR_CLASSPATH%" ^
--StartMode="%PR_STARTMODE%" ^
--StartClass="%PR_STARTCLASS%" ^
--StartMethod="%PR_STARTMETHOD%" ^
--StartParams="%PR_STARTPARAMS%" ^
--StopMode="%PR_STOPMODE%" ^
--StopClass="%PR_STOPCLASS%" ^
--StopMethod="%PR_STOPMETHOD%" ^
--StopParams="%PR_STOPPARAMS%" ^
--Type interactive
if not errorlevel 1 goto installed
echo Failed to install "%SERVICE_NAME%" service. Refer to log in %PR_LOGPATH%
goto end
:doStart
rem Starting the service
echo Starting the service '%SERVICE_NAME%' ...
%PR_INSTALL% //ES//%SERVICE_NAME%
if not errorlevel 1 goto started
echo Failed to start "%SERVICE_NAME%" service. Refer to log in %PR_LOGPATH%
goto end
:doStop
rem Stop the service
echo Stopping the service '%SERVICE_NAME%' ...
%PR_INSTALL% //SS//%SERVICE_NAME%
if not errorlevel 1 goto stopped
echo Failed to stop "%SERVICE_NAME%" service. Refer to log in %PR_LOGPATH%
goto end
:doDelete
rem Delete the service
echo Deleting the service '%SERVICE_NAME%' ...
%PR_INSTALL% //DS//%SERVICE_NAME%
if not errorlevel 1 goto deleted
echo Failed to delete "%SERVICE_NAME%" service. Refer to log in %PR_LOGPATH%
goto end
:doMonitor
rem Monitor the service
echo Monitoring the service '%SERVICE_NAME%' ...
echo Look for the service in the system tray. You can modify the properties in the GUI.
%PRMGR_INSTALL% //MR//%SERVICE_NAME%
goto end
:doRun
rem Run the service
echo Running the service '%SERVICE_NAME%' ...
%PR_INSTALL% //RS//%SERVICE_NAME%
goto end
:doEdit
rem Edit the service
echo Editing the service '%SERVICE_NAME%' ...
%PRMGR_INSTALL% //ES//%SERVICE_NAME%
goto end
:doConsole
rem Running the service as console application
%PR_INSTALL% //TS//%SERVICE_NAME%
goto end
:installed
echo The Service "%SERVICE_NAME%" has been installed
goto logging
goto end
:started
echo The Service "%SERVICE_NAME%" has been started
goto logging
goto end
:deleted
echo The Service "%SERVICE_NAME%" has been deleted
goto end
:stopped
echo The Service "%SERVICE_NAME%" has been stopped
goto logging
goto end
:logging
echo Refer to log in %PR_LOGPATH%
:end
</code>
我能够成功地将 jar 安装为 Windows 服务并启动/停止它
此外,当通过命令行执行 com.documents4j.standalone.StandaloneServer 类时,转换会正确发生。
最佳答案
您是否阅读过有关将 Word 作为 Windows 服务运行 Documents4j 的信息?
documents4j might malfunction when run as a Windows service together with MS Office conversion. Note that MS Office does not officially support execution in a service context. When run as a service, MS Office is always started with MS Window's local service account which does not configure a desktop. However, MS Office expects a desktop to exist in order to run properly. Without such a desktop configuration, MS Office will start up correctly but fail to read any input file. In order to allow MS Office to run in a service context, there are two possible approaches of which the first approach is more recommended:
On a 32-bit system, create the folder C:\Windows\System32\config\systemprofile\Desktop. On a 64-bit system, create the folder C:\Windows\SysWOW64\config\systemprofile\Desktop.
Further information can be found on MSDN. You can manipulate MS Window's registry such that MS Office applications are run with another account than the local service account. This approach is documented on MSDN. Note that this breaks MS Window's sandbox model and imposes additional security threats to the machine that runs MS Office.
关于java - 如何使用 procrun 将 Documents4j 服务器独立安排为 Windows 服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28760670/
我正在尝试计算 iFrame 的高度,但不明白为什么 document.body.offsetHeight + document.body.bottomMargin 不等于 document.docu
我正在使用 Node/Mongoose/MongoDB 并尝试构建一个轮询应用程序。一个关键需求是跟踪单个用户对同一民意调查的响应如何随时间变化(他们一遍又一遍地进行同一民意调查)。 我有一个用户模型
首先,我不是普通的博主,我很困惑。如果我的问题不符合要求,请指导我。我会努力改进的。 我已提交 Microsoft Code Review 的 Microsoft CRM 插件。我是 JavaScri
谁能解释为什么使用类似的东西: gci -force "\\computername\c$\users\username\Documents" -recurse 或者 gci -force "\\co
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, over
这个问题已经有答案了: What is the (function() { } )() construct in JavaScript? (28 个回答) 已关闭 6 年前。 说实话,一开始我以为我可
document.getElementsByTagName("*") 适用于 IE/Firefox/Opera,但不适用于 Chrome 和 Safari。 document.all 适用于 IE/C
这个问题在这里已经有了答案: What is the difference between Document and document in JavaScript? (2 个答案) 关闭 8 年前。
我以某种方式发现将事件监听器添加到文档的行为有点奇怪。虽然向 HTMLElements 添加监听器工作正常,但向文档添加监听器不起作用。但奇怪的是,使用 jQuery 可以让它工作。 那么有人可以解释
谁能告诉我这两个 JavaScript 命令之间的区别? 这两个跨主要浏览器的兼容性是什么?我知道 documentElement 与大多数浏览器兼容。 谢谢 最佳答案 document.docume
什么时候应该使用 document.all 与 document.getElementById? 最佳答案 document.all 是 Microsoft 对 W3C 标准的专有扩展。 getEle
当升级到 react-native 0.61.2 时,这个问题出现了。我做到了从手机中删除了 apk 和自动链接使用 react-native link 然后 react-native run-and
当升级到 react-native 0.61.2 时,这个问题出现了。我做到了从手机中删除了 apk 和自动链接使用 react-native link 然后 react-native run-and
我将收到 tungstenite::Message ,它将包含来自客户端的bson文档。我可以将tungstenite::Message转换为Vec,但是如何在服务器端将其转换回 bson::docu
我这里有一个简单的疑问: 文档对象范围位于浏览器选项卡内:我的意思是如果我设置document.tab1 ='tab1' 在一个浏览器选项卡中 它在其他选项卡中不可用。 但是 document.coo
我经常使用并看到推荐的 dom 访问结构,例如这样动态地将内容添加到页面: loader = document.createElement('script'); loader.src = "myurl
我对 JQuery 还很陌生。我正在使用this JQuery 函数在元素上显示工具提示。 我根据我的需要(在这个社区的帮助下)以这种方式编辑了代码: $(document).ready(functi
我想知道哪个是运行js代码的正确方法,该代码根据窗口高度计算垂直菜单的高度并按时设置,不晚不早。 我正在使用 document.ready 但它并没有真正帮助我解决这个问题,它有时没有设置,我必须重新
我正在浏览一个 js 文件并发现这个声明var dataobj=document.all? document.all.id_name : document.getElementById("id_nam
想知道何时使用,这适用于什么浏览器? if (document.all&&document.getElementById) { // Some code block } 最佳答案 我认为没有任何重要的
我是一名优秀的程序员,十分优秀!