Re: Java.library.path

Richard Deadman <[email protected]>
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <[email protected]>
Actually, no.

The error indicates that a shared library or DLL is not found for some native
method call (JNI) that the application is trying to make. More specificly, the
Dialogic Global Call service provider is looking for a file called
"gcprovider.dll" or "gcprovider.so" on the library path and can't find it.

Let's back up. GJTAPI is a JTAPI and JAIN JCC (and JAIN Jcat) framework that
supports these APIs and delegates hardware- (or protocol-) specific calls to a
service provider. Depending if you are talking to a serial voice modem, a
MS-Windows TAPI instance, a Dialogic GlobalCall object, SIP or some other
telephony protocol, you need to tell the GJTAPI framework which service
provider is to be hooked into the framework. This is done through a
combination of entries in the "GenericResources.props" file and the string
passed into "JtapiPeer.getProvider()".

By default, the GenericResources.props file in version 1.7 has the Dialogic
GlobalCall provider set as the default. If your application's call to
JtapiPeer.getProvider() passes in an empty string or null then the framework
will load up this provider. The GlobalCall provider than tries to talk to the
non-Java GlobalCall api using JNI and this causes Java to look for the
gcprovider shared library (aka DLL).

You have two options:
  1. Hook the shared library into your java library path (using
"-Djava.library.path=." or setting the system's library path using the
system-specific call -- see
http://java.sun.com/docs/books/jni/html/start.html). You only want to do this
if you are really hooking GJTAPI to a Dialogic board using the GlobalCall API.
  2. Choose a different service provider by changing the default in the
GenericResources.props file or by passing the provider's name from this file
into your JtapiPeer.getProvider() method.

Cheers,


Richard

On Aug 24, Phil Crick <[email protected]> wrote:
>
> This isn't a jtapi error as such, it's a version problem with the JRE you're
> using. UnsatisfiedLinkErrors generally mean that you have one version of
> java installed on your machine - say 1.3.1 - and you've downloaded a jar
> file that was compiled with a later version of java - say 1.4.2, the runtime
> is basically saying it can't run the new stuff because it's a different
> version.
>
> You're error is subtley different however: "no gcprovider in java", the
> gcprovider is the garbage collector and is a fundamental part of java,
> sounds like it's a bit screwed! If I were you I'd do the following:
>
> 1. Check the version of java you have installed - bring up dos prompt and
> type "java -version"
> 2. Check this version against the version of jtapi you downloaded and check
> they are compatible.
>
> You may have multiple versions of java installed on your machine which may
> take some untangling - the easiest option is to uninstall and re-install the
> version you need.
>
> Hope that helps
>
> Phil
>
> -----Original Message-----
> From: Please help [mailto:[email protected]]
> Sent: 24 August 2004 06:55
> To: [email protected]
> Subject: [JTAPI] Java.library.path
>
>
> I got this error:
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no gcprovider
> in java
> .library.path
>         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
>         at java.lang.Runtime.loadLibrary0(Runtime.java:788)
>         at java.lang.System.loadLibrary(System.java:834)
>         at net.sourceforge.gjtapi.raw.dialogic.GCProvider.<clinit>
> (GCProvider.ja
> va:509)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:141)
>         at net.sourceforge.gjtapi.GenericJtapiPeer.getProvider
> (GenericJtapiPeer.
> java:184)
>         at CallCtlOutcall.main(CallCtlOutcall.java:20)
> Press any key to continue . . .
>
> My gjtapi located in jre/lib/ext. Please show me how to set
> java.library.path.
>
> Thank you in advance


--
Richard Deadman
Deadman Consulting, Incorporated
mailto:[email protected]
http://www.deadman.ca
Office: 613-231-5112
Cell: 613-220-2469

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.