Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006223 [Resin] minor always 03-26-19 03:54 04-01-19 17:01
Reporter stbu View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.61
Summary 0006223: 404 for META-INF/resources file when a jar in /webapp-jars is replaced with different name
Description We have a jar file placed in $RESIN_HOME/webapp-jars called my-library-1.0.jar and it contains certain css and images in META-INF/resources/ that are accessed by many web-apps on several virtual-hosts.

From time to time we generate a new version of the "my-library" jar with a different filename, remove the old version from webapp-jars and put the new version (!with the new filename) in.

At this time the web-apps are getting stopped and started due to the detected modification. Perfect so far.
However, accessing these META-INF/resources files are now not served any more -> we get a 404 Not Found.

Other content from the .jar file (classes) are working as expected.

This does not happen when the .jar filename does not change.

See additional information for a way to reproduce the issue.
Additional Information ## This testcase was performed under Linux (Windows blocked certain delete activities)

* Download fresh Resin-4.0.61

# Setup a new web-app called "/test-meta-inf":
mkdir -p webapps/test-meta-inf

## Setup a dummy folder named 'XXX' in which we will build a .jar file with META-INF/resources content
mkdir -p XXX/META-INF/resources/css

# Generate a dummy.css there with the content "Version 1.0":
echo "Version 1.0" > XXX/META-INF/resources/css/dummy.css

# Generate a my-library-1.0.jar and put it in 'webapp-jars' Folder so that it is shared by all web-apps of all hosts:
cd XXX
jar -cvf ../webapp-jars/my-library-1.0.jar *

# Startup Resin
cd ..
bin/ start

# Run curl to see that the file is served with 200 and expected content:
curl http://localhost:8080/test-meta-inf/css/dummy.css [^]

#The output will be:
Version 1.0

# Now we prepare an update of this library.
echo "Version 1.1" > XXX/META-INF/resources/css/dummy.css

rm webapp-jars/my-library-1.0.jar
cd XXX
jar -cvf ../webapp-jars/my-library-1.1.jar *

# Note: Output of log/jvm-app-0.log during these activities at 10:45:28:
[19-03-26 10:43:28.864] {main} Resin[id=app-0] started in 2326ms
[19-03-26 10:45:28.513] {resin-44} /tmp/test-meta-inf-resources/resin-4.0.61/webapp-jars has modified jar files
[19-03-26 10:45:28.513] {resin-44} WebApp[production/webapp/default/ROOT] stopping
[19-03-26 10:45:28.571] {resin-29} WebApp[production/webapp/default/ROOT] active
[19-03-26 10:45:28.863] {resin-46} /tmp/test-meta-inf-resources/resin-4.0.61/webapp-jars has modified jar files
[19-03-26 10:45:28.863] {resin-46} WebApp[production/webapp/default/test-meta-inf] stopping
[19-03-26 10:45:28.902] {resin-48} WebApp[production/webapp/default/test-meta-inf] active

# Run curl again to check for dummy.css
curl http://localhost:8080/test-meta-inf/css/dummy.css [^]

## Now the output is neither "Version 1.0" nor "Version 1.1" it is a 404:
<head><title>404 Not Found</title></head>
<h1>404 Not Found</h1>
/test-meta-inf/css/dummy.css was not found on this server.

<hr />
Server: 'app-0'

# Only with a restart it is going to get picked up:
cd ..
bin/ restart

curl http://localhost:8080/test-meta-inf/css/dummy.css [^]

# Output (as expected):
Version 1.1

Attached Files

- Relationships

- Notes
04-01-19 17:01


- Issue History
Date Modified Username Field Change
03-26-19 03:54 stbu New Issue
03-26-19 03:54 stbu Issue Monitored: stbu
04-01-19 17:01 ferg Note Added: 0006880
04-01-19 17:01 ferg Assigned To  => ferg
04-01-19 17:01 ferg Status new => closed
04-01-19 17:01 ferg Resolution open => fixed
04-01-19 17:01 ferg Fixed in Version  => 4.0.62

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker