Jetty IllegalArgumentException when using 1.9.30 GAE - java

I've been on a very old version of GAE for a long time. Every time I try to update to the latest version I get this error when deploying it to GCP:
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is
Java 7: org/eclipse/jetty/http/BadMessageException.class in C:\Users\XXXXXXXXXXX\
backendservlet\build\exploded-app\WEB-
INF\lib\jetty-http-9.3.2.v20150730.jar
I think jetty comes with GAE so how do I fix this? When I deploy it locally it runs without errors. It also builds without error. This only happens when deploying to GCP.
My appengine instance is on JAVA 7 runtime so maybe that's the issue? How do I change that? I tried deplying with a different version and name and it still didn't work.
Please help.

Looks like jetty (or at least the version you're using) needs Java 8, which is not supported on GAE: Does Google App Engine support Java 8?.

GAE does not yet support Java 8. If jetty is a dependency of your project, you need to use a version that has source 1.7. Otherwise delete C:\Users\XXXXXXXXXXX\
backendservlet\build\exploded-app\WEB-
INF\lib\jetty-http-9.3.2.v20150730.jar

Related

Apache Camel 2.20.2 compatibility with JDK 11

I'm working on Oracle JDK 8 to AdoptOpenJDK 11 migration. We are also using Apache Camel 2.20.2. After JDK migration, I'm facing below issues in Camel Context XML file.
not able to recognize exchangePattern parameter
enum value not permissible
Even after having above issues, sometimes my application runs successfully and sometimes it gives error that it is not able to create spring bean. While creating below bean it says trustAllPackages is not a valid parameter which I know is not actually causing the issue.
bean creation
I think the issue is somewhat related to the errors in XML file. My question is:
Is Camel 2.20.2 compatible with JDK 11? If not, are above errors result of this incompatibility?
How to resolve these errors and why isn't this causing issue every time I run my application?
Currently we are using :
AdoptOpenJDK 11
Spring 4.3.11.RELEASE
Camel 2.20.2
ActiveMQ 5.15.0
Maven Build Tool
Thanks in advance.
You can see here what JDK version Camel supports
https://camel.apache.org/manual/latest/what-are-the-dependencies.html
Camel 2.x only supports Java 8.
You need Camel 3.x for Java 11 support.

How to deploy war in wild fly server?

we are using one java application in wildfly server which uses java 1.8.0_202, now we want to migrate the java from oracle jdk to adoptopenjdk. I changed the path of new openjdk in management console of wildfly server.
Now the question is do we need again rebuild the application using adoptopenjdk or can i use the old war which is deployed.
Thanks in advance!..
As I cannot comment because of lack of reputation as an answer:
Normally you can run a Java Application without knowledge of the Java it was built with if the versions match. Second: Why don't you just try it? If you have these strong concerns you should try it in a test environment.
You should not need to do anything to migrate from an Oracle JDK to OpenJDK. Just change the path to the JAVA_HOME and that's it. The only possible issues would be if you use Oracle specific API's which one should not be doing anyway :)

intellij gives error of non-whitelisted class with app engine using java 8

AFAIK App Engine supports all standard java libraries when project uses java 8. For some reason Intellij show this as an error. I can run local development server and deploy this project to app engine and it works ok.
I think I could just disable the check for forbidden code in App Engine but is there something else that would actually be forbidden with java 8 also.
Is this issue with gcloud plugin or intellij...?
Edit:
Added project structure
As per documentation The App Engine Java 8 runtime supports the standard public Java library, so there shouldn't be any limitations.
Ther has been an issue (#CrazyCoder's comment) opened in google-cloud-intellij library which has been resolved in the latest version.
IntelliJ Ultimate 2018.2 build on July 2018 solved the issue

IntelliJ 2016.3 GAE Deploy Java8/7

I'm new at IntelliJ and I created a new empty project(Google App Engine) and changed the bytecode level to 7, but I get this error in deployment:
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: org/eclipse/jetty/apache/jsp/JettyJasperInitializer$1.class in C:\Recursos\appengine-java-sdk-1.9.48\jetty93\jetty-distribution\lib\apache-jsp\org.eclipse.jetty.apache-jsp-9.3.14.v20161028-nolog.jar
Unable to update app: Class file is Java 8 but max supported is Java 7: org/eclipse/jetty/apache/jsp/JettyJasperInitializer$1.class in C:\Recursos\appengine-java-sdk-1.9.48\jetty93\jetty-distribution\lib\apache-jsp\org.eclipse.jetty.apache-jsp-9.3.14.v20161028-nolog.jar
I found this answer GAE Deploy Java8/Java7 Error, but I can't find the pom file.
I have encountered the same problem after updating to appengine-java-sdk-1.9.48, and switching to 1.9.46 fixed the problem.
You may download the 1.9.46 at https://storage.googleapis.com/appengine-sdks/featured/appengine-java-sdk-1.9.46.zip
HTH
Using the IntelliJ plugin, one can deploy to the flex environment, using the 1.8 JDK, as documented on the IntelliJ IDEA Google Cloud Tools plugin documentation page.
Still, to deploy in the app engine standard environment (not flex), one needs to choose the 1.7 version of the JDK, as documented on the "Setting up IntelliJ IDEA Ultimate Edition for Java Development and Debugging of App Engine Standard Environment Apps" page: “The Java SDK should be set to Java 7.”

Windows Service starting Java not working since Java Upgrade to 8

We've updated our buildserver (Atlassian Bamboo) to Java 8 (JDK).
Since then our integrationtests are failing because our started product does not open any port.
We are building with maven and as part of the integrationtest we are starting our builded product. Our product is a Rest-Api based in an OSGI (equinox) and Jetty.
I tried a lot of things, but nothing helped me to get the product start properly in the maven build.
When I log in on my remote machine and start the product manually everything works fine.
Some more information:
Our buildserver runs as a windows service and our product is written in plain Java.
Presumably you are affected by one or more of the issues discussed in Custom AMIs will not start anymore in Bamboo Cloud (BAM-16291), notably that Bamboo is not compatible with JDK8u60 yet:
Joda-time, one of the libraries used by Bamboo is not compatible with
8u60. We've fixed this problem, but the fix has not been rolled out
yet. Known breakages include S3 interaction and CodeDeploy plugin.
Most/All participants got things working again by downgrading to JDK8u45, as also recommended in Atlassian's most recent update:
Use JDK 8u45. The latest JDKs are incompatible with some 3rd party libraries we're using.
Try to match the layout and scripts of our stock images as closely as possible. This will make it easier for us to provide help if
anything goes wrong.
Choose Oracle if you have the choice between Oracle and OpenJDK flavor of JDK.

Categories

Resources