I'm learning clojure in Ubuntu(Linux) OS. I'm facing an unexpected error. Everything is working fine in my system. When I move same code & data in different system, I got an error. I run following command:
$ lein run
Exception in thread "main" java.lang.ClassNotFoundException: java.util.Base64, compiling:(com/data/common/jwt.clj:86:23)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6875)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$IfExpr$Parser.parse(Compiler.java:2797)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6319)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$IfExpr$Parser.parse(Compiler.java:2797)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler.eval(Compiler.java:6931)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:703)
at binutils.core$eval20$loading__5569__auto____21.invoke(core.clj:1)
at binutils.core$eval20.invokeStatic(core.clj:1)
at binutils.core$eval20.invoke(core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval5$fn__7.invoke(form-init2263747695343924382.clj:1)
at user$eval5.invokeStatic(form-init2263747695343924382.clj:1)
at user$eval5.invoke(form-init2263747695343924382.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at clojure.main$initialize.invokeStatic(main.clj:308)
at clojure.main$null_opt.invokeStatic(main.clj:342)
at clojure.main$null_opt.invoke(main.clj:339)
at clojure.main$main.invokeStatic(main.clj:421)
at clojure.main$main.doInvoke(main.clj:384)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: java.util.Base64
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:1030)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6807)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6854)
... 107 more
lein retrieve required library, but I'm not sure whether It retrieve all required lib or not. I don't understand, why it is happening? can anyone help me to fix this error? Thanks.
It's likely that your Java version is lower than 8.
You can either switch to use Java 8 to run your compiled clojure code (or update to Java 8 if you don't have one), or use Base64 from Apache Commons Codec library, you can check this post for detail: java.lang.NoClassDefFoundError: java/util/Base64
I had this problem with OpenJDK 8...
turned out I was missing the fact that it is a nested class
I had tried to import it like this
[java.util.Base64 Encoder]
which is incorrect, this is correct:
[java.util Base64$Encoder]
Related
Hi whenever I try to create a java class or anything on my project I get an unexpected error on my NetBeans, I installed a hibernate plugin which was requesting for freemaker jar version 238 and which after installing the hibernate plugin every time I try to create a java class this is the error I get, thank you in advance for your help.
java.lang.ClassNotFoundException: freemarker.template.Template
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.netbeans.ProxyClassLoader.doFindClass(ProxyClassLoader.java:209)
Caused: java.lang.ClassNotFoundException: freemarker.template.Template starting from ModuleCL#58762fd2[org.netbeans.libs.freemarker] with possible defining loaders null and declared parents [org.netbeans.JarClassLoader#6dedf07b, org.netbeans.MainImpl$BootClassLoader#51efea79, ModuleCL#9e4e8cd[org.netbeans.modules.queries]]
at org.netbeans.ProxyClassLoader.doFindClass(ProxyClassLoader.java:211)
at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:125)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
Caused: java.lang.NoClassDefFoundError: freemarker/template/Template
at org.netbeans.libs.freemarker.FreemarkerFactory.getScriptEngine(FreemarkerFactory.java:156)
at java.scripting/javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:241)
at org.netbeans.api.scripting.Scripting$EngineManager.getEngineByName(Scripting.java:180)
at org.netbeans.modules.templates.ScriptingCreateFromTemplateHandler.getEngine(ScriptingCreateFromTemplateHandler.java:141)
at org.netbeans.modules.templates.ScriptingCreateFromTemplateHandler.engine(ScriptingCreateFromTemplateHandler.java:150)
at org.netbeans.modules.templates.ScriptingCreateFromTemplateHandler.accept(ScriptingCreateFromTemplateHandler.java:65)
at org.netbeans.api.templates.CreateFromTemplateImpl.build(CreateFromTemplateImpl.java:113)
at org.netbeans.api.templates.CreateFromTemplateImpl.build(CreateFromTemplateImpl.java:73)
at org.netbeans.api.templates.FileBuilder.build(FileBuilder.java:227)
at org.netbeans.api.templates.FileBuilder.createFromTemplate(FileBuilder.java:329)
at org.openide.loaders.MultiDataObject.handleCreateFromTemplate(MultiDataObject.java:853)
at org.openide.loaders.DataObject$CreateAction.run(DataObject.java:1572)
at org.openide.loaders.DataObjectPool$1WrapAtomicAction.run(DataObjectPool.java:236)
at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:102)
at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:494)
at org.openide.loaders.DataObjectPool.runAtomicAction(DataObjectPool.java:261)
at org.openide.loaders.DataObject.invokeAtomicAction(DataObject.java:1026)
at org.openide.loaders.DataObject.createFromTemplate(DataObject.java:958)
at org.netbeans.modules.java.project.ui.NewJavaFileWizardIterator.instantiate(NewJavaFileWizardIterator.java:340)
at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1050)
at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:602)
at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:436)
at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:223)
at org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:135)
at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1605)
at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1546)
at org.openide.WizardDescriptor.access$2300(WizardDescriptor.java:67)
at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:2233)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
i am trying to install scala in vs code but it's not working (or running) and i have this error
this is my code
object assd extends App{
print("dfdfdfdfdf")
}
and this is the error
[Running] scala "c:\Users\ahmed\Desktop\scala\tempCodeRunnerFile.scala"
Exception in thread "main" java.lang.IllegalArgumentException: name
at java.base/jdk.internal.loader.URLClassPath$Loader.getResource(URLClassPath.java:636)
at java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:314)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:455)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at scala.reflect.internal.util.RichClassLoader$.$anonfun$tryClass$extension$1(ScalaClassLoader.scala:47)
at scala.util.control.Exception$Catch.$anonfun$opt$1(Exception.scala:245)
at scala.util.control.Exception$Catch.apply(Exception.scala:227)
at scala.util.control.Exception$Catch.opt(Exception.scala:245)
at scala.reflect.internal.util.RichClassLoader$.tryClass$extension(ScalaClassLoader.scala:47)
at scala.reflect.internal.util.ScalaClassLoader.tryToLoadClass(ScalaClassLoader.scala:41)
at scala.reflect.internal.util.ScalaClassLoader.tryToLoadClass$(ScalaClassLoader.scala:119)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.tryToLoadClass(ScalaClassLoader.scala:161)
at scala.reflect.internal.util.ScalaClassLoader$.classExists(ScalaClassLoader.scala:189)
at scala.tools.nsc.GenericRunnerCommand.guessHowToRun(GenericRunnerCommand.scala:43)
at scala.tools.nsc.GenericRunnerCommand.<init>(GenericRunnerCommand.scala:62)
at scala.tools.nsc.GenericRunnerCommand.<init>(GenericRunnerCommand.scala:25)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:45)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
[Done] exited with code=1 in 0.99 seconds
and this is path windowpath window
These are the extensions that I added
scala
code runner
if you use code runner,you can set scala change
"scala": "cd $dir && scala $fileName",
I am trying to use Netlogo via R using the following code:
library(RNetLogo)
my.netlogo1 <- "my.netlogo1"
nl.path <- "C:/Program Files/NetLogo 6.1.1/app"
NLStart(nl.path, gui = FALSE,
nl.obj = my.netlogo1, nl.jarname='netlogo-6.1.1.jar')
And I get the following message:
java.lang.NoClassDefFoundError: org/nlogo/workspace/Controllable
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:416)
Caused by: java.lang.ClassNotFoundException
at RJavaClassLoader.findClass(RJavaClassLoader.java:383)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 2 more
I heard it was because of a compatibility issue with Netlogo6 but that it had now been solved. Could someone say what I'm doing wrong?
This question already has an answer here:
How to fix the "Found Netty's native epoll transport in the classpath, but epoll is not available. Using NIO instead" warning?
(1 answer)
Closed 5 years ago.
When I run my service locally, I get a warning that epoll isn't available, so it's using NIO. Fair enough. When I deploy it in Kubernetes, I get this, which prevents the service from running:
2017-03-29T19:09:22.739482458Z 19:09:22.739 WARN com.datastax.driver.core.NettyUtil - Found Netty's native epoll transport in the classpath, but epoll is not available. Using NIO instead.
2017-03-29T19:09:22.739505903Z java.lang.UnsatisfiedLinkError: could not load a native library: netty-transport-native-epoll
2017-03-29T19:09:22.739509966Z at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:224)
2017-03-29T19:09:22.739513326Z at io.netty.channel.epoll.Native.loadNativeLibrary(Native.java:269)
2017-03-29T19:09:22.739516421Z at io.netty.channel.epoll.Native.<clinit>(Native.java:64)
2017-03-29T19:09:22.739519628Z at io.netty.channel.epoll.Epoll.<clinit>(Epoll.java:33)
2017-03-29T19:09:22.739522527Z at java.lang.Class.forName0(Native Method)
2017-03-29T19:09:22.739525253Z at java.lang.Class.forName(Class.java:264)
2017-03-29T19:09:22.739528047Z at com.datastax.driver.core.NettyUtil.<clinit>(NettyUtil.java:68)
2017-03-29T19:09:22.739530907Z at com.datastax.driver.core.NettyOptions.eventLoopGroup(NettyOptions.java:99)
2017-03-29T19:09:22.739533585Z at com.datastax.driver.core.Connection$Factory.<init>(Connection.java:769)
2017-03-29T19:09:22.739544382Z at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1400)
2017-03-29T19:09:22.739547340Z at com.datastax.driver.core.Cluster.init(Cluster.java:159)
2017-03-29T19:09:22.739550134Z at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:330)
2017-03-29T19:09:22.739555749Z at com.datastax.driver.core.Cluster.connect(Cluster.java:280)
2017-03-29T19:09:22.739558846Z at io.getquill.context.cassandra.CassandraSessionContext.<init>(CassandraSessionContext.scala:38)
2017-03-29T19:09:22.739562704Z at io.getquill.CassandraAsyncContext.<init>(CassandraAsyncContext.scala:19)
2017-03-29T19:09:22.739565629Z at io.xxxxxxxxx.platform.db.Datastore.<init>(Datastore.scala:26)
2017-03-29T19:09:22.739568481Z at DatastoreModule.configure(DatastoreModule.scala:22)
2017-03-29T19:09:22.739571234Z at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
2017-03-29T19:09:22.739574009Z at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
2017-03-29T19:09:22.739576726Z at com.google.inject.spi.Elements.getElements(Elements.java:110)
2017-03-29T19:09:22.739579348Z at com.google.inject.util.Modules$OverrideModule.configure(Modules.java:177)
2017-03-29T19:09:22.739581979Z at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
2017-03-29T19:09:22.739584688Z at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
2017-03-29T19:09:22.739587416Z at com.google.inject.spi.Elements.getElements(Elements.java:110)
2017-03-29T19:09:22.739590109Z at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
2017-03-29T19:09:22.739592859Z at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
2017-03-29T19:09:22.739595643Z at com.google.inject.Guice.createInjector(Guice.java:99)
2017-03-29T19:09:22.739598376Z at com.google.inject.Guice.createInjector(Guice.java:84)
2017-03-29T19:09:22.739600979Z at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
2017-03-29T19:09:22.739603649Z at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
2017-03-29T19:09:22.739606361Z at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
2017-03-29T19:09:22.739609008Z at play.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
2017-03-29T19:09:22.739611618Z at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
2017-03-29T19:09:22.739614246Z at play.core.server.ProdServerStart.main(ProdServerStart.scala)
2017-03-29T19:09:22.739616846Z Caused by: java.lang.RuntimeException: failed to get field ID: DefaultFileRegion.transfered
2017-03-29T19:09:22.739619540Z at java.lang.ClassLoader$NativeLibrary.load(Native Method)
2017-03-29T19:09:22.739624975Z at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
2017-03-29T19:09:22.739627704Z at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
2017-03-29T19:09:22.739630403Z at java.lang.Runtime.load0(Runtime.java:809)
2017-03-29T19:09:22.739632988Z at java.lang.System.load(System.java:1086)
2017-03-29T19:09:22.739635608Z at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:36)
2017-03-29T19:09:22.739638288Z at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:255)
2017-03-29T19:09:22.739640937Z at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:222)
2017-03-29T19:09:22.739643779Z ... 33 common frames omitted
2017-03-29T19:09:22.902948521Z 19:09:22.902 WARN i.n.util.concurrent.DefaultPromise - An exception was thrown by com.datastax.driver.core.Connection$1.operationComplete()
2017-03-29T19:09:22.902975391Z java.lang.NullPointerException: null
2017-03-29T19:09:22.902979455Z at io.netty.channel.group.DefaultChannelGroup.add(DefaultChannelGroup.java:146)
2017-03-29T19:09:22.902982663Z at io.netty.channel.group.DefaultChannelGroup.add(DefaultChannelGroup.java:42)
2017-03-29T19:09:22.902985588Z at com.datastax.driver.core.Connection$1.operationComplete(Connection.java:162)
2017-03-29T19:09:22.902988575Z at com.datastax.driver.core.Connection$1.operationComplete(Connection.java:149)
2017-03-29T19:09:22.902991374Z at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
2017-03-29T19:09:22.902995665Z at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:488)
2017-03-29T19:09:22.902998584Z at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:34)
2017-03-29T19:09:22.903001524Z at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:438)
2017-03-29T19:09:22.903004958Z at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:233)
2017-03-29T19:09:22.903008073Z at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
2017-03-29T19:09:22.903011054Z at java.lang.Thread.run(Thread.java:745)
How do I:
a) Stop the error; and
b) Make it use epoll if that's more performant than whatever NIO uses otherwise (is it really using select?)
Adding this dependency fixed the problem:
"io.netty" % "netty-transport-native-epoll" % "4.1.6.Final" classifier "linux-x86_64"
I'm new to flexjson.
I tried the following java code for my test: "FlexjsonTest.zip".
The result of running the program is in "Protocol.txt".
I ran the code from the command line:
javac FlexjsonTest.java
java Flexjson
I use flexjson 2.1 .
Using Java 6 or Java 7 doesn't make any difference.
The result is always:
Exception in thread "main" flexjson.JSONException: [ _address ]: Could not load Address
at flexjson.ObjectBinder.findClassInMap(ObjectBinder.java:235)
at flexjson.ObjectBinder.findClassName(ObjectBinder.java:202)
at flexjson.ObjectBinder.bind(ObjectBinder.java:83)
at flexjson.ObjectBinder.bindIntoObject(ObjectBinder.java:139)
at flexjson.factories.ClassLocatorObjectFactory.instantiate(ClassLocatorObjectFactory.java:38)
at flexjson.ObjectBinder.bind(ObjectBinder.java:86)
at flexjson.ObjectBinder.bind(ObjectBinder.java:65)
at flexjson.JSONDeserializer.deserialize(JSONDeserializer.java:158)
at FlexjsonTest.<init>(FlexjsonTest.java:22)
at FlexjsonTest.main(FlexjsonTest.java:32)
Caused by: java.lang.ClassNotFoundException: Address
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at flexjson.ObjectBinder.findClassInMap(ObjectBinder.java:230)
... 9 more
So, what am I doing wrong?
igel
it seems that you're trying to deserialize a JSON into an object called Address but the class Address seems not to be in your classpath
at flexjson.JSONDeserializer.deserialize(JSONDeserializer.java:158)
at FlexjsonTest.<init>(FlexjsonTest.java:22)
at FlexjsonTest.main(FlexjsonTest.java:32)
Caused by: java.lang.ClassNotFoundException: Address
also, you should post the code that actually throws this stacktrace in your question