Skip to Content
avatar image
Former Member

SAPUI5 in web application bundle

I'm currently trying to build a simple web application bundle which makes use of sapui5. My bundle has roughly the following content:

`- META-INF/    `- MANIFEST.MF    `- p2.inf`- WEB-INF/    `- classes/    `- lib/    `- web.xml`- js/`- resources/`- index.html

The WEB-INF/lib folder contains the 13 jars for sapui5 version 1.8.6. The index.html includes the sap bootstrap js  and a local js which builds the shell content. The bootstrapping works but when it comes to the creation of the app specific sapui5 controllers and views I'm getting a browser error saying the resource is not available. On the server the log contains entries like:

javax.naming.NameNotFoundException: Name '/resources/foo/bar/l10n/' does not exist. at org.eclipse.gemini.web.tomcat.internal.loading.BundleDirContext.getNamedEntry( at org.eclipse.gemini.web.tomcat.internal.loading.BundleDirContext.doGetAttributes( at org.apache.naming.resources.BaseDirContext.getAttributes( at org.apache.naming.resources.BaseDirContext.getAttributes( at org.apache.naming.resources.ProxyDirContext.cacheLoad( at org.apache.naming.resources.ProxyDirContext.cacheLookup( at org.apache.naming.resources.ProxyDirContext.lookup( at org.apache.catalina.core.ApplicationContext.getResource( at org.apache.catalina.core.ApplicationContextFacade.getResource( at at at at at at javax.servlet.http.HttpServlet.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.authenticator.AuthenticatorBase.invoke( at at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.valves.ErrorReportValve.invoke( at org.apache.catalina.valves.AccessLogValve.invoke( at at at at org.apache.catalina.core.StandardEngineValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.service( at org.apache.coyote.http11.AbstractHttp11Processor.process( at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process( at$ at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( at java.util.concurrent.ThreadPoolExecutor$ at|

Any hints someone?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 18, 2013 at 07:51 PM

    Hi Tobias,

    do you store the under resources in your web application? There is a classloading issue with the SAPUI5 resource handler and local resources in case of web application bundles. Therefore the SAPUI5 resource handler only finds the resources coming from the bundle classpath and not from the web context classpath. This issue is known but not so easy to fix - unfortunately...

    If you put your code from resources/foo/bar/* under js/foo/bar/* and use the following command to register this path as module path for then your code should work:"", "./js/foo/bar");

    Details about the modularization concept + explanation of the upper code can be found in the UI5 demokit:

    Hope this helps and best regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Peter,

      thanks for your explanation. I'm already aware of the local resource registration (see also I must confess that I haven't read the sapui5 documentation in depth yet. As you can see in my wab layout I've put the resources into a subfolder of the bundle root. But I only added 'WEB-INF/classes' and 'WEB-INF/lib' to my bundle classpath (not '.'). Maybe I was on a wrong path here because it looks like the resource is loaded from the bundle and not from the classpath in the exception stack trace. I also haven't included the fragment - maybe this also makes a difference? Haven't had the time to check that yet...

      Anyway I changed my current setup to load the sapui5 components from the nwc  installation and register local resources. Works like a charm and decreases the size of my wab by some megabytes.

      Thanks and best regards,