Comments (6)
can you give me the full stacktrace of the error message?
from java.
Trying the code on another platform, it seems to work (asking for decoder).
Can confirm this and give you the full stack next thuesday.
Now i'm getting:
com.jsoniter.spi.JsonException: static gen should provide the decoder we need, but failed to create the decoder at com.jsoniter.Codegen.gen(Codegen.java:80) at com.jsoniter.Codegen.getDecoder(Codegen.java:35) at com.jsoniter.JsonIterator.read(JsonIterator.java:336) at com.jsoniter.JsonIterator.deserialize(JsonIterator.java:373) at net.esyo.utils.JsonUtils.loadFromFile(JsonUtils.java:61) at net.esyo.registry.server.RegistryServer.loadConfig(RegistryServer.java:328) at net.esyo.registry.server.RegistryServer.main(RegistryServer.java:44) Caused by: java.lang.ClassNotFoundException: decoder.net.esyo.registry.server.NetRegistryConfig at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.jsoniter.Codegen.gen(Codegen.java:75) ... 6 more
I haven't wrote a decoder but, why is it searching decoder.net.esyo.registry.server.NetRegistryConfig? note the 'decoder' as the base package instead of 'net.esyo'.
from java.
static decoder works this way. it will create the the decoder source code in the package "decoder.xxx" prefixing your class name. you do not need to write the decoder, the decoder should be generated by com.jsoniter.StaticCodeGenerator
then in the runtime, it will search for "decoder.xxx". if in static mode, not found such class will be a fatal error, because it expects the class should be generated ahead of time. if in dynamic mode, it will trigger class generation in the runtime (using javaasist).
checkout code https://github.com/json-iterator/java/tree/master/demo
mvn exec:java -Dexec.mainClass=com.jsoniter.demo.Demo
from java.
Multiple java installations misconfiguration.
from java.
Using netbeans with maven.
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_102
Have:
jdk1.7.0_25
jdk1.7.0_79
jdk1.8.0.91
jdk1.8.0_102
jdk-9
Installed in C:\Program Files\Java
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/esyo/utils/JsonUtils : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.jsoniter.StaticCodeGenerator.main(StaticCodeGenerator.java:17)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
from java.
ok found this: http://stackoverflow.com/questions/4681090/how-do-i-find-where-jdk-is-installed-on-my-windows-machine
Netbeans maven process was using system32/java.exe instead of the JAVA_HOME one...
from java.
Related Issues (20)
- Bug?: iter.skipNumber will keep illegal character
- hma HOT 1
- Codegen fails to generate Enum decoder if Enum has overriden toString() method
- No constructor for: interface io.netty.Channel
- `indentionStep` has no effect on `com.jsoniter.any.Any`
- In the micro-benchmark test, the jsoniter serialization performance seems to be a bit poor
- java 17 NPE
- duplicate class definition for name: "com/jsoniter/IterImpl" when use treaming processing
- Aplicación del patrón de diseño "Strategy"
- Aplicación del patrón de diseño Decorator
- Aplicacion del patron de diseño Strategy 2
- Reporte Refactoring 1
- Reporte refactoring 2 HOT 1
- Java 17 support & java-json-benchmark HOT 5
- Concerns regarding the way jsoniter is implemented for high performance parsing
- Java HOT 1
- Json java
- helloworld
- 递归循环报错,引发StackOverflowError HOT 1
- JsonStream.serialize error,cause StackOverflowError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java.