Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Spring loaded in spring mvc framework

I am having some issues using spring loaded with spring mvc. I added the spring loaded jar as a java agent on the server.

Now when I added new methods for instance in my case I added a new method testHomes(), and it gives me with this dialog. enter image description here

Below is my config enter image description here

enter image description here

I also checked Build Automatically I am using spring framework 4.2.5.RELEASE.

I checked from the following link SpringLoaded

Unlike 'hot code replace' which only allows simple changes once a JVM is running (e.g. changes to method bodies), Spring Loaded allows you to add/modify/delete methods/fields/constructors. The annotations on types/methods/fields/constructors can also be modified and it is possible to add/remove/change values in enum types.

IS there any way I can make this work ?

Regards,

like image 371
Manish Basdeo Avatar asked Apr 29 '16 17:04

Manish Basdeo


People also ask

Can we use Spring MVC and Spring boot together?

Yes, you can use Spring MVC with Spring Boot. To create and run a Spring MVC web application in spring boot, you need to add the spring-boot-starter dependency in your pom. xml file.

Can we integrate Spring with other MVC frameworks?

Spring Web FlowSWF integrates with existing frameworks like Spring MVC, Struts, and JSF, in both servlet and portlet environments. If you have a business process (or processes) that would benefit from a conversational model as opposed to a purely request model, then SWF may be the solution.

What is difference between Spring and Spring MVC?

Spring Boot is considered a module of the Spring framework for packaging the Spring-based application with sensible defaults. Spring MVC is considered to be the model view controller-based web framework under the Spring framework. For building a Spring-powered framework, default configurations are provided by it.

Can we use Struts and Spring together?

Spring framework provides an easy way to manage the dependency. It can be easily integrated with struts 2 framework.


1 Answers

What is Hot Code Replace?:

Hot code replace (HCR) is a debugging technique whereby the Eclipse Java debugger transmits new class files over the debugging channel to another JVM. In the case of Eclipse development, this also applies to the VM that runs the runtime workbench. The idea is that you can start a debugging session on a given runtime workbench and change a Java file in your development workbench, and the debugger will replace the code in the receiving VM while it is running. No restart is required, hence the reference to "hot".

When it works:

HCR only works when the class signature does not change; you cannot remove or add fields to existing classes, for instance. However, HCR can be used to change the body of a method. HCR is reliably implemented only on 1.4.1 VMs and later, or using any version of the IBM J9 VM. J9 is available in IBM products such as Websphere Studio Device Developer.

Troubleshooting the problem:

  1. Check you are running the application on a supported VM (taking note that the JVM that runs Eclipse may not be the same as the JVM that is running your Java application).

  2. Check whether automatic building turned on. Make sure that 'Project> Build Automatically' is checked.

  3. Check the following option being selected on Eclipse Tomcat Server.

    enter image description here

References:wiki.eclipse

like image 117
CrawlingKid Avatar answered Oct 23 '22 13:10

CrawlingKid