Can't execute a plugin

Hello,
When I try to execute my plugin with IntelliJ Idea 11.1.3 I get the following exception :

ERROR: com/sun/jna/Pointer
java.lang.NoClassDefFoundError: com/sun/jna/Pointer
    at com.intellij.openapi.util.io.FileSystemUtil.<clinit>(FileSystemUtil.java:62)
    at com.intellij.openapi.util.io.FileUtil.delete(FileUtil.java:600)
    at com.intellij.ide.startup.StartupActionScriptManager$DeleteCommand.execute(StartupActionScriptManager.java:226)
    at com.intellij.ide.startup.StartupActionScriptManager.executeActionScript(StartupActionScriptManager.java:47)
    at com.intellij.ide.ClassloaderUtil.initClassloader(ClassloaderUtil.java:127)
    at com.intellij.ide.Bootstrap.main(Bootstrap.java:38)
    at com.intellij.ide.Bootstrap.main(Bootstrap.java:34)
    at com.intellij.idea.Main.main(Main.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Pointer
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    ... 13 more
Exception in thread "main" java.lang.AssertionError: com/sun/jna/Pointer
    at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:50)
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:69)
    at com.intellij.openapi.util.io.FileSystemUtil.<clinit>(FileSystemUtil.java:66)
    at com.intellij.openapi.util.io.FileUtil.delete(FileUtil.java:600)
    at com.intellij.ide.startup.StartupActionScriptManager$DeleteCommand.execute(StartupActionScriptManager.java:226)
    at com.intellij.ide.startup.StartupActionScriptManager.executeActionScript(StartupActionScriptManager.java:47)
    at com.intellij.ide.ClassloaderUtil.initClassloader(ClassloaderUtil.java:127)
    at com.intellij.ide.Bootstrap.main(Bootstrap.java:38)
    at com.intellij.ide.Bootstrap.main(Bootstrap.java:34)
    at com.intellij.idea.Main.main(Main.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Is some one has an idea about this?

7 comments
Comment actions Permalink

What do you mean with "execute"? Run plugin run configuration from IDEA? Please attach full console log and idea.log

0
Comment actions Permalink

Thank you for your reply,
In fact I try to Run the plugin. Before when I run the plugin I get a new window and I can work with the plugin I implemented but now it is not the case.


Remarks:
- When I start IntellijIdea I get the following notification : File Watcher: The current inotify(7) watch limit of 8192 is too low. More details. (show balloon).

-When I run the plugin I get in the end of the exception: Process finished with exit code 1 and in the event log window I get: Compilation: all files are up to date

0
Comment actions Permalink

I already try it but I can not always the running of the plugin

0
Comment actions Permalink

I've had same exception. Look at StartupActionScriptManager.execute() :

public void execute() throws IOException {
      if (mySource != null && mySource.exists() && !FileUtil.delete(mySource)) {
        //noinspection HardCodedStringLiteral
        System.err.println("Action " + this + " failed.");
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),
                                      MessageFormat.format("<html>Cannot delete {0}<br>Please, check your access rights on folder <br>{1}",
                                                           mySource.getAbsolutePath(), mySource.getAbsolutePath()),
                                      "Installing Plugin", JOptionPane.ERROR_MESSAGE);
      }
    }

If you have directory with same name as your plugin in plugin sandbox dir (~/.IntelliJIdea11/system/plugins-sandbox/plugins in my case) then StartupActionScriptManager will try to remove it and jna is not yet on classpath so that will trigger exception.
If your plugin is named "Rearranger" then remove directory ~/.IntelliJIdea11/system/plugins-sandbox/plugins/Rearranger.

The way to trigger this problem is probably like this:
1. Install plugin X in normal Idea mode
2. Open project of plugin X (source code of plugin X)
3. Try to run plugin X

0
Comment actions Permalink

On Mac OS, delete files in directory: ~/Library/Caches/IdeaIC11/plugins-sandbox/plugins/

0
Comment actions Permalink

Also, If you installed your plugin to Intellij IDEA which used for plugin development, uninstall it first.

0

Please sign in to leave a comment.