facebook

[Closed] -Djava.library.path

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #242681 Reply

    bfarnik
    Member

    I’ve got 2 projects which are supposed to do the same thing:
    Initialize and access external ActiveX. The 1st project is Standard Java Application and the code starts like this:

    import com.develop.jawin.*;
    import MyBeans.*;
    public class Test {

    public static void main(String[] args) {
    MyBeans.JavaNativeBridge oJNB;
    try
    {
    oJNB = new MyBeans.JavaNativeBridge();
    str = oJNB.toString();
    System.out.println(str);
    … some Java stuff calling oJNB methods

    This works fine, I only had to specify -Djava.library.path in project Run VM Arguments, which point to the jawin.dll necessary to access my ActiveX.

    Now in the 2nd project I am doing the same thing, but from JSP (running in Tomcat 5.5/JRE 1.5), which header looks like this:

    <%@ page language=”java” contentType=”text/html;charset=ISO-8859-1″ import=”MyBeans.*”%>
    <jsp:useBean id=”oJNB” scope=”session” class=”MyBeans.JavaNativeBridge” />
    … some JSP stuff calling oJNB methods

    This passes MyEclipse JSP project validation and initializes the Bean (my ActiveX specific logon dialog is invoked when the validation starts), but when I try to open it with MyEclipse browser, I am getting error NoClassDefFound, which I am almost sure is because the jawin.dll was not found.

    Where should I put -Djava.library.path in this case, to make sure the DLL is found? Tomcat 5 VM settings are suggesting to avoid it and even if I ignored it it did not help.

    #242716

    Riyad Kalla
    Member

    Under the Tomcat 5 > Paths settings, the last box is for appending resources to your Library Path, you will want to add the dir that has your DLL in it there.

    #242740

    bfarnik
    Member

    Thanks for the prompt reply.

    Unfortunately this did not help. I am still getting an exception

    java.lang.NoClassDefFoundError
    at com.develop.jawin.IdentityManager.registerProxy(IdentityManager.java:259)

    which for all I have learned before is symptomatic for jawin.dll not found.

    I was getting the same error in my Java Application, before I added -Djava.library.path=… to the application VM arguments, so I wonder why it doesn’t work in Tomcat environment 😕

    #242755

    Riyad Kalla
    Member

    java.lang.NoClassDefFoundError
    at com.develop.jawin.IdentityManager.registerProxy(IdentityManager.java:259)

    which for all I have learned before is symptomatic for jawin.dll not found.

    The class, IdentityManager, is contained in a JAR somewhere, you need to find that JAR and append it to your Tomcat classpath, using the top box on the Paths panel. Making additions to the Library path is not going to help that. Check the directory you appended to the library path, it may also contain the JAR you need in addition ot the DLL.

    #242832

    bfarnik
    Member

    Correct, jawin comes as a pair: jawin.jar and jawin.dll.
    I’ve put C:\bscdev\njawin\lib\jawin.jar to Tomcat5 Prepend to classpath
    and
    C:\bscdev\njawin\lib to Tomcat5 Append to library path.

    In a despair I have already put the jawin dll+jar almost
    everywhere in my system.

    It is now in:
    C:\bscdev\njawin1.2\lib – this is where I configured MyEclipse Tomcat 5 to look for it
    Then in:
    <Tomcat_Home>
    bin
    common\lib
    server\lib
    shared\lib
    webapps\myjawinapp\WEB-INF\lib
    <Winows_Home>
    system32

    Still getting gthe exception …

    #242834

    bfarnik
    Member

    OK I made it working, but not sure how.
    I have reinstalled Java 1.5 and Tomcat 5.5 into simple (non-default) directory structure, reconfigured Eclipse workbench and the application properties accordingly, applied jawin classpath and library paths as suggested, re-deployed the application and – the bean initialization passes when the JSP page is opened with MyEclipse browser (sadly it is failing on another place, but it is not Eclipse problem I think)

    Thanks for your help.

    #242847

    Riyad Kalla
    Member

    Glad to hear it is working now, thank you for following up.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: [Closed] -Djava.library.path

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