Closed mestachs closed 8 years ago
Phantom is opinionated in that it does not run as an app inside a web container. In fact, it inverts the control where it is the uber container that brings up a number of socket listeners(Netty based), Jetty based admin interface and Spring ApplicationContexts - one for each deployed "Handler". We have production deployments with upto 6 such socket listeners running on the same JVM instance.
For the above design to work and also externalize configurations that can be edited independently of code, Phantom needs to be deployed in exploded form and not as a single war file. Moreover, I am not sure if this is the only change required for you to be able to run Phantom as a web app inside a servlet container.
Were you able to test if Phantom works well with the change you have proposed? If it does work, I don't see much of a problem in making the change you have requested.
Unfortunately, you cannot replace or change the beans loaded from common-proxy-server-nature-config.xml in a straightforward manner. It is picked up from the classpath. So, a workaround will be to have another file with the same name on the classpath that can be scanned before the bundled one.
Btw, the classpath scan happens for "packaged/common-proxy-server-nature-config.xml". You need to have the replacement file follow the same path.
My colleague will prepare a pullrequest. We still have one issue between windows and linux to investigate.
Thanks for the explanation we found a way to override both context and code. For the record lookup in WEB-INF/classes is done before WEB-INF/lib/*.jar, and override the FileLocator to allow non unique location to the "packaged/common-proxy-server-nature-config.xml".
I'm bundling phantom in war (just to make start and stop easier for ops)
One thing that blocks me is that the JetteyWebAppContextFactory does'nt work well when the path contains WEB-INF
eg
....workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/phantom-war/WEB-INF/lib/runtime-1.4.4.jar!/WEB-INF
is transformed to...workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/phantom-war//lib/runtime-1.4.4.jar!/WEB-INF
and not...workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/phantom-war/WEB-INF/lib/runtime-1.4.4.jar!/
The code looks like
is it possible to modify it to something like
or is there a way to override the
common-proxy-server-nature-config.xml
with my own definition ?