<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Access Cloud Connector data from Spring Boot in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418771#M52051</link>
    <description>&lt;P&gt;I also have similar requirement but without springboot.&lt;/P&gt;&lt;P&gt;I have a web.xml filebut still I am facing same set of isues.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shirjan&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2017 08:43:58 GMT</pubDate>
    <dc:creator>shrijan_shrivastav</dc:creator>
    <dc:date>2017-05-08T08:43:58Z</dc:date>
    <item>
      <title>Access Cloud Connector data from Spring Boot</title>
      <link>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaq-p/418770</link>
      <description>&lt;P&gt;I want to access data which has been served by the Cloud Connector and which is successfully connected to my Cloud Platform account. Now I want to access this data within a Spring Boot application and display the data on a web page.&lt;/P&gt;&lt;P&gt;But I get an error when I try to access the connectivityConfiguration resource:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;javax.naming.NamingException: Cannot create resource instance&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In Spring Boot I have no web.xml, so I try to do it this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;@Bean
public TomcatEmbeddedServletContainerFactory tomcatFactory() {
    return new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer(Tomcat tomcat) {
            tomcat.enableNaming();
            return super.getTomcatEmbeddedServletContainer(tomcat);
        }
        @Override
        protected void postProcessContext(Context context) {
            ContextResource resource = new ContextResource();
            resource.setName("connectivityConfiguration");
            resource.setType(com.sap.core.connectivity.api.configuration.ConnectivityConfiguration.class.getName());
            context.getNamingResources().addResource(resource);
        }
    };
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I access the InitialContext, I see the connectivityConfiguration key in the list of resources, but when I try to access it like that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Context context = new InitialContext();
Object conObj = context.lookup("java:comp/env/connectivityConfiguration");
ConnectivityConfiguration configuration = (ConnectivityConfiguration) conObj;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.. I get the exception I mentioned above. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any idea?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2024 21:00:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaq-p/418770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2024-02-03T21:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Access Cloud Connector data from Spring Boot</title>
      <link>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418771#M52051</link>
      <description>&lt;P&gt;I also have similar requirement but without springboot.&lt;/P&gt;&lt;P&gt;I have a web.xml filebut still I am facing same set of isues.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shirjan&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 08:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418771#M52051</guid>
      <dc:creator>shrijan_shrivastav</dc:creator>
      <dc:date>2017-05-08T08:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Access Cloud Connector data from Spring Boot</title>
      <link>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418772#M52052</link>
      <description>&lt;P&gt;I have the same issue (also without spring-boot, just spring framework). Any news on that?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 07:43:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418772#M52052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-01T07:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Access Cloud Connector data from Spring Boot</title>
      <link>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418773#M52053</link>
      <description>&lt;P&gt;I have two applications deployed and I missed the resource-ref entry in the web.xml of one of the web applications, but I needed it in both. So it wasn't related to spring at all.&lt;/P&gt;&lt;P&gt;Hope that helps someone.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 14:18:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418773#M52053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-01T14:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Access Cloud Connector data from Spring Boot</title>
      <link>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418774#M52054</link>
      <description>&lt;P&gt;Since you do not use the embedded Tomcat on SAP CP, you won't need the TomcatEmbeddedServletContainerFactory stuff.&lt;/P&gt;&lt;P&gt;I provided a context.xml including a &amp;lt;Resource&amp;gt; tag for the ConnectivityConfiguration and placed that file in "src/main/webapp/META-INF". Don't use "src/main/resources/..." also it is suggested for Spring Boot. Then you'll be able to lookup the JNDI resource...&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 19:53:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-cloud-connector-data-from-spring-boot/qaa-p/418774#M52054</guid>
      <dc:creator>detrapto</dc:creator>
      <dc:date>2017-06-02T19:53:59Z</dc:date>
    </item>
  </channel>
</rss>

