Again: Failed to load the bootstrap javascript

Hi all,

I’ve noticed that this question has been asked several times before, but none of the answers seemed to apply to my case - although I could be wrong, because these are my first steps with Vaadin. So, my Vaadin app runs locally via Maven/Jetty, but deploying it to Tomcat gives me:

Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js?v=8.3.0

Now, let’s start at the beginning: where in my WAR is this Javascript supposed to be located? I do not have anything like that, I don’t even have a VAADIN folder. My WAR has a META-INF folder, a WEB-INF folder (but no web.xml as that is optional for Servlet 3.0). My VaadinloginUI class is annoted as such:

@WebServlet(value = {“/", "/UI/”,“/VAADIN/*”}, name=“MyApp”, asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = VaadinloginUI.class)
public static class Servlet extends VaadinServlet { }

So, where is this JavaScript supposed to come from? Is it supposed to be in the WAR, do I need to deploy it statically? My context root in Tomcat is /myapp, so perhaps I need to but this in the WebServlet annotation?

Many thanks in advance,

Ulrich

Well, there is no VAADIN folder in my WAR and no svaadin-server-8.3.0.jar either. There is a vaadin-server-8.3.0.jar in WEB-INF/lib, which is the standard way of packaging libs in WAR files. I built the WAR with Maven and the Vaadin Maven plugin and I assumed the purpose of this plugin is to get the WAR structure right.

Is there any documentation what Vaadin expects the internal structure of the WAR to be like?

Ulrich

Hi,

The “VAADIN” folder should be at the same level as “META-INF” and “WEB-INF” folders. So if WAR packaging has went correctly you should see all three at root level of the WAR. But you wont see the file vaadinBootstrap.js there. The file is in svaadin-server-8.3.0.jar VAADIN folder. And it is introspected from there with Sevlet 3.0.

Br. Tatu

Yes, WEB-INF/lib is the correct place for vaadin-server-8.3.0.jar (sorry about s there, it is a typo). And when you look into that jar you will notice that the vaadinBootstrap.js is there.

Ok, so then my setup is correct. Why would then the error message appear:

Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js?v=8.3.0

Ulrich

I have now tried to use a web.xml instead of the @WebServlet annotation, but no success. Here is the content of my WAR file (edited for brevity):

95 Sun Feb 04 12:26:12 CET 2018 META-INF/MANIFEST.MF
 0 Sun Feb 04 12:26:12 CET 2018 META-INF/
 0 Sun Feb 04 12:26:12 CET 2018 VAADIN/
 0 Sun Feb 04 12:26:12 CET 2018 VAADIN/themes/
 0 Sun Feb 04 12:26:12 CET 2018 VAADIN/themes/mytheme/
 0 Sun Feb 04 12:26:12 CET 2018 WEB-INF/
 0 Sun Feb 04 12:26:12 CET 2018 WEB-INF/classes/

[… more directories …]

 0 Sun Feb 04 12:26:12 CET 2018 WEB-INF/lib/

31005 Fri Feb 02 00:13:04 CET 2018 VAADIN/themes/mytheme/favicon.ico
350223 Sun Feb 04 12:26:10 CET 2018 VAADIN/themes/mytheme/styles.css
255 Fri Feb 02 00:13:04 CET 2018 VAADIN/themes/mytheme/styles.scss
230 Sun Feb 04 12:26:08 CET 2018 VAADIN/themes/mytheme/addons.scss
1379 Fri Feb 02 18:02:42 CET 2018 VAADIN/themes/mytheme/mytheme.scss
4501 Sun Feb 04 12:26:12 CET 2018 WEB-INF/classes/de/top100golfcourses/panel/VaadinUI.class
[… more classes …]

524142 Fri Feb 02 00:13:14 CET 2018 WEB-INF/lib/vaadin-shared-8.3.0.jar
806 Sun Feb 04 12:25:50 CET 2018 WEB-INF/web.xml
182 Sat Feb 03 21:58:38 CET 2018 WEB-INF/context.xml
2682626 Fri Feb 02 00:13:20 CET 2018 WEB-INF/lib/vaadin-server-8.3.0.jar
[… more libs …]

7230 Sat Feb 03 22:02:02 CET 2018 META-INF/maven/de.top100golfcourses/Top100Panel/pom.xml
97 Sun Feb 04 12:26:12 CET 2018 META-INF/maven/de.top100golfcourses/Top100Panel/pom.properties

This is an excerpt from my web.xml:

Top100Panel com.vaadin.server.VaadinServlet
<init-param>
  <param-name>UI</param-name>
  <param-value>de.top100golfcourses.panel.VaadinUI</param-value>
</init-param>
Top100Panel /*

So I am stumped. Has anybody ever deployed a Vaadin webapp to Tomcat 7 and can show the code?

Ulrich

For the benefit of others - what can go wrong, will go wrong:

My production envorionment has a specific server for static files and the load balancer settings are such that any request for *.js (and other static file extensions like *.html and *.css) are re-routed to this static backend. Thus, the request for the bootstrapVaadin.js never arrived at my Tomcat.

This type of setup is probably not uncommon, so hopefully this will help someone in the future :slight_smile:

Ulrich