0

i have a project built with jhipster (spring-boot).
run my project with Run Configuration from Eclipse IDE:

clean spring-boot:run -Dmaven.test.skip="true" -Drebel.remoting_plugin="true"

every time i save changes, jrebel give me error like the following:

[2017-12-03 22:15:55] [Project my-project, server localhost] Connecting to server to sync project
[2017-12-03 22:15:55] Unexpected response from server. Raw Headers: {date=Sun, 03 Dec 2017 15:15:55 GMT, allow=GET, HEAD, expires=0, transfer-encoding=chunked, x-xss-protection=1; mode=block, x-content-type-options=nosniff, connection=keep-alive, content-type=application/json;charset=UTF-8, cache-control=no-cache, no-store, max-age=0, must-revalidate, pragma=no-cache, x-application-context=my-project:swagger,dev:8080}
[2017-12-03 22:15:55] Unexpected response from server. First kilobyte of content:
[2017-12-03 22:15:55] {
  "timestamp" : "2017-12-03T15:15:55.499+0000",
  "status" : 405,
  "error" : "Method Not Allowed",
  "exception" : "org.springframework.web.HttpRequestMethodNotSupportedException",
  "message" : "Request method 'POST' not supported",
  "path" : "/"
}

[2017-12-03 22:15:55] [Project my-project, server localhost] Synchronization failed! JRebel remote server did not respond. The remote server has to be started with the JVM argument: -Drebel.remoting_plugin=true.
[2017-12-03 22:15:55] Synchronization took 42 ms in total.

what is actually happen? how to solve this?

my environment:
- macOS
- jRebel 7.1.3
- spring-boot 1.5.9.RELEASE

thanks in advance.

stkertix
  • 81
  • 1
  • 10

1 Answers1

4

TL;DR

Don't use -Drebel.remoting_plugin=true.

Instead use Help > JRebel > Configuration > Startup > Run locally from command line.


The long version.

Based on your description, it sounds like you're running the Spring Boot application on your own machine.

The argument -Drebel.remoting_plugin=true should only be used when the actual application is on a different machine (or virtual machine) from the IDE (eclipse) you are using.

You also don't need to use the JRebel Eclipse plugin synchronize feature. JRebel will itself monitor for changes to class files in the target/classes directory. When you build your project with either Eclipse or with mvn compile, then JRebel will detect the changes and reload the classes.

So remove the remoting argument and instead use the following instructions: In Eclipse, go to Help > JRebel > Configuration > Startup > Run locally from command line. Then choose your JVM and Spring Boot.

Find the instructions for the Maven Spring Boot plugin and use them for adding the JRebel agent to your application.


Also, you can't just add JVM arguments to spring-boot:run by adding them to the end of the command. Instead you should add the arguments to a MAVEN_OPTS environmental argument or pass them with -Drun.jvmArguments="-Dsome.argument"

Veiko Kääp
  • 161
  • 5