尝试使用com4j将文件中的图稿添加到iTunes IITrack对象时出现灾难性错误

Pau*_*lor 5 java com itunes com4j

将Com4j与iTunes一起使用,将各种文本值添加到IITrack对象没有问题,但是如果我尝试添加艺术作品

if(iTunesTrack.artwork().count()==0)
{
  String path = new File(new File(song.getFilename()).getParent(),"folder.jpg").getPath();
  if(Files.exists(Paths.get(path)))
  {
      iTunesTrack.addArtworkFromFile(path);
  }
}
Run Code Online (Sandbox Code Playgroud)

它失败了

11/05/2017 18.24.56:BST:com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges:updateITunesLibTrackFromSong:SEVERE:无法更新ItunesTrack C:\ Users\Paul\Desktop\TestMusic\WAV\Music \唱片三一学院\ Carols来自Trinity\27 - 在Dulci Jubilo(管风琴独奏).wav:8000ffff灾难性失败:灾难性失败com4j.Com例外:8000ffff灾难性失败:灾难性失败:.\ invoke.cpp:517 at com4j.Wrapper.invoke(Wrapper.java: 187)at com.sun.proxy.$ Proxy57.addArtworkFromFile(Unknown Source)at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateITunesLibTrackFromSong(WindowsUpdateItunesWithChanges.java:611)at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.addEditedTrack(WindowsUpdateItunesWithChanges .java:646)com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.analyseFiles(WindowsUpdateItunesWithChanges.java:277)at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateItunes(WindowsUpdat)eItunesWithChanges.java:180)at com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call(UpdateItunesWithChanges.java:182)at com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call(UpdateItunesWithChanges.java:32)at java.util.concurrent来自java.util.conc.Thread上的java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)的.futureTask.run(未知来源)java.lang.Thread.run上的java.man.run(未知来源)$(未知来源)引起:com4j.ComException:8000ffff灾难性故障:灾难性故障:.\ invoke.cpp:517 at com4j.Native.invoke(Native Method)at com4j.StandardComMethod.invoke(StandardComMethod.java:35)at com4j.Wrapper $ InvocationThunk .call(Wrapper.java:356)at com4j.Task.invoke(Task.java:50)at com4j.ComThread.run0(ComThread.java:172)at com4j.ComThread.run(ComThread.java:153)

COM4j接口是从我的iTunes版本构建的,所以它们存在,我不知道我做错了什么或者它是否坏了,我已经尝试过一些具有相同结果的jpogs.我检查文件是否存在,如果尝试添加不存在的文件,确实错误是不同的.