- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的 spring 项目中使用 Ghost4J 0.5.1。
在本地一切正常(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 位,因为我认为这是两个系统之间的主要区别,并且已经发现其他相关问题表明它。
如何让 Ghost4j 在我的 64 位机器上工作?
编辑我正在使用 Spring Integration 服务捕获异常。当我不这样做时,会出现内部错误:
这是重要的部分:
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 content=com.proyecti.magma.web.issues.UpdateIssueRequestDTO@b31a250][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
最佳答案
好的,我们有了!
问题是缺少一些依赖项......
sudo apt-get install libgs-dev
然后重新启动,一切正常。
关于执行 Ghost4J 时出现 java.lang.IllegalStateException(Linux 32 位与 64 位),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24786565/
我有一个坦克射击弹药的游戏。我对这部分代码的目标是检查它们是否与“碰撞”磁贴发生碰撞,如果是,则将其和磁贴移除。 代码如下所示,每 1/60 秒检查一次: Iterator iterator = sh
我尝试使用 JSR-303 注释(类级别)和验证器实现为 play 2.0.1 编写自定义表单验证器。 不幸的是,当我提交表单并且验证失败时,我收到了一个 IllegalStateException,
根据answer of BalusC ,我用过 FacesContext.getCurrentInstance().getExternalContext().redirect(url); 在我的 @P
这个问题已经有答案了: Copy a stream to avoid "stream has already been operated upon or closed" (10 个回答) 已关闭 5
这个问题已经有答案了: Spring: getOutputStream() has already been called for this response (3 个回答) 已关闭 4 年前。 我正
我正在尝试将 Activity 转换为 FragmentActivty 对象,以便获得 FragmentManager 对象 public class Main extends ListActivit
我正在尝试使用可编辑的组合框,通过用户的某些击键从数据库中快速搜索客户端的功能。我想要的是,用户将输入一些字母,如果这些字母与某些客户端匹配,这些客户端将保留在组合框的当前数据模型中。 代码如下。请修
这个问题已经有答案了: You need to use a Theme.AppCompat theme (or descendant) with this activity. Change to Th
我正在使用 Android Studio 和 Genymotion 作为模拟器创建一个应用程序,其中我在 3 个 EditText 中输入数据,当我单击按钮将其存储在 sqlite 数据库中时,它不起
我正在为 Android 构建一个简单的消息应用程序,并且在发送短信时遇到一些问题。我第一次使用 OnlickListener 时,消息被发送并显示在我的 ListView 中。当我在 Activit
我了解到 collect() 和 forEach() 都是流终端操作,在同一个流上调用它们会抛出 非法状态异常。但是,以下代码可以成功编译并按升序打印每个字符串的长度。不会引发任何异常。怎么会这样?
我对 classcastException 和非法状态异常都有点困惑,因为在大多数情况下它们看起来都很相似。 我在这个java代码中遇到了一个问题 class consumer {
我正在尝试这个小计算器程序。当我调用calculateResult()方法时,我想在第二个操作数为零且运算符为除法时显示IllegalStateException错误。但尽管如此,我在calculat
Stacktrace Here 导入java.util.*; 公共(public)类 AccountClient { public static void main(String[] args) {
我正在使用 readEntity() 方法读取 JAVAX 响应,但我收到以下堆栈跟踪: java.lang.IllegalStateException: Entity input stream ha
我是安卓新手。我正在尝试进行简单的登录 Activity ,但当我单击“登录”按钮时出现运行时错误。我认为我没有正确获取数据。我已经检查过,SQLite 中有一个与该 PK 相对应的数据。 日志猫。
我正在创建一个登录页面,工程师可以通过以“engg”开头的用户名登录。问题出在登录页面,当我使用正确的密码提供正确的输入时,它会给出“非法状态异常”。在错误的输入中,它工作正常。就像当我在我的 ora
我正在使用一些现有的 Java 设备驱动程序软件,该软件使用 JavaCOMM 进行串行 I/O。我昨天看到它抛出一个异常,其中有一个 IllegalStateException - 端口从 publ
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我正在使用 Adventnet SNMPAPI 开发 UDP 监听程序。现在我需要将监听数据保存到数据库中。当我这样做时,我遇到了错误。任何人都可以帮忙解决这个问题吗... 这是我的代码。 impor
我是一名优秀的程序员,十分优秀!