Intellij Idea Hot swap failed

Answered

Hi

I'm debugging my application deployed on a remote server and I get this error while building the project when the server is running.

Compilation completed successfully in 7s 12ms
Hot Swap failed
add method not implemented;
Operation not supported by VM

It is either - "add method not implemented" or "hierarchy change not implemented" or "schema change not implemented".

I initially added new method, new inner class, later reverted these changes as I found another simpler solution for my problem.

While making the code changes, I repeatedly test by rebuilding the project while the remote server is running and end up with any of the above errors.

I tried all options I knew and what google gave me - Hot swap properties changes, Compiler JDK version changes, try in duplicate versions of the project and server, but nothing seems to be a permanent solution.

I need to build while the server is running otherwise the changes do not reflect.

I'm not sure what I'm missing here, any help is appreciated.

6 comments
Comment actions Permalink

HotSwap doesn't support adding methods or hierarchy changes as indicated by the error messages. It's the limitation of Java HotSwap, not IntelliJ IDEA. Some third-party tools like JRebel enhance standard HotSwap by implementing support for this type of code modifications.

0
Comment actions Permalink

Thank you, I'll try out JRebel. 

I have 1 more question. Right now, I checked out the project again into a separate folder and haven't done any changes to it, when I rebuild the project I still get the same error.

Hot Swap failed
add method not implemented;
Operation not supported by VM

Why this is still coming? Is there any way to stop this error?

 

0
Comment actions Permalink

Do you build the project using Build | Make in IDEA? If there are no changes, it will not compile any files.

0
Comment actions Permalink

I build the project using Build > Rebuild project for which I always get this log -  Compilation completed successfully in Xs Yms (even if I haven't done any changes). 

I checkout the project again, after restarting IDEA and now I don't get this error (Hot Swap failed) when I don't make any change.

Since it's a small application and simple change I'm able to repeat it many times.

The change to the application is adding a Frame, Panel, Combobox, Button and Action listener to the JButton in the same method.

And I assume I get this error - "Hot Swap failed add method not implemented;" because the action listener needs to override a method of it's interface. 

Is my assumption right?

 

main method {
...
button.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent event) {
JButton button = (JButton) event.getSource();
...
}
}
}

 

 

 

0
Comment actions Permalink

Rebuild will rebuild all the files. Use Make to build only changed and dependent files.

0
Comment actions Permalink

Got you, thanks a lot for your inputs.

0

Please sign in to leave a comment.