Phidget code suddenly not working in Tomcat

Supporting Java SE version 7 and up
Fresh meat
Posts: 2
Joined: Sun Jul 10, 2016 8:12 pm

Phidget code suddenly not working in Tomcat

Postby tom.williamson » Sun Jul 10, 2016 8:35 pm

It's been probably three years since I looked into the Phidget code, so if this is something stupid and basic, I apologize in advance.

I've used a couple of temperature sensor Phidgets in a web based project for years. The project ran so reliably (on a small Ubuntu box running a Tomcat server) that I never paid any attention to it, such as backing it up.

Well the box crashed, and I lost my Ubuntu install. Now I'm trying to get this project working on a development Windows server. This code DID WORK THE LAST TIME I TRIED IT, I want to emphasize that. Of course, that was probably two or three YEARS ago. So this is some kind of configuration problem. When I start this server, with my WAR file as the only web app, I get this:

Code: Select all

10-Jul-2016 19:20:08.480 INFO [localhost-startStop-1] org.apache.jasper.servlet.
TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs.
 Enable debug logging for this logger for a complete list of JARs that were scan
ned but no TLDs were found in them. Skipping unneeded JARs during scanning can i
mprove startup time and JSP compilation time.
CRIT: Couldn't get method ID <init> from tagLossEvent_class
Exception in thread "localhost-startStop-1" java.lang.NoSuchMethodError: <init>
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(
        at java.lang.ClassLoader.loadLibrary(
        at java.lang.Runtime.loadLibrary0(
        at java.lang.System.loadLibrary(
        at com.phidgets.Phidget.<clinit>(
        at com.electricgearbox.temperature.PhidgetSensor.<init>(PhidgetSensor.ja
        at com.electricgearbox.temperature.PhidgetSensor.getInstance(PhidgetSens
        at com.electricgearbox.temperature.TempServletListener.contextInitialize
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
        at org.apache.catalina.util.LifecycleBase.start(
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
        at org.apache.catalina.core.ContainerBase.addChild(
        at org.apache.catalina.core.StandardHost.addChild(

        at org.apache.catalina.startup.HostConfig.deployWAR(

        at org.apache.catalina.startup.HostConfig$
        at java.util.concurrent.Executors$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
        at java.util.concurrent.ThreadPoolExecutor$

Various JDKs and Tomcat instances have been uninstalled and reinstalled on this machine over the years, so whatever Phidget specific configuration I had seems to be gone.

I've uninstalled and reinstalled the Phidget21 MSI. I've tried bundling Phidget21.jar in the WAR, and also dropped it into the Tomcat /lib directory. I've added the Phidget21.dll to the JRE /bin directory. I've prayed to various gods. I don't know why it's not finding these entry points.

Here's the line of my code where it dives into the Phidget code:

Code: Select all

            pik = new InterfaceKitPhidget();

Once it goes in, it crashes the whole JRE - no survivors.

Does anyone know what I can do to fix this?

System Details:

Windows 7 x64
Java 1.8.0_77 64 bit
Tomcat 8.0.33
Intellij 2016 IDE

EDIT: The "Phidget Control Panel" app comes up and detects the interface board and sensors, so I know the Windows-level stuff is working. It's just the connection between the Tomcat install and the Phidgets DLL (I guess....)

Fresh meat
Posts: 2
Joined: Sun Jul 10, 2016 8:12 pm

Re: Phidget code suddenly not working in Tomcat

Postby tom.williamson » Mon Jul 11, 2016 7:28 pm

Figured it out, I had a different version of the Phidget jar in the project than the DLL in Windows/System32.

Return to “Java”

Who is online

Users browsing this forum: No registered users and 1 guest