Open dogoku opened 9 years ago
Any reason why you're not using @CAPLIN.DEV.MODE@
to access the token? There's still the problem of JSPs not working correctly but using @ABC@
style tokens are the recommended way of accessing JNDI (or property file) token replacements (http://bladerunnerjs.org/docs/use/app_tokens/).
The tokens are replaced after jsp scriptlets are executed. Therefore if I need the value of the JNDI I need to read it myself. For example, given this token
<New class="org.eclipse.jetty.plus.jndi.EnvEntry">
<Arg><Ref id='webAppCtx'/></Arg>
<Arg>HELLO.WORLD</Arg>
<Arg type="java.lang.String">hello world</Arg>
<Arg type="boolean">true</Arg>
</New>
This line returns false
instead of true
<%= "@HELLO.WORLD@".equals("hello world") %>
Yes ok, that makes sense. Ive also checked the above using property file tokens and the same is true.
I managed to get the above working by using Java7 rather than Java8 (https://support.lucidworks.com/hc/en-us/articles/201784186-Error-in-Javac-compilation-for-JSP-in-LucidWorks-Search-UI). This is probably caused by our use of an old version of Jetty (the older versions are compiled for Java7 not Java8) which in turn comes from a requirement to use a very old version of the servlet API to support Java 6.
@dogoku, does running BRJS with Java 7 solve the problem for you too?
@andyberry88, didn't you create a branch where you spiked upgrading to a newer version of Jetty to address #1387?
This stack-overflow issue seems to be the best match I could find:
didn't you create a branch where you spiked upgrading to a newer version of Jetty to address #1387?
Yep, I've did a spike investigating adding http2 and SSL support. I upgraded to the latest (at the time) version of Jetty but I vaguely remember this required upgrading to version 3 of the servlet API and dropping support for Java6. I can have another look at that branch and work out how feasible an upgrade would be on Monday.
The https://github.com/BladeRunnerJS/brjs/tree/upgrade-jetty is the branch with the Jetty upgrade. As it stands it includes an upgrade to Jetty 9.3.0 and an upgrade to v3 of the servlet API. But it requires us to stop supporting Java 1.7 in dev (due to Jetty upgrade) and legacy versions of Tomcat (due to the servlet API upgrade). It does allow us to continue supporting Java 1.6 in production but this may be pointless since AFAIK most servers that use servlet API v3 don't support 1.6 anyway.
replace the ecj.jar with ecj-4.3.1.jar
I came across an exception when adding the following code in my index.jsp, in an attempt to read JNDI tokens from within the scriplet
The exception is caused by the 3rd line
500 error:
Call stack from terminal: