Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6694197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:04:26+00:00 2026-05-26T06:04:26+00:00

I wrote a stand alone Java program (THAT WORKS) it calls a native library

  • 0

I wrote a stand alone Java program (THAT WORKS) it calls a native library created from a C program by generating the libipmi_agent.so lib, but running it in a web-app in tomcat is giving the following error:

native library call java.lang.reflect.InvocationTargetException
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
java.lang.UnsatisfiedLinkError: org.qcri.power.util.IPMIAgent.ipmi_agent_init()I 
    org.qcri.power.util.IPMIAgent.ipmi_agent_init(Native Method)
    org.qcri.power.util.IPMIAgent.main(IPMIAgent.java:18)
...

Here is my Java class:

package org.qcri.power.util;

public class IPMIAgent
{
  private native int ipmi_agent_init();
  private native void ipmi_agent_close();
  private native int ipmi_agent_read_current_value();
  static
    {
      System.loadLibrary("ipmi_agent");
    }

  // The main program
  public static int main(String[] args)
    {
        int i, v=0;
        IPMIAgent ipmiagent = new IPMIAgent();
        ipmiagent.ipmi_agent_init();
        for (i = 0; i < 100; i++)
        {
          try{
          v = ipmiagent.ipmi_agent_read_current_value();
          System.out.println("Current value is " + v);
          Thread.currentThread().sleep(1000);
          }
          catch(InterruptedException ie){
          }
        }
        return v;
    }
}

the libipmi_agent.so is in the same class folder with the the above Java class under /webapps/myapp/WEB_INF/classes.

is the position of the file correct? anyone has an idea?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:04:26+00:00Added an answer on May 26, 2026 at 6:04 am

    Building a stand alone program didn’t work on tomcat because the standalone class included in the web-app structure had a package name, so tomcat couldn’t find the right path since the native library generated was the one from the stand alone app with no package name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stand-alone application that I wrote before I became test-infected. Its a
I am a bit confused. I wrote a Java stand alone app and now
I have python script that works fine but only when run as stand-alone, while
Is there a stand-alone GUI designer that can read and write the .form files
Is there a good way to write F# scripts that execute stand-alone without compiling?
I wrote a windows service using VB that read some legacy data from Visual
Assume we have a trivial Java program that consists of just one class: public
I'm developing a simple, stand-alone, command line Java application. The project is managed by
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate
I wrote myself a little downloading application so that I could easily grab a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.