IDEA CE 9 remote debugging

Hi all,

I have developed a plugin and it works really well in the development mode. But when I put it in the "plugin" folder and restart the IDEA, it shows all the icons I added to the plugin, but required screens are not coming. So my intention is to do a remote debug.

So can anyone please tell me how to do a remote debug(in local machine, and by another IDEA instance)

thanks in advance..  

12 comments

Hi Thisum,

Generally speaking, you need to do the following:

  1. Configure target IDEA 'under-debug' instance to accept remote debugger clients;
  2. Instruct 'debugger' IDEA how to connect to remote IDEA process;


You can start by creating new 'Run Configuration' at IDEA - choose 'Remote':

idea-remote-debug1.png
IDEA shows the following dialog then:

idea-remote-debug2.png
It lists options to run to IDEA start configuration and allows to specify target remote host & port.

I.e. you should do the following:

  1. Open 'idea.vmoptions' file of IDEA instance that will be debugged;
  2. Add target options to the new line there - '-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005' (note that you can define port over than default 5005 here);
  3. (Re)start IDEA instance that should be debugged;
  4. Create new 'Remote' configuration at IDEA from which debugging will be performed;
  5. Define target remote host/port at that new run configuration;
  6. Start debugging session (IDEA will automatically connect to remote application that is configured to accept remote debuggers);


Denis

0

Hi,

Thanks for the info. It solved my problem with remote debugging.


By debugging, I witnessed that the form panel I want to display is ok(not returning null). But the problem is, it just doesn't show the screen.

When I run the plugin in the developing mode, it shows the screen and no exceptions thrown, works well. And when run IDEA using batch file(after putting the plugin into the config->plugin folder), it once again works really fine.

But when I run the IDEA normally, the icons of the plugin are displayed(on the tool bar), But the required screen is not appearing. As I said when I did remote debugging, no problems encountered.

Is there any difference in running IDEA using the batch file and normally(idea.exe).

So what can I do regarding this issue?
Is there any other methods to show a screen(plugging)?


Thanks in advance..

0

Hello Thisum,

Are there any exceptions in idea.log when you run your plugin?

Hi,

Thanks for the info. It solved my problem with remote debugging.

By debugging, I witnessed that the form panel I want to display is
ok(not returning null). But the problem is, it just doesn't show the
screen.

When I run the plugin in the developing mode, it shows the screen and
no exceptions thrown, works well. And when run IDEA using batch
file(after putting the plugin into the config->plugin folder), it once
again works really fine.

But when I run the IDEA normally, the icons of the plugin are
displayed(on the tool bar), But the required screen is not appearing.
As I said when I did remote debugging, no problems encountered.

Is there any difference in running IDEA using the batch file and
normally(idea.exe).

So what can I do regarding this issue?
Is there any other methods to show a screen(plugging)?
Thanks in advance..

---
Original message URL:
http://www.jetbrains.net/devnet/message/5262725#5262725

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hi,

No. There are no exceptions displayed.

But it shows some messages like:


2010-05-07 14:25:13,640 [   9265]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/cachedDictionary.xml file is null
2010-05-07 14:25:13,640 [   9265]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/cachedDictionary.xml
2010-05-07 14:25:14,328 [   9953]   INFO - ij.openapi.wm.impl.IdeRootPane - App initialization took 11294 ms
2010-05-07 14:25:16,593 [  12218]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gant_config.xml file is null
2010-05-07 14:25:16,593 [  12218]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gant_config.xml
2010-05-07 14:25:16,593 [  12218]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gradle.xml file is null
2010-05-07 14:25:16,593 [  12218]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gradle.xml
2010-05-07 14:25:16,937 [  12562]   INFO -                  TestNG Runner - Create TestNG Template Configuration
2010-05-07 14:25:17,359 [  12984]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dynamic.xml file is null
2010-05-07 14:25:17,359 [  12984]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dynamic.xml
2010-05-07 14:25:33,890 [  29515]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml file is null
2010-05-07 14:25:33,890 [  29515]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml
2010-05-07 14:25:33,953 [  29578]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml file is null
2010-05-07 14:25:33,953 [  29578]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml
2010-05-07 14:25:35,062 [  30687]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 20244 ms


But these messages were keep coming when I was running IDEA using the batch file...

0

Hey Thisum,

