title: UI5 - Resource not found
body: <p>I'm working with the OpenUI5 tutorial on <a href="https://openui5.hana.ondemand.com/#docs/guide/b4d66ebee72645c1a3501a769e935541.html" rel="nofollow">https://openui5.hana.ondemand.com/#docs/guide/b4d66ebee72645c1a3501a769e935541.html</a></p>
  
  <p>Right now at "Step 7" I am getting an error loading the app:</p>
  
  <pre><code>failed to load 'sap/m/splitApp.js' from resources/sap/m/splitApp.js: 404 - Resource could not be found!
  </code></pre>
  
  <p>The error message is thrown by UIComponent.js, a file from the UI5 library, which means, that the library itself is found.</p>
  
  <p>Please help.</p>
  
  <p>The code is an exact copy from the tutorial and the project was created by Eclipse and the UI5 plugin.</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/&gt;
  
      &lt;script src="resources/sap-ui-core.js"
              id="sap-ui-bootstrap"
              data-sap-ui-libs="sap.m"
              data-sap-ui-theme="sap_bluecrystal"
              data-sap-ui-xx-bindingSyntax="complex"
              data-sap-ui-resourceroots='{
                  "sap.ui.demo.tdg": "./"
              }'&gt;
      &lt;/script&gt;
      &lt;!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme --&gt;
  
      &lt;script&gt;
          sap.ui.getCore().attachInit(function() {
              new sap.m.Shell({
                  app: new sap.ui.core.ComponentContainer({
                      height : "100%",
                      name : "sap.ui.demo.tdg"
                  })
              }).placeAt("content");
          });
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body class="sapUiBody" id="content"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Component.js</p>
  
  <pre><code>jQuery.sap.declare("sap.ui.demo.tdg.Component");
  jQuery.sap.require("sap.ui.demo.tdg.MyRouter");
  
  sap.ui.core.UIComponent.extend("sap.ui.demo.tdg.Component", {
   metadata : {
   name : "TDG Demo App",
   version : "1.0",
   includes : [],
   dependencies : {
    libs : ["sap.m", "sap.ui.layout"],
    components : []
   },
   rootView : "sap.ui.demo.tdg.view.App",
   config : {
    resourceBundle : "i18n/messageBundle.properties",
    serviceConfig : {
     name : "Northwind",
     serviceUrl : "http://services.odata.org/V2/(S(sapuidemotdg))/OData/OData.svc/"
    }
   },
   routing : {
     config : {
      routerClass : sap.ui.demo.tdg.MyRouter,
      viewType : "XML",
      viewPath : "sap.ui.demo.tdg.view",
      targetAggregation : "detailPages",
      clearTarget : false
     },
    routes : [
     {
      pattern : "",
      name : "main",
      view : "Master",
      targetAggregation : "masterPages",
      targetControl : "idAppControll",
      subroutes : [
             {
                                          pattern : "{product}/:tab:",
                                          name : "product",
                                          view : "Detail"
                                      }
                                    ]
                    },
                    {
                        name : "catchallMaster",
                        view : "Master",
                        targetAggregation : "masterPages",
                        targetControl : "idAppControl",
                        subroutes : [
                                      {
                                          pattern : ":all*:",
                                          name : "catchallDetail",
                                          view : "NotFound"
                                      }
                                    ]
                    }
                   ]
      }
  },
  
      init : function() {
      sap.ui.core.UIComponent.prototype.init.apply(this, arguments);
  
      var mConfig = this.getMetadata().getConfig();
  
      var rootPath = jQuery.sap.getModulePath("sap.ui.demo.tdg");
  
      var i18nModel = new sap.ui.model.resource.ResourceModel({
          bundleUrl : [rootPath, mConfig.resourceBundle].join("/")
      });
      this.setModel(i18nModel, "i18n");
  
      var sServiceUrl = mConfig.serviceConfig.serviceUrl;
      var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true);
      this.setModel(oModel);
  
      var deviceModel = new sap.ui.model.json.JSONModel({
          isTouch : sap.ui.Device.support.touch,
          isNoTouch : !sap.ui.Device.support.touch,
          isPhone : sap.ui.Device.system.phone,
          isNoPhone : !sap.ui.Device.system.phone,
          listMode : sap.ui.Device.system.phone ? "None" : "SingleSelectMaster",
          listItemType : sap.ui.Device.system.phone ? "Active" : "Inactive"
      });
      deviceModel.setDefaultBindingMode("OneWay");
      this.setModel(deviceModel, "device");
  
      this.getRouter().initialize();
  },
  
  });
  </code></pre>
  
  <p>MyRouter.js</p>
  
  <pre><code>jQuery.sap.require("sap.m.routing.RouteMatchedHandler");
  jQuery.sap.require("sap.ui.core.routing.Router");
  jQuery.sap.declare("sap.ui.demo.tdg.MyRouter");
  
  sap.ui.core.routing.Router.extend("sap.ui.demo.tdg.MyRouter", {
  
  constructor : function() {
      sap.ui.core.routing.Router.apply(this, arguments);
      this._oRouteMatchedHandler = new sap.m.routing.RouteMatchedHandler(this);
  },
  
  myNavBack : function(sRoute, mData) {
      var oHistory = sap.ui.core.routing.History.getInstance();
      var sPreviousHash = oHistory.getReviousHash();
  
      if(sPreviousHash !== undefined) {
          window.history.go(-1);
      } else {
          var bReplace = true;
          this.navTo(sRoute, mData, bReplace);
      }
  },
  
  myNavToWithoutHash : function (oOptions) {
      var oSplitApp = this._findSplitApp(oOptions.currentView);
  
      var oView = this.getView(oOptions.targetView, oOptions.targetViewType);
      oSplitApp.addPage(oView, oOptions.isMaster);
      oSplitApp.to(oView.geId(), oOptions.transition || "show", oOptions.data);
  },
  
  backWithouHash : function (oCurrentView, bIsMaster) {
      var sBackMethod = bIsMaster ? "backMaster" : "backDetail";
      this._findSplitApp(oCurrentView)[sBackMethod]();
  },
  
  destroy : function (oControl) {
      sap.ui.core.routing.Router.prototype.destroy.apply(this, arguments);
      this._oRouteMatchedHandler.destroy();
  },
  
  _findSplitApp : function (oControl) {
      sAncestorControlName = "idAppControl";
  
      if (oControl instanceof sap.ui.core.mvc.View &amp; oControl.byId(sAncestorControlName)){
          return oControl.byId(sAncestorConrolName);
      }
  
      return oControl.getParent() ? this._findSplitApp(oControl.getParent(), sAncestorControlName) : null;
  }
  
   });
  </code></pre>