Cannot stop Office Process when stop tomcat server on Ubuntu 11.10

112 views
Skip to first unread message

hadv

unread,
Mar 6, 2012, 1:55:11 AM3/6/12
to JODConverter
In my web app, I call OfficeManager.stop() to stop the office process
when terminate the tomcat server on Ubuntu 11.10; but sometimes, if
the pid of office process was changed, then the OfficeManager cannot
stop the running office process and throw exception as below.
How can I stop the office processes in this case?

Thanks in advanced!


org.artofsolving.jodconverter.office.OfficeException: failed to start
and connect
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.stopAndWait(ManagedOfficeProcess.java:
77)
at
org.artofsolving.jodconverter.office.PooledOfficeManager.stop(PooledOfficeManager.java:
108)
at
org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.stop(ProcessPoolOfficeManager.java:
91)
at
org.exoplatform.services.cms.jodconverter.impl.JodConverterServiceImpl.stop(JodConverterServiceImpl.java:
157)
at sun.reflect.GeneratedMethodAccessor395.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:
75)
at
org.picocontainer.defaults.LifecycleVisitor.stop(LifecycleVisitor.java:
121)
at
org.exoplatform.container.ConcurrentPicoContainer.stop(ConcurrentPicoContainer.java:
479)
at org.exoplatform.container.ExoContainer.stop(ExoContainer.java:194)
at
org.exoplatform.container.PortalContainer.stop(PortalContainer.java:
626)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:
75)
at
org.picocontainer.defaults.LifecycleVisitor.stop(LifecycleVisitor.java:
121)
at
org.exoplatform.container.ConcurrentPicoContainer.stop(ConcurrentPicoContainer.java:
479)
at org.exoplatform.container.ExoContainer.stop(ExoContainer.java:194)
at org.exoplatform.container.RootContainer.stop(RootContainer.java:
655)
at org.exoplatform.container.RootContainer
$ShutdownThread.run(RootContainer.java:649)
Caused by: java.util.concurrent.ExecutionException:
org.artofsolving.jodconverter.office.OfficeException: could not
terminate process
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.stopAndWait(ManagedOfficeProcess.java:
75)
... 21 more
Caused by: org.artofsolving.jodconverter.office.OfficeException: could
not terminate process
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doTerminateProcess(ManagedOfficeProcess.java:
174)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStopProcess(ManagedOfficeProcess.java:
154)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.access
$100(ManagedOfficeProcess.java:31)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess
$2.run(ManagedOfficeProcess.java:71)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException: invalid pid: -2
at
org.artofsolving.jodconverter.process.LinuxProcessManager.kill(LinuxProcessManager.java:
68)
at
org.artofsolving.jodconverter.office.OfficeProcess.forciblyTerminate(OfficeProcess.java:
211)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doTerminateProcess(ManagedOfficeProcess.java:
171)
... 9 more
Reply all
Reply to author
Forward
0 new messages