我正在尝试从GWT Web应用程序打印TSC-244 Pro条形码标签打印机。他们给tsclib.dll。这就是为什么我使用jna.jar并将tsclib.dll文件复制到C:\ Windows和[my_project_dir] \ war \ WEB-INF \ lib。它的工作但是当我部署到apache tomcat时。它不起作用,我得到了以下错误。请给我解决方案。感谢。
SEVERE:调度传入的RPC调用时发生异常 com.google.gwt.user.server.rpc.UnexpectedException:服务方法'public abstract boolean com.mbc.client.Controller.print(java.lang.String,java.util.ArrayList)throws java.lang.IllegalArgumentException'thrrew意外异常:java.lang.UnsatisfiedLinkError:无法加载库'TSCLIB':找不到指定的模块。
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
引起:java.lang.UnsatisfiedLinkError:无法加载库'TSCLIB':找不到指定的模块。
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:375)
at com.sun.jna.Native.loadLibrary(Native.java:360)
at com.mbc.server.impls.TscLibDll.<clinit>(TscLibDll.java:8)
at com.mbc.server.util.BarCode.openport(BarCode.java:73)
at com.mbc.server.util.Printer.openBarCodePrinter(Printer.java:67)
at com.mbc.server.util.Printer.printtsc(Printer.java:97)
at com.mbc.server.util.Printer.print(Printer.java:35)
at com.mbc.server.ControllerServlet.print(ControllerServlet.java:1390)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
... 17 more
答案 0 :(得分:1)
我解决了这个问题。我找不到TSCLIB.dll,因为我刚刚下载了32 bit
的dll文件。我的apache tomcat程序位于64 bit
。因此,为什么无法加载库'TSCLIB'。现在我刚刚下载了64 bit
dll文件并将其复制到C:\Windows\sysWOW64\
。这是工作!好的。
答案 1 :(得分:0)
您需要将TscLib.DLL
添加到LD_LIBRARY_PATH
,才能使com.mbc.server.impls.TscLibDll
中的本机代码生效。