moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
279 stars 200 forks source link

Taking out the Framework code and running in tomcat. #277

Closed RollaAshokkumar closed 6 years ago

RollaAshokkumar commented 6 years ago

I am running two application with Moqui, Is that any possible to run framework code in one place and the two portals will point to same framework (To reduce tomcat load).

jonesde commented 6 years ago

Could you be more specific? It sounds like you're talking about having the framework run on one server and your application on another... but that doesn't make any sense.

RollaAshokkumar commented 6 years ago

When I am running two application, The framework code will be there in two places in a single tomcat. Is there any way to make it as single framework code in side tomcat.

jonesde commented 6 years ago

Why do you want 2 separate webapps in the same servlet container, both running Moqui Framework? Why not combine them into one?

jonesde commented 6 years ago

I don't think this is going anywhere, so closing.

On a side note it is possible to run Moqui Framework outside a webapp or one level up in the classpath from webapps and have multiple webapps using it. To do so would require different packaging and direct use of the moqui-framework.jar file and all dependent jars (by default included in the executable war file). Keep in mind that the tests run outside a Servlet Container with direct init of the framework.

The problem with offering a standardized build with a single framework instance (ExecutionContextFactory as the main object) is that it is done differently for each Servlet Container (or full J2EE application server). There is no standard way of doing it, mostly because EAR packages (single file or exploded) don't offer a standard way to put things on the classpath one level above the per-webapp level. Most application servers that support EAR files have custom extensions to do this sort of thing (with custom deployment descriptors and such).

This is the main reason that Apache OFBiz (the spiritual predecessor of Moqui) runs with an embedded servlet container and can't easily be dropped into an app server at all without repackaging (which requires significant effort). The default Moqui approach is to support multiple applications within the same webapp to simplify deployment, allowing a build into a single WAR file (that is also executable when you want to run with an embedded servlet container, namely Jetty, handy for development and for pre-built container images and such).