This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 124316 - NullPointerException at$ when doing refactor->rename on a .java file.
Summary: NullPointerException at$...
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker with 1 vote (vote)
Assignee: _ sandipchitale
Depends on:
Reported: 2007-12-20 11:10 UTC by tomsve
Modified: 2008-08-12 21:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description tomsve 2007-12-20 11:10:51 UTC
When I right click on a .java file and then select the "Refactor->Rename" menu entry I get the below exception. No
dialog ever pops up.

I was not entirely sure what component to report this on. It could be a refactoring problem. I might be totally
missinterpreting the stack trace, but to me it seems like the refactoring thinks that it is about to refactor a Java
Faces model class, which is not the case. The class I'm trying to refactor is a standard POJO. It is however in the
visualweb part that the exception occurs, so I decided to report it on this component. 

I can also add that:
- This problem only occurs for certain java files (POJOs) in a maven project with packaging of type "war". Yes, I'm
using the maven2 plugins, and yes, this could be related to those plugins also, but I cannot determine that.
- All java classes (tested) in maven projects of type "jar" the refactoring works (the dialog asking for new name pops
up nicely).
- There is nothing unique to distinguish the classes that fail from the ones that work. It seems random even though it
is not random since for the classes that fails it always fails.
- This have worked fine in beta1, beta2, rc1, rc2, and release version of 6.0 up until today (2007-12-20)! No new plugin
have been installed. No plugin have been removed. The java installation used have not changed. Just for testing I
started the rc2 version with its own installation and ~/.netbeans/netbeans-6.0beta2 user directory. Same problem! 

I as a last test uninstalled all netbeans installations on my machine and then did a rm -rf ~/.netbeans, and then
reinstalled netbeans 6.0, and finally installed only the absolutely neccesarry plugins: maven + spring. The problem remains.

What really annoys me is that it worked fine yesterday, and the day before that and so on. The java version is 1.5.0_14
and that has not changed since yesterday. The only things that have changed is some system updates: openssl, openssh,
firefox, python. I cannot se how it can affect either java or netbeans.

Unfortunately the only workaround I can see to this, for the moment, is installing the eclipse monster. I only have a
2.4Ghz duo core processor with 3GB of memory so that will be difficult. 

	at org.netbeans.modules.visualweb.insync.models.FacesModel.openJavaUnits(
	at org.netbeans.modules.visualweb.insync.models.FacesModel.syncImpl(
	at org.netbeans.modules.visualweb.insync.Model.sync(
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.getPlugins(
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.addProgressListener(
	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel.showDialog(
	at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.refresh(
	at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.<init>(
	at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.<init>(
	at org.netbeans.modules.refactoring.spi.ui.UI.openRefactoringUI(
	at org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.doRename(
	at org.netbeans.modules.refactoring.spi.impl.RenameAction.performAction(
	at org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction.performAction(
	at org.openide.util.actions.NodeAction.performAction(
	at org.openide.util.actions.CallableSystemAction$
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(
	at org.openide.util.actions.CallableSystemAction.actionPerformed(
	at org.openide.util.actions.NodeAction.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.AbstractButton.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
[catch] at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(
Comment 1 _ sandipchitale 2008-01-16 18:38:10 UTC
Can you please attach a sample Maven2 project with packaging of type "war" and a .java file that reproduces the exception?
Or atleast instructions on how to set up such a project.
Comment 2 oakie3cr 2008-01-22 21:42:47 UTC
It is easy to reproduce.  All I did to duplicate the problem was:

1 - create a new maven project
2 - use the maven webapp archetype
3 - use the default com.mycompany
4 - right click on the empty package (com.mycompany) and create a new package with the default name.
5 - right click on the new class (, then click refactor -> rename.

Boom, null pointer exception.
Comment 3 Karthikeyan Rajeswaran 2008-08-12 21:50:02 UTC
See also: issue 31227