getPageContext().GetRequest() error with Caucho Resin

Hi!

I’m trying to find out the port, on which the current application-server instance is running (in a setup behind a reverse proxy).
For years, I used GetPageContext().getRequest().getOriginalRequest().getLocalPort() in Lucee 4.5.
As I’m now migrating to 5.2.8.50 I get an exception.
Even throws an error. Is this intended or a bug?
Is there an equivalent function to get the LocalPort?

Thanks in advance
Michael

What error do you get? I just tried that code on trycf.com, which is running 5.2.9-RC and it runs fine without error (and returns 80)

This is the stacktrace.

lucee.runtime.exp.NativeException: javax/servlet/http/HttpUpgradeHandler at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetPublicMethods(Class.java:2902) at java.lang.Class.getMethods(Class.java:1615) at lucee.runtime.dump.DumpUtil.toDumpData(DumpUtil.java:576) at lucee.runtime.functions.other.DumpStruct.call(DumpStruct.java:92) at lucee.runtime.functions.other.DumpStruct.call(DumpStruct.java:81) at dump_cfc$cf.udfCall1(/Dump.cfc:107) at dump_cfc$cf.udfCall(/Dump.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:107) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:212) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:695) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:573) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2014) at lucee.runtime.tag.CFTag.cfcStartTag(CFTag.java:400) at lucee.runtime.tag.CFTag.doStartTag(CFTag.java:179) at _skriptkiste.getpagecontext_cfm$cf.call(/_skriptkiste/getpagecontext.cfm:7) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:931) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:821) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:225) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2462) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2452) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2425) at lucee.runtime.engine.Request.exe(Request.java:44) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1091) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1039) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:97) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:109) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:95) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:290) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:840) at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1362) at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1318) at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1302) at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1210) at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:1006)

I got it.

javax.servlet-api-3.1.0.jar was missing.

Seems not to be included in a clean install with Caucho Resin.