首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用ChronicleMap时出现运行时错误“找不到符号字节值$$Native”

使用ChronicleMap时出现运行时错误“找不到符号字节值$$Native”
EN

Stack Overflow用户
提问于 2017-08-01 22:53:10
回答 1查看 86关注 0票数 0

我正在处理的项目由几个组件组成--几个被编译成JAR的独立库,以及一个引用它们的主项目。所有这些都是用Scala编写的。

我在其中一个库中内部使用了ChronicleMap,使用一个带有自己的封送处理程序的自定义值类。在运行主项目时,我收到以下错误:

代码语言:javascript
复制
 /net/openhft/chronicle/core/values/ByteValue$$Native.java:15: error: cannot find symbol
public class ByteValue$$Native implements ByteValue, Copyable<ByteValue>, BytesMarshallable, Byteable {
                                          ^
  symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Native.java:15: error: cannot find symbol
public class ByteValue$$Native implements ByteValue, Copyable<ByteValue>, BytesMarshallable, Byteable {
                                                              ^
  symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Native.java:39: error: cannot find symbol
  public void copyFrom(ByteValue from) {
                       ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:12: error: cannot find symbol
public class ByteValue$$Heap implements ByteValue, Copyable<ByteValue>, BytesMarshallable {
                                        ^
  symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:12: error: cannot find symbol
public class ByteValue$$Heap implements ByteValue, Copyable<ByteValue>, BytesMarshallable {
                                                            ^
  symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:34: error: cannot find symbol
  public void copyFrom(ByteValue from) {
                       ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Heap
/net/openhft/chronicle/core/values/ByteValue$$Native.java:20: error: method does not override or implement a method from a supertype
  @Override
  ^
/net/openhft/chronicle/core/values/ByteValue$$Native.java:25: error: method does not override or implement a method from a supertype
  @Override
  ^
/net/openhft/chronicle/core/values/ByteValue$$Native.java:30: error: method does not override or implement a method from a supertype
  @Override
  ^
/net/openhft/chronicle/core/values/ByteValue$$Native.java:65: error: cannot find symbol
    if (!(obj instanceof ByteValue)) return false;
                         ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Native.java:66: error: cannot find symbol
    ByteValue other = (ByteValue) obj;
    ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Native.java:66: error: cannot find symbol
    ByteValue other = (ByteValue) obj;
                       ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:15: error: method does not override or implement a method from a supertype
  @Override
  ^
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:21: error: method does not override or implement a method from a supertype
  @Override
  ^
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:26: error: method does not override or implement a method from a supertype
  @Override
  ^
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:57: error: cannot find symbol
    if (!(obj instanceof ByteValue)) return false;
                         ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Heap
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:58: error: cannot find symbol
    ByteValue other = (ByteValue) obj;
    ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Heap
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:58: error: cannot find symbol
    ByteValue other = (ByteValue) obj;
                       ^
  symbol:   class ByteValue
  location: class net.openhft.chronicle.core.values.ByteValue$$Heap

这只发生在从Intellij IDEA运行项目时,而不是从命令行运行时。

此外,如果我设置了一个独立的项目,该项目使用相同的ChronicleMap和相同的自定义类和编组程序,那么在集成开发环境中运行它不会有任何问题。只有在IDE中运行使用我的库的项目时,才会出现问题。

因此,我认为这可能与类加载顺序有关,也可能与类加载顺序无关,或者可能与IDE中缺少的某些依赖项有关。

我能做些什么来找出我不能从IDE运行的原因吗?

EN

回答 1

Stack Overflow用户

发布于 2017-08-02 16:07:04

这看起来确实像是某种配置问题。

通过使用-XX:+TraceClassLoading运行代码并比较程序成功执行/不成功执行之间的输出,您可能能够获得有关正在进行的类加载的更多信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45441179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档