- This topic has 14 replies, 3 voices, and was last updated 19 years, 7 months ago by Riyad Kalla.
-
AuthorPosts
-
paula9295MemberWindows
Eclipse Version 3.0.2 Build id 200503110845
MyEclipse Version 3.8.4
JDK version: 1.4.2
Tomcat 5.5Here’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?
paula9295MemberAnyone yet?
Scott AndersonParticipantPaula,
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.
paula9295MemberWindows
Eclipse Version 3.0.2 Build id 200503110845
MyEclipse Version 3.8.4
JDK version: 1.4.2
Tomcat 5.5I 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 resolvedAn error occurred at line: 16 in the jsp file: /news.jsp
Generated servlet error:
Registry cannot be resolvedwhere, ‘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.
Riyad KallaMemberPaula,
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.
paula9295Member1. 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?
Riyad KallaMember3. 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.
paula9295MemberHi, 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.
Riyad KallaMemberthis 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?
paula9295MemberHi 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.
Riyad KallaMember1. 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.
paula9295MemberHi, 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
Riyad KallaMemberHi, 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
paula9295MemberThanks Riyad, I’ve defined a package, created the appropriate directories and now the build doesn’t generate the unresolved error.
Riyad KallaMemberglad to hear it.
-
AuthorPosts