[Bug 61632] New: Improve search for tcnative-1.dll on Windows when current directory is not bin/ (e.g. in Eclipse IDE, separate catalina_base)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61632] New: Improve search for tcnative-1.dll on Windows when current directory is not bin/ (e.g. in Eclipse IDE, separate catalina_base)

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61632

            Bug ID: 61632
           Summary: Improve search for tcnative-1.dll on Windows when
                    current directory is not bin/ (e.g. in Eclipse IDE,
                    separate catalina_base)
           Product: Tomcat 8
           Version: 8.5.23
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ----

In short:

- When running Tomcat on Windows, if current directory (when starting Tomcat)
is not $CATALINA_HOME\bin then the tcnative-1.dll is not found.

The default "java.library.path" on Windows includes "." current directory, but
does not include "$CATALINA_HOME\bin".


My main concern is running Tomcat as a Server in Eclipse IDE.

Steps to reproduce:
1. Download and unzip apache-tomcat-8.5.23-windows-<arch>.zip

2. Download, install and run Eclipse IDE for Java EE developers (I am using
Neon.3 aka 4.6.3)

3. Create a Tomcat 8.5 server in the IDE

https://wiki.apache.org/tomcat/FAQ/Developing#Q6

(Window > Show view > Other... > Server/Servers, add a new server)

4. Start it

Result:
[[[
Oct 18, 2017 4:17:59 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the java.library.path:
[...;;D:\eclipse_4_6;;.]
]]]

In Eclipse the default working directory when running a new server is the same
as default working directory of Eclipse IDE. In my case: "D:\eclipse_4_6"


Possible ways to resolve this:
a. Improve documentation. Add a note and a recipe to

https://tomcat.apache.org/tomcat-8.5-doc/apr.html#Windows

and

https://wiki.apache.org/tomcat/FAQ/Developing#Q6

b. Implement some way to search for tcnative-1.dll in ${catalina.home}/bin ?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61632] Improve search for tcnative-1.dll on Windows when current directory is not bin/ (e.g. in Eclipse IDE, separate catalina_base)

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61632

Konstantin Kolinko <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Konstantin Kolinko <[hidden email]> ---
> b. Implement some way to search for tcnative-1.dll in ${catalina.home}/bin ?

For this solution I thought that maybe

1. Allow to configure an explicit path to the dll in AprLifecycleListener

2. Use System.load(filename) call to load the library from an explicitly
specified filename.

The current code (in org.apache.tomcat.jni.Library) calls a different method -
System.loadLibrary(name).

Generally, loading a DDL from an explicit path is better than performing a
search.


A deficiency in this solution is that such configuration is specific to
Microsoft Windows. It cannot be included in the default *.zip download of
Apache Tomcat,
but it can be included "Windows" flavors of zip downloads.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61632] Improve search for tcnative-1.dll on Windows when current directory is not bin/ (e.g. in Eclipse IDE, separate catalina_base)

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61632

--- Comment #2 from Konstantin Kolinko <[hidden email]> ---
> a. Improve documentation. Add a note and a recipe to

My recipe is to configure "java.library.path" explicitly.


For running Tomcat in Eclipse IDE the steps are the following:

1. Open edit dialog for the Server

(In "Servers" view select the server and double-click it or press "F3" (Open))

See http://markmail.org/message/7zkyocvph56b6t6q

2. Click "Open launch configuration" link

An "Edit launch configuration properties" dialog opens.

3. Switch to "Arguments" tab and edit "VM arguments".

Add
-Djava.library.path="<your path of catalina.home>\bin"

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]