Author Topic: Getting Error --no hapi66 in java.lang.library  (Read 20593 times)

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Getting Error --no hapi66 in java.lang.library
« on: December 20, 2007, 13:32:38 »
I am getting the following error while running the Hugin Sample in Tomcat

java.lang.UnsatisfiedLinkError: no hapi66 in java.library.path
        java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
        java.lang.Runtime.loadLibrary0(Runtime.java:822)
        java.lang.System.loadLibrary(System.java:992)
        COM.hugin.HAPI.Native.DefaultNativeHAPI.loadLibrary(DefaultNativeHAPI.java:29)
        COM.hugin.HAPI.Native.AbstractNativeHAPI.<init>(AbstractNativeHAPI.java:35)
        COM.hugin.HAPI.Native.DefaultNativeHAPI.<init>(DefaultNativeHAPI.java:25)
        COM.hugin.HAPI.Native.HAPI.<clinit>(HAPI.java:31)
        COM.hugin.HAPI.Domain.<init>(Domain.java:198)
        test.BAP.<init>(BAP.java:17)
        org.apache.jsp.test_jsp._jspService(test_jsp.java:49)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
However when I am running the sample code as a standalone application its running fine.

Please help.


Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2282
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #1 on: December 20, 2007, 16:31:08 »
The HUGIN Java API is implemented on top of the HUGIN C API using a Java Native Interface (JNI). This implies that the HUGIN Java API library is provided as two files:

  • hapi67.jar contains the Java interface to the underlying C library. This file must be mentioned by the CLASSPATH environment variable.
  • hapi67.dll contains the native version of the HUGIN API for the platform used. When running the Java VM, this file must be located in a directory mentioned by the LD_LIBRARY_PATH environment variable.
HUGIN EXPERT A/S

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #2 on: December 21, 2007, 06:17:59 »
When I installed Hugin I got the hgai69.dll with it.
I run the sample program as standalone application it gives no error and pics up the hgapi69.dll from classpath.
But when I run this sample from Tomcat I get the Exception and it says that HAPI66.dll is not there.(I am unable to find HAPI66.dll with the HUgin installation )
Can you please suggest from where I can obtain this dll.

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2282
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #3 on: December 21, 2007, 09:24:20 »
The hapi66.dll file for the HUGIN Java API is located in this directory by default:

Code: [Select]
C:\Program Files\Hugin Expert\Hugin Developer 6.8\HDE6.6J\Bin
If you have changed the installation path, then you will have to update the above path.

Notice that the hgapi69.dll is the JNI dll file for the HUGIN Graphical User Interface (implemented in Java) distributed with HUGIN Developer 6.9. The hapi66.dll is the JNI dll file for Java API distributed with HUGIN Developer 6.8.

When using the HUGIN Java API you should use the corresponding JNI dll file and not the JNI dll file for the HUGIN Graphical User Interface.
HUGIN EXPERT A/S

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #4 on: December 24, 2007, 16:10:04 »
I am Using the Evaluation Version of Hugin and couldnt find this dll.
Does it comes only with Developer pack and not with Hugin Lite evaluation?

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2282
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #5 on: December 25, 2007, 11:48:31 »
Quote
Does it comes only with Developer pack and not with Hugin Lite evaluation?

No, the HUGIN Lite package contains the same APIS as HUGIN Developer. The only difference between a Developer and Lite package (besides the fact that the latter is to be used for technology assessment only) is the size of the models and data sets.

In a HUGIN Lite 6.8 installation you should be able to find the dll file in this directory:
Code: [Select]
C:\Program Files\Hugin Expert\Hugin Lite 6.8\HDE6.6J\Bin
HUGIN EXPERT A/S

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #6 on: December 26, 2007, 07:26:30 »
I have installation of Hugin Lite 6.9 which contains hapi67.dll

My standalone application is running fine with above installation but when I am deploying this application in Tomcat or weblogic I am getting error that no
hapi66 is available in class path..

Does hugin lite application only run in standalon mode nad canot be deployed in web container? ???

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #7 on: December 26, 2007, 07:55:28 »
Would really appreciate if you can send me the hapi66.dll(using Zip) on my mailid ajay.atiwari@wipro.com

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2282
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #8 on: December 26, 2007, 11:11:02 »
I have installation of Hugin Lite 6.9 which contains hapi67.dll

My standalone application is running fine with above installation but when I am deploying this application in Tomcat or weblogic I am getting error that no hapi66 is available in class path..

I'm not an expert on Tomcat/weblogic, but it seems that your standalone application is using the files from HUGIN Lite 6.9 while Tomcat/weblogic are using the hapi66.jar file from HUGIN Lite 6.8 (or some other HUGIN package version 6.8 ). Can you verify that the CLASSPATH used by Tomcat/weblogic is in fact including hapi67.jar and not hapi66.jar?

Quote
Does hugin lite application only run in standalon mode nad canot be deployed in web container? ???

No, but the CLASSPATH and the LD_LIBRARY_PATH need to refer to the files of the same version of HUGIN. If the CLASSPATH includes hapi67.jar (or hapi.66.jar), then the LD_LIBRARY_PATH should include the path of hapu67.dll (or hapi66.dll). This seems not to be the case on your system.

Quote
Would really appreciate if you can send me the hapi66.dll(using Zip) on my mailid ajay.atiwari@wipro.com

The hapi66.dll file has been sent to the email address listed.
HUGIN EXPERT A/S

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #9 on: December 26, 2007, 13:10:43 »
Thanks for your Quick Response...
The attachment u send is blank..it contains blank Zip file.
Could you please resend it???

I have one more doubt....Does Hugin API supports Multitenancy(Multi User Environment)???

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2282
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #10 on: December 26, 2007, 13:37:18 »
Thanks for your Quick Response...
The attachment u send is blank..it contains blank Zip file.
Could you please resend it???

I think the content was removed by an email server. The file is attached.

Quote
I have one more doubt....Does Hugin API supports Multitenancy(Multi User Environment)???

The HUGIN API is thread-safe and can be used in multithreaded applications. You may find more information on multiprocessing and multitreaded applications in the HUGIN (C) API Reference Manual.
HUGIN EXPERT A/S

Offline Ajay Tiwari

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Getting Error --no hapi66 in java.lang.library
« Reply #11 on: January 02, 2008, 08:26:40 »
Thanks for ur help....Problem got resolved by putting DLL in CLASSPATH