I need help with the error “Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js” using Vaadin 7.0.0.rc2.
Here is what I did:
Created a new project in Eclipse Juno and the Vaadin plugin (2.0.1.201301081221) with the project wizard (File → New → Other… → Vaadin → Vaadin 7 Project)
Target Runtime is Tomcat 7
Configuration is “Vaadin 7, Java 7, Servlet 2.4”
Deployment configuration “Servlet (default)”
Checked “Create project template” and left all default values (no portlet version)
Built the project and started it within Eclipse via “Run as → Run on Server”
→ Application runs, the “Click me” button shows up and responds
Export the project to a war file
Deploy the war to other server (Ubuntu 10.04, Tomcat 7, Java 1.7)
→ the above error occurs.
Checked with Firebug. The site is trying to load “MyApp/VAADIN/vaadinBootstrap.js”. But in the VAADIN directory, there is no vaadinBootstrap.js
When I follow the above steps for a Vaadin 6-Project, the project runs fine on the Linux-Server. So, in general, my setup seems to work.
In your deployment descriptor (web.xml), do you have the VaadinServlet mapped to some other path than "/"? If you do, you must provide mapping for /VAADIN/ path as well.
According to your web.xml the widgetset should be compiled to com.example.vaadin_7_tst_wiz_1.widgetset.Vaadin_7_tst_wiz_1Widgetset is this also part of your exported war package? It should be under WebContent/VAADIN/widgetsets.
If you have not used any add-ons you don’t need to compile the widgetset and instead use the precompiled one that comes with vaadin-client-compiled jar. In order to do this remove the widgetset init-param from your web.xml
What I found out is that the error occurs only when I follow the hyperlink on the “Tomcat Web Applicaion Manager” after deployment. The error also occurs only in Firefox. Following the link in IE does not produce the error on the target site.
When I access the website directly from a freshly opened window, the page works.
This behaviour is independent from whether the widgetset is included in the web.xml.
I have the same problem. I installed necessary plugins in Eclipse IDE and created Vaadin 7 project. Then I tried to run immediately and got the following error:
Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js
I checked it in firebug and the problem is in the following rows:
if (!window.vaadin) alert(“Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js”);
vaadin.initApplication(“vaa1-3611611”,{
The error message originates in that vaadin-server.jar is not deployed correctly so the bootstrap javascript cannot be found. There could be many reasons for this, one thing to check of course is that the project includes the vaadin-server jar (included through Ivy by default) and that it is actually deployed to the server.
Both projects are working well with jetty but as soon as I deploy them on Weblogic it’s no more working, I got the same popup saying “Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js” which is opened at this line:
if (!window.vaadin) alert("Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js");
I also tried to extract the vaadinBootstrap.js of the vaadin-server.jar but it’s the same.
My war file contains all the vaadin-.jar and as you can see my servlet is mapped to /
I just found something new… if I add /VAADIN to my browser url to have something like http://localhost:7001/MyApplication/VAADIN, my application is working fine without any errors.
Strange isn’t it ?
EDIT : mapping the servlet to /VAADIN/* did the tricks and it’s ok but I wasn’t supposed to do that as it was only mapped to /*
Actually I don’t think it’s related to server configuration.
I deployed the same application with Vaadin 6.8.7 instead of 7.0.0 on the same server, without touching the server config and I was able to access it using http://localhost:7001/MyApplication (without trailing slash)
Vaadin 7 uses relative URLs to support proxies and similar setups better. For this to work you must end the URL in a slash as the relative URL, ./VAADIN in this case, should refer to /MyApplication/VAADIN and not /VAADIN. To support using /MyApplication without a trailing slash, VaadinServlet should automatically redirect the user to /MyApplication/, which obviously is not happening in this case. If you fire up your debugger, set a breakpoint at VaadinServlet.handleContextRootWithoutSlash you might be able to tell us what goes wrong in WebLogic.
Ok I did a test in debug mode, here is what I got :
VaadinServlet.handleContextRootWithoutSlash returned
false
If I take the method implementation in detail
protected boolean handleContextRootWithoutSlash(HttpServletRequest request,
HttpServletResponse response) throws IOException {
if ("/".equals(request.getPathInfo())
&& "".equals(request.getServletPath())
&& !request.getRequestURI().endsWith("/")) {
/*
* Path info is for the root but request URI doesn't end with a
* slash -> redirect to the same URI but with an ending slash.
*/
String location = request.getRequestURI() + "/";
String queryString = request.getQueryString();
if (queryString != null) {
location += '?' + queryString;
}
response.sendRedirect(location);
return true;
} else {
return false;
}
}
request.getPathInfo() is null => “/”.equals(request.getPathInfo() returned
false
request.getServletPath() == “” => “”.equals(request.getServletPath() returned
true
!request.getRequestURI().endsWith(“/”) => returned
true
With this the / is not added at the end of requestURI
I think the code that creates the relative path to vaadin folder needs a bit more work…
Not sure this is exactly the same problem but still similar…
Adding more slashes at the end of the path also produces the same error…
BUT in the case of just adding slashes you get the wrong path to VAADIN and http://localhost/MyApp/// → vaadin will still use ./VAADIN/* as path… and this will fail!!
Hi.
I have the same issue with vaadin 7. We are trying to migrate vaadin 6 to vaadin 7 and we’re stuck. I checked that the vaadin-server.jar is part of the war file. i also tried extracting the vaadinBootstrap.js to the WEB-INF/classes/VAADIN folder. Also tried extracting it to /VAADIN folder. Any ideas? I have also tried clearing my browser cache. it didnt work.
Re-check your war that vaadin-server.jar indeed is in /WEB-INF/lib. If you extract it, it should be in a /VAADIN folder in the war. If you are using Eclipse, then it should be in WebContent/VAADIN in the project to end up as /VAADIN in the war.
Thanks! I am no longer getting the “failed to load…” error but i am encountering a javascript error that says “‘vaadin’ is undefined”. Any idea what this means? The error says that it’s a syntax error from vaadinBootstrap.js.
The “could not load vaadinBootstrap” error still happens on Mozilla, but does not show up anymore on IE. What i did was i extracted vaadinBootstrap.js to WebContent/VAADIN. I also checked that the vaadin-server.jar is in WEB-INF/lib. Please help!
After debugging in the handleContextRootWithoutSlash() method I have this:
in the first case which does not work:
“/”.equals(request.getPathInfo()) => returns false. request.getPathInfo() is null so it does not do the redirect