Skip to Content
0

Need Help in regards to Get ConnectivityConfiguration using cloud API

May 08, 2017 at 06:04 AM

594

avatar image
Former Member

I am trying to get details of destination defined in Hana Cloud Platform account using neo java web sdk. In sdk, there is an interface ConnectivityConfiguration, but how can I get instance of this? Using context lookup, I can get the instance of HttpDestination. But how can I get instance to ConnectivityConfiguration/DestinationConfiguration? I need some property values defined in the destination at runtime.

javax.naming.Context ctx = new javax.naming.InitialContext();

(HttpDestination) ctx.lookup(destinationPath);


Context ctx = new InitialContext(); 
		
		//ctx.addToEnvironment("connectivityConfiguration", "com.sap.core.connectivity.api.configuration.ConnectivityConfiguration");
		
		//Hashtable<String, String> mytable = ctx.
		
		//Context context = (Context)ctx.lookup("java:comp/env");
		ConnectivityConfiguration configuration = (ConnectivityConfiguration) ctx.lookup("java:comp/env/connectivityConfiguration");




<resource-ref>
		<res-ref-name>connectivityConfiguration</res-ref-name>
		<res-type>com.sap.core.connectivity.api.configuration.ConnectivityConfiguration</res-type>
	</resource-ref>
</web-app>

Server: Java Web Tomcat 8 Server




After all these steps I am facing some issue with JNDI NameNotFound Exception

13:39:06.485 [http-nio-8080-exec-4] ERROR java.lang.Throwable - javax.naming.NameNotFoundException: Name [connectivityConfiguration] is not bound in this Context. Unable to find [connectivityConfiguration].

13:39:06.490 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.NamingContext.lookup(NamingContext.java:816)

13:39:06.492 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.NamingContext.lookup(NamingContext.java:159)

13:39:06.493 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.NamingContext.lookup(NamingContext.java:827)

13:39:06.495 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.NamingContext.lookup(NamingContext.java:159)

13:39:06.497 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.NamingContext.lookup(NamingContext.java:827)

13:39:06.498 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.NamingContext.lookup(NamingContext.java:173)

13:39:06.499 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.naming.SelectorContext.lookup(SelectorContext.java:163)

13:39:06.501 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at javax.naming.InitialContext.lookup(Unknown Source)

13:39:06.501 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.SystemDetails.systemSetup(SystemDetails.java:39)

13:39:06.502 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.LoginService.doGet(LoginService.java:91)

13:39:06.503 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)

13:39:06.504 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

13:39:06.504 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)

13:39:06.505 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

13:39:06.506 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

13:39:06.507 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)

13:39:06.508 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

13:39:06.509 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

13:39:06.510 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

13:39:06.511 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)

13:39:06.512 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.cloud.runtime.impl.bridge.security.AbstractAuthenticator.invoke(AbstractAuthenticator.java:206)

13:39:06.513 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

13:39:06.514 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)

13:39:06.514 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:168)

13:39:06.515 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:94)

13:39:06.515 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.js.statistics.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:38)

13:39:06.516 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:27)

13:39:06.516 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)

13:39:06.516 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

13:39:06.517 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)

13:39:06.517 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)

13:39:06.518 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

13:39:06.518 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)

13:39:06.519 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)

13:39:06.519 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

13:39:06.520 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

13:39:06.520 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

13:39:06.521 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

13:39:06.521 [http-nio-8080-exec-4] ERROR java.lang.Throwable - at java.lang.Thread.run(Unknown Source)

Please let advise me is resolving the same if I am missing any Jar.

Regards

Shrijan

tomcat.png (560.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
May 16, 2017 at 02:45 PM
0

Hello All

I have found solution for the same.

While shipping the project just ensure that neo-sdk.jar is not in the generated war file.

Regards

Shrijan

Share
10 |10000 characters needed characters left characters exceeded