I have a NullPointerException that I don't understand. Usually, the console points to a line in my code when this happens. This time, it's pointing to
at javax.swing.plaf.synth.SynthLabelUI.getPreferredSize(SynthLabelUI.java:238)
which as far as I understand, is not in my code. Would someone please explain to me what's going on?
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at javax.swing.plaf.synth.SynthLabelUI.getPreferredSize(SynthLabelUI.java:238)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1660)
at javax.swing.plaf.basic.BasicSliderUI.getHeightOfTallestLabel(BasicSliderUI.java:775)
at javax.swing.plaf.synth.SynthSliderUI.layout(SynthSliderUI.java:378)
at javax.swing.plaf.synth.SynthSliderUI.calculateGeometry(SynthSliderUI.java:343)
at javax.swing.plaf.basic.BasicSliderUI$Handler.componentResized(BasicSliderUI.java:1496)
at java.awt.Component.processComponentEvent(Component.java:6331)
at java.awt.Component.processEvent(Component.java:6285)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
I'm painting custom labels with
private void setSliderLabels() {
Dictionary<Integer, JLabel> table = new Hashtable<Integer, JLabel>();
table.put(-256, new JLabel("-w/2"));
table.put(-128, new JLabel("-w/4"));
table.put(0, new JLabel("0"));
table.put(128, new JLabel("w/4"));
table.put(256, new JLabel("w/2"));
LSlider.setLabelTable(table);
QSlider.setLabelTable(table);
}
This usually means that you violated the (implied or expressed) contract of the API you are using. For example calling a method with a null value that is not supposed to be called with null, or not setting some fields that ought to be set. If the API is not clear in that regard, this is often guesswork.
Related
I am new to pentaho. I am using Pentaho Report Desiner ce-5.3.0 on Windows 7 32 bit.
When I try to publish report then login window popup then filling all fields and click on ok, it gives error.
Unable to publish your file
please try again or contact to your system administrator for assistance.
Then I have following message in error window.
Internal error occure
java.lang.RuntimeException: org.pentaho.reporting.designer.extensions.pentaho.repository.util.PublishException: The File exists and override has not been specified.
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.UpdateReservedCharsTask.run(UpdateReservedCharsTask.java:90)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:870)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638)
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.PublishToServerTask.showErrorMessage(PublishToServerTask.java:170)
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.PublishToServerTask.run(PublishToServerTask.java:105)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: org.pentaho.reporting.designer.extensions.pentaho.repository.util.PublishException: The File exists and override has not been specified.
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.UpdateReservedCharsTask.run(UpdateReservedCharsTask.java:84)
... 35 more
The version of Report designer and bi server should be same. try that and post the result.
The error says the file already exists. You must either delete the file beforehand or check the "overwrite" checkbox.
I am trying to attach a jar library toolkit to one of my netbeans projects. However, when I go to File > Project Properties > Libraries > Add Wrapped Jar the import succeeds but running the plugin causes a NullPointerException. I suspect this has something to do with the path but I don't understand how to manipulate the path or why there is even a null pointer.
java.lang.NullPointerException
at org.gephi.desktop.recentfiles.RecentFiles.getMenuPresenter(RecentFiles.java:88)
at org.openide.awt.DynaMenuModel.loadSubmenu(DynaMenuModel.java:100)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.createInstance(MenuBar.java:831)
at org.openide.loaders.FolderInstance.defaultProcessObjectsFinal(FolderInstance.java:885)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:730)
at org.openide.util.Task.run(Task.java:253)
[catch] at org.netbeans.modules.openide.loaders.AWTTask.run(AWTTask.java:79)
at org.netbeans.modules.openide.loaders.AWTTask$Processor.run(AWTTask.java:171)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:158)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
A NPE should not happen. So please file an issue at https://netbeans.org/bugzilla/
I have a problem with the for loop because of the nullpointerexception error.
for (int num = 0; num < checkingAcct.getSize(); num++)
And the error comes up as:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at application2.Panel.listTransactions(Panel.java:152)
at application2.Application2$Application2a.actionPerformed(Application2.java:84)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
The for loop is line 152. As for application2 line 84
if (codee == dos)
Panel.listTransactions(); <-----
And then getSize:
public int getSize(){
transSize = transList.size();
return transSize;
}
Based on google findings, NullPointerException means that I didn't initialize something. But I don't know what to intialize. transSize was initialized to 0.
Thank you~
Based on the error happening at the for loop, I suspect that your checkingAcct is null. Make sure you are using the constructor to initialize:
CheckingAccount checkingAcct = new CheckingAccount();.
If you're already doing that, make sure that it's not being assigned to null anywhere else in your code.
Since going to 1.7.0_45 (and 51) my program sometimes hangs. All of it's windows work OK except for one, it's fairly complex and has around 60 JButtons, JTextFields, two JScrollbars, JLabels etc. But so do all my other windows and they work fine.
I've put debug lines to the console so I can see where the program is hanging and it seems to be during the repaint() fn. It's hanging at the line
Graphics g = getGraphics();
It has managed to draw some stuff to the screen so it's not the first call to repaint that's the issue. Looks like this: http://www.unixnerd.demon.co.uk/hungjava.jpg
I get this StackTrace. None of the lines of code are in my program. It only happens maybe one time in ten if I open and close the window. Never had the issue with Java 1.6.x. Happens on a few PCs (all Windows 7), not just mine.
Grateful for any ideas.
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at javax.swing.LayoutComparator.compare(LayoutComparator.java:116)
at javax.swing.LayoutComparator.compare(LayoutComparator.java:42)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:329)
at java.util.TimSort.sort(TimSort.java:189)
at java.util.TimSort.sort(TimSort.java:173)
at java.util.Arrays.sort(Arrays.java:659)
at java.util.Collections.sort(Collections.java:217)
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:136)
at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(SortingFocusTraversalPolicy.java:110)
at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:435)
at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:166)
at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:515)
at java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolicy.java:169)
at java.awt.Window.getMostRecentFocusOwner(Window.java:2317)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:681)
at java.awt.Component.dispatchEventImpl(Component.java:4731)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:128)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Im working on my old project at the moment using jide libraries, I used netbeans as my IDE, it works fine when I was working with it in Windows 7 a year ago.
Currently I'm using OS X Mavericks and using netbeans 7.2.1, when I try to drag the component from the palette manager i got this error.
Got anyone also encounter this?
EDIT:
Added the error log:
java.lang.NoClassDefFoundError: Could not initialize class com.jidesoft.swing.JideSwingUtilities
at com.jidesoft.swing.Searchable.installListeners(Unknown Source)
at com.jidesoft.swing.Searchable.<init>(Unknown Source)
at com.jidesoft.swing.ComboBoxSearchable.<init>(Unknown Source)
at com.jidesoft.swing.AutoCompletion.<init>(Unknown Source)
at com.jidesoft.swing.AutoCompletionComboBox.createAutoCompletion(Unknown Source)
at com.jidesoft.swing.AutoCompletionComboBox.initComponents(Unknown Source)
at com.jidesoft.swing.AutoCompletionComboBox.<init>(Unknown Source)
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:526)
at java.lang.Class.newInstance(Class.java:374)
at org.netbeans.modules.form.CreationFactory.createDefaultInstance(CreationFactory.java:178)
at org.netbeans.modules.form.RADComponent.createBeanInstance(RADComponent.java:252)
at org.netbeans.modules.form.RADComponent.initInstance(RADComponent.java:191)
at org.netbeans.modules.form.MetaComponentCreator.initComponentInstance(MetaComponentCreator.java:1508)
at org.netbeans.modules.form.MetaComponentCreator.createVisualComponent(MetaComponentCreator.java:975)
at org.netbeans.modules.form.MetaComponentCreator.access$300(MetaComponentCreator.java:79)
at org.netbeans.modules.form.MetaComponentCreator$2.run(MetaComponentCreator.java:286)
at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1368)
at org.openide.util.Mutex.readAccess(Mutex.java:327)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:283)
at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:306)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:3367)
at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:3359)
at org.netbeans.modules.form.HandleLayer.mouseMoved(HandleLayer.java:2167)
at java.awt.Component.processMouseMotionEvent(Component.java:6550)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3338)
at java.awt.Component.processEvent(Component.java:6274)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4505)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
You get this error because your code is compiled against JDK1.6 but your runtime is not. In my case it was JRE1.7
You can fix this by making sure you JRE and JDK are the same versions.
For me, I changed my eclipse run config from 1.7 (default) to 1.6