RESTEasy gives NoClassDefFoundError for HeaderParameterParser - google-chrome

I have written simple RESTEasy Hello World web-service. It used to work just fine when invoked from IE or from within Eclipse(RAD), but when I hit it from Google Chrome, it used give Exception saying.
com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet RestEasy: java.lang.NoClassDefFoundError: org/jboss/resteasy/util/HeaderParameterParser
at org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate.parse(MediaTypeHeaderDelegate.java:57)
at org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate.fromString(MediaTypeHeaderDelegate.java:18)
at javax.ws.rs.core.MediaType.valueOf(MediaType.java:150)
at org.jboss.resteasy.util.MediaTypeHelper.parseHeader(MediaTypeHelper.java:203)
at org.jboss.resteasy.plugins.server.servlet.ServletUtil.extractAccepts(ServletUtil.java:120)
at org.jboss.resteasy.plugins.server.servlet.ServletUtil.extractHttpHeaders(ServletUtil.java:83)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:186)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1224)
But now this Exception is occurring in all the cases.
I am sure that the jar file containing HeaderParameterParser class which is restreasy-jaxrs2.2.3.GA.jar is on the classpath.
I am using
RESTEasy 2.2.3.GA(also tried with 3.o.1Final).
Websphere Application Server v8.0
RAD 8.0
Maven

Related

Can I deploy a Grails 4 app to Google Cloud Platform?

I have been able to run through the following Grails 3 guide for deploying a Grails application to GCP.
https://guides.grails.org/grails-google-cloud/guide/index.html
I've tried to mirror this using my own Grails 4 application but it fails when I try to access it.
appengineDeploy completes successfully but when I try and access the webapp URL, I get a long stacktrace which culminates in the following error;
Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/mysql/cj/api/io/SocketFactory
...
...
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.api.io.SocketFactory
I've been trying all sorts of various versions of the socket factory dependency to try and solve and redeploy but all result in the same error.
I have used various version of the j-6 connector (com.google.cloud.sql:mysql-socket-factory-connector-j-6) and my most recent attempt used the j-8 (1.0.14).
At this point it would be great to even know if what I'm trying is even possible. Java 11 support has been added quite recently and I have made the necessary config adjustments to get my app to deploy, but I cannot then access it.
Upgrading to version 8 of mysql-connector-java in tandem with mysql-socket-factor-connector-j-8 appears to have made this particular issue go away (and moved me to the next).
Dependencies are as follows;
runtime "mysql:mysql-connector-java:8.0.15"
runtime "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.0.14"

java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;

When I try to create a RemoteWebDriver in 3.11, I see this error below.
This worked fine up through 3.10. I've reverted to 3.10 for now.
I tried adding in the gson jar from google, but I still see same error.
Anyone else see this? I'm running one selenium server as hub, and then running
a node against it with webdriver for ff or chrome, same issue.
com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
at org.openqa.selenium.json.Json.(Json.java:47)
at org.openqa.selenium.logging.profiler.HttpProfilerLogEntry.constructMessage(HttpProfilerLogEntry.java:37)
at org.openqa.selenium.logging.profiler.HttpProfilerLogEntry.(HttpProfilerLogEntry.java:29)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:135)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:209)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:132)
at oracle.ojet.automation.test.selenium.WebDriverManager._buildRemoteWebDriver(WebDriverManager.java:573)
This error message...
java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
...implies that the JVM was unable to find the method setLenient()Lcom/google/gson/GsonBuilder.
Reason
Release Notes of Selenium v3.10.0 clearly mentions:
Migrate Selenium Grid to reduce exporting GSON and Apache HttpClient as much to public APIs.
Further, Release Notes of Selenium v3.12.0 clearly mentions:
Remove GSON from how we coerce JSON to Java types.
Clean up the internals of Selenium's JSON handling, including deprecating places where GSON leaks from our APIs.
Finally, Release Notes of Selenium v3.13.0 clearly mentions:
Introduced our own JSON parser and outputter, allowing GSON to be removed from our dependencies.
Solution
To get rid of the warning and errors upgrade to Selenium v3.14.0, where Release Notes clearly mentions:
Completely removed the GSON dependency. We now use reflection to try and find the class.

java.lang.No classDefFound error while using PEXML for android in Libgx

I am using PEXML library for giving physics to bodies in my game. It worked very well in desktop but when I ran in android it is giving me error at code
playerPhysics = new PEXML(Gdx.files.internal("data/physics.xml").file());
and showing error
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/JAXBContext; at com.hi5dev.box2d_pexml.PEXML.loadXML(PEXML.java:124) at com.hi5dev.box2d_pexml.PEXML.(PEXML.java:24)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.JAXBContext" on path: DexPathList[[dex file "/data/data/com.myplayer.football/files/instant-run/dex/slice-slice_9...
Google search shows javax.xml.bind.JAXBContext is in the file javax.xml.bind.jar
Java needs to find this file at runtime. It looks for it in your Java classpath ( set of directories ).
You need this Jar to be in your runtime classpath
The error you wrote about shows you the classpath.
You can either
put javax.xml.bind.jar in the current classpath
or
Modify the classpath to include the location of javax.xml.bind.jar
Lookup how to modify the Java classpath for your operating system.

Dependent JARS for producing RESTful JSON

I have written a RESTful service in java and want to produce json out of the get method. I was struggling with many no class def found error due to issues in jar versions or dependencies.
For example
Jackson error: java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/Versioned
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonMappingException$Reference
I have created a dynamic web project in eclipse and added the jars in classpath and Maven is not used here.
Any idea on the list of dependent jars ??
I have finally found the jar versions and dependencies

Glassfish Embedded does not start

My glassfish 3.2 embedded was starting with Arquillian and Junit perfectly and now I've getting this Exception in eclipse.
I've replace .m2 repository and it doesn't start.
Anybody could help me:
java.lang.RuntimeException: Could not setup GlassFish Embedded Runtime
Caused by: org.glassfish.embeddable.GlassFishException: A MultiException has 2 exceptions.
1. java.lang.IllegalArgumentException: The scope name given in the descriptor (org.glassfish.hk2.api.PerLookup) did not match the scope annotation on the class (javax.inject.Singleton) in class CommandExecutorImpl
2. java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
implementation=com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl
contracts={com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl,org.glassfish.embeddable.CommandRunner
at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:138)
at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.setup(GlassFishContainer.java:138)
... 62 more
I've solved this question deleting all workspace project and eclipse .metadata and RemoteSystemsTempFiles folders, after that I've dowloaded all project with "Checkout Project" and the glassfish-embedded using Junit 4 have started normally.