I'm afraid we still don't have enough details here.

Can you create minimal but complete standalone example that illustrates the problem and post it here?

Regards, Denis

0

Hi,

Thanks for your reply and I will post an example.

But before that I have an idea which I think will solve the problem. So could you please give me a clarification regarding these things:

My problem is, plugin woks if I run IDEA using the .bat file. But doesn't work with the idea.exe

So when I looked at the bat file, it has :

:: ---------------------------------------------------------------------
:: You may specify your own JVM arguments in idea.exe.vmoptions file. Put one option per line there.
:: ---------------------------------------------------------------------
SET ACC=
FOR /F "delims=" %%i in (%IDEA_HOME%\bin\idea.exe.vmoptions) DO call %IDEA_HOME%\bin\append.bat "%%i"

set REQUIRED_IDEA_JVM_ARGS=-Xbootclasspath/a:%IDEA_HOME%/lib/boot.jar %IDEA_PROPERTIES_PROPERTY% %REQUIRED_IDEA_JVM_ARGS%
SET JVM_ARGS=%ACC% %REQUIRED_IDEA_JVM_ARGS%

SET OLD_PATH=%PATH%
SET PATH=%IDEA_HOME%\bin;%PATH%

SET CLASS_PATH=%IDEA_HOME%\lib\bootstrap.jar
SET CLASS_PATH=%CLASS_PATH%;%IDEA_HOME%\lib\util.jar
SET CLASS_PATH=%CLASS_PATH%;%IDEA_HOME%\lib\jdom.jar
SET CLASS_PATH=%CLASS_PATH%;%IDEA_HOME%\lib\log4j.jar
SET CLASS_PATH=%CLASS_PATH%;%IDEA_HOME%\lib\extensions.jar
SET CLASS_PATH=%CLASS_PATH%;%IDEA_HOME%\lib\trove4j.jar
SET CLASS_PATH=%CLASS_PATH%;%IDEA_JDK%\lib\tools.jar




So what I'm thinking is, if I set these parameters in the idea.exe.vmoptions file,it might work!!!!!

So could you please tell me how to insert these parameters in to the idea.exe.vmoptions file(basically syntax) ?

**please note that this is what I think and I don't know whether it will work. Please give me an explanation.


Thank you.
0

I sent the plugin to your email address (denzhdanov@gmail.com).
It works well when run by the batch file. But not by the idea.exe


Please give me a solution..

Thank you...

0

Hi Thisum,

Just tried your plugin and it doesn't display anything on attempt to create archive at my machine as well (Ubuntu Linux, IDEA 9.0.2, running from *.sh).

Unfortunately, you didn't provide plugin sources that can answer on what exactly goes wrong there.

Please, provide plugin sources as well or create minimal standalone example that illustrates the problem and send it to me.

Regarding idea.exe - it's built via 'exe4j' product, so, you can check it's documentation on how to twek java invocation parameters - exe4j Wizard - Step 5: Configure Java Invocation (note that exe4j *.pdf documentation contains much more examples about that). However, idea.exe encapsulates all of the settings you mentioned.

Denis

0

Hi,

Sorry for that. Now I have mailed you the source code. Please check it.

Thanks.

0

Hi Thisum,

Checked your plugin - it shows GUI if you make JarEditor not extend JPanel. I.e. it works after the following changes:

  • 'extends JPanel' clause is removed;
  • dummy 'addPropertyChangeListener()' & 'addPropertyChangeListener()' implementations are provided;
  • dedicated 'JPanel' instance field is introduced;
  • 'jbInit()', 'getComponent()' and 'getPreferredFocusedComponent()' are switched to using 'JPanel' instance mentioned above instead of 'this';


I'm not sure about exact details that prevent IDEA function properly when 'FileEditor' implementation IS-A JPanel/JComponent at the moment. Feel free to submit corresponding ticket to IDEA tracker.

Denis

0

Hi Denis,

Thank you very much for your support. This solution really works.

As you told when the Editor is extended JPanel, it has worked in IDEA 6. But hard to figure out the reason for not working in IDEA CE.

Anyway thank you very much for your help.

0

Welcome

Anyway, it seems worth to add a request about unexpected behavior in case FileEditor IS-A JPanel. I suspect that there is a bug somewhere in depth of IDEA editor GUI processing logic.

0

Please sign in to leave a comment.