Configuring appengine-web.xml - java

I successfully cloned an web application project from Github to eclipse Luna.
When I try to deploy the cloned project to google app engine, eclipse does not recognise it as a web project. I realised that it was missing the appengine-web.xml file.
I created one under directory WEB-INF in War,
I saved it but when I try again to deploy, still eclipse says that the project is not an app engine project.
What could I be possibly doing wrong?

Since you do not provide the exact error message, I list several possible causes:
Right click on your project, select "Google" option, then "App Engine". Make sure that "Use Google App Engine" checkbox is checked.
In your build path, make sure that "Allow output folders for source folders" is checked and the correct folder is specified (i.e. "MyProject/war/WEB-INF/classes".
Make sure that you are logged in Google with the correct account before you try to deploy - your current account is shown in the bottom right corner.
UPDATE:
This error indicates that your project is not a Java project. Select Project Facets in Properties. On the right side make sure that on the left side Java 1.7 is selected.

Related

How to set up the JavaEE First Cup tutorial in eclipse?

I'm going through the tutorial (https://docs.oracle.com/javaee/7/firstcup/creating-example002.htm). I have Eclipse for EE developers (4.6.3) with Glassfish (4.x) properly configured in it.
I see the project folder under glassfish4\docs\firstcup but I don't know how to import it since the instructions are for Netbeans. If I try to "Open projects from file system" or a general import I get just the folder structure in the workspace and not with the right "flavor":
Then Glassfish doesn't recognize this as a resource that can be added. How do I do this in Eclipse?
I was stuck with the same problem.
Here are the steps I took to make it work.
Skip the step where you have to open the firstcup project and build.
When you have to create the dukes-age project and the firstcup-war project, go to File > New > Maven Project.
Make sure the "Create a simple project (skip archetype selection)" option is unchecked. Click Next.
On the next page, you have to select an archetype. Choose "All Catalogs" and type glassfish in Filter and you will see the 2 archetypes you need for the tutorial.
On the next page, you need to enter Group Id and Artifact Id. For the dukes-age project, type firstcup.dukesage.resource in Group Id and dukes-age for Artifact Id. Click Finish.
You will notice that there's an error in your pom.xml file. Open it and edit by removing -SNAPSHOT from the line <version>8.0-SNAPSHOT</version>. Save.
Right click the project in Project Explorer (the left pane). Go to Maven > Update Project.
Skip the step to set the default URL for dukes-age. Instead, when you want to test your completed web service, go to http://localhost:8080/dukes-age/webapi/dukesAge/.
Note for the firstcup-war project. Before adding the project to the server, make sure you start Derby by running ./asadmin start-database inside glassfish5/bin. Otherwise, you have to remove the project from the server and add it back.
That's all. Other than that, everything is quite similar to the steps in the tutorial. Feel free to ask.

vaadin4spring security sample: failed to load widgetset

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/

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.

Can't Save "Is a Tomcat Project" setting in Eclipse Project Properties

I have a Spring MVC project that I've been deploying to Tomcat (installed both locally and on a server). I'm using Eclipse Indigo as my IDE. To deploy, I had been right clicking and choosing "run on server", which would run fine on localhost. For deploying a WAR to the actual server, I had been right clicking on Project, selecting Export, and going through the wizard to deploy a WAR file.
My Eclipse/Java is rusty, but I did remember that when I used it a couple of years back, I was using the Sysdeo plugin for Tomcat that would give me an option for Deploy to War right from the right click context. So, I poked around and found "Mongrel", which I installed. With that in place, I went to Mongrel under preferences, and set up my Tomcat version, so that I can click the little start/stop Tomcat icons and start/stop the server. This was successful.
What I can't now do for the life of me is, in Project Properties->Tomcat, choose "Is a Tomcat Project". I check the checkbox and then click Apply and/or OK to dismiss the window, and when I open it again, my setting is not recorded. I have tried checking the box and adding other options (like context name, path for a WAR file export, root sub-directory, and activating dev loader), but nothing I do "sticks".
Can someone tell me what I'm missing, or at least point me in the right direction? I'm stumped.
Thanks in advance.
I know this may be a late answer, but as I had the same issue today, I figure I could post my findings here.
I had the exact same problem as yours when I installed mongrel from the eclipse marcket place.
The solution for me was to uninstall mongrel, delete the plugin folder in the plugin directory of eclipse and then get the plugin from the project page on sourceforge.

Class path entry is missing in Eclipse

I am using Eclipse, Helios Service Release 2, Build id: 20110218-0911.
I have created a new dynamic web site, I have added google app engine sdks in it. now i shows the following msg in problem window,
Classpath entry com.google.appengine.eclipse.core.GAE_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
due to this, jar files in sdk are not coming in lib folder of WEB-INF,
any idea how to solve it?
Right click on this warning in the problems (or markers) view and select quick fix. There is a quick fix available for this problem that will tag the classpath entry for inclusion in the web app, which is what you want. You can also control what's included in the web app by using Deployment Assembly page under your web app's project properties.

Categories

Resources