Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.7.1
-
None
-
None
-
Linux
Description
I have a TomEE installation /opt/apache-tomee-plus-1.7.1. There is a symlink /opt/apache-tomee pointing to that directory. TomEE is started using this symlink as CATALINA_HOME and CATALINA_BASE. Then I have a webapp with an annotated WebListener. The class is inside the webapps WEB-INF/classes directory. However, the init listener never gets called in this scenario. If I set CATALINA_HOME/BASE to the "real" directory it works.
I did a bit of debugging and the cause is the check in org.apache.tomee.catalina.OpenEJBContextConfig.internalProcessAnnotations, line 573. The "webAnnotated.name" contains the symlink in the path whereas "currentUrlAsFile" is the canonical path. The canonical path is not a part of the symlinked path and therefore the listeners does not get added.
The root cause is probably org.apache.openejb.loader.JarLocation.jarLocation(Class). It should also return canonical paths to be consistent.
This bug is pretty nasty because without hours of debugging you won't find the problem.
Attachments
Issue Links
- duplicates
-
TOMEE-1370 symbolic links not supported by tomee for @WebXXX
- Closed