UI Webstart NPE in main()

Hey there-

I'm getting this lovely error that I cannot for the life of me figure out:

java.lang.NullPointerException

at com.realmranker.client.RealmRanker.<init>(RealmRanker.java:51)

at com.realmranker.client.RealmRanker.main(RealmRanker.java:153)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at com.sun.javaws.Launcher.executeApplication(Launcher.java:1301)

at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1239)

at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1086)

at com.sun.javaws.Launcher.run(Launcher.java:105)

at java.lang.Thread.run(Thread.java:637)


I'm using the latest IDEA 8.1, UI Designer, and so far as I can tell the built in IntelliJ form layout tool. Here's the main:

public static void main(String[] args) {

        JFrame frame = new JFrame("RealmRanker");

        frame.setContentPane(new RealmRanker().panel1);

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.pack();

        frame.setVisible(true);

        frame.setTitle("realmRanker Data Updater");

        frame.setName("realmRanker Data Updater");

..


And line #51 is:

addPlayer.addActionListener(new ActionListener() {

I've switched to have the GUI Builder put the java code into my class, and I see it there. The main() runs from IDEA just fine (Run RealmRanker.main()) but does not run from webstart or anything, with the NPE error above.

Any help would be MOST appreciated. I think I'm missing something in the GUI form deploy process somewhere. Do I need to do anything other than design the form in IDEA and press "go"?



 


2 comments
Comment actions Permalink

Hello Matthew,

If you're using source code generation mode of the UI Designer, there's no
additional deploy step required. I can't tell why the exception happens without
having a complete source file in which the problem occurs.

Hey there-

I'm getting this lovely error that I cannot for the life of me figure
out:

java.lang.NullPointerException
at com.realmranker.client.RealmRanker.<init>(RealmRanker.java:51)
at com.realmranker.client.RealmRanker.main(RealmRanker.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1301)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1239)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1086)
at com.sun.javaws.Launcher.run(Launcher.java:105)
at java.lang.Thread.run(Thread.java:637)
I'm using the latest IDEA 8.1, UI Designer, and so far as I can tell
the built in IntelliJ form layout tool. Here's the main:

public static void main(String[] args) {
JFrame frame = new JFrame("RealmRanker");
frame.setContentPane(new RealmRanker().panel1);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
frame.setTitle("realmRanker Data Updater");
frame.setName("realmRanker Data Updater");
.
And line #51 is:

addPlayer.addActionListener(new ActionListener() {

I've switched to have the GUI Builder put the java code into my class,
and I see it there. The main() runs from IDEA just fine (Run
RealmRanker.main()) but does not run from webstart or anything, with
the NPE error above.

Any help would be MOST appreciated. I think I'm missing something in
the GUI form deploy process somewhere. Do I need to do anything other
than design the form in IDEA and press "go"?

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

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


0
Comment actions Permalink

I figured it out. I was using a custom ant task to create my jar, and pointing at the source files which did not have the needed IntelliJ "magic code" in them that made everything work.

Once I used the compiled code from the "generate an ant build" build file, things started working just fine.

0

Please sign in to leave a comment.