Using Spring HTTP invoker between difference versions of spring? - java

I have a server which uses spring 2.5.6 and currently my client spring mvc application are also using same version 2.5.6. I use httpinvoker for the connection between the two. I want to update and benefit of spring mvc 3, but I can not do anything with the server.
My questions is:
Will it work to use a different version of spring on the web-application than on the server-side?
And can this have side-effects that can cause problems?

Related

Use embedded tomcat instead of netty with spring-gateway

I'm running this project: https://github.com/wdahlenburg/spring-gateway-demo
It uses netty by default, how can I change it to embedded tomcat instead? I've tried to modify the pom.xml and replaces spring-boot-starter-test with spring-boot-starter-tomcat, but it doesn't work.
Does anyone know how to do that?
I don't think it's possible, spring cloud gateway is build on top of reactive Spring WebFlux project and requires netty runtime, as stated in docs:
Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spring Webflux. It does not work in a traditional Servlet Container or when built as a WAR.

Embed Grizzly (glassfish) Servlet Container with Spring Boot Java

Spring boot by default uses Tomcat as an Internal Embedded Servlet Container .
It has also got support for Jetty and UnderTow.
I have build a Restful Application using spring boot . But now i need to deploy it on Grizzly (Glassfish) Servlet Container .
How do i embed my application to run on grizzly as spring dosen't have support for the same.
https://github.com/spring-projects/spring-boot/issues/5015.
Please help as i researched a lot on thistopic but i coudnt get any link that shows how to embed a new Servlet Container for our spring boot app that spring dosent have support for.
Thanks
The Grizzly website states that Grizzly's servlet support is incomplete:
This is not a Servlet compliant implementation and as such, not all features exposed by a typical Servlet container are available here.
I haven't seen anywhere that expands on what those missing features are, but there's a good chance that what you're trying to do isn't possible without filling in some gaps in Grizzly's servlet support.
Assuming that it is possible, you need to write Grizzly-specific implementations of Spring Boot's EmbeddedServletContainerFactory and EmbeddedServletContainer interfaces. This is a fairly significant amount of work so, before undertaking it, I would ask yourself what you will gain by being able to use Grizzly as an embedded servlet container versus using Jetty, Tomcat, or Undertow which are already supported out of the box.
If you do decide to tackle this, reading the source code for the existing implementations for Jetty, Tomcat, and Undertow is the best way to learn about what needs to be done:
JettyEmbeddedServletContainer.java
JettyEmbeddedServletContainerFactory.java
TomcatEmbeddedServletContainer.java
TomcatEmbeddedServletContainerFactory.java
UndertowEmbeddedServletContainer.java
UndertowEmbeddedServletContainerFactory.java
As pointed by #Andy there is no support for Spring Boot and Grizzly .
Finally i moved to Spring MVC for the same.
Here is the working repo where i embedd Spring MVC with grizzly.
Hope it helps someone.
Link
There is now a third-party implementation of a Spring Boot starter for Grizzly which has specific implementations of the Spring Boot's EmbeddedServletContainerFactory and EmbeddedServletContainer classes for Grizzly.
Besides that it also offers JSP support through Tomcat's Jasper JSP engine, simply by specifying an additional dependency. You can find the project at GitHub and it is also listed in the Spring Boot starters list.

How to implement RMI with Spring 4?

Update
Sorry for not being clear in my question, I am developing a Spring project with the next dependencies
Spring Boot
Spring Data
Mysql
wsdl
In the project I exposed soap Web services with Spring Data for persistence, I have to use RMI for support of application desktop.
I tried the following :
Integrate in the same project Spring and RMI (using RMI Register ) successfully but when I tried use Spring annotations obviously not working.
I'm searching when I found that Spring have support for RMI using XML configuration but I need the configuration in annotations.
My question How to would implement RMI in my project?
I'm using latest version in all dependencies

Spring 4 mvc + security for servlet 2.5 in JBoss5.1.0.GA

I want to use spring 4 with minimal xml configuration for the now new project I am about to develop. I will be using Spring in this project for dependency-injection, mvc, security and jdbc. I will use JOOQ for query generation. (Yes, I need to project to support Postgresql and oracle) (maybe, in future, this app will extended support for REST too). The problem I face now is my production application server is JBoss5.1.0.GA, which obviously does not support servlet 3.0. Now I have a working spring 4 mvc code base with servlet 2.5, but I could not figure out how to configure the security with java config. Because I see most of the examples on spring 4 on servlet 3.0+ versions, and very less not good examples on 2.5. Though I read the spring security from the spring website, it made little difference on implementing it. Have anyone implemented security (db/ldap) on servlet 2.5? Share with me your wisdom and experiences.
Spring security (I suppose version 3.2 as you speak of spring 4) works well on servlet 2.5, at least with xml config. I am not sure that you can use full java config for security, but I am sure annotations can be used for method security.

Web Sockets in Spring MVC 3.2 and HTML5

I want to use Web HTML5 sockets with Spring MVC. A few days ago I heard that Spring 3.2 release will come up with Web Sockets support for real time updates.
http://blog.springsource.org/2012/05/08/spring-mvc-3-2-preview-techniques-for-real-time-updates/
But still not able to find any sample code which provide me the facility of real time update. I am using Tomcat for this purpose now but want to shift to Spring. Please see if you can help me finding a very good example of to use Web HTML5 sockets with Spring MVC.
At the end of the blog post there's this paragraph:
Coming back to Spring MVC 3.2, the Servlet 3 async feature can be used for long-running requests and also for HTTP streaming, techniques Filip Hanik referred to as "the server version of client AJAX calls". As for WebSockets, there is no support yet in Spring 3.2 but it will most likely be included in Spring 3.3. You can watch SPR-9356 for progress updates.
So there is no support for WebSockets in Spring MVC 3.2. The [SPR-9356] issue says that the feature is in the Spring 4.0 backlog. 1

Categories