Error in Javac compilation for JSP

206 views
Skip to first unread message

Kudret Güler

unread,
Mar 7, 2017, 9:25:55 AM3/7/17
to Payara Forum
Hi,

This is a Glassfish 4.1.1 build 1 instance. Can you please suggest what may be wrong?
https://gist.github.com/Kudret/b3c37cf5f3bdd0cf564d49dc0ade28ca

Thank you,
Kudret

Steve Millidge

unread,
Mar 7, 2017, 3:12:19 PM3/7/17
to Payara Forum
Check you deployment descriptor in your war file for initialization attributes like compilerSourceVM or compilerTargetVM it is also possible that these parameters are set in your default-web.xml in the config directory of your domain.

Kudret Güler

unread,
Mar 7, 2017, 4:11:34 PM3/7/17
to Payara Forum
Thank you! Setting compilerSourceVM and compilerTargetVM to 1.8 in default-web.xml fixed the issue. Any guesses why jspc may have defaulted to 1.5 all of a sudden?

Ondrej Mihályi

unread,
Mar 7, 2017, 5:12:49 PM3/7/17
to Kudret Güler, Payara Forum
Is it possible that you weren't using any Java6+ features in the JSPs? I think that those Java version warnings appear only in case of compile failure, so probably you were using javac 1.5 even before, but problems appeared only when you started to use more modern syntax.

Also, be aware that Payara Server 171 fixes an annoying issue with precompiled JSPs - https://github.com/payara/Payara/pull/1267
With GlassFish and older versions of Payara Server, the JSP compiler was always using javac 1.5 when precompiliing JSPs at deploy time, even when compilerSourceVM and compilerTargetVM were set to higher versions.

Ondrej

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/ccbc2f9b-98f8-42d3-a088-791f407ed681%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Kudret Güler

unread,
Mar 8, 2017, 9:55:50 AM3/8/17
to Payara Forum, kudr...@gmail.com
I don't think the jsp file in error is using more features than it did before. I only added a "c:choose" block additionally. Depending on how the war file is deployed (precompilejsp enabled versus not) I got slightly a different version of the error in which some_jsp.java was generated but failed to compile with the same error. Investigating the _jsp.java file I did not see any multi catch blocks or try with resources generated, either.

Kudret


On Tuesday, March 7, 2017 at 5:12:49 PM UTC-5, Ondrej Mihályi wrote:
Is it possible that you weren't using any Java6+ features in the JSPs? I think that those Java version warnings appear only in case of compile failure, so probably you were using javac 1.5 even before, but problems appeared only when you started to use more modern syntax.

Also, be aware that Payara Server 171 fixes an annoying issue with precompiled JSPs - https://github.com/payara/Payara/pull/1267
With GlassFish and older versions of Payara Server, the JSP compiler was always using javac 1.5 when precompiliing JSPs at deploy time, even when compilerSourceVM and compilerTargetVM were set to higher versions.

Ondrej
2017-03-07 22:11 GMT+01:00 Kudret Güler <kudr...@gmail.com>:
Thank you! Setting compilerSourceVM and compilerTargetVM to 1.8 in default-web.xml fixed the issue. Any guesses why jspc may have defaulted to 1.5 all of a sudden?

On Tuesday, March 7, 2017 at 3:12:19 PM UTC-5, Steve Millidge wrote:
Check you deployment descriptor in your war file for initialization attributes like compilerSourceVM or compilerTargetVM it is also possible that these parameters are set in your default-web.xml in the config directory of your domain.

On Tuesday, 7 March 2017 14:25:55 UTC, Kudret Güler wrote:
Hi,

This is a Glassfish 4.1.1 build 1 instance. Can you please suggest what may be wrong?
https://gist.github.com/Kudret/b3c37cf5f3bdd0cf564d49dc0ade28ca

Thank you,
Kudret

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages