Hi,
I know from blog's guide that you can call extension from servlet deployed on jetty,
but is there a way to call servlet from extension?
I'm trying to call spring boot deployed on sfs2x jetty using war.
Thanks,
Richard
Calling spring boot from extension
Re: Calling spring boot from extension
Hi,
no this is not possible sorry. Also it sounds quite strange as use case.
Servlets respond to HTTP requests. Why do you need to invoke one from an Extension?
Can you explain what you're trying to do?
Thanks
no this is not possible sorry. Also it sounds quite strange as use case.
Servlets respond to HTTP requests. Why do you need to invoke one from an Extension?
Can you explain what you're trying to do?
Thanks
Re: Calling spring boot from extension
Hi,
I'm trying to use spring boot but it seems it can only deployed as:
a standalone jar with embedded application server such as jetty
OR
a war to be deployed to application server.
My case is actually simple, to be able to use spring 5 and spring data jpa with hibernate as jpa provider.
The only know way to run is actually only by using spring boot but it has limitation where it need to run in Java EE environment.
Scenario that I have tried:
1. running extension build as spring boot standalone jar. extension was able to be started but spring boot boot failed to start.
2. running old version of boot as war and was successful.
3. running newest version of boot as war and upgrade jetty on sfs installation to newest 9.3 jetty and was successful
4. running newest version of boot as war and failed on sfs jetty because JEP 238 jars.
5. I can run old version of spring using normal maven dependency as extension but still failing to configure to run spring data jpd with hibernate.
Thank you,
Richard
I'm trying to use spring boot but it seems it can only deployed as:
a standalone jar with embedded application server such as jetty
OR
a war to be deployed to application server.
My case is actually simple, to be able to use spring 5 and spring data jpa with hibernate as jpa provider.
The only know way to run is actually only by using spring boot but it has limitation where it need to run in Java EE environment.
Scenario that I have tried:
1. running extension build as spring boot standalone jar. extension was able to be started but spring boot boot failed to start.
2. running old version of boot as war and was successful.
3. running newest version of boot as war and upgrade jetty on sfs installation to newest 9.3 jetty and was successful
4. running newest version of boot as war and failed on sfs jetty because JEP 238 jars.
5. I can run old version of spring using normal maven dependency as extension but still failing to configure to run spring data jpd with hibernate.
Thank you,
Richard
Re: Calling spring boot from extension
Hi,
I found a temporary solution by using spring-jdbc for database connection and thus i don't need to use spring boot.
Spring boot facilitate automatic spring dependency and configuration. I have been using their auto configuration for so long that
currently are struggling to manually configure spring.
So my original question was me trying to find a shortcut by calling spring boot war deployed on jetty from extension.
If I'm able to do this then I don't need to do manual spring configuration.
it is just about boilerplate size. spring-jdbc require 100+ LoC where spring-data-jpa 3 require 1 LoC.
Thanks,
Richard
I found a temporary solution by using spring-jdbc for database connection and thus i don't need to use spring boot.
Spring boot facilitate automatic spring dependency and configuration. I have been using their auto configuration for so long that
currently are struggling to manually configure spring.
So my original question was me trying to find a shortcut by calling spring boot war deployed on jetty from extension.
If I'm able to do this then I don't need to do manual spring configuration.
it is just about boilerplate size. spring-jdbc require 100+ LoC where spring-data-jpa 3 require 1 LoC.
Thanks,
Richard
Re: Calling spring boot from extension
Hi,
I am glad you were able to figure out a solution. We don't use Spring so our knowledge of the framework is very limited.
Cheers
I am glad you were able to figure out a solution. We don't use Spring so our knowledge of the framework is very limited.
Cheers
Re: Calling spring boot from extension
rlaksana wrote:
Hi,
I found a temporary solution by using spring-jdbc for database connection and thus i don't need to use spring boot.
Spring boot facilitate automatic spring dependency and configuration. I have been using their auto configuration for so long that
currently are struggling to do my assignment and manually configure spring.
So my original question was me trying to find a shortcut by calling spring boot war deployed on jetty from extension.
If I'm able to do this then I don't need to do manual spring configuration.
it is just about boilerplate size. spring-jdbc require 100+ LoC where spring-data-jpa 3 require 1 LoC.
Thanks,
Richard
Hello,
Thanks for the possible solution. Once I tried to create table (h2) with jdbcTemplate. So I had a defined a datasource in the spring configuration and then defined JdbcTemplate as a bean in my spring configuration and autowired it.
-
- Posts: 1
- Joined: 21 Dec 2019, 17:32
Re: Calling spring boot from extension
Hi,
I know from blog's guide that you can call extension from servlet deployed on jetty,
but is there a way to call servlet from extension? 9Apps VidMate Vlc
I'm trying to call spring boot deployed on sfs2x jetty using war.
I know from blog's guide that you can call extension from servlet deployed on jetty,
but is there a way to call servlet from extension? 9Apps VidMate Vlc
I'm trying to call spring boot deployed on sfs2x jetty using war.
Last edited by smithclarkson1 on 19 Jan 2020, 19:18, edited 1 time in total.
Re: Calling spring boot from extension
No, because they live in their own separate class loader, plus it's not a good idea generally speaking to invoke a servlet directly.
What you could do is using an event system to communicate between Extensions and Servlets.
Using something like the Observer pattern you could register one or more servlets to receive events from an Extension (and viceversa).
Hope it helps
What you could do is using an event system to communicate between Extensions and Servlets.
Using something like the Observer pattern you could register one or more servlets to receive events from an Extension (and viceversa).
Hope it helps
Who is online
Users browsing this forum: No registered users and 65 guests