SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

"Failed to launch JVM" on Windows java.lang.NullPointerException: Cannot invoke “java.awt.Image.getWidth)

I know this is not new but I cannot find a solution.

I have run the debug and get this:

Microsoft Windows [Version 10.0.19045.4651]
© Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd “C:\Program Files\Jthink\SongKong”

C:\Program Files\Jthink\SongKong>SongKongDebug
debuglogfile is:C:\Users\paulw\AppData\Roaming\SongKong\Logs/songkong_debug%u-%g.log
userlogfile is:C:\Users\paulw\AppData\Roaming\SongKong\Logs/songkong_user%u-%g.log
java.lang.NullPointerException: Cannot invoke “java.awt.Image.getWidth(java.awt.image.ImageObserver)” because “retVal” is null
at java.desktop/sun.awt.shell.Win32ShellFolder2$MultiResolutionIconImage.getResolutionVariant(Win32ShellFolder2.java:1459)
at java.desktop/sun.awt.shell.Win32ShellFolder2$MultiResolutionIconImage.getBaseImage(Win32ShellFolder2.java:1438)
at java.desktop/java.awt.image.AbstractMultiResolutionImage.getProperty(AbstractMultiResolutionImage.java:140)
at java.desktop/javax.swing.ImageIcon.(ImageIcon.java:255)
at java.desktop/javax.swing.ImageIcon.(ImageIcon.java:241)
at java.desktop/javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:252)
at com.formdev.flatlaf.ui.FlatFileChooserUI$FlatFileView.getIcon(FlatFileChooserUI.java:373)
at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1613)
at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxRenderer.getListCellRendererComponent(MetalFileChooserUI.java:949)
at com.formdev.flatlaf.ui.FlatComboBoxUI$FlatComboPopup$PopupListCellRenderer.getListCellRendererComponent(FlatComboBoxUI.java:1047)
at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1444)
at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1394)
at java.desktop/javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2815)
at com.formdev.flatlaf.ui.FlatListUI.lambda$createListSelectionListener$2(FlatListUI.java:195)
at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:231)
at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:206)
at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:258)
at java.desktop/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:459)
at java.desktop/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:469)
at java.desktop/javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:513)
at java.desktop/javax.swing.JList.setSelectedIndex(JList.java:2232)
at java.desktop/javax.swing.plaf.basic.BasicComboPopup.setListSelection(BasicComboPopup.java:1281)
at java.desktop/javax.swing.plaf.basic.BasicComboPopup$Handler.itemStateChanged(BasicComboPopup.java:1097)
at java.desktop/javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1257)
at java.desktop/javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1318)
at java.desktop/javax.swing.JComboBox.contentsChanged(JComboBox.java:1365)
at java.desktop/javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:127)
at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.setSelectedItem(MetalFileChooserUI.java:1104)
at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.addItem(MetalFileChooserUI.java:1069)
at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI.doDirectoryChanged(MetalFileChooserUI.java:719)
at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI$5.propertyChange(MetalFileChooserUI.java:808)
at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
at java.desktop/java.awt.Component.firePropertyChange(Component.java:8717)
at java.desktop/javax.swing.JFileChooser.setCurrentDirectory(JFileChooser.java:610)
at java.desktop/javax.swing.JFileChooser.(JFileChooser.java:364)
at java.desktop/javax.swing.JFileChooser.(JFileChooser.java:310)
at com.jthink.songkong.action.OpenFolder.init(OpenFolder.java:18)
at com.jthink.songkong.ui.MainWindow.setupFields(MainWindow.java:110)
at com.jthink.songkong.ui.MainWindow.setupPanel(MainWindow.java:152)
at com.jthink.songkong.ui.MainWindow.setupScreen(MainWindow.java:268)
at com.jthink.songkong.cmdline.SongKong.guiStart(SongKong.java:1166)
at com.jthink.songkong.cmdline.SongKong.finish(SongKong.java:1299)
at com.jthink.songkong.cmdline.SongKong.main(SongKong.java:1322)

Failed to launch JVM

C:\Program Files\Jthink\SongKong>

I think this is a bug on Java 21, are you using multiple monitors, if so does it work if you go back to one monitor?

Just the one monitor.

Hmm, actually the bug was in Java 20 and resolved in Java 21 and SongKong ships with Java 21 so not clear why you are seeing this, I assume you are using latest version of SongKong ?

