Native Tomcat / Tomcat Native: Pick Only One

An Excelsior JET user reported an interesting problem recently.

Symptoms

After native compilation, your Tomcat Web application stops serving static files, with error messages varying by browser, and the following error appears in the log:

.... org.apache.tomcat.util.net.AprEndpoint$Sendfile add 
SEVERE: Unexpected sendfile error 
org.apache.tomcat.jni.Error: 720003: The system cannot find the path specified. 
at org.apache.tomcat.jni.File.open(Unknown Source) 
at org.apache.tomcat.util.net.AprEndpoint$Sendfile.add(Unknown Source) 
at org.apache.coyote.http11.Http11AprProcessor.breakKeepAliveLoop(Unknown Source) 
at org.apache.coyote.http11.AbstractHttp11Processor.process(Unknown Source) 
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Unknown Source) 
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source) 

Cause

As you know, Excelsior JET enables you to pack resources — images, property files, media clips, etc. — into the resulting executable. For this to work without any application code changes, we have modified the respective parts of the standard Java library to intercept and “redirect” file I/O operations.

However, Tomcat APR/native connectors use the operating system file API directly. So when those connectors are used, the resource files must be present in the underlying file system.

(To be more precise, you can try setting the useSendfile to false in the APR/native connectors configuration, but correct operation is not guaranteed.)

Resolution

We plan to address this issue in future releases, but for now, you have to either stop using APR/native connectors or switch off resource packing.

Important: APR connectors get enabled automatically if you install Tomcat Native, even if you do not make any changes to Tomcat configuration.

Categories: Excelsior JET, Tomcat

Comments are closed.