ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Brohl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-10765) Failed registration for virtual hosts with similar mount points
Date Fri, 01 Feb 2019 15:26:00 GMT

    [ https://issues.apache.org/jira/browse/OFBIZ-10765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16758407#comment-16758407
] 

Michael Brohl commented on OFBIZ-10765:
---------------------------------------

I will try to explain what I have found out so far.

The (simplified) scenario: we have the framework + applications and several webapps which
are accessible through different domains but running on the same OFBiz instance.
This works perfectly with an older version of OFBiz which has the hot-deploy folder with several
webapps.

The webapp loading sequence of the CatalinaContainer is as follows (simplified by only showing
a few webapps, not all of them):


{noformat}
untitled text 210:2608: 2019-02-01 14:53:45,645 (catalina-startup-4) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[webapp1]].addChild(StandardEngine[default-server].StandardHost[webapp1].StandardContext[/static])
untitled text 210:2612: 2019-02-01 14:53:45,645 (catalina-startup-5) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[webapp1]].addChild(StandardEngine[default-server].StandardHost[webapp1].StandardContext[/webcontent])
untitled text 210:2609: 2019-02-01 14:53:45,645 (catalina-startup-2) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/static])
untitled text 210:2611: 2019-02-01 14:53:45,645 (catalina-startup-3) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/webcontent])
[...]
untitled text 210:2634: 2019-02-01 14:53:46,257 (catalina-startup-3) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/static])
untitled text 210:2635: 2019-02-01 14:53:46,263 (catalina-startup-5) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/webcontent])
untitled text 210:2646: 2019-02-01 14:53:46,298 (catalina-startup-7) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/webapp1])
untitled text 210:2647: 2019-02-01 14:53:46,296 (catalina-startup-1) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/webapp2])
[...]
untitled text 210:2718: 2019-02-01 14:53:47,207 (catalina-startup-2) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/sfa])
untitled text 210:2719: 2019-02-01 14:53:47,263 (catalina-startup-3) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/marketing])
untitled text 210:2720: 2019-02-01 14:53:47,263 (catalina-startup-6) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/humanres])
untitled text 210:2721: 2019-02-01 14:53:47,263 (catalina-startup-5) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/ordermgr])
[... other standard applications]
untitled text 210:2730: 2019-02-01 14:53:47,791 (catalina-startup-5) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/content])
untitled text 210:2731: 2019-02-01 14:53:47,862 (catalina-startup-0) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/partymgr])
untitled text 210:2732: 2019-02-01 14:53:47,937 (catalina-startup-1) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/tomahawk])
untitled text 210:2733: 2019-02-01 14:53:48,032 (catalina-startup-4) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/customtheme1])
untitled text 210:2734: 2019-02-01 14:53:48,067 (catalina-startup-7) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/customtheme2])
[... other themes]
untitled text 210:2740: 2019-02-01 14:53:48,128 (catalina-startup-7) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/images])
untitled text 210:2741: 2019-02-01 14:53:48,176 (catalina-startup-0) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/webtools])
untitled text 210:2742: 2019-02-01 14:53:48,194 (catalina-startup-5) [  CatalinaContainer.java:668:INFO
] host[StandardEngine[default-server].StandardHost[0.0.0.0]].addChild(StandardEngine[default-server].StandardHost[0.0.0.0].StandardContext[/bi]){noformat}


We are migrating this to work with the 17.12 release branch. The hot-deploy webapps are changed
to plugins. I have added the logging again which was missing after the refactoring to see
what's going on. The loading sequence of the CatalinaContainer now is:


{noformat}
untitled text 211:847: 2019-02-01 15:09:03,033 |catalina-startup-6   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp1]].addChild(StandardEngine[default-server].StandardHost[webapp1].StandardContext[/static])
untitled text 211:852: 2019-02-01 15:09:03,033 |catalina-startup-7   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp1]].addChild(StandardEngine[default-server].StandardHost[webapp1].StandardContext[/webcontent])
untitled text 211:883: 2019-02-01 15:09:04,106 |catalina-startup-8   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/webcontent])
untitled text 211:884: 2019-02-01 15:09:04,109 |catalina-startup-7   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/static])
untitled text 211:887: 2019-02-01 15:09:04,133 |catalina-startup-3   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/static])
untitled text 211:891: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException:
addChild:  Child name '/static' is not unique
untitled text 211:903: Caused by: java.lang.IllegalArgumentException: addChild:  Child name
'/static' is not unique
untitled text 211:904:         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
~[tomcat-catalina-9.0.10.jar:9.0.10]
untitled text 211:905:         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
~[tomcat-catalina-9.0.10.jar:9.0.10]
untitled text 211:906:         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
~[tomcat-catalina-9.0.10.jar:9.0.10]
untitled text 211:916: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException:
addChild:  Child name '/webcontent' is not unique
untitled text 211:928: Caused by: java.lang.IllegalArgumentException: addChild:  Child name
'/webcontent' is not unique
untitled text 211:929:         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
~[tomcat-catalina-9.0.10.jar:9.0.10]
untitled text 211:930:         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
~[tomcat-catalina-9.0.10.jar:9.0.10]
untitled text 211:931:         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
~[tomcat-catalina-9.0.10.jar:9.0.10]
untitled text 211:945: 2019-02-01 15:09:04,430 |catalina-startup-1   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/webapp3])
untitled text 211:947: 2019-02-01 15:09:04,485 |catalina-startup-5   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/webapp4])
[...]
untitled text 211:982: 2019-02-01 15:09:04,898 |catalina-startup-8   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/flatgrey])
untitled text 211:984: 2019-02-01 15:09:04,902 |catalina-startup-5   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/webtools])
untitled text 211:985: 2019-02-01 15:09:04,903 |catalina-startup-4   |CatalinaContainer            
|I| host[StandardEngine[default-server].StandardHost[webapp2]].addChild(StandardEngine[default-server].StandardHost[webapp2].StandardContext[/bluelight]){noformat}
 

It seems that after creating the host for the last plugin webapp, the host name stays webapp2
and there are no webapps registered under the standard host 0.0.0.0. As you can see, this
is the root cause for the error "Child name '/static' is not unique" which was the initial
cause of this issue.

My "fix" does not handle the real problem. There must be a change in the loading sequence
and nesting of hosts.

I'll try to find out what is wrong and appreciate any help from people more familiar with
this code.

> Failed registration for virtual hosts with similar mount points
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-10765
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10765
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Trunk, Release Branch 17.12, Release Branch 18.12
>            Reporter: Michael Brohl
>            Assignee: Michael Brohl
>            Priority: Blocker
>             Fix For: 17.12.01, 18.12.01
>
>         Attachments: OFBIZ-10765_failed_registration_for_similar_mount_points.patch
>
>
> The registration of webapps with virtual hosts using similar mount points does not work.
> Example
> The following webapps should be registered (virtual host/ mount point)
>  * host1/webcontent
>  * host2/webcontent
> During registration, the name of the context is implicitly set through the setPath(...)
method in org.apache.catalina.core.StandardContext if not already set. In the above example,
the name will be set as "/webcontent".
> Wenn the context is added, it is checked if a child under the name is already registered
and the addition will be refused.
> The solution would be to explicitly set the name from the webappInfo.name before the
path is set. I will provide a patch for it.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message