cancel
Showing results for 
Search instead for 
Did you mean: 

"Error - found in negative cache" for Component.js

Former Member
0 Kudos

Hi Experts,

I've created my own sandbox in Eclipse to test and extend Standard Fiori apps.

I've downloaden and uploaded a standard Fiori app (CRM_MYCONT) to my Eclipse workspace.

After that, I did the appconfig, the configuration of the proxy and the installation of the tomcatserver.

This all works fine.

So when I go to:

http://localhost:8080/CRM_MYCONT/test-resources/sap/ushell/shells/sandbox/fioriSandbox.html

I can see my Fiori luanchpad, with the CRM_MYCONT app:

When I click on the tile, I get the message that the app doesn't work:

In the javaconsole:

Failed to load resource: the server responded with a status of 404 (Not Found)

http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js Failed to load resource: the server responded with a status of 404 (Not Found)send @ sap-ui-core.js:27

sap-ui-core.js:80 2016-04-18 11:45:11 registerResourcePath ('cus/crm/mycontacts', '/CRM_MYCONT/') -  sap.ui.ModuleSystem

2http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js Failed to load resource: the server responded with a status of 404 (Not Found)send @ sap-ui-core.js:27

sap-ui-core.js:80 2016-04-18 11:45:11 registerResourcePath ('cus/crm/mycontacts', '/CRM_MYCONT/') -  sap.ui.ModuleSystem

sap-ui-core.js:80 2016-04-18 11:45:11 Application initialization failed due to an Exception:

Error: found in negative cache: 'cus/crm/mycontacts/Component.js' from /CRM_MYCONT/Component.js: 404 - Not Found

    at a1 (http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js:80:15688)

    at Object.jQuery.sap.require (http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js:80:19389)

    at g (http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js:144:57068)

    at Function.sap.ui.component.load (http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js:144:57886)

    at Object.sap.ui.component (http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js:144:56721)

    at j (http://localhost:8080/CRM_MYCONT/resources/sap/ushell/components/container/ApplicationContainer.js:2...)

    at u (http://localhost:8080/CRM_MYCONT/resources/sap/ushell/components/container/ApplicationContainer.js:2...)

    at w (http://localhost:8080/CRM_MYCONT/resources/sap/ushell/components/container/ApplicationContainer.js:2...)

    at Object.sap.ui.core.Control.extend.renderer [as render] (http://localhost:8080/CRM_MYCONT/resources/sap/ushell/components/container/ApplicationContainer.js:2...)

    at R.renderControl (http://localhost:8080/CRM_MYCONT/resources/sap-ui-core.js:144:140482) -  z @ sap-ui-core.js:80

sap-ui-core.js:80 2016-04-18 11:45:11 Error - found in negative cache: 'cus/crm/mycontacts/Component.js' from /CRM_MYCONT/Component.js: 404 - Not Found z @ sap-ui-core.js:80

sap-ui-core.js:80 2016-04-18 11:45:11 App kon niet worden geopend; probeer het later opnieuw -  z @ sap-ui-core.js:80

Layout.js:1 Uncaught TypeError: Cannot read property 'appendChild' of null

It looks like the Component.js can not be found.

But:

it's there...

What can be the problem?

KR,

Andy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Andy,

Your appconfig should look like below

{

"applications" : {

            "<semantic object>-<action>" : {

                "additionalInformation" : "SAPUI5.Component=<your application namespace>",

                "applicationType" : "URL",

                "url" : "/<Eclipse project>",

                "description" : "<app description>"

            }

    }

}

And if your app is using an odata service and not mock data, then try defining service uRL in your component.js as below. Also define a function for your getServiceURL like below. I had initially faced a lot of challenges to setup my App on Launchpad sandbox.

                serviceUrl : URI(

                    getServiceUrl("/sap/opu/odata/sap/<whatever>/"))

               }

function getServiceUrl(sServiceUrl) {

  // for local testing prefix with proxy

  // if you and your team use a special host name or IP like 127.0.0.1 for

  // localhost please adapt the if statement below

  if (window.location.hostname == "localhost") {

    var str = window.location.pathname;

    var patt = new RegExp(

        "test-resources/sap/ushell/shells/sandbox/fioriSandbox.html");

    if (patt.test(str)) {

      return "../../../../../" + "proxy" + sServiceUrl;

    } else {

      return "proxy" + sServiceUrl;

    }

  } else {

    return sServiceUrl;

  }

}

Former Member
0 Kudos

Hi Mathew,

I don't think it has someting to do with the proxy.

This is the error I get:

KR.

Former Member
0 Kudos

Looks like there is an issue with your file structure. Can you please send me screenshot of your Webcontent folder in your extension project. You previously sent a similar one for the standard app. 

Former Member
0 Kudos
Former Member
0 Kudos

Hi Mathew,

I found the problem...

I moved the files:

Component-dbg.js

Component-preload-dbg.js

Component-preload.js

Component.js

Configuration-dbg.js

Configuration.js

index.html

Main-dbg.controller.js

Main.controller.js

Main.view.xml

version.json

to the WebContent folder.

And now it's working

KR

Former Member
0 Kudos

Hi Mathew,

Now I get  the message that the OData call failes...

I added this in the web.xml file:


<!-- ============================================================== -->

  <!-- UI5 proxy servlet                                              -->

  <!-- ============================================================== -->

  <servlet>

  <servlet-name>SimpleProxyServlet</servlet-name>

  <servlet-class>com.sap.ui5.proxy.SimpleProxyServlet</servlet-class>

  </servlet>

  <servlet-mapping>

  <servlet-name>SimpleProxyServlet</servlet-name>

  <url-pattern>/proxy/*</url-pattern>

  </servlet-mapping>

  <context-param>

  <param-name>com.sap.ui5.proxy.REMOTE_LOCATION</param-name>

  <param-value>http://xxxx.atosorigin-ica.com</param-value>

  </context-param>

do I have to do something more?

KR

Former Member
0 Kudos

You also need to add the port

<param-value>http://xxxx.atosorigin-ica.com:XXXX</param-value>

Former Member
0 Kudos

Hi Mathew,

I found the problem.

I have to change the pad in the "Component-preload.js":

now it works.

KR,

Answers (2)

Answers (2)

arun_krishna567
Explorer
0 Kudos

Hi Andy,

Make an entry of your application in app.config file in your Eclipse environment and try to access your application.

Regards,

Arun Krishna

Former Member
0 Kudos

Hi,

the config file looks like this:

{

"applications" : {

             "CRM_MYCONT-display" : {

                "additionalInformation" : "SAPUI5.Component=cus.crm.mycontacts",

                "applicationType" : "URL",

                "url" : "/CRM_MYCONT",

                "description" : "My Contacts"

            }

    }

}

Former Member
0 Kudos

Hi,

Where can I find the app.config file?

Or do you mean fioriSandboxConfig.json?

KR,

saurabh_vakil
Active Contributor
0 Kudos

Hi Andy,

After deploying the extended app to the ABAP repository, go to SE80, select your BSP (corresponding to the extended app) and check if the Component.js file is visible.

Also can you post screen shots of your launchpad in LPD_CUST and the tile and target mapping properties from launchpad designer?

Regards,

Saurabh

Former Member
0 Kudos

Hi,

I am running the application local on a tomcat server (Version 8).