vaadin4spring security sample: failed to load widgetset - java

I am desperately trying to build a little Vaadin project with login secured pages/views. I have found vaadin4spring and thought I could start based on the security sample. However, after importing the project and running it, I am receiving the message (without any changes at the project):
Failed to load the widgetset:
./VAADIN/widgetsets/org.vaadin.spring.samples.security.Widgetset/org.vaadin.spring.samples.security.Widgetset.nocache.js?1424243461387
I have also tried to compile the widgetset manually, which wasn’t possible at the beginning (missing WebContent folder). After converting the project to use WebFacets and adding Dynamic Web Module the compilation was possible. But the widgetset related error message was still the same.
Can anybody help me with this problem? I have the feeling that it is just a little thing I am missing.

I think you have imported the sample somehow wrong, because you are talking about WebContent folder. I bet you are using eclipse (because of WTP related WebContent folder).
Delete the old project from workspace and possible settings files eclipse created
Choose File->Import->Maven->Existing Maven Project
You probably want to make one fresh install before you start to play with the project: from the top level "parent-pom" project, choose with right click: Run as -> Maven install. Get a cup of coffee, the build will take a while.
Enjoy!
To start e.g. the Security sample you seem to have tried, just execute the main method from org.vaadin.spring.samples.security.ApplicationInitializer. In eclipse, right click on the class and choose Run as Java Application and the app will launch with embedded Tomcat at http://localhost:8080/

Related

How do I find out why Eclipse is stuck in an endless build cycle?

