shylynx
shylynx

Reputation: 615

Apache Tomcat doesn't find Native library

I maintained countless instances of tomcat but now I run into a problem I never ran into before.

I get the well known log message where tomcat complains that it can't find the native lib at D:\Programme\Apache Software Foundation\Tomcat 7.0\bin:

"The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Programme\Apache Software Foundation\Tomcat 7.0\bin; [...]"

As usual I put the native lib "tcnative-1.dll" into the bin-folder of Tomcat (and yes, it is at drive D:!!), but tomcat furthermore complains the missing native lib.

I also tried to specify -Djava.library.path at startup, but without success. There are no further messages in the log that may indicate other problems at startup.

Why doesn't tomcat find the native lib?

The web is full of stupid trial-and-error-approaches and the tomcat documentation doesn't explicitly describes under which circumstances it doesn't take the native lib in the bin-folder.

Additional info:

Apache Tomcat 7.0.8

JVM 1.6.0_29-b11

Upvotes: 2

Views: 22819

Answers (3)

Jimmysnn
Jimmysnn

Reputation: 593

It is an old post, but I lose a lot of time with the same problem. so I would like to post my solution about this problem.

1st step: copy paste your dll in a java.path for example in windows C:\Windows\System32

2nd step: set VM Option: -Djava.library.path="C:\Windows\System32"

in netebeans rightClick on project --> properties --> run -->fill textfield in vmOption.

Upvotes: 0

Shinichi Kai
Shinichi Kai

Reputation: 4513

Create setenv.bat into D:\Programme\Apache Software Foundation\Tomcat 7.0\bin and put a following line in it.

set JAVA_OPTS=-Djava.library.path="D:\Programme\Apache Software Foundation\Tomcat 7.0\bin"

Is this work for you?

Upvotes: 0

Olaf Kock
Olaf Kock

Reputation: 48087

Check if the DLL bitsize matches your JDK bitsize (not the OS bitsize): E.g. if you run Win64, but a 32bit Java, make sure to have a 32bit DLL.

Upvotes: 1

Related Questions