0

I am using SoapUI 5.7.0 to generate a .war file that represents a simple endpoint where I send a POST and get a 201 created response. On another host, I am running an Apache Tomcat instance version 9.0.73. When I startup the server it starts up fine and I get the landing page. When I query my endpoint I get:

BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 61

I have Java 17 on my remote host and Java 11 on my localhost where SoapUI is running.

I've tried running apache tomcat 9.0.73 and 10.1.5 but get errors.

  • 1
    There's a mismatch between the JVm that generated the war file and the one running on tomcat host. You should compile for the version on the latter. One way to do that could be to make soapui run (and generate the war) with the same JVM version of tomcat's JVM – LMC Mar 31 '23 at 13:47
  • I don't understand the error in that case. Its complaining that its seeing a file with major version 61 which corresponds to Java 17, but I'm building the .war with Java 11. My Java 17 should be able to support major version 61 and earlier versions, shouldn't it? – user13893642 Mar 31 '23 at 14:06
  • But you have to tell the compiler that you are compiling for a previous version. Default compile version is latest for that JDK. – LMC Mar 31 '23 at 15:01
  • I'm making the war on my localhost which has Java 11 and then running it on my remote host which is Java 17. Does Java compile more code from the .war? I thought the .war is compiled Java code, so my compiler is 11 and my runtime is 17. I guess if it has to compile more code out of the .war that would make sense. – user13893642 Mar 31 '23 at 15:29
  • Looks like the opposite according to the error message, runtime is 11 and compiled 17. Double [check versions](https://stackoverflow.com/a/75247102/2834978) on both sides. `java.class.version = 55.0 java.version = 11.0.17` – LMC Mar 31 '23 at 15:35
  • My remote is definitely JDK 17 and my local is definitely 11. That's why I'm not understanding the error. – user13893642 Mar 31 '23 at 15:42
  • Is soapui running its own jvm? – LMC Mar 31 '23 at 15:43
  • It does appear that SOAP UI has an embedded JRE.https://community.smartbear.com/t5/SoapUI-Open-Source-Questions/How-to-change-the-used-java-version-of-SoapUI/td-p/117780 – user13893642 Mar 31 '23 at 15:55
  • 1
    The embedded version on my local is 16. I guess i'll just change it. – user13893642 Mar 31 '23 at 16:00
  • You know what, I don't understand why this is happening. I'm just going to write a small standalone spring app and run it from the command line. If anyone finds this thread and figures it out please let me know. – user13893642 Mar 31 '23 at 16:39

0 Answers0