2017-08-01 77 views
0

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

我在其中一个库内部使用ChronicleMap,使用具有自己的编组器的自定义值类。 当运行的主要项目中,我得到这些错误:

/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中缺少的一些依赖关系。

有什么我可以做,找出为什么我不能从IDE运行?

回答

0

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

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

相关问题