facebook

TomCat 5.0 Path

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #260871 Reply

    jediez
    Member

    hi there.

    I developed and application which uses a dll to get data from windows registry, there is a dll located at a directory included in PATH environment variable. Ir works fine If I invoke it from and standalone application, but When I tested it from a Web App hosted in Tomcat, It throws a javalinkunsatisfiedException. It seems like TomCat gets a different value for PATH Variable.

    The question would be:
    – Where does TomCat get java.library.path value?
    – How Can I include a new directory there?

    Thanks in advance.
    Esteban Diez.

    #260915 Reply

    Riyad Kalla
    Member

    Esteban,
    I cannot tell from your post if you are asking in the general case, or if you are a MyEclipse user. If you are a MyEclipse user, edit your Tomcat connector settings, under Path, and add the directory with the DLL in it, to the ‘Path’ (last box), that will fix it.

    #260927 Reply

    jediez
    Member

    Hi Riyad

    Actually, I am asking in the general case; although I am a MyEclipse user, the application that I am develoving is gonna be hosted in a server that doesn’t MyEclipse.

    What can I do, then?
    Is there any way to solve this?

    Thanks u for your cooperation.
    Esteban D.

    #260957 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    Please Google for “Tomcat DLL” or something similar, you will find plenty of information on this.

    #260986 Reply

    jediez
    Member

    Hey Ryad.

    If I am posting this topic in this forum It’s because all information I got from the Internet (GOOGLE) has either been few or not useful.
    Thanks anyway for trying helping me.!

    Regards,
    Esteban

    #260988 Reply

    Riyad Kalla
    Member

    A quick search brought up this:
    http://forum.java.sun.com/thread.jspa?threadID=369425&messageID=3786636

    You need to add the dir that contains the DLL in your System PATH it seems like.

    #260999 Reply

    jediez
    Member

    Riyad.

    Adding the dir that contains the DLL in my System path does not solve the problem!. I’ve already tried that.
    It seems like when u are running an app hosted in Tomcat, the value for java.system.path variable is not the same as the one on System Path (Environment variable).

    How can I add a new directory to the Path, If my application runs from Tomcat???????
    It works fine for stand-alone app, but not for Tomcat.

    Thanks a lot for any help with this.!
    Esteban

    #261013 Reply

    jediez
    Member

    Hi Guys!. Hi solved the problem, by following this instructions:

    Place the jar file that has the JNI Java classes in the {CATALINA_HOME}\shared\lib folder.
    If the folder doesn’t exist then create it.
    The JNI DLL must be located somewhere visible from either the java.library.path java system property or the Path windows system (or user) property.
    To set the java.library.path java system property with Tomcat simply set the JAVA_OPTS environment variable before executing {CATALINA_HOME}\bin\startup.bat:

    set CATALINA_HOME=someTomcatRootFolder
    set JAVA_HOME=someJavaRootFolder
    set JAVA_OPTS=-Djava.library.path=someJniDllPath
    cd “%CATALINA_HOME%\bin”
    call startup.bat

    ——-

    Although, I am still getting an error because there are two apps hosted at my Tomcat Server, do u know how I can make this up?
    The error message is (Its shown, once the second app attempts to use the dll):

    java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\Apache Software Foundation\Tomcat 5.0\shared\classes\jRegistryKey.dll already loaded in another classloader

    Thanks a lot!.
    Esteban Diez G.

    #261019 Reply

    Riyad Kalla
    Member

    Unfortunately the VM can only load a DLL once, so you will need to work around that issue.

    #261031 Reply

    jediez
    Member

    So u mean I cant have two apps hosted in Tomcat Server that use same dll?

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: TomCat 5.0 Path

You must be logged in to post in the forum log in