Phidget code suddenly not working in Tomcat

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

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(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at com.phidgets.Phidget.<clinit>(Phidget.java:26)
        at com.electricgearbox.temperature.PhidgetSensor.<init>(PhidgetSensor.ja
va:33)
        at com.electricgearbox.temperature.PhidgetSensor.getInstance(PhidgetSens
or.java:45)
        at com.electricgearbox.temperature.TempServletListener.contextInitialize
d(TempServletListener.java:21)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:4811)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5251)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:725)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
1)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)

        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
1816)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
        at java.lang.Thread.run(Thread.java:745)



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....)

tom.williamson
Fresh meat
Posts: 2
Joined: Sun Jul 10, 2016 8:12 pm
Contact:

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