cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 : 500 Internal Server Error

nalini
Explorer
0 Kudos

Hello Everyone,

I am new to SAP UI5.

I am using :

SAP MII 14.0

UI5 version 1.14.0

Chrome

IE 10

I have written a simple html page using SAP UI5 in MII. The code is at the end.

The html page was working fine till I cleared the browser cache(I did in both chrome and IE).

After I cleared the browser cache I am getting an error.

GET http://Server:Port/sapui5/resources/sap-ui-core-dbg.js 500 (Internal Server Error) sap-ui-core.js:41

Uncaught ReferenceError: sap is not defined

Earlier I was getting this type of error for sapui5/resources/sap/ui/commons/library.js and sapui5/resources/sap/ui/commons/Button.js

http://Server:Port/sapui5/resources/sap-ui-core-dbg.js does not open (Also library.js and Button.js  do not open)

But http://Server:Port/sapui5/resources/sap-ui-core.js opens up.

I have selected Always refresh from server in IE and Disable cache in Chrome.

Please help me to resolve the issue.

Thanks,

Nalini


<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />

  <title>Test</title>

  <script id="sap-ui-bootstrap"
    type="text/javascript"
     src="/sapui5/resources/sap-ui-core.js"
    data-sap-ui-theme="sap_goldreflection"
               data-sap-ui-libs="sap.ui.commons" >
  </script>


  <script>
   var oLabel = new sap.ui.commons.Label("l1");
   oLabel.setText("Test label");
   oLabel.placeAt("content");


  </script>
</head>

<body class="sapUiBody">
  <h1>Test Page</h1>
  <div id="content"></div>
</body>
</html>

Accepted Solutions (0)

Answers (2)

Answers (2)

nalini
Explorer
0 Kudos

The problem was occurring only for specific login to the RDP,where I had cleared the browser cache.

The web page worked fine from other logins to the RDP. But couldnot understand how clearing browser cache caused the error.

Thanks Ria, for the suggestion.

One more question.What is the location of the controls, like button.js?

Thanks,

Nalini

Private_Member_14935
Active Participant
0 Kudos

Hi Nalini,

You can find the code for the controls in the following location:

C:\usr\sap\<SID>\<J_instance#>\j2ee\cluster\apps\sap.com\ui~five\servlet_jsp\sapui5\root\resources\sap\ui\commons

Best Regards,

Ria

Private_Member_14935
Active Participant
0 Kudos

Hi Nalini,

The html code you have at the end of your question looks fine.Strange, that it's not working after clearing cache. However, you can re-try copying the above code to a new html page in MII.

Best Regards,

Ria

nalini
Explorer
0 Kudos

Hi Ria,

Thanks for the input.

I tried creating a new page with the same code. I am experiencing strange behaviour. In chrome it doesnt work at all. In IE it works if I uncheck "Always refresh from server". But I get same error if I check "Always refresh from server".( Same is happening with other old pages also)

I have few questions:

1) Ideally http://Server:Port/sapui5/resources/sap-ui-core-dbg.js should open is it? (Also library.js and Button.js ).

If it is really missing how to place it back?

2) I was using MVC approach and created .html, .view.js, .controller.js files.Whenever I changed the code in .html file it was reflecting on the web page. But the code changes in .view.js and .controller.js files were not reflected on the web page. What needs to be done for this?

Thanks,

Nalini


Private_Member_14935
Active Participant
0 Kudos

Hi Nalini,

My answers to your queries:

1. You can check if this sap-ui-core-dbg.js is physically present in your server location. Once you deploy SAP UI5 sca it should get copied to the following location:

C:\usr\sap\<SID>\<J_instance#>\j2ee\cluster\apps\sap.com\ui~five\servlet_jsp\sapui5\root\resources\sap-ui-core-dbg.js

The SAP UI5 version you currently have is quite old, you can try upgrading that also and then re-try.

2. The SAP UI5 library has js caching implementation which should ideally take care of changes in js files.

Best Regards,

Ria