How to solve "java.lang.NoClassDefFoundError: org/json/JSONException" - eclipse

I am using marionette driver for testing with selenium. when I run the code it gives me the error:
java.lang.NoClassDefFoundError: org/json/JSONException.
Also gives error :
Found argument '--webdriver-port' which wasn't expected, or isn't valid in this context
Please help for the same
I have used "java-json.jar" however now it's give the error "org.openqa.selenium.WebDriverException: java.net.ConnectException: Connection refused:" so can you suggest what issue is for the same

Try adding java-json/.jar in your classpath.
Download the jar from Jar link

Related

errai GWT data binding getting failed

I am trying to run errai databinding in my GWT application
simply followed this tutorial , but with no luck
https://docs.jboss.org/author/display/ERRAI/Data+Binding
I am kept on getting errors, resolved some by adding some jars etc.
Now , I am getting this error which I am not able to resolve
[ERROR] Error generating BindableProxyLoaderImpl
java.lang.AbstractMethodError: org.jboss.errai.codegen.meta.MetaField.getDeclaringClassName()Ljava/lang/String;
Here is the screenshot of m console and the Jars i am using
Please guide
http://screencast.com/t/TdECCZNTxc

Play 2.5.3: Cryptic error message: Exception caught in Netty java.lang.NoClassDefFoundError

[error] p.c.s.n.PlayRequestHandler - Exception caught in Netty
java.lang.NoClassDefFoundError: Could not initialize class play.api.http.DefaultHttpErrorHandler$
at
I get error message and my app doesn't start in dev mode.
The error doesn't give me any details about what went wrong. I changed log level in logback.xml to DEBUG, but it didn't help.
Any suggestions how to investigate the problem? A week ago it worked just fine and since then there was no any changes in sources and configuration. It stopped working for an unknown reason.
Edit1: How do I enable more verbose logging? Otherwise it's absolutely unclear where the error comes from.
Edit2: changed the title
(Server started, use Ctrl+D to stop and go back to the console...)
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using no
de.js.
[error] p.c.s.n.PlayRequestHandler - Exception caught in Netty
java.lang.NoClassDefFoundError: Could not initialize class play.api.http.DefaultHttpErrorHandler$
at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:45)
at play.core.server.Server$class.getHandlerFor(Server.scala:65)
at play.core.server.NettyServer.getHandlerFor(NettyServer.scala:47)
at play.core.server.netty.PlayRequestHandler.handle(PlayRequestHandler.scala:82)
at play.core.server.netty.PlayRequestHandler.channelRead(PlayRequestHandler.scala:163)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
at com.typesafe.netty.http.HttpStreamsHandler.channelRead(HttpStreamsHandler.java:129)
at com.typesafe.netty.http.HttpStreamsServerHandler.channelRead(HttpStreamsServerHandler.java:96)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
[error] p.c.s.n.PlayRequestHandler - Exception caught in Netty
java.lang.NoClassDefFoundError: Could not initialize class play.api.http.DefaultHttpErrorHandler$
at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:45)
at play.core.server.Server$class.getHandlerFor(Server.scala:65)
at play.core.server.NettyServer.getHandlerFor(NettyServer.scala:47)
at play.core.server.netty.PlayRequestHandler.handle(PlayRequestHandler.scala:82)
at play.core.server.netty.PlayRequestHandler.channelRead(PlayRequestHandler.scala:163)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
at com.typesafe.netty.http.HttpStreamsHandler.channelRead(HttpStreamsHandler.java:129)
at com.typesafe.netty.http.HttpStreamsServerHandler.channelRead(HttpStreamsServerHandler.java:96)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
I don't know exactly what your problem is, but I encountered this cryptic, unhelpful error when I discovered an error in my application.conf where I was attempting to set a configuration based on an environment variable that may or may not be there. Clearly, the cause of the exception and the place it becomes apparent are pretty far apart.
So I would suggest checking your application.conf for a misconfiguration. Consider also any dependencies that might have been built for Play versions < 2.5. Basically anything that might cause the application to be "mis-initalized" for lack of a better term.
EDIT: I just discovered another cause of this error that falls under the category of "mis-initialization." I changed the name of a route in my routes file but forgot to change the corresponding reverse route in my template. I feel this should be caught sooner and with a more intuitive error, but regardless, look out for this (or something similar) as well in application.conf or routes.
Oops.. java.lang.NoClassDefFoundError: Could not initialize class play.api.http.DefaultHttpErrorHandler$ tells nothing what went wrong.
One such reason I have encountered is when I had missing/typos in my configuration properties and use guice injectors.
You can run your app in prod mode to see more informative error message activator clean compile start.
....
[info] Done packaging.
(Starting server. Type Ctrl+D to exit logs, the server will remain in background)
Oops, cannot start the server.
Configuration error: Configuration error[storage.conf # file:/myproject/mymodule/target/universal/stage/conf/storage.conf: 16: Could not resolve substitution to a value: ${storage.cluster.name}]
at play.api.Configuration$.configError(Configuration.scala:154)
....
In my case the below dependency was what was causing the error
libraryDependencies += "com.google.cloud" % "gcloud-java-storage" % "0.2.5"
Source Getting ChannelException when adding Google cloud client library to Play 2.5
In my case it was a missed } in the application.conf file :( .

Upgrading from gwt2.4.0 to gwt2.5.0 giving exceptions

I have a application for that i have updated from gwt2.4.0 to gwt2.5.0.
When i am running the application then seeing the following exception.
18:34:25.338 [ERROR] [OneViewUI] Errors in 'jar:file:/C:/Users/srapolu/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/core/client/GWT.java'
18:34:25.391 [ERROR] [OneViewUI] Line 276: The method setBridge(GWTBridge) in the type GWT is not applicable for the
arguments (GWTBridge)
can you please help.
I experienced the same issue. it turns out i had some references to the 2.4 version of gwt-dev.jar. make sure you don't have any and try again.

java.lang.NoSuchMethodError: net.sf.json.JSONObject.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object

After some time to work with eclipse, jboss and json I get this library json-lib-0.9.jar and added to jboss library so here the problem is that when I run the program I get
java.lang.NoSuchMethodError:
net.sf.json.JSONObject.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object
This error ocurs when i try to make json.put(key,value). json is define as JSONObject.
Can someone help me please i don't know how resolve this one:(
Thanks,
Radu
The exact error is
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/ExtJSFirstTry].[servlet.User]]
(http--127.0.0.1-8080-2) Servlet.service() for servlet servlet.User
threw exception: java.lang.NoSuchMethodError:
net.sf.json.JSONObject.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
You need to add the JSON library to your build path. Follow this tutorial .. http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)

No Class deffinition found jboss: java.lang.NoClassDefFoundError: org/jboss/kernel/Kernel

Hello I am having a problem using jboss from command line, i get the following error:
ERROR [AbstractKernelController] Error installing to PreInstall: name=WSKernelLocator state=Real
java.lang.NoClassDefFoundError: org/jboss/kernel/Kernel
Any reply will be appreciated. Thanks
Hmm, maybe JBoss archive was not unzipped properly? If you are working on Windows do not use built-in unzipper, it fails for larger archives. Use 7-Zip, WinRar, Total Commander, etc.