2.0.2 and Gutter leads to null pointer exception

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: 2.0.2 and Gutter leads to null pointer exception

Re: 2.0.2 and Gutter leads to null pointer exception

Post by CoffeeNerd » Wed Jun 27, 2012 3:52 pm

robert wrote:It seems like no matter how many times I think I fix this, it always stays broken! I just patched the problem indicated by your stack trace; could you check out the latest from SVN and verify that it works for you?


Hi Robert, it works great now. Thank you very much!!

Re: 2.0.2 and Gutter leads to null pointer exception

Post by robert » Wed Jun 27, 2012 2:13 am

It seems like no matter how many times I think I fix this, it always stays broken! I just patched the problem indicated by your stack trace; could you check out the latest from SVN and verify that it works for you?

Re: 2.0.2 and Gutter leads to null pointer exception

Post by CoffeeNerd » Tue Jun 26, 2012 8:50 pm

Hi Robert,

I see that others have found this issue fixed in 2.0.3 but I'm still having trouble with RTextSrollPane generating a NPE, and also a window indicating that "The component cannot be instantiated. Please make sure it is a JavaBeans component", in NetBeans GUI designer using the precompiled 2.0.3 jar or a jar compiled from the 2.0.3 source. I've tested and had the same result in all of Netbeans 7.1.1, 7.1.2 and 7.2 Beta. Is there anything I can do to make this work or is there any chance you're still looking into the issue?

I'm upgrading from 1.5.2. This is an incredibly useful work you've created, thank you very much for your effort!

Here is the stack trace:

Code: Select all
INFO [org.netbeans.modules.form.BeanSupport]: Cannot create default instance of: org.fife.ui.rtextarea.RTextScrollPane
java.lang.NullPointerException
   at org.fife.ui.rtextarea.Gutter.setLineNumberFont(Gutter.java:580)
   at org.fife.ui.rtextarea.RTextScrollPane.<init>(RTextScrollPane.java:98)
   at org.fife.ui.rtextarea.RTextScrollPane.<init>(RTextScrollPane.java:73)
   at org.fife.ui.rtextarea.RTextScrollPane.<init>(RTextScrollPane.java:47)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)
   at org.netbeans.modules.form.CreationFactory.createDefaultInstance(CreationFactory.java:178)
[catch] at org.netbeans.modules.form.BeanSupport.createBeanInstance(BeanSupport.java:83)
   at org.netbeans.modules.form.BeanSupport.getDefaultInstance(BeanSupport.java:109)
   at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:718)
   at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:956)
   at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:528)
   at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:312)
   at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:343)
   at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:286)
   at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
   at org.openide.util.Mutex.readAccess(Mutex.java:322)
   at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:269)
   at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:340)
   at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:455)
   at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:274)
   at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:86)
   at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:263)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:701)
   at java.awt.EventQueue.access$000(EventQueue.java:102)
   at java.awt.EventQueue$3.run(EventQueue.java:662)
   at java.awt.EventQueue$3.run(EventQueue.java:660)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:671)
   at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:158)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

Re: 2.0.2 and Gutter leads to null pointer exception

Post by robert » Mon Apr 16, 2012 9:59 pm

Excellent, thanks for verifying that. I hope to have a 2.0.3 release out soonish that will include this fix.

Re: 2.0.2 and Gutter leads to null pointer exception

Post by preditcon » Mon Apr 16, 2012 7:29 am

Sorry for the delay. I built the latest source from SVN with ant and importing RSyntaxTextArea as a bean into Netbeans 6.9.1 works without problems.

Re: 2.0.2 and Gutter leads to null pointer exception

Post by robert » Thu Mar 29, 2012 12:54 pm

Right now it's SVN only. It may be a couple of weeks before I release another pre-built RSTA jar.

Re: 2.0.2 and Gutter leads to null pointer exception

Post by Guest » Wed Mar 28, 2012 7:15 am

The only requirement to use a component with Netbeans GUI editor is that you have a compiled class which respresents it on classpath and that it has a zero argument constructor. This has always allowed me to import components into Netbeans so far (with Choose Bean). The actual importing was never an issue for me with RSystaxTextArea.

It there a prebuilt jar available with this fix or do I have to build it from SVN code myself? I'm going test this anyways just to make sure (do note that I'm not using the latest version of NB though, mine is 6.9.1 and the latest should be 7+ I think).

Re: 2.0.2 and Gutter leads to null pointer exception

Post by robert » Sun Mar 18, 2012 10:10 pm

I think I've fixed the NPE, but can't seem to get the NetBeans visual editor to be happy importing RTextScrollPane as a component. Not sure if this is because I'm doing something wrong, or there's still something wrong, since I don't use NetBeans In Real Life (TM). Try it out and let me know if things are better.

And also let me know if there's some sort of NetBeans equivalent to the Eclipse Errors view. When I tried to add RSyntaxTextArea and RTextScrollPane to the Palette Manager, it suddenly displayed nothing, not even the standard components. I don't see an Error View so I can't tell if some sort of exception was thrown.

Re: 2.0.2 and Gutter leads to null pointer exception

Post by preditcon » Tue Mar 13, 2012 1:39 pm

Actually I went with 2.0.1. I cannot use the other constructor since I'm using Netbeans visual gui builder and stuff needs to be created in a certain order for it to be satisfied. I could bypass all that an not rely on the builder but I am reluctant to do so, especially because it simply works with the previous version.

I haven't tested it with the non-zero argument constructor for that reason but I think it should be okay as long as the argument to it is non-null. You forgot to do a null check in your new code.

Re: 2.0.2 and Gutter leads to null pointer exception

Post by robert » Tue Mar 13, 2012 1:19 pm

Sigh, this kind of stuff always happens! At least it sounds like you're still OK creating your RTextScrollPane using the constructor taking a parameter?

Thanks for the bug report, you're right that it should be an easy fix. I should get it into SVN shortly.

Top