使用 JACOB 时出现 NoSuchMethodError

发布于 2024-11-07 12:31:33 字数 1684 浏览 0 评论 0原文

我一直在我的 java 程序中使用 JACOB 来工作,但是每次尝试从 ITTrackCollection 获取 ITTrack 时都会遇到错误。

这是给出错误的行:

a.add(t.getItem(1));

这是错误:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: com.jacob.com.Dispatch.call(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/Object;)Lcom/jacob/com/Variant;
    at com.dt.iTunesController.ITTrackCollection.getItem(ITTrackCollection.java:42)
    at iq.Main.addSong(Main.java:27)
    at iq.Main$listener.onHotKey(Main.java:70)
    at com.melloware.jintellitype.JIntellitype$1.run(JIntellitype.java:396)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
com.jacob.com.Dispatch.call(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/Object;)Lcom/jacob/com/Variant;

a 是 ITTrack 的数组列表,t 是 ITTrack 集合。 其中肯定有两个以上的 ITTrack。

谢谢

I have beeen using JACOB in my java program to work but I run into an error everytime I try to get an ITTrack from an ITTrackCollection.

This is the line that gives the error:

a.add(t.getItem(1));

This is the error:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: com.jacob.com.Dispatch.call(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/Object;)Lcom/jacob/com/Variant;
    at com.dt.iTunesController.ITTrackCollection.getItem(ITTrackCollection.java:42)
    at iq.Main.addSong(Main.java:27)
    at iq.Main$listener.onHotKey(Main.java:70)
    at com.melloware.jintellitype.JIntellitype$1.run(JIntellitype.java:396)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
com.jacob.com.Dispatch.call(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/Object;)Lcom/jacob/com/Variant;

a is an arraylist of ITTrack and t is an ITTrack collection.
t definitely has more than two ITTracks in it.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

音栖息无 2024-11-14 12:31:33

您的代码正在调用一个在具有以下签名的 Dispatch 类中找不到的方法:

Variant call(Dispatch dispatchTarget, String name, Object attributes)

查看 Jacob 文档,该类中的以下方法与该方法最接近:

Variant call(Dispatch dispatchTarget, String name, Object... attributes)

请注意,最后一个参数是不同的(vararg - 对象数组)。

您是否针对不同版本的库编译了代码?

Your code is invoking a method which can not be found in the Dispatch class with the following signature:

Variant call(Dispatch dispatchTarget, String name, Object attributes)

Looking at the Jacob documentation, the following method from that class most closely matches that one:

Variant call(Dispatch dispatchTarget, String name, Object... attributes)

Note that the last parameter is different (vararg - an array of Object).

Did you compile your code against a different version of the library?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文