使用xshell连接Linux服务器,kkFileView启动时报错
cn.keking.service.OfficePluginManager : 启动office组件失败,请检查office组件是否可用
Caused by: java.lang.IllegalStateException: a process with acceptString 'socket,host=127.0.0.1,port=2001' is already running; pid 53580
产生的原因
原因当前遇到两种情况:
- xshell弹窗提示“需要Xmanager软件来处理X11转发请求;
- 之前运行过,已经运行了libreoffice7.1,shutdown脚本未kill掉libreoffice7.1的进程。
详细的启动日志如下
_ _ ______ _ _ __ __ _
| | | | | ____| (_) | | \ \ / / (_)
| | __ | | __ | |__ _ | | ___ \ \ / / _ ___ __ __
| |/ / | |/ / | __| | | | | / _ \ \ \/ / | | / _ \ \ \ /\ / /
| < | < | | | | | | | __/ \ / | | | __/ \ V V /
|_|\_\ |_|\_\ |_| |_| |_| \___| \/ |_| \___| \_/\_/
=> Spring Boot :: (v2.4.2) QQ1 :: 613025121
=> kkFileView :: (v4.0.0) QQ2 :: 484680571
=> github :: https://github.com/kekingcn/kkFileView
=> gitee :: https://gitee.com/kekingcn/file-online-preview
2022-12-08 14:20:51.695 INFO 53530 --- [ main] org.eclipse.jetty.util.log : Logging initialized @7138ms to org.eclipse.jetty.util.log.Slf4jLog
2022-12-08 14:20:52.354 INFO 53530 --- [ main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8012
2022-12-08 14:20:52.364 INFO 53530 --- [ main] org.eclipse.jetty.server.Server : jetty-9.4.35.v20201120; built: 2020-11-20T21:17:03.964Z; git: bdc54f03a5e0a7e280fab27f55c3c75ee8da89fb; jvm 1.8.0_171-b11
2022-12-08 14:20:52.466 INFO 53530 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
2022-12-08 14:20:52.466 INFO 53530 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4198 ms
2022-12-08 14:20:52.883 INFO 53530 --- [ main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
2022-12-08 14:20:52.883 INFO 53530 --- [ main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
2022-12-08 14:20:52.886 INFO 53530 --- [ main] org.eclipse.jetty.server.session : node0 Scavenging every 600000ms
2022-12-08 14:20:52.906 INFO 53530 --- [ main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@661972b0{application,/,[file:///tmp/jetty-docbase.8012.7249097480667247675/],AVAILABLE}
2022-12-08 14:20:52.908 INFO 53530 --- [ main] org.eclipse.jetty.server.Server : Started @8359ms
2022-12-08 14:20:52.946 INFO 53530 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : Autowired annotation is not supported on static methods: public static void cn.keking.config.ConfigConstants.setFileUploadDisable(java.lang.Boolean)
2022-12-08 14:20:53.179 INFO 53530 --- [ main] cn.keking.service.FileConvertQueueTask : 队列处理文件转换任务启动完成
2022-12-08 14:20:53.422 INFO 53530 --- [ main] o.a.j.office.ProcessPoolOfficeManager : ProcessManager implementation is LinuxProcessManager
2022-12-08 14:20:53.485 INFO 53530 --- [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : starting process with acceptString 'socket,host=127.0.0.1,port=2001,tcpNoDelay=1' and profileDir '/tmp/.jodconverter_socket_host-127.0.0.1_port-2001'
2022-12-08 14:20:53.534 INFO 53530 --- [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : started process; pid = 53577
2022-12-08 14:20:57.742 WARN 53530 --- [ProcessThread-0] o.a.j.office.ManagedOfficeProcess : office process died with exit code 81; restarting it
2022-12-08 14:20:57.800 ERROR 53530 --- [ main] cn.keking.service.OfficePluginManager : 启动office组件失败,请检查office组件是否可用
2022-12-08 14:20:57.804 WARN 53530 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'officeFilePreviewImpl' defined in URL [jar:file:/root/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar!/BOOT-INF/classes!/cn/keking/service/impl/OfficeFilePreviewImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'officeToPdfService' defined in URL [jar:file:/root/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar!/BOOT-INF/classes!/cn/keking/service/OfficeToPdfService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'officePluginManager': Invocation of init method failed; nested exception is org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
2022-12-08 14:20:57.818 INFO 53530 --- [ main] org.eclipse.jetty.server.session : node0 Stopped scavenging
2022-12-08 14:20:57.824 INFO 53530 --- [ main] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@661972b0{application,/,[file:///tmp/jetty-docbase.8012.7249097480667247675/],STOPPED}
2022-12-08 14:20:57.854 INFO 53530 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-12-08 14:20:57.935 ERROR 53530 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'officeFilePreviewImpl' defined in URL [jar:file:/root/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar!/BOOT-INF/classes!/cn/keking/service/impl/OfficeFilePreviewImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'officeToPdfService' defined in URL [jar:file:/root/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar!/BOOT-INF/classes!/cn/keking/service/OfficeToPdfService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'officePluginManager': Invocation of init method failed; nested exception is org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1206) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:571) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:923) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144) [spring-boot-2.4.2.jar!/:2.4.2]
at cn.keking.ServerMain.main(ServerMain.java:27) [classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [kkFileView-4.0.0.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) [kkFileView-4.0.0.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [kkFileView-4.0.0.jar:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [kkFileView-4.0.0.jar:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'officeToPdfService' defined in URL [jar:file:/root/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar!/BOOT-INF/classes!/cn/keking/service/OfficeToPdfService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'officePluginManager': Invocation of init method failed; nested exception is org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1206) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:571) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.3.jar!/:5.3.3]
... 27 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'officePluginManager': Invocation of init method failed; nested exception is org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:429) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1780) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:609) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.3.jar!/:5.3.3]
... 41 common frames omitted
Caused by: org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:58) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:96) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.start(ProcessPoolOfficeManager.java:56) ~[office-plugin-4.0.0.jar!/:na]
at cn.keking.service.OfficePluginManager.startOfficeManager(OfficePluginManager.java:76) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.3.jar!/:5.3.3]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.3.jar!/:5.3.3]
... 54 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.artofsolving.jodconverter.office.OfficeException: could not establish connection
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_171]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_171]
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:56) ~[office-plugin-4.0.0.jar!/:na]
... 64 common frames omitted
Caused by: org.artofsolving.jodconverter.office.OfficeException: could not establish connection
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:136) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.access$000(ManagedOfficeProcess.java:25) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.ManagedOfficeProcess$1.run(ManagedOfficeProcess.java:52) ~[office-plugin-4.0.0.jar!/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_171]
Caused by: java.lang.IllegalStateException: a process with acceptString 'socket,host=127.0.0.1,port=2001' is already running; pid 53580
at org.artofsolving.jodconverter.office.OfficeProcess.start(OfficeProcess.java:61) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.ManagedOfficeProcess$6.attempt(ManagedOfficeProcess.java:127) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.Retryable.execute(Retryable.java:34) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.Retryable.execute(Retryable.java:24) ~[office-plugin-4.0.0.jar!/:na]
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:134) ~[office-plugin-4.0.0.jar!/:na]
... 7 common frames omitted
解决方法
1.xshell弹窗提示“需要Xmanager软件来处理X11转发请求的解决
如果是xshell弹窗提示“需要Xmanager软件来处理X11转发请求”,只需要按照提示,关闭会话属性即可解决该问题。
在连接会话上右键选择属性
->连接
->SSH
->隧道
,在该页面取消X11转移
的勾选即可。
2.已经运行了libreoffice的解决方法
检查正在运行的libreoffice进程,如果发现已经运行了libreoffice,则需要kill掉相关进程。有时候kill掉还会自动运行,可以多运行几次shutdown.sh脚本,确保执行startup.sh脚本前,没有运行的libreoffice进程。文章来源:https://www.toymoban.com/news/detail-673857.html
ps -ef|grep office
文章来源地址https://www.toymoban.com/news/detail-673857.html
到了这里,关于kkFileView启动时报错Caused by: java.lang.IllegalStateException: a process with acceptString ‘socket,host=的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!