Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Problem with Externalize string dilaog(Externalize string dialog reports a warning and then shows error when pressing Next)
Problem with Externalize string dilaog [message #1837179] Sat, 23 January 2021 12:30 Go to next message
Eclipse UserFriend
I have had this problem for a while and decided to try again to find a solution. It is a pain to do this manually - which is what I have been doing.

My application is a SWT with JFace UI.

I have a file which creates my preference dialog box and of course I am trying to property externalize the strings. When I bring the dialog box up it shows a warning that says "Entry is missing in property file". There is no indication pointing to which one. If I create externalize entries for a couple of strings and ignore the rest (first time I did the whole dialog - not doing that again:-) and then press Next I get a panel that says "An unexpected exception occurred while creating a change object. See the error log for more details."

Sadly I cannot figure out what the problem is from the error.
The key error is:
Root exception:
java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.refactoring.nls.PropertyFileDocumentModel.escape(PropertyFileDocumentModel.java:217)

It seems like while it is trying to escape the key name it fails. I'm not using any special characters in my names other than periods '.' which the tool also adds on its own.

Full errors from the log:
!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2021-01-23 12:16:27.353
!MESSAGE Internal Error
!STACK 0
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:397)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1033)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:662)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:504)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:77)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:113)
at org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizardPage.getNextPage(ExternalizeWizardPage.java:1257)
at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:910)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:468)
at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
at org.eclipse.jface.window.Window.open(Window.java:799)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.lambda$0(RefactoringWizardOpenOperation.java:190)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:209)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:126)
at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:41)
at org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard.lambda$0(ExternalizeWizard.java:93)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
at org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard.open(ExternalizeWizard.java:81)
at org.eclipse.jdt.internal.ui.text.correction.LocalCorrectionsSubProcessor$1.apply(LocalCorrectionsSubProcessor.java:591)
at org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover$AnnotationInformationControl.apply(AbstractAnnotationHover.java:561)
at org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover$AnnotationInformationControl.access$1(AbstractAnnotationHover.java:538)
at org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover$AnnotationInformationControl$4.widgetSelected(AbstractAnnotationHover.java:532)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Widget.sendSelectionEvent(Widget.java:1078)
at org.eclipse.swt.widgets.Link.wmNotifyChild(Link.java:713)
at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5816)
at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1954)
at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5384)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4818)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4938)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
at org.eclipse.swt.widgets.Link.callWindowProc(Link.java:161)
at org.eclipse.swt.widgets.Widget.wmLButtonUp(Widget.java:1964)
at org.eclipse.swt.widgets.Control.WM_LBUTTONUP(Control.java:5197)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4799)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4938)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3624)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.refactoring.nls.PropertyFileDocumentModel.escape(PropertyFileDocumentModel.java:217)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSPropertyFileModifier.addReplaceEdits(NLSPropertyFileModifier.java:186)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSPropertyFileModifier.addChanges(NLSPropertyFileModifier.java:119)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSPropertyFileModifier.create(NLSPropertyFileModifier.java:79)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring.createChange(NLSRefactoring.java:245)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:125)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Root exception:
java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.refactoring.nls.PropertyFileDocumentModel.escape(PropertyFileDocumentModel.java:217)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSPropertyFileModifier.addReplaceEdits(NLSPropertyFileModifier.java:186)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSPropertyFileModifier.addChanges(NLSPropertyFileModifier.java:119)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSPropertyFileModifier.create(NLSPropertyFileModifier.java:79)
at org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring.createChange(NLSRefactoring.java:245)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:125)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Re: Problem with Externalize string dilaog [message #1860064 is a reply to message #1837179] Fri, 14 July 2023 14:49 Go to previous messageGo to next message
Eclipse UserFriend
I got exactly the same problem and this is really a show-stopper. Don't know how to maintain these message files now.

It seems to happen only when you call the "Externalize strings" wizard for the second time.

Eclipse version 2023-06.

EDIT:
I got a workarund now.

This line in the generated Message.java causes the problem:
private static final String BUNDLE_NAME = Messages.class.getPackageName() + ".messages"; 

The workaround is to hard-code the BUNDLE_NAME like this:
private static final String BUNDLE_NAME = "org.myworkaroundpackage.messages"; 

[Updated on: Fri, 14 July 2023 15:14] by Moderator

Re: Problem with Externalize string dilaog [message #1860609 is a reply to message #1860064] Mon, 21 August 2023 14:36 Go to previous message
Eclipse UserFriend
Same problem here.

The trick above (harcode the package in Message.java) worked for me.
Previous Topic:conditional breakpoint expressions always fail with ClassNotFoundException
Next Topic:Directories in ISO Charset not shown in Project explorer
Goto Forum:
  


Current Time: Wed Jul 02 17:19:51 EDT 2025

Powered by FUDForum. Page generated in 0.03180 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top