ApplicationManager always returns null?

I have a code snippet that is trying to get the current application. The snippet reads:

ApplicationManager.getApplication().runReadAction(new Runnable() {
public void run() {
obj[0] = LocalFileSystem.getInstance().findFileByPath(path.replace('

And when debugging this segment, I step into this OpenAPI call to ApplicationManager.getApplications and the source reads (at the top of the ApplicationManager class:

protected static Application outApplication = null;

And the ApplicationManager.getApplication() method just returns ourApplication.

What am I missing here? Why is ourApplication always coming back 'null'?

Comment actions Permalink

Hey Gregg,

are you using DevKit to start your project, and do you reference "idea.jar"
as a library for your project? If both answers are yes, it may be your
problem (because idea.jar gets copied to your plugin's "lib" directory and
messes everything up). In that case remove "idea.jar" from your referenced
libraries and simply add it to your IDEA SDK.

Otherwise let us know what you find out :)


Comment actions Permalink

I didn't have the idea.jar listed in my project. That seems to be just the de-compiled sources and not really helpful.

There is a more fundamental issue here... I just inherited uncommented/undocumented Synergy/CM plugin code that I don't think worked beyond just getting IntelliJ v4.5.4 to load the plugin at startup.

This plugin source tree came with a test case class that I've been running (and debugging with), but now I'm to a point that I need to understand why the developer wrote this one section. (I have emails into the original developer, but no replies yet) This one section is going off to the underlying OS (Windows) and retrieving actual file handles (I believe). Why? I don't know.


Please sign in to leave a comment.