OpenHFT / Chronicle-Values

http://chronicle.software
Other
104 stars 38 forks source link

Error generating Heap Class implementation. #10

Closed vemana closed 8 years ago

vemana commented 8 years ago

When I tried to create a new heap instance, I got this failure in version: 1.5.1. The error seems believable and later versions also appear to have HeapByteable non-public.

Class definition:

public interface ChronicleValueType<C extends ChronicleValueType<C>>
    extends Byteable, BytesMarshallable, Copyable<C> {..}

public interface MyDate extends ChronicleValueType<MyDate> {..}

Error message:

error: net.openhft.chronicle.values.HeapByteable is not public in net.openhft.chronicle.values; cannot be accessed from outside package
import net.openhft.chronicle.values.HeapByteable;

error: cannot find symbol
public class MyDate$$Heap implements MyDate, Copyable<MyDate>, BytesMarshallable, HeapByteable {
                                                                                  ^
  symbol: class HeapByteable

error: com.vemana.structs.MyDate$$Heap is not abstract and does not override abstract method maxSize() in net.openhft.chronicle.bytes.Byteable
public class MyDate$$Heap implements MyDate, Copyable<MyDate>, BytesMarshallable, HeapByteable {

Exception in thread "main" net.openhft.chronicle.values.ImplGenerationFailedException: java.lang.ClassNotFoundException: com.vemana.structs.MyDate$$Heap
        at net.openhft.chronicle.values.ValueModel.createClass(ValueModel.java:349)
        at net.openhft.chronicle.values.ValueModel.createHeapClass(ValueModel.java:326)
        at net.openhft.chronicle.values.ValueModel.heapClass(ValueModel.java:316)
        at net.openhft.chronicle.values.ValueFieldModel$2.generateFields(ValueFieldModel.java:276)
        at net.openhft.chronicle.values.FieldModel.generateMembers(FieldModel.java:190)
        at net.openhft.chronicle.values.FieldModel.generateHeapMembers(FieldModel.java:186)
        at net.openhft.chronicle.values.Generators.lambda$generateHeapClass$7(Generators.java:227)
        at net.openhft.chronicle.values.Generators$$Lambda$88/1518728219.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
        at net.openhft.chronicle.values.Generators.generateHeapClass(Generators.java:227)
        at net.openhft.chronicle.values.ValueModel$$Lambda$87/1408662262.apply(Unknown Source)
        at net.openhft.chronicle.values.ValueModel.createClass(ValueModel.java:345)
        at net.openhft.chronicle.values.ValueModel.createHeapClass(ValueModel.java:326)
        at net.openhft.chronicle.values.ValueModel.heapClass(ValueModel.java:316)
        at net.openhft.chronicle.values.ValueFieldModel$2.generateFields(ValueFieldModel.java:276)
        at net.openhft.chronicle.values.FieldModel.generateMembers(FieldModel.java:190)
        at net.openhft.chronicle.values.FieldModel.generateHeapMembers(FieldModel.java:186)
        at net.openhft.chronicle.values.Generators.lambda$generateHeapClass$7(Generators.java:227)
        at net.openhft.chronicle.values.Generators$$Lambda$88/1518728219.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
        at net.openhft.chronicle.values.Generators.generateHeapClass(Generators.java:227)
        at net.openhft.chronicle.values.ValueModel$$Lambda$87/1408662262.apply(Unknown Source)
        at net.openhft.chronicle.values.ValueModel.createClass(ValueModel.java:345)
        at net.openhft.chronicle.values.ValueModel.createHeapClass(ValueModel.java:326)
        at net.openhft.chronicle.values.ValueModel.heapClass(ValueModel.java:316)
        at net.openhft.chronicle.values.Values.heapClassFor(Values.java:67)
        at net.openhft.chronicle.values.Values.newHeapInstance(Values.java:36)
leventov commented 8 years ago

Thanks for the finding. I made HeapByteable public. Shouldn't be an issue in the next released version.

kapiljshah commented 1 year ago

@leventov Getting similar exception with chronicle-map-3.24ea3.jar as below on linux environment but working on windows ... any resolution?

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'gatewayHealthTrackerImpl': Unsatisfied dependency expressed through field 'connectionStatusTracker': Error creating bean with name 'connectionStatusTracker': Invocation of init method failed at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:712) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:692) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:127) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:481) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1397) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:709) ~[spring-beans-6.0.2.jar!/:6.0.2] ... 28 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionStatusTracker': Invocation of init method failed at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:195) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:420) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1743) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:709) ~[spring-beans-6.0.2.jar!/:6.0.2] ... 42 common frames omitted

