{"action":"opened","issue":{"url":"https://api.github.com/repos/OpenHFT/Chronicle-Map/issues/92","repository_url":"https://api.github.com/repos/OpenHFT/Chronicle-Map","labels_url":"https://api.github.com/repos/OpenHFT/Chronicle-Map/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/OpenHFT/Chronicle-Map/issues/92/comments","events_url":"https://api.github.com/repos/OpenHFT/Chronicle-Map/issues/92/events","html_url":"https://github.com/OpenHFT/Chronicle-Map/issues/92","id":170181522,"number":92,"title":"ClassNotFoundException when loading value interface from web application","user":{"login":"barabaka","id":103233,"avatar_url":"https://avatars.githubusercontent.com/u/103233?v=3","gravatar_id":"","url":"https://api.github.com/users/barabaka","html_url":"https://github.com/barabaka","followers_url":"https://api.github.com/users/barabaka/followers","following_url":"https://api.github.com/users/barabaka/following{/other_user}","gists_url":"https://api.github.com/users/barabaka/gists{/gist_id}","starred_url":"https://api.github.com/users/barabaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barabaka/subscriptions","organizations_url":"https://api.github.com/users/barabaka/orgs","repos_url":"https://api.github.com/users/barabaka/repos","events_url":"https://api.github.com/users/barabaka/events{/privacy}","received_events_url":"https://api.github.com/users/barabaka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-09T14:32:04Z","updated_at":"2016-08-09T14:32:04Z","closed_at":null,"body":"I have the following issue when creating a map from web application environment (running from jetty maven plugin in intellij idea or from standalone tomcat). Looks like classloader problem but I can't figure out what exactly the issue is. Looks similar to the one described here: http://stackoverflow.com/questions/35814537/chronicle-map-classnotfoundexception-with-gradle-aspectj but stack trace is different.\r\n\r\nMap is created like this:\r\nChronicleMapBuilder<String, TestMetric> builder = ChronicleMapBuilder\r\n                .of(String.class, TestMetric.class)\r\n                .averageKeySize(50)\r\n                .entries(1000000);\r\n\r\n(1) net.test.TestMetric is a custom value interface\r\n(2) I can access the class via Class.forName(), it's present in the project.\r\n(3) It works ok when doing the same from standalone java app\r\n(4) chronicle-map-2.4.15, lang-6.8.2 and compiler-2.2.5 are used, so basically latest versions for java 7 (we can't go directly to java 8 at the moment)\r\n\r\nCaused by: java.lang.AssertionError: java.lang.ClassNotFoundException: net.test.TestMetric$$Native\r\n\tat net.openhft.lang.model.DataValueGenerator.acquireNativeClass(DataValueGenerator.java:825)\r\n\tat net.openhft.lang.model.DataValueClassCache.directClassFor(DataValueClassCache.java:48)\r\n\tat net.openhft.lang.model.DataValueClasses.directClassFor(DataValueClasses.java:55)\r\n\tat net.openhft.chronicle.hash.serialization.internal.DataValueBytesMarshallers.acquireReaderClass(DataValueBytesMarshallers.java:72)\r\n\tat net.openhft.chronicle.hash.serialization.internal.DataValueBytesMarshallers.acquireBytesReader(DataValueBytesMarshallers.java:50)\r\n\tat net.openhft.chronicle.map.SerializationBuilder.configureByDefault(SerializationBuilder.java:95)\r\n\tat net.openhft.chronicle.map.SerializationBuilder.<init>(SerializationBuilder.java:72)\r\n\tat net.openhft.chronicle.map.ChronicleMapBuilder.<init>(ChronicleMapBuilder.java:152)\r\n\tat net.openhft.chronicle.map.ChronicleMapBuilder.of(ChronicleMapBuilder.java:178)\r\n\tat net.test.SegmentDataServiceChronicle.init(SegmentDataServiceChronicle.java:55)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)\r\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)\r\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)\r\n\t... 84 more\r\nCaused by: java.lang.ClassNotFoundException: net.test.TestMetric$$Native\r\n\tat org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)\r\n\tat org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)\r\n\tat org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)\r\n\tat org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450)\r\n\tat org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)\r\n\tat net.openhft.compiler.CachedCompiler.loadFromJava(CachedCompiler.java:155)\r\n\tat net.openhft.compiler.CachedCompiler.loadFromJava(CachedCompiler.java:75)\r\n\tat net.openhft.lang.model.DataValueGenerator.acquireNativeClass(DataValueGenerator.java:823)"}}
{"actor":{"display_login":"barabaka"}}