Problem with Startup() SingleFrameApplication Warning: getApplicationResourceMap(): no Application class
I created a project with NetBeans. I did a class that checkForUpdates. If there are it does the updgrade otherwise it starts main project class.
The problem is when i Create object of MyClassApp and i launch with myClass.startup() i got those errors....I thought that was my update class so I tryed with a normal main without anything just create MyClassApp and launch startup() but it gets the same errors.
How can i fix it?
26-set-2011 12.34.32 org.jdesktop.application.ResourceManager getApplicationResourceMap
WARNING: getApplicationResourceMap(): no Application class
26-set-2011 12.34.36 org.jdesktop.application.SingleFrameApplication initRootPaneContainer
WARNING: couldn't restore sesssion [mainFrame.session.xml]
java.lang.NullPointerException
at org.jdesktop.application.LocalStorage.getApplicationId(LocalStorage.java:195)
at org.jdesktop.application.LocalStorage.getDirectory(LocalStorage.java:234)
at org.jdesktop.application.LocalStorage$LocalFileIO.openInputFile(LocalStorage.java:330)
at org.jdesktop.application.LocalStorage.openInputFile(LocalStorage.java:76)
at org.jdesktop.application.LocalStorage.load(LocalStorage.java:138)
at org.jdesktop.application.SessionStorage.restore(SessionStorage.java:382)
at org.jdesktop.application.SingleFrameApplication.initRootPaneContainer(SingleFrameApplication.java:231)
at org.jdesktop.ap开发者_JS百科plication.SingleFrameApplication.show(SingleFrameApplication.java:463)
I don't know what causes this error, but I have a solution.
You probably have a class as defined below:
public class MyClassApp extends SingleFrameApplication {
...
@Override protected void startup() {
show(new MyClassApp (this));
}
...
public static MyClassApp getApplication() {
return Application.getInstance(MyClassApp.class);
}
...
}
If you start your application with
MyClassApp.getApplication().startup();
You probably won't get any error.
精彩评论