I am working on a web application that takes user-input to create serial output to an Arduino. For the serial output I am using the RXTX library, which has worked well in a standard Java application.
Since creating a Tomcat web-application however, I have found that for whatever reason, Tomcat does not recognise external Jars and I simply get this console error every time I try to run the server.
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Mar 30, 2016 9:03:18 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class web.Startup
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at controller.DCCSerialCom.init(DCCSerialCom.java:38)
at controller.MasterController.<init>(MasterController.java:17)
at web.Startup.contextInitialized(Startup.java:16)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have tried every solution I could find, including putting the jar in the tomcat/lib or in the WEB-INF folders and trying to reconfigure the server with no luck. I'm out of ideas now.
How can I get Tomcat to recognise RXTX or any other external libraries?