Using JDK15's JEP 378 text blocks in Tomcat JSP pages - java

Sample code:
String s = """
test
""";
%>
Getting.
org.apache.jasper.compiler.JDTCompiler.generateClass Unsupported target VM [15] requested, using [13]
/usr/local/tomcat/bin/version.sh reports:
Server version: Apache Tomcat/9.0.38
JVM Version: 15+36-1562
At http://tomcat.apache.org/tomcat-10.0-doc/changelog.html I see:
Add support for specifying Java 14 (with the value 14) and Java 15 (with the value 15) as the compiler source and/or compiler target for JSP compilation. If used with an ECJ version that does not support these values, a warning will be logged and the latest supported version will used. (markt)
Anyone had any success getting Text Blocks working on non-alpha Tomcat?

Related

WARN EclipseJavaCompiler Using unsupported java version '11', assuming latest supported version '9' when running AEM 6.5 on Java 11

When running AEM 6.5.3 on Java 11 I noticed suspicious WARN messages appearing in error.log from time to time:
08.01.2020 16:33:06.236 WARN [10.0.2.2 [1578497585926] GET /editor.html/content/* HTTP/1.1] org.apache.sling.commons.compiler.impl.EclipseJavaCompiler Using unsupported java version '11', assuming latest supported version '9'
It looked like a warning during JSP compilation but forcing JSP recompilation is not triggering this WARN. I wonder if this is a known issue and if it can cause any troubles when executing JSPs?
It looks like this issue is already fixed in SLING-8322 but is not released yet. I assume that, at the moment of writing, it is impossible to use Java 10+ code in any AEM JSP files. Beyond that, all works fine - experience from two different projects.

GWT RemoteServiceServlet Java 6

I need to deploy my GWT application to an OC4J server using Java 6.
I'm using GWT SDK 2.7.0 - according to the release notes while Java 7 is the default, this can be overridden using -sourceLevel 6 which in Eclipse I am adding as a compiler argument.
This has solved most of the problems the OC4J progress text gave me when deploying my war - but one seems to remain.
Operation failed with error: com/google/gwt/user/server/rpc/RemoteServiceServlet : unsupported classversion 51.0
Ignoring the specificity of OC4J, why is the RemoteServiceServlet a Java 7 class, when I have set the GWT compiler to use Java 6?
It sounds like you aren't using the right version of GWT - either that isn't 2.7.0, or you are using the wrong jar:
$ javap -cp /Users/colin/.m2/repository/com/google/gwt/gwt-servlet/2.7.0/gwt-servlet-2.7.0.jar -v com.google.gwt.user.server.rpc.RemoteServiceServlet
Classfile jar:file:/Users/colin/.m2/repository/com/google/gwt/gwt-servlet/2.7.0/gwt-servlet-2.7.0.jar!/com/google/gwt/user/server/rpc/RemoteServiceServlet.class
Last modified Nov 20, 2014; size 11978 bytes
MD5 checksum ef76115d101d7321764ed74a7d8c1d62
Compiled from "RemoteServiceServlet.java"
public class com.google.gwt.user.server.rpc.RemoteServiceServlet extends com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet implements com.google.gwt.user.server.rpc.SerializationPolicyProvider
minor version: 0
major version: 50
...
I just checked gwt-user also, and it too is 50.0, check that your gwt-servlet is actually the version you think you are using?

Why won't Palantir QS 3.8 recognise its own XML export?

Hello Palantir community on StackOverflow - if you exist?
I'm having a problem with pXML and PXZ files on a QuickStart instance (see below for details). If I export from Graph (even if only a few relatively small Objects), then try and reimport that file, I get the error message,
Error: The file [file path & name] is not a valid .pxz file:
com.palantir.exceptionPalantirUserMessageException. Unexpected error
while validating PalantirXML; please see the log for details.
The log will then give some version of,
Value " with length = '0' is not faced-valid with respect to minLength
'1' for type #AnonType_namedataSource;.
Multiple Java error references will then follow (195, 131, 384, 318, etc).
So this seems to be an issue with Palantir writing an XML file badly, then not recognising it when you try to reimport.
The XML file itself seems ok - it's not very small, all the XML tags close off, etc. But clearly there's a value somewhere that's meant to be a positive, and it's not being populated in the correct way. The errant tag isn't obvious, if that's the case.
Weirdly, I can usually export a single Object (or maybe two or three) - but not if the Object is too complex (eg has lots of Properties).
I'm using an installation of Palantir Quick Start 3.8 (3.8.2.8.603030, Java Version: 1.6.0_30 Sun Microsystems Inc. - Java HotSpot(TM) 64-Bit Server VM build 20.5-b03 64-bit).
I've tried various configurations of Java updates (6.3 32 & 64, 7.25 32 & 64, no Java update (Pal 3.8 comes with 6.3).
The computer is an Intel, 2.7 Ghz with 16 GB of RAM, running Windows 7 (SP1), 64bt.
I tried disabling the AV (McAfee) and Windows firewall - no difference.
I'll leave it there for now - very grateful for any advice / suggestions.
R
That's an old version of Palantir! I worked on the code you're seeing errors with through many versions of Gotham. The problem is that the first step in the import process is validating the pXML against its .xsd file. While writing, the library makes sure the XML is syntactically valid, but doesn't verify it against the schema.
That error makes it sound like a DataSource is missing some value that's required by the schema. Exporting from a new Investigation may work, but this bug would need to be fixed by a Palantir developer.
You could also try it later version where it may be fixed already.

WAS 6.1 shows Java version 5, but its really 1.4

I have a strange problem.
I have configured our Websphere Application Server to run Java 5. Its a really old application that I have migrated from Java 4.
If I in the jsp page print
System.getProperty("java.version")
System.getProperty("java.specification.version")
System.getProperty("java.vm.name")
I get
Java version: 1.5.0
java.specification.version: 1.5
java.vm.name: IBM J9 VM
However, If I in the jsp change the code from List to List<Object> I get the following exception:
The type ArrayList is not generic; it cannot be parameterized with arguments <Object>
JSPG0091E: An error occurred at line: 79 in the file: /jsp/archive/archiveoverview.jsp
JSPG0093E: Generated servlet error from file: /jsp/archive/archiveoverview.jsp
C:\SDP75\runtimes\base_v61\profiles\was61profile1\temp\CR122599Node01\server1\myifEAR\myif.war\jsp\archive\_archiveoverview.java : 199 : Syntax error, parameterized types are only available if source level is 5.0
How can this be???
The JVM used to run WebSphere Application Server is different from the compiler compliance level used to compile JSPs running within the server. See this technote: Using Java 5 language feature in a JSP targeting WebSphere Application Server v6.1.

500 server error with servlet after deploy it on app engine

please take a look to my problem below i deployed my website (java) on my app engine account the url it work to show html and jsp pages but the servlet pages it make error rather than show it correctly this is what appear:
Error: Server Error The server encountered an error and could
not complete your request. If the problem persists, please report your
problem and mention this error message and the query that caused it.
notice :: that all work on localhost server but on app engine !! what can i
do to avoid this problem !!!!
web/ASS2webServlet : Unsupported major.minor version 51.0, java.lang.UnsupportedClassVersionError
Indicates that you are using a higher version of Java than GAE supports. Quoting from documentation of GAE:
"App Engine runs Java applications using the Java 6 virtual machine (JVM). The App Engine SDK supports Java 5 and later, and the Java 6 JVM can use classes compiled with any version of the Java compiler up to Java 6"
So can you check what version are you using on local Eclipse to compile your classes?

Categories