I've got Eclipse building a Maven project that I just imported. I have Build Automatically checked and Eclipse is constantly building. It builds and waits a few seconds and builds again without me making any changes. I noticed that this only happens when the server is running so I'll include some info on the setup here:
Have a local install of Tomcat.
Eclipse is set up to start Tomcat but points the Tomcat executables to a directory of its own making (Server Location is set to "Use workspace metadata").
Eclipse is set to "Automatically publish when resources change".
As far as I know, Eclipse (or Eclipse's embedded Maven) is building everything into the target directory at the root of my project. Is it possible that Eclipse doesn't realize that the target directory is not supposed to be scanned for changes?
There are zero references checked under the project properties -> Project References.
I'm at a loss as to what this might be. If there are other settings that someone would like me to confirm, please let me know.
This seems to be the same problem but none of the answers seem to apply to me. I'm not sure what the original poster's comment that "added annotation processing to my project which interfere the build process" means.
Does your code generate something in src/main/java or src/main/resources ?
Only then, eclipse scanner can interpret this as 'source change' and then build and deploy continuously.
Any change in 'src' should trigger build
Any change in 'target' should trigger deploy.
If your code is generating data in target (logging for e.g) you would see tomcat deploy happening continuously

Eclipse Build Issue in Dynamic Web Project Creation

I am tyring to build dynamic web application using Eclipse Luna and facing one very strange problem. When I build using eclipse there is no "classes" folder generated and hence application is not able to find the classes ie. the servlets. However if I build war file for my project, classes folder is generated and works perfectly fine.
I have searched the web on this issue and tried the possible solutions. Here are the screenshots of my project settings and few solutions that people recommended. Looks like I am missing either some important property or else eclipse is playing weird.
Thanks,
Try giving this path in the output folder Testing123/build/classes instead of Testing123/WebContent/WEB-INF/classes

Why won't basic spring 4 sample run with Eclipse kepler?

I am using the sample project code here that i've downloaded from the following:
http://javahash.com/spring-4-mvc-hello-world-tutorial-full-example/
Direct link here:
http://javahash.com/wp-content/uploads/2014/02/Spring4MVCHelloWorld.zip
I have Eclipse Kepler SR2 (J2EE), Tomcat 7 64-bit, Java 7.
The project does not appear to be a web project, so I add "Dynamic Web Module" version 3.0 and "Java" (version 1.7) to it. I right click, maven install, which appears to run fine. When I try to actually deploy it on tomcat, it does not give any errors in the console, but when the browser window pops up it shows a 404
http://localhost:8080/Spring4MVCHelloWorld/
HTTP Status 404 - /Spring4MVCHelloWorld/
--------------------------------------------------------------------------------
type Status report
message /Spring4MVCHelloWorld/
description The requested resource is not available.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.39
That said, how do I get this "basic" example running in eclipse? Anyone able to get this working successfully? It feels like it should be more trivial than the 5 hours I've spent on trying to get this sample code working to no avail.
UPDATE:
Still continues to fail despite using Tomcat 7.0 server.
Download the sample, extract contents to workspace directory.
"Import Existing Project" in Eclipse
Since there is no "Run On Server" option, I right click on the imported project directory and hit "Properties".
I go to "Project Facets" and check 2 things: "Dynamic Web Module" (3.0) and "Java" (1.7) and hit apply then "Ok".
I right click on the project Spring4MVCHelloWorld and click "Maven"->"Update Project". Then I click "Run On Server".
There are no errors in the console, but the web browser that pops up in eclipse shows a HTTP STATUS 404.
I tried going to:
http://localhost:8080/Spring4MVCHelloWord/hello
and the same:
HTTP Status 404 - /Spring4MVCHelloWorld/hello
shows up, but the tomcat shows up as:
Apache Tomcat/7.0.53
Note that this is the 64-bit version. What steps am I missing? How do I get around this silent failing?
Apart from what Dimitri stated, your log seems to indicate that you are using
Apache Tomcat/6.0.39
That version of Tomcat does not support ServletContainerInitializer which your Spring web application depends on for configuration. Upgrade to a Tomcat version 7+.
It seems like the Maven update doesn't work for you (or for me).
First, go into Properties -> Deployment Assembly. You need to get rid of Web Content if it's there and add src/main/webapp (which is a maven convention). You also need to add the Maven Dependencies as shown below.
Finally, and this might not be necessary, delete the web.xml provided to you and re-create it by selecting and right clicking Deployment Descriptor in the Project Explorer and clicking Generate Deployment Descriptor Stub.
Also, make sure your Java Build Path in the Properties has a Java 7+ version of the JRE.
As far as I can see your controller only maps to /hello, which means your URL should be:
http://localhost:8080/Spring4MVCHelloWorld/hello
Another thing that might be interesting to you is that if your having problems with certain project facets (like Dynamic Web Module) not being recognized, you can usually fix them by righ clicking your project, opening the Maven menu and choosing Update Project.

Running dynamic web projects on Eclipse brings up a 404 error in Tomcat 7

I'm not entirely sure why this happens.
Right now I'm able to build the project without running into any issues, and it deploys to the eclipse tomcat server that I have running
So with that kept in mind, the index here is hera.jsp, which I have set in my web.xml file:
to make matters worse it seems like no matter what I try I always get this same error message:
All I can think to include to make this more complete before posting is my build path and the server settings, so here's those as well.
I had similar problem. First of all:
Check if all the sources are copied to tomcat7 webapps, especially hera/WEB-INF/web.xml.
If its not there, try to create dummy folder in your project, e.g. "hera/fix", and in your
"project properties->deployment assembly" add this folder (as a result, "hera/fix -> /" mapping should be created). This worked for me when the eclipse plugin didn't want to copy web.xml.
Check in "project properties->deployment assembly" if all needed libraries are there, if not, add them.
Check why you have problems in src in your eclipse project, as that may interrupt or conflict the dynamic project deployment from eclipse.
Hope it helps.

Webapp shows 404 page after project renaming

I have been working on this web application using Eclipse and m2e (maven plugin for Eclipse).
After a while I decide to change the project name in eclipse doing: Right click on project >> refactor >> rename
Following this I see a few errors coming up, mostly to do with classpath configuration & java versions mismatch. I fix them, adding the maven dependencies to the build path, and updating the java versions to be used during compilation & run time.
I rebuild my web app & restart my server (Tomcat in this case). Open my browser to go to my app's root url. And I get a 404 page (everything looks fine in the console btw).
I've been going through my buildpath and classpath config to double check if anything was coming from there but everything seems fine. I'm confused and unsure where to look at.
Thanks in advance
This really depends on your Setup. If you are using the default path, it is (as Kal said) myserver/newappname.
If you are using a url that you have configured in webserver for easier readability like (myapp.myserver.com) you would have to change the redirection in your server from your old appname to the new one.
Actually,
404 HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested.
1. Check your path with newapplication name.
2. See inside your server, Is there a resource with (newNameApp.war)?
3. As you are using maven, try to build the project and see the log, by which name war is generated, and where the war got placed.
I faced the same situation and simply restarted Eclipse and no more 404 afterward

Categories

Resources