I have version 10.8 installed

Can anyone help resolve this problem?

Can you try running

SongKongRemote instead

If it starts without error then go to Web Browser and enter http://localhost:4567 in the url bar, then select Create Support Files to send me your logs

If this does work, as temparary workaround everthing you can do with usual Windows Desktop UI can also be done with the Web Remote UI

I tried SongKongRemote and was asked to permit network access by windows which I granted.

This is all that was shown in the window

debuglogfile is:C:\Users\paulw\AppData\Roaming\SongKong\Logs/songkong_debug%u-%g.log
userlogfile is:C:\Users\paulw\AppData\Roaming\SongKong\Logs/songkong_user%u-%g.log
songkong:remote dbinit
songkong:remote started

songkong_debug0-0.log is empty

songkong_user0-0.log is also empty

Ok so you should be able to use remote mode instead as a temporary workaround, I’m away for a week from tommorrow so I’m not going to be able to do anything else about this until I get back. It would still be useful if you could run Create Support Files from the the webui.

Songkong does not run in remote mode all I get is the DOS box.

I think it does. once you have started SongKongRemote in dos box and it says

songkong:remote started

you just need to open your webbrowser and enter http://localhost:4567 in the url bar

db5ba872e6c2f54d23f34382c042471352fdc132_2_690x207

The rename function does not work. I get " 500 Internal Server Error"

Here is what is shown in the CLI window:

debuglogfile is:C:\Users\paulw\AppData\Roaming\SongKong\Logs/songkong_debug%u-%g.log
userlogfile is:C:\Users\paulw\AppData\Roaming\SongKong\Logs/songkong_user%u-%g.log
songkong:remote dbinit
songkong:remote started

/style/fontawesome/webfonts/fa-light-300.woff2
/foldertree
/style/fontawesome/webfonts/custom-icons.woff2
/start.task
/renamefiles.select_profile
/renamefiles.select_profile
/renamefiles.go
java.lang.NullPointerException: Cannot invoke “String.lastIndexOf(int)” because “result” is null
at com.jthink.songkong.analyse.filename.FileNameFormatter.specialHandlingForDuplicatesAlbums(FileNameFormatter.java:522)
at com.jthink.songkong.analyse.filename.FileNameFormatter.formatFromMaskNoLimit(FileNameFormatter.java:502)
at com.jthink.songkong.analyse.filename.FileNameFormatter.formatFromMask(FileNameFormatter.java:393)
at com.jthink.songkong.server.page.RenameFilesPage.getExamples(RenameFilesPage.java:202)
at com.jthink.songkong.server.page.RenameFilesPage.getCompRenameMaskExamples(RenameFilesPage.java:232)
at com.jthink.songkong.server.page.RenameFilesPage.createMenuFilenaming(RenameFilesPage.java:259)
at com.jthink.songkong.server.page.RenameFilesPage.createPage(RenameFilesPage.java:92)
at com.jthink.songkong.server.callback.serverstartcontroller.ServerRenameFiles.getOptionsPage(ServerRenameFiles.java:214)
at com.jthink.songkong.server.callback.serverstartcontroller.AbstractServerModifySongs.processSelectedProfile(AbstractServerModifySongs.java:349)
at com.jthink.songkong.server.CmdRemote.lambda$configureWebEndPoints$100(CmdRemote.java:237)
at spark.RouteImpl$1.handle(RouteImpl.java:72)
at spark.http.matching.Routes.execute(Routes.java:61)
at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1598)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.base/java.lang.Thread.run(Thread.java:1583)

Ah yes, sorry bug introduced but now fixed - 500 Internal Server Error . On Windows just uninstall SongKong, download again and reinstall and then it will work.

Okay I think it is this related issue https://bugs.openjdk.org/browse/JDK-8320692 that was backported to Java 21.0.4 but Im only using Java 21.0.3, so I will update SongKong to use the latest release of Java 21 and I think that will fix it.

It is occuring at starup because of an optimization I did to open JFileChooser in background because of an issue on Windows on fileysystem with broken network shares, so if I wrap a try/catch block around that as well that should allow Jaikoz to start even if problem does occur.

Raised https://jthink.atlassian.net/browse/SONGKONG-2619

Fixed ready for next release.

Please give 10.9 a go, now available