facebook

installing dll’s

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #229273 Reply

    paula9295
    Member

    Windows
    Eclipse Version 3.0.2 Build id 200503110845
    MyEclipse Version 3.8.4
    JDK version: 1.4.2
    Tomcat 5.5

    Here’s an old post:

    ‘The library path preference of the Tomcat connector is how you make DLLs known to a Tomcat instance. Under the covers the Tomcat connector adds your DLLs to the equivalent of Java’s “java.libraries” system property. This property is a concatenated path of directories the JVM uses to dynamically search and load DLLs required by JNI dependent classes of your webapp such as a native DB driver. So if you have DLLs required by your MyEclipse webapp make sure that the directories containing these DLLs is specified in the library paths of the Tomcat connector.’

    I have DLLs required by my MyEclipse webapp. Let’s say they’re in C:\ProjectDLLs How do I ‘specify the library path of the Tomcat connector’, or more basically, where in MyEclipse do I specify this DLL directory?

    #229303 Reply

    paula9295
    Member

    Anyone yet?

    #229305 Reply

    Scott Anderson
    Participant

    Paula,

    Sorry for the delay; we must’ve missed this one.
    You can specify the directory at Window > Preferences > MyEclipse > Application Servers > Tomcat 5 > Paths > Append to Library Path
    That will make dlls in that directory available to the JVM running Tomcat.

    #229333 Reply

    paula9295
    Member

    Windows
    Eclipse Version 3.0.2 Build id 200503110845
    MyEclipse Version 3.8.4
    JDK version: 1.4.2
    Tomcat 5.5

    I have an existing project consisting of JSPs, .class files and dlls. The .class files use JNI (Java Native Interface) to call the DLLs. I’ve tried to import this project into MyEclipse, but am having problems building it. I put the .class files in /WEB-INF/classes and the dlls in a dir within the PATH environment variable. When I try to run the application, Tomcat displays the following error:

    Generated servlet error:
    The import Registry cannot be resolved

    An error occurred at line: 16 in the jsp file: /news.jsp
    Generated servlet error:
    Registry cannot be resolved

    where, ‘Registry’ is the name of the class and the dll. I believe this is telling me that it cannot find the .class file?

    Any ideas on how to build this successfully? Please let me know if you need more info.

    #229335 Reply

    Riyad Kalla
    Member

    Paula,
    Is your project a Java project or a Web project? Are you deploying it using our deployment tool? If you rebuild the entire project, are any errors marked or does it compile without problems?

    Also please do the tip Scott mentioned to add the DLL to your Library Path for Tomcat to find it.

    #229346 Reply

    paula9295
    Member

    1. Web project
    2. Yes, I deploy through Project –> MyEclipse –> Add/Remove Project deployments
    3. Rebuild by doing exactly what steps? I do see the ‘unresolved’ error on the .jsp pages referencing the .class file and subsequently the dll, but in order to rebuild, do I just re-run the Tomcat server after making changes to source files?
    3. Yes, I did add the directory that the dll’s are in to the Library path. Do you add mean the name of the .dll file itself to the lib path?

    #229348 Reply

    Riyad Kalla
    Member

    3. Rebuild by doing exactly what steps? I do see the ‘unresolved’ error on the .jsp pages referencing the .class file and subsequently the dll, but in order to rebuild, do I just re-run the Tomcat server after making changes to source files?

    Make sure “automatically rebuild” is checked in your Project menu, then do Project > Clean and select your project and hit OK. It will now rebuild. We need to resolve the problems in ME first.

    3. Yes, I did add the directory that the dll’s are in to the Library path. Do you add mean the name of the .dll file itself to the lib path?

    No what you did was fine, thank you.

    #229351 Reply

    paula9295
    Member

    Hi, I did the rebuild, and the error in the .jsp file is:
    The import Registry cannot be resolved (in file: “Registry”)
    ‘Registry’ is the name of the .class file and the dll.

    #229355 Reply

    Riyad Kalla
    Member

    this is very strange indeed, admitedly I haven’t don’t JNI work before so I don’t know if having the name of both conflicting is a problem.

    First I would suggest:
    1) Find the actual source file in your <source dir>\<package to source> directory and open it, does it compile? Any error markers?
    2) Open your Navigation View, navigate to your <WebRoot dir>\WEB-INF\classes directory and then drill down to find the compiled version of your Registry soruce dir, can you find it? Is it in the right location?
    3) Open your jSP file, remove the line that imports the Registry class into your JSP page, and then go down to the line of code where you use the Reigstry class, go to the end of the class name (after the “y”) and hit CTRL-SPACE and autocomplete the name, this should automatically add an Import statement for you in your JSP page, now save the JSP file, did the error go away?

    #229361 Reply

    paula9295
    Member

    Hi Riyad, let me first tell you that I’m a newbie, so it may be something really simple.

    1. I placed Registry.java in project/src/Registry.java. Then I hit Project –> Clean to re-build.

    2. Then I found the new Registry.class file in <WebRoot dir>\WEB-INF\classes . Which is the right location correct?

    3. After I deleted the imports line, I tried to autocomplete by choosing the Registry class file that popped up, but I do not see any Import statements added in the JSP file, so, the error is still there.

    Thanks for your helpful responses.

    #229367 Reply

    Riyad Kalla
    Member

    1. I placed Registry.java in project/src/Registry.java. Then I hit Project –> Clean to re-build.

    Does Registry have a package defined in it? It needs to, you can’t use classes in the default package, god will strike you down with lightning.

    3. After I deleted the imports line, I tried to autocomplete by choosing the Registry class file that popped up, but I do not see any Import statements added in the JSP file, so, the error is still there.

    I think this all stems from the fact that you have not defined a package for thsi class and put it in the appropriate location, you need to do that first.

    #229372 Reply

    paula9295
    Member

    Hi, from the package explorer view, it looks like Registry.java is in default package. However in the navigator view, Registry.java shows up in src (no package). Can you point me to something to read on this subject? Thanks

    #229373 Reply

    Riyad Kalla
    Member

    Hi, from the package explorer view, it looks like Registry.java is in default package. However in the navigator view, Registry.java shows up in src (no package).

    These are one and the same.

    As far as packages go, Java Tutorial is a good place to start: http://java.sun.com/docs/books/tutorial/getStarted/index.html

    #229376 Reply

    paula9295
    Member

    Thanks Riyad, I’ve defined a package, created the appropriate directories and now the build doesn’t generate the unresolved error.

    #229378 Reply

    Riyad Kalla
    Member

    glad to hear it.

Viewing 15 posts - 1 through 15 (of 15 total)
Reply To: installing dll’s

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