Caused by: net.openhft.chronicle.hash.ChronicleHashRecoveryFailedException: net.openhft.chronicle.values.ImplGenerationFailedException: java.lang.ClassNotFoundException: net.openhft.chronicle.hash.VanillaGlobalMutableState$$Native at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1937) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1706) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.map.ChronicleMapBuilder.recoverPersistedTo(ChronicleMapBuilder.java:1622) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1605) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1597) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at com.intrade.etrading.commons.mw.store.chronicle.map.ChronicleMapStore.buildCrashSafeChronicle(ChronicleMapStore.java:42) ~[distributed-data-cache-1.0.1.23.3.3.4.jar!/:na] at com.intrade.etrading.commons.mw.store.chronicle.map.ChronicleMapStore.(ChronicleMapStore.java:15) ~[distributed-data-cache-1.0.1.23.3.3.4.jar!/:na] at com.intrade.etrading.sor.health.ConnectionStatusTracker.init(ConnectionStatusTracker.java:26) ~[classes!/:1.0.0.47.2.2.3-SNAPSHOT] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:424) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:368) ~[spring-beans-6.0.2.jar!/:6.0.2] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:192) ~[spring-beans-6.0.2.jar!/:6.0.2] ... 54 common frames omitted Caused by: net.openhft.chronicle.values.ImplGenerationFailedException: java.lang.ClassNotFoundException: net.openhft.chronicle.hash.VanillaGlobalMutableState$$Native at net.openhft.chronicle.values.ValueModel.createClass(ValueModel.java:329) ~[chronicle-values-2.24ea0.jar!/:na] at net.openhft.chronicle.values.ValueModel.createNativeClass(ValueModel.java:306) ~[chronicle-values-2.24ea0.jar!/:na] at net.openhft.chronicle.values.ValueModel.nativeClass(ValueModel.java:282) ~[chronicle-values-2.24ea0.jar!/:na] at net.openhft.chronicle.values.Values.nativeClassFor(Values.java:89) ~[chronicle-values-2.24ea0.jar!/:na] at net.openhft.chronicle.values.Values.newNativeReference(Values.java:57) ~[chronicle-values-2.24ea0.jar!/:na] at net.openhft.chronicle.hash.impl.VanillaChronicleHash.createGlobalMutableState(VanillaChronicleHash.java:351) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.hash.impl.VanillaChronicleHash.initOwnTransients(VanillaChronicleHash.java:404) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.hash.impl.VanillaChronicleHash.initTransients(VanillaChronicleHash.java:400) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.map.VanillaChronicleMap.initTransients(VanillaChronicleMap.java:186) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.hash.impl.VanillaChronicleHash.readMarshallable(VanillaChronicleHash.java:249) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] at net.openhft.chronicle.wire.SerializationStrategies$1.readUsing(SerializationStrategies.java:51) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.TextWire$TextValueIn.marshallable(TextWire.java:1995) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.Wires.objectMap(Wires.java:562) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.Wires.object1(Wires.java:658) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.Wires.object0(Wires.java:602) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.ValueIn.object(ValueIn.java:554) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.ValueIn.object(ValueIn.java:550) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.TextWire$TextValueIn.objectWithInferredType0(TextWire.java:2276) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.TextWire$TextValueIn.objectWithInferredType(TextWire.java:2249) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.wire.TextWire$TextValueIn.typedMarshallable(TextWire.java:2057) ~[chronicle-wire-2.24ea25.jar!/:na] at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1899) ~[chronicle-map-3.24ea1.jar!/:3.24ea1] ... 68 common frames omitted Caused by: java.lang.ClassNotFoundException: net.openhft.chronicle.hash.VanillaGlobalMutableState$$Native at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[na:na] at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:149) ~[smart-order-router-1.0.0.47.2.2.3-20230922.104016-4.jar:1.0.0.47.2.2.3-SNAPSHOT] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na] at net.openhft.chronicle.values.CachedCompiler.loadFromJava(CachedCompiler.java:125) ~[chronicle-values-2.24ea0.jar!/:na] at net.openhft.chronicle.values.ValueModel.createClass(ValueModel.java:326) ~[chronicle-values-2.24ea0.jar!/:na] ... 88 common frames omitted

alamar commented 1 year ago

@kapiljshah Please use Stack Overflow to ask question, as this seems to be a different issue.