1
I rented a VPS server and when trying to connect my android application with Java EE, I received the following message:
type Exception report message app/server/CSelerServer : Unsupported major.minor version 52.0 (unable to load class app.server.CSelerServer) description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.UnsupportedClassVersionError: app/server/CSelerServer : Unsupported major.minor version 52.0 (unable to load class app.server.CSelerServer) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2899) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.
On the server, I have the WHM/Cpanel CENTOS 6.8 x86_64 Virtuozzo and use the Apache Tomcat as application server. In the project the client side (desktop and mobile) and server side I am using JDK 1.8.
I noticed that the server Tomcat is using JVM 1.7.0
I found two articles that say Centos/Tomcat does not support Java 1.8
https://blog.cpanel.com/tomcat-support-in-centos-7/
https://forums.cpanel.net/threads/tomcat-centos-7.462501/
Got it wrong?
If so, how should I proceed?
Go back to JDK1.7, change application server, change server OS or change control panel?
On localhost everything is working fine.
All help will be welcome.
I understood Victor, I worry a little about the fact that I have to go back to the Java7, I have a very large amount of code, although I would only need to go back to the Javaee part, but if that’s the solution I will do it. Wouldn’t it be the case to change the application server? Do you know one that supports java 8 in cPanel?
– Edson Santos
@Edsonfsantos What I’ve been researching, I can’t, but I’m not absolutely sure. What it looks like is that cPanel has left Java totally and never endured anything more than Tomcat. This means you will have to run the Tomcat outside the cPanel. If you prefer Jetty (I recommend), Glassfish, Wildfly or some other, you will also have to be outside the cPanel. Or, if you really want to keep cPanel, you’ll have to downgrade and stay in the old Tomcat.
– Victor Stafusa
Victor, was already starting the downgrade when the VPS support put Tomcat to work in cPanel with java8. Saved me a lot of trouble and now we know it’s possible. The app is working with the remote server :)
– Edson Santos
@Edsonfsantos Which version of Tomcat?
– Victor Stafusa
Apache Tomcat/7.0.42 --- JVM 1.8.0_101-B13
– Edson Santos
@Edsonfsantos Bem, according to this page, it will work with Java 6 or higher and with Java 7 or higher if you’re gonna use Websocket. You will be stuck to Specification 3.0 of Servlet (that is, you will not be able to use details of Servlets 3.1 and 4.0, but these are quite few). I mean, just switching the JVM should really be enough for you.
– Victor Stafusa