Spring loaded 1.2.5 + Spring Boot 1.3.2. can't seem to get it to work - spring

I came across a video on youtube ( https://www.youtube.com/watch?v=GTrNkhVnJBU ) where it demos Spring Loaded.
I'm trying to duplicate the same behavior but am still unsuccessful so far.
What I'm using:
Spring Tool Suite 3.7.2
Spring Boot 1.3.2-RELEASE
Spring loaded 1.2.5-RELEASE
Maven version 3.1.0
JDK 1.8.0_71
I tried the same thing as the guy does in the video (except for the versions being more up to date of course) but it doesn't work.
I also tried the "maven plugin" way as described in the spring docs here -> https://docs.spring.io/spring-boot/docs/current/reference/html/howto-hotswapping.html#howto-reload-springloaded-maven
But that also did not work.
I tried changing the versions of spring loaded to 1.2.0 (docs use that version) but that didn't do anything either.
I ran the app in STS itself, and also tried mvn spring-boot:run from command line, but both simply don't get the desired result.
When using mvn spring-boot:run I see that it is attaching the agent:
[INFO] Attaching agents: [C:\Users\ron.m2\repository\org\springframework\springloaded\1.2.5.RELEASE\springloaded-1.2.5.RELEASE.jar]
But changing RequestMappings or method signatures do not get picked up by spring loaded and thus the change is not reflected.
I'm a little out of ideas why I can't get this to work and any help would be greatly appreciated.

Spring loaded does not yet support spring 4.2. See https://github.com/spring-projects/spring-loaded/issues/139
So you either stick with DevTools which definitely speeds up the development process (although not as fast as spring-loaded), use JRebel (which supports the latest spring version) or downgrade to spring 4.1.

As an alternative you could also try the automatic restart feature of Spring Boot Devtools: https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3. It restarts just the app and it is much quicker than restarting the whole JVM. You are loosing application state though, but it might be an alternative.

Related

Spring boot + Activiti explorer

Is it possible to integrate activiti explorer maven plugin with activiti Spring boot app?, so that we can make use of activit-explorer to view deployed process in activit-spring boot engine.
I know we can use rest-api over spring boot to query process engine, but I want to know if it is possible to run the explorer over spring boot by adding it as a maven plugin during deployment?Or can we tweak the activit-explorer.war somehow to point to spring-boot activiti engine?
activiti-explorer.war is standalone webapp by itself. I've write some guideline on how to manually to embed activiti-explorer to you own app. http://blog.canang.com.my/2016/05/12/embedding-activiti-explorer-to-your-application/
Most probably step 5 in my blog is your solution.
btw, there's reason why the name is 'default'. I can't recall it atm
I thought of answering my own question so that it will be useful for other developers with similar requirement. If you want to make an eco-system where activiti-rest, explorer and your custom end points co-exist, please refer this thread from activit forum. I have tried this and is working fine. link to thread
I would like to give my observation here. In order to avoid getting into pulling source and trying to build myself, I achieved partial success, by installing the activit-explorer as part of the usual standalone installation.Started the standalone activiti-explorer using Apache-Tomcat but I configured the database for Activiti as same as (MYSQL in my case) I used in my spring-boot application to hit the common ground.
But apparently the activiti version in my spring boot app was 5.19.0.0 and that for activiti-explorer was 5.22.0.0, which created some misalignment for spring boot application startup to fail. I am hopeful that with matching versions it might succeed. When I get some more time on me I will try and update. Since then may be someone can use this route.

No log messages after Spring Boot upgrade

I have recently upgraded spring boot from 1.1.10 to 1.2.0. I did not specify version information for spring boot dependencies like spring mvc. So they also got upgraded.
After upgrade, I am not able to see any log information from spring.
I am able to see the sysout and syserr information of my code though.
Did any thing change in the latest relese ?
As per the changelog Spring Boot 1.2.0 changelog Spring Boot's default behavior is to not write any log files.
Sorry folks, I have a log4j.properties in my class path. That configuration file prevented entries from springframework packages. Not sure how it ended up there though. Probably 1.1.10 is not picking it up. Things might have changed with 1.2.0. Hence the problem. Once I deleted that file, every thing is working fine
Thank you for your time

Using spring insight with an app that uses spring integration 1.0.4

I'm trying to deploy an existing app to tc-server. I have been using this app on tomcat for a couple of years and the production version already runs on tc-server. I have installed the version of tc-server that comes with spring insight. Everything goes well until I deploy a war file that has a dependency on spring integration. I'm getting a no class def found error and it is complaining about a class called
org/springframework/integration/transformer/AbstractMessageProcessingTransformer
I opened up the spring integration jar that is bundled with my war in the WEB-INF lib and did not see that class.
I poked around in the tomcat instance that I created with the bat files in tc-server and see a later version of spring-integration i.e.
.\insight\collection-plugins\insight-plugin-spring-integration-1.9.2.SR1.jar
Since my war is now getting a class not found exception (whereas it deploys fine on my normal tomcat 6.29 ) I'm assuming that this other version of spring-integration is being seen by my app somehow. My app is configured to use spring-integration-1.0.4.
Does anyone know how to get around this problem?
1.0.4 is an extremely old version (3+ years old) the current release is 2.2.4. That class was introduced in 2.0.0.
So you probably have a classpath issue - insight needs a more recent version of Spring Integration on the classpath.
The insight plugin version (1.9.2.x) is not related to the Spring Integration version (but it needs a much more recent version than 1.0.4).

Is it possible to run Mule 2.2.1 on spring 3?

We have an application that is currently running spring 2.5.6 and mule 2.2.1. We have decided to go ahead and upgrade the app to use spring 3.2 we also upgraded spring security to 3.1. I understand that Mule 2.2.1 uses spring 2.5.6 for configuration and so forth. We were to re-factor our code and build the entire project. However after deploying the application and starting the server, my server started in about 6 seconds instead of the normal 30 seconds and then I noticed that none of my services were not loaded. Unfortunately after days of investigating I cannot find where everything fails, as there are no errors in any of the logs including spring and mule logs. My question is it possible to get these to play together or should I just forget about getting this to work.
I read this post http://lifeinide.blogspot.com/2012/07/spring-3-and-mule-2-initialized-by.html and followed these instruction and still was not able to get it work. Mule says it started up just fine without any errors but I can hit any of my services. Any help? Thanks
Thanks #genjosanzo for the pointer. It helped met dig into this issue better and eventually make it work.
#mtanzania,
We had a similar need like yours - need to make Mule 2.2.1 work with Spring 3.2.x releases. Upgrade to Mule 3 involved rewrite of Mule extensions such as exception handling strategies, a RabbitMQ Mule transport etc. Upgrade to Mule 3 was therefore ruled out.
In order to make this work, you need to rewrite/update 3 java files from your module:
groupId:org.mule.modules
artifactId:mule-module-spring-config
version:2.2.1
with implementations from :
groupId:org.mule.modules
artifactId:mule-module-spring-config
version:3.4.0
To be more specific, you need these classes to be updated/upgraded: MuleBeanDefinitionDocumentReader.java, MuleApplicationContext.java and SpringXmlConfigurationBuilder.java
With these updated versions, you can continue to create the MuleContext like:
SpringXmlConfigurationBuilder springConfigBuilder = new SpringXmlConfigurationBuilder(muleConfigPaths);
MuleContext context = new DefaultMuleContextFactory().createMuleContext(springConfigBuilder)
The modified implementations are here : Mule in Trooper and sample class that uses this is here : Trooper Mule container
Mule uses some internal spring API to parse the mule configuration and creates the correspondent beans.
For this reason the upgrade might work with spring 3.0.x but I'm pretty sure that something got broken with spring 3.1.x (i.e. this code has been introduced to maintain backward compatibility).
How about upgrading mule as well? Most of the 2.2.x syntax is still supported and many new feature has been introduced in newer mule versions.
FWIW, the above answer from #regunathb is right on. Patching in those three classes works. However, it is important to note that the 3.4 version of those classes from mule-module-spring-config will not work as-is. You must get the modified versions of the classes that #regunathb posted on GitHub, otherwise you'll end up with various incompatibilities between 3.4 and 2.2.1.

Mongo repository for Spring Batch?

Is there a Mongo-based job repository for Spring Batch? If not, would I need to implement JobInstanceDao and its siblings? Are there any examples or existing works that would help in this endeavor?
there is a https://github.com/jbaruch/springbatch-over-mongodb project, it looks discontinued, but it might give you a better start
I have a github project which enhanced JBaruch's Springbatch-over-mongodb to newer versions of
Spring framework (4+)
Spring-batch (3+)
Mongo DB driver: 2.11.2
https://github.com/vfouzdar/springbatch-mongoDao
Though I have tested it and have a upgraded almost all of junits from JBaruch's project but it is still under BETA phase. If somebody is interested then s/he can give a try.

Resources