Skip to Content
0
Apr 24, 2013 at 08:59 AM

Problem with JNDI lookups in Hana Cloud

121 Views

Hi, in the app I am trying to run on NW Cloud (or HANA Cloud) I need a custom URLContextFactory (UCF). As per classic JNDI, the UCF is declared in a jndi.properties file that is looked up via the classpath.

This works fine in Tomcat. It does even work fine in Eclipse's virgo-tomcat-server-3.6.1. I believe it worked ok on HANA Cloud just last week. Now it says:

javax.naming.NoInitialContextException: Error occurred during a privileged operation [Root exception is java.lang.ClassCastException: class java.io.BufferedInputStream:null incompatible with class java.io.File:null] at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl.invokePrivilegedAction(SecurityAwareContextManagerImpl.java:81) at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl.newInitialContext(SecurityAwareContextManagerImpl.java:53) at org.eclipse.gemini.naming.TraditionalInitialContextFactoryBuilder$TraditionalInitialContextFactory.getInitialContext(TraditionalInitialContextFactoryBuilder.java:97) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.(InitialContext.java:175) at javax.naming.InitialContext.doLookup(InitialContext.java:265) at org.apache.jsp.index_jsp._jspService(index_jsp.java:104) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at com.sap.security.auth.service.webcontainer.internal.Authenticator.invoke(Authenticator.java:160) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:171) at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:86) at com.sap.js.statistics.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:25) at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:27) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:722)Caused by: java.lang.ClassCastException: class java.io.BufferedInputStream:null incompatible with class java.io.File:null at org.eclipse.gemini.naming.OSGiInitialContextFactoryBuilder.getFileDefinedJndiProperties(OSGiInitialContextFactoryBuilder.java:670) at org.eclipse.gemini.naming.OSGiInitialContextFactoryBuilder.getCombinedEnvironment(OSGiInitialContextFactoryBuilder.java:544) at org.eclipse.gemini.naming.OSGiInitialContextFactoryBuilder.createInitialContextFactory(OSGiInitialContextFactoryBuilder.java:132) at org.eclipse.gemini.naming.ContextManagerImpl.createNewInitialContext(ContextManagerImpl.java:129) at org.eclipse.gemini.naming.ContextManagerImpl.newInitialContext(ContextManagerImpl.java:65) at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl$NewInitialContextWithEnvironmentAction.run(SecurityAwareContextManagerImpl.java:122) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.gemini.naming.SecurityUtils.invokePrivilegedAction(SecurityUtils.java:45) at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl.invokePrivilegedAction(SecurityAwareContextManagerImpl.java:73) ... 35 more

Do we have an expert on the forum who would know about this?

Thanks! Henning