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

java.util.NoSuchElementException: No value present #8

Closed
SvetaSR opened this issue Aug 12, 2022 · 4 comments
Closed

java.util.NoSuchElementException: No value present #8

SvetaSR opened this issue Aug 12, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@SvetaSR
Copy link

SvetaSR commented Aug 12, 2022

Hi there. Thank you for this nice tool!
I was trying to run it though, and get the following error.
The program does open but won't let me open my backup file.

D:\test-temp>java -jar itunes-backup-explorer-1.2.jar
אוג? 12, 2022 4:35:20 אחה?צ com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @78b0aab6'
me.maxih.itunes_backup_explorer.api.BackupReadException: me.maxih.itunes_backup_explorer.api.BackupReadException: java.util.NoSuchElementException: No value present
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.loadInfo(ITunesBackup.java:93)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.<init>(ITunesBackup.java:70)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.lambda$getBackups$0(ITunesBackup.java:31)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.getBackups(ITunesBackup.java:41)
        at me.maxih.itunes_backup_explorer.ui.WindowController.loadBackups(WindowController.java:135)
        at me.maxih.itunes_backup_explorer.ui.WindowController.initialize(WindowController.java:76)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:577)
        at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:77)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:577)
        at com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:275)
        at com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2673)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516)
        at me.maxih.itunes_backup_explorer.ITunesBackupExplorer.start(ITunesBackupExplorer.java:21)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: me.maxih.itunes_backup_explorer.api.BackupReadException: java.util.NoSuchElementException: No value present
        at me.maxih.itunes_backup_explorer.api.BackupInfo.<init>(BackupInfo.java:74)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.loadInfo(ITunesBackup.java:91)
        ... 32 more
Caused by: java.util.NoSuchElementException: No value present
        at java.base/java.util.Optional.orElseThrow(Optional.java:377)
        at me.maxih.itunes_backup_explorer.api.BackupInfo.<init>(BackupInfo.java:59)
        ... 33 more

My Java version is

java version "18.0.2" 2022-07-19
Java(TM) SE Runtime Environment (build 18.0.2+9-61)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing

Thanks!

@MaxiHuHe04
Copy link
Owner

Hey!
Could you give me some details about your system and the backup you were trying to open? Which operating system do you use? If Windows, what iTunes version? Which device and i(Pad)OS version is the backup from?

Apparently, the product name is missing from the backup info file. I thought it would be included in every backup, but maybe it is omitted in some configuration. I will make the value optional when loading the backup.

@SvetaSR
Copy link
Author

SvetaSR commented Aug 13, 2022

Hi @MaxiHuHe04 sure.
Windows 10 Pro (OS build 19043.1889)
Itunes 12.9.2.6
The backup is of an iPhone 6 with iOS 10.2.
The backup was created with a tool called CopyTrans, as iTunes required a factory restore 😨 (hate that program).

@TianLing2020
Copy link

TianLing2020 commented Sep 11, 2022

I met the same prolem.
Use Tool: i4tool.cn
Windows: Win11
Java:18

when i use the iTunes to backup. The problem has fixed.
But use the i4tool to backup ,will be failed

MaxiHuHe04 added a commit that referenced this issue Feb 2, 2023
Apparently, some 3rd-party backup tools produce info files with missing fields compared to the iTunes ones. Backups without any Info.plist file also load now.
@MaxiHuHe04 MaxiHuHe04 self-assigned this Feb 2, 2023
@MaxiHuHe04 MaxiHuHe04 added the bug Something isn't working label Feb 2, 2023
@MaxiHuHe04
Copy link
Owner

I'm sorry I haven't got around to fixing this until now. I'd appreciate it if someone could test it and reopen the issue if there are still problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants