2014-07-16 2 views
0

내 봄 프로젝트에서 Ghost4J 0.5.1을 사용하고 있습니다.java.lang.IllegalStateException Ghost4J 실행 중 (Linux 32 대 64 비트)

로컬에서는 모든 것이 잘 작동하지만 (32 비트) EC2 (64 비트)로 배포하면 java.lang.IllegalStateException이 발생합니다.

final Ghostscript ghostScript = Ghostscript.getInstance(); 

synchronized(ghostScript) 
{ 
    try 
    { 
     ghostScript.initialize(optimicePdfArguments); //here raises the exception 
    } 
    catch (GhostscriptException e) 
    { 
     LOGGER.error("Error"); 
    } 
} 

나는 두 시스템 간의 주된 차이점이라고 생각하고 다른 관련 문제가 있음을 알았 기 때문에 32/64 비트를 표시합니다.

내 64 비트 시스템에서 Ghost4j를 작동 시키려면 어떻게해야합니까?

EDIT 나는 Spring Integration 서비스로 Exception을 잡았다. 나는 그것을하지 않는 경우, 내부 오류가 나타납니다

이것은 중요한 부분입니다 :

Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'gs': libgs.so: cannot open shared object file: No such file or directory 

이 전체 스택 트레이스입니다 :

2014-07-16 20:16:15,159 DEBUG [userId = 1] [transformPdfToHpubChannelExecutor-1] o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'errorChannel' 
2014-07-16 20:16:15,160 DEBUG [userId = 1] [transformPdfToHpubChannelExecutor-1] o.s.i.c.DirectChannel - preSend on channel 'v1.manageIssueChange.channel.error', message: [Payload MessageHandlingException content=org.springframework.messaging.MessageHandlingException: java.lang.IllegalStateException: Cannot process message][Headers={id=12dbbf58-eda5-14b7-0ad9-8058225b6353, timestamp=1405541775160}] 
2014-07-16 20:16:15,160 WARN [userId = 1] [transformPdfToHpubChannelExecutor-1] o.s.i.c.MessagePublishingErrorHandler - Error message was not delivered. 
org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel 'org.springframework.web.context.WebApplicationContext:/MagmaServer.v1.manageIssueChange.channel.error'. 
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:81) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:255) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.channel.MessagePublishingErrorHandler.handleError(MessagePublishingErrorHandler.java:83) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55) [spring-integration-core-4.0.2.RELEASE.jar:na] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_60] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_60] 
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_60] 
Caused by: org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers 
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:107) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    ... 6 common frames omitted 
2014-07-16 20:16:15,162 ERROR [userId = 1] [transformPdfToHpubChannelExecutor-1] o.s.i.c.MessagePublishingErrorHandler - failure occurred in messaging task with message: [Payload UpdateIssueRequestDTO [email protected]250][Headers={errorChannel=v1.manageIssueChange.channel.error, operationType=createFromPdf, id=bd35e61d-7492-fb61-0d7f-49eea3b5c3f7, timestamp=1405541773441}] 
org.springframework.messaging.MessageHandlingException: java.lang.IllegalStateException: Cannot process message 
    at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:78) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:71) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:170) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:150) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:114) ~[spring-messaging-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:44) ~[spring-messaging-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:93) ~[spring-messaging-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:260) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:241) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:205) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:199) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:177) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:150) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:114) ~[spring-messaging-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:44) ~[spring-messaging-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:93) ~[spring-messaging-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:260) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:241) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:205) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:199) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:177) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:131) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.dispatcher.UnicastingDispatcher.access$000(UnicastingDispatcher.java:48) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.dispatcher.UnicastingDispatcher$1.run(UnicastingDispatcher.java:92) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_60] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_60] 
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_60] 
Caused by: java.lang.IllegalStateException: Cannot process message 
    at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:284) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:142) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:75) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    ... 33 common frames omitted 
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'gs': libgs.so: cannot open shared object file: No such file or directory 
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166) ~[jna-3.3.0.jar:3.3.0 (b0)] 
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239) ~[jna-3.3.0.jar:3.3.0 (b0)] 
    at com.sun.jna.Library$Handler.<init>(Library.java:140) ~[jna-3.3.0.jar:3.3.0 (b0)] 
    at com.sun.jna.Native.loadLibrary(Native.java:393) ~[jna-3.3.0.jar:3.3.0 (b0)] 
    at com.sun.jna.Native.loadLibrary(Native.java:378) ~[jna-3.3.0.jar:3.3.0 (b0)] 
    at org.ghost4j.GhostscriptLibraryLoader.loadLibrary(GhostscriptLibraryLoader.java:39) ~[ghost4j-0.5.1.jar:na] 
    at org.ghost4j.GhostscriptLibrary.<clinit>(GhostscriptLibrary.java:34) ~[ghost4j-0.5.1.jar:na] 
    at org.ghost4j.Ghostscript.initialize(Ghostscript.java:323) ~[ghost4j-0.5.1.jar:na] 
    at com.proyecti.magma.services.v1.issue.transformpdf.TransformPdfToHpubServiceImpl.optimizePdf(TransformPdfToHpubServiceImpl.java:217) ~[TransformPdfToHpubServiceImpl.class:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_60] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_60] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_60] 
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_60] 
    at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:63) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:122) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.expression.spel.ast.MethodReference.access$000(MethodReference.java:44) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.expression.spel.ast.MethodReference$MethodValueRef.getValue(MethodReference.java:258) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:114) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:111) ~[spring-expression-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
    at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:159) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:268) ~[spring-integration-core-4.0.2.RELEASE.jar:na] 
    ... 35 common frames omitted 
+0

전체 스택 추적과 함께 전체 예외를 포함하십시오. –

+0

@Banthar 포함 시켰습니다. –

답변

1

OK, 우리가있다!

문제

sudo apt-get install libgs-dev 

그런 다음 다시 시작하고 모든 작동 ... 일부 누락 된 의존성이었다.