Is it possible to deploy a spring application in jetty of exist-db?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is it possible to deploy a spring application in jetty of exist-db?

Lin Ni
Hello,

now i have two projects. One is exist-db project and the other is spring
project.

I am running spring project on tomcat. Since exist-db uses Jetty as
servlet container, I am looking for a way to run my spring project in
Jetty of exist-db.

I want to ask a question. Is it possible to deploy a spring application
in jetty of exist-db?

I know Jetty can auto deploy the .war. But exist-db has URLRewrite
module. I cannot access my spring project correctly.

I haven't found any documetation for this.

If it is possible, could you tell me how to configure it?

Any help from you would be greatly appreciated.


Regards,

Lin


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

nsincaglia
I would also like to know the answer to this question. I do not have a Spring application but I have become interested in using the Vaadin Framework (https://vaadin.com/framework) in conjunction with eXist-db and was curious how these two might be able to be deployed using the same Jetty. Is there anyone who might be able to suggest a resource that would help us understand how something like this could be configured?

Best,

Nick
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

Wolfgang Meier-2
Well, you can place any .war into EXIST_HOME/tools/jetty/webapps and it will be deployed as a normal web app with a separate context (next to /exist).

Wolfgang



> Am 01.02.2017 um 17:56 schrieb nsincaglia <[hidden email]>:
>
> I would also like to know the answer to this question. I do not have a Spring
> application but I have become interested in using the Vaadin Framework
> (https://vaadin.com/framework) in conjunction with eXist-db and was curious
> how these two might be able to be deployed using the same Jetty. Is there
> anyone who might be able to suggest a resource that would help us understand
> how something like this could be configured?
>
> Best,
>
> Nick
>
>
>
> --
> View this message in context: http://exist.2174344.n4.nabble.com/Is-it-possible-to-deploy-a-spring-application-in-jetty-of-exist-db-tp4671242p4671249.html
> Sent from the exist-open mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

Dannes Wessels-3
In reply to this post by nsincaglia
Hi,

On 1 Feb 2017, at 17:56 , nsincaglia <[hidden email]> wrote:

I would also like to know the answer to this question. I do not have a Spring
application but I have become interested in using the Vaadin Framework
(https://vaadin.com/framework) in conjunction with eXist-db and was curious
how these two might be able to be deployed using the same Jetty. Is there
anyone who might be able to suggest a resource that would help us understand
how something like this could be configured?

as Wolfgang pointed out, it is possible to drop war files in the webapps directory. Please note..

- that you might encounter classloader conflicts with JARs provided by eXist-db
- all applications share the same java memory-space ; 

the latter is dangerous for a database; exist-db should not share memory. If you decide to do anyway, please don’t report issues to the community when having issues because of out-of-memory exceptions :-)

regards

Dannes


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

nsincaglia
Dannes,
Thank you for pointing out the short comings of doing this. The Java memory-space was not immediately obvious to me.

Let me ask a follow up question to you then. Is there are deployment approach you would recommend under the described circumstances?

Nick

On Feb 1, 2017, at 3:49 PM, Dannes Wessels <[hidden email]> wrote:

Hi,

On 1 Feb 2017, at 17:56 , nsincaglia <[hidden email]> wrote:

I would also like to know the answer to this question. I do not have a Spring
application but I have become interested in using the Vaadin Framework
(https://vaadin.com/framework) in conjunction with eXist-db and was curious
how these two might be able to be deployed using the same Jetty. Is there
anyone who might be able to suggest a resource that would help us understand
how something like this could be configured?

as Wolfgang pointed out, it is possible to drop war files in the webapps directory. Please note..

- that you might encounter classloader conflicts with JARs provided by eXist-db
- all applications share the same java memory-space ; 

the latter is dangerous for a database; exist-db should not share memory. If you decide to do anyway, please don’t report issues to the community when having issues because of out-of-memory exceptions :-)

regards

Dannes




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

Dannes Wessels-3
Hi,

Thank you for pointing out the short comings of doing this. The Java memory-space was not immediately obvious to me.

Let me ask a follow up question to you then. Is there are deployment approach you would recommend under the described circumstances?




From a maintenance and configuration perspective I'd recommend to split servers over several hosts, e.g. with a virtualization solution. Only this way it is guaranteed that one piece of software is claiming resources [memory, cpu, io] from an other one.  I can't suggest a product, but Docker is commonly used (though: this runs multiple servers on one server, isolated though)

A host split makes diagnostics probably  more easy too,  as you can monitor inter-host communication.

In general: a database like eXist-db should not share critical resources like memory and disk space with other servers.


regards

Dannes



--
eXist-db Native XML Database - http://exist-db.org
Join us on linked-in: http://www.linkedin.com/groups?gid=35624

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

Adam Retter
Docker is not a good choice for databases.

On 3 Feb 2017 5:09 p.m., "Dannes Wessels" <[hidden email]> wrote:
Hi,

Thank you for pointing out the short comings of doing this. The Java memory-space was not immediately obvious to me.

Let me ask a follow up question to you then. Is there are deployment approach you would recommend under the described circumstances?




From a maintenance and configuration perspective I'd recommend to split servers over several hosts, e.g. with a virtualization solution. Only this way it is guaranteed that one piece of software is claiming resources [memory, cpu, io] from an other one.  I can't suggest a product, but Docker is commonly used (though: this runs multiple servers on one server, isolated though)

A host split makes diagnostics probably  more easy too,  as you can monitor inter-host communication.

In general: a database like eXist-db should not share critical resources like memory and disk space with other servers.


regards

Dannes



--
eXist-db Native XML Database - http://exist-db.org
Join us on linked-in: http://www.linkedin.com/groups?gid=35624

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

Lin Ni

Hi,

thank you for all your advises.

I will make them on two different hosts.

Best,

Lin

Am 03.02.2017 um 11:21 schrieb Adam Retter:
Docker is not a good choice for databases.

On 3 Feb 2017 5:09 p.m., "Dannes Wessels" <[hidden email]> wrote:
Hi,

Thank you for pointing out the short comings of doing this. The Java memory-space was not immediately obvious to me.

Let me ask a follow up question to you then. Is there are deployment approach you would recommend under the described circumstances?




From a maintenance and configuration perspective I'd recommend to split servers over several hosts, e.g. with a virtualization solution. Only this way it is guaranteed that one piece of software is claiming resources [memory, cpu, io] from an other one.  I can't suggest a product, but Docker is commonly used (though: this runs multiple servers on one server, isolated though)

A host split makes diagnostics probably  more easy too,  as you can monitor inter-host communication.

In general: a database like eXist-db should not share critical resources like memory and disk space with other servers.


regards

Dannes



--
eXist-db Native XML Database - http://exist-db.org
Join us on linked-in: http://www.linkedin.com/groups?gid=35624

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to deploy a spring application in jetty of exist-db?

nsincaglia
In reply to this post by Wolfgang Meier-2
Hi Wolfgang,
I have been trying to follow your instructions on this thread but so far without success. With everything I have read on the topic, it sounds as easy as you have suggested. Since I have not been successful yet, it makes me question my understanding of how eXist-db and Jetty are configured and working together.

I found this article which decribes "I think" what I am trying to accomplish.
http://blogs.quovantis.com/run-multiple-java-web-apps-using-jetty-on-different-ports-simple-quick/

When I compare the recommended settings in the article to those in the eXist-db jetty.xml file in $EXIST_HOME/tools/jetty/etc, I noticed the reference to class="org.exist.jetty.WebAppContext" instead of class="org.eclipse.jetty.webapp.WebAppContext" in the article, which makes me think that eXist-db has embedded Jetty is embedded into eXist-db as the Jetty documentation suggests to do:

"Jetty has a slogan, "Don’t deploy your application in Jetty, deploy Jetty in your application!" What this means is that as an alternative to bundling your application as a standard WAR to be deployed in Jetty, Jetty is designed to be a software component that can be instantiated and used in a Java program just like any POJO. Put another way, running Jetty in embedded mode means putting an HTTP module into your application, rather than putting your application into an HTTP server."

We are running our eXist-db in a Servlet Context. The Jetty configuration can be found in tools/jetty/etc/jetty.xml. It defines a single web application context /exist, mapped to the webapp directory. Do we have to add second web application context to this file for us to run another application .war file on another port? Or is the current default implementation only set up to run one Java web app? Is it even possible to do what I am trying to do with the default eXist-db deployment as a servlet context?

Nick
Loading...