Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create a new file #4471

Open
dmitry-kabanov opened this issue Jan 13, 2025 · 9 comments
Open

Cannot create a new file #4471

dmitry-kabanov opened this issue Jan 13, 2025 · 9 comments
Labels

Comments

@dmitry-kabanov
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Click "Create a New File" on the Welcome screen or choose File -> New -> File
  2. See that nothing happens.

Expected behavior
A dialog window for creating a new portfolio file should appear on the screen.

Desktop (please complete the following information):

  • OS: macOS
  • Version 0.73.0
@TBdt38
Copy link

TBdt38 commented Jan 16, 2025

I get the same problem with recent version of Portfolio Performance! Impossible to create new file, the menu point to nothing.

  • OS: Windows

  • Version: 0.73.0

@buchen
Copy link
Member

buchen commented Jan 17, 2025

@dmitry-kabanov @TBdt38

I have trouble reproducing the problem. I see the "new file wizard" open up when clicking the menu or the link on the welcome screen.

Are there any exceptions / entries in the error log? can you share?

Go to Help -> Show error log.

@buchen
Copy link
Member

buchen commented Jan 17, 2025

I might have an idea.

Depending on your local locale, we cannot determine the default currency. And that results in a NullPointerException in the current version. It is already fixed af9618b but not yet published.

To verify, can you share what properties you have in "About Portfolio Performance" -> "Installationdetails" for these two entries:

user.country: DE
user.language: de

@TBdt38
Copy link

TBdt38 commented Jan 17, 2025

@dmitry-kabanov @TBdt38

I have trouble reproducing the problem. I see the "new file wizard" open up when clicking the menu or the link on the welcome screen.

Are there any exceptions / entries in the error log? can you share?

Go to Help -> Show error log.

Yes i get an error in the diary,

Fri Jan 17 20:22:27 CET 2025
Command 'name.abuchen.portfolio.ui.command.newclient' failed

org.eclipse.core.commands.ExecutionException: Error executing 'name.abuchen.portfolio.ui.command.newclient': java.lang.IllegalArgumentException

	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:179)

	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)

	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)

	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)

	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:444)

	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:442)

	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:464)

	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)

	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4404)

	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1173)

	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4202)

	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3790)

	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)

	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)

	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)

	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)

	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:165)

	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)

	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)

	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)

	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)

	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)

	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)

	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)

	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)

Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.IllegalArgumentException

	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:66)

	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:299)

	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:233)

	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)

	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)

	... 26 more

Caused by: java.lang.IllegalArgumentException

	at java.base/java.util.Currency.getInstance(Unknown Source)

	at name.abuchen.portfolio.money.CurrencyUnit.getDefaultInstance(CurrencyUnit.java:79)

	at name.abuchen.portfolio.ui.wizards.client.BaseCurrencySelectionPage.createControl(BaseCurrencySelectionPage.java:49)

	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:180)

	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)

	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:637)

	at org.eclipse.jface.window.Window.create(Window.java:431)

	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1092)

	at org.eclipse.jface.window.Window.open(Window.java:788)

	at name.abuchen.portfolio.ui.handlers.NewFileHandler.execute(NewFileHandler.java:37)

	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)

	... 30 more

@TBdt38
Copy link

TBdt38 commented Jan 17, 2025

I might have an idea.

Depending on your local locale, we cannot determine the default currency. And that results in a NullPointerException in the current version. It is already fixed af9618b but not yet published.

To verify, can you share what properties you have in "About Portfolio Performance" -> "Installationdetails" for these two entries:

user.country: DE
user.language: de

I have
user.country: FR
user.language: fr

but in the properties/laanguage i have Language set to FR
and Country is empty, set to nothing.
dont know if it can be the problem.

@dmitry-kabanov
Copy link
Author

@buchen, sorry for the delay with the reply.

I have the following details:

user.country: DE
user.dir: /Applications/PortfolioPerformance.app/Contents/MacOS
user.home: /Users/dima
user.language: de
user.name: dima
user.timezone: Europe/Berlin

@dmitry-kabanov
Copy link
Author

I have just realized that I have set the in Preferences the language to English (although macOS is overall using German, as probably, follows from the above details). When I have switched the language to automatic and restarted, the interfaces is of course in German, and the Create New Portfolio dialog window appears on the screen!

@dmitry-kabanov
Copy link
Author

dmitry-kabanov commented Jan 17, 2025

Now I switch back to English, and the dialog window again does not appear. The error log says:

Fri Jan 17 22:11:33 CET 2025
Command 'name.abuchen.portfolio.ui.command.newclient' failed

org.eclipse.core.commands.ExecutionException: Error executing 'name.abuchen.portfolio.ui.command.newclient': java.lang.IllegalArgumentException
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:179)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)

[ removed by me]

that is, the same error log as @TBdt38 has provided.

I have just found a fix (a bit strange one).
Below the combobox for Language, there is a combobox for Country. This combobox was empty. I have set it explicitly to Germany (keeping the language to English). After a restart, everything works!

The strangeness here is that the user.country and user.language settings are the same (DE, de - does user.language relate to the OS language? Because I have set it in the program's preferences to English). Why setting the Country combobox helps, I don't know, because user.country was already correct (DE) automatically.

@TBdt38
Copy link

TBdt38 commented Jan 18, 2025

ok interesting. You are correct, if i force the country then it works again to do New File. I dont know what has changed, i dont remember what i had in this setting before. Either a recent version has flushed the setting or it is a recent bug. anyway we have a workaround now ahah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants