How to run google test-analytics project on appEngine using eclipse - java

I am working on google test-analytics project and I am able to build the project successfully using maven through command line and deploy on google appEngine locally.But I couldn't figure out how to deploy the project on appengine using eclipse. when I right click on the project, Its not showing any option to "run on appEngine".
Any help would be appreciated.

Follow this documentation.
To upload an app created with the the appengine-skeleton-archetype:
Change directory to the top level of your project (for example, myapp)
and invoke Maven as follows:
mvn appengine:update
You will be prompted for an authorization code in the terminal window
and your web browser will launch with a consent screen which you must
accept in order to be authorized. Follow the prompts to copy any codes
from the browser to the command line.

Related

How to auto-run maven project with Azure after CD and display correct webpage

I’m trying to host a webpage but I’m unsure as to how and googling doesn’t show anything relevant to what I’m trying to do specifically.
I have a Java maven project on GitHub, and I’ve set up CD to Azure so whenever I push to GitHub, Azure downloads the project.
When you run the maven program a “webpage.html” is created in the repository. I want this html file to be displayed when I enter my Azure webpage.
So, whenever I push to GitHub and Azure clones the project, I want it to run the maven program (to create the html file) and then display the html file when you enter the website. How do I do this?
I have verified that azure does indeed clone the git repository, but I don't see how I make it run the java code and display the html file.
Make sure that “webpage.html” is in the “settings - configuration - default documents" list.

Couldn't deploy GAE (Google App Engine) application (Java SDK)

I was trying this quick start but I couldn't deploy the app. I made Google Cloud Platform account, cloud platform project and app engine application.
I used mvn appengine:update command.
Result was
[INFO] Running -A masas-first-project -V masas-first-project1 --oauth2 update /home/masa/Code/googleAppEngine/java-docs-samples/appengine/helloworld/target/appengine-helloworld-1.0-SNAPSHOT
The following URL can be used to authenticate:
https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&client_id=550516889912.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/appengine.admin%20https://www.googleapis.com/auth/cloud-platform
Attempting to open it in your browser now.
And it was like
I don't know where to paste code
At last could deploy...
By using command "gcloud app create".
Maybe I made gcp project, but not gcloud app yet.
First I went along with Japanese quick start but I tried English one next.
cloud.google.com/appengine/docs/standard/java/quickstart
And I got same similar error but I read error message of maven
mvn appengine:deplpy
ERROR: (gcloud.app.deploy) The current Google Cloud project [testproject-218805] does not contain an App Engine application. Use gcloud app create to initialize an App Engine application within the project.
Here is another good resource... github.com/GoogleCloudPlatform/getting-started-java/issues/371 Thanks LOL.
By the way I wrote about this at my weblog. But in Japanese..
I have also English contents. Visit https://lavilleeternelle.wordpress.com/2018/10/08/gae-google-app-engine%e3%81%a7%e9%81%8a%e3%81%b6/
You have to paste that code into your terminal in order to authenticate.

Deploy the app on Google App Engine

I am following this tutorial to see how Google App Engine (Java) works. I was able to successfully build the app:
cd appengine-try-java-master
mvn clean install
The issues happens at the last (deployment) stage on Windows. The tutorial says that it's necessary to run this command (the number 1111 is not the original one due to security reasons):
appcfg.cmd -A master-scanner-1111 update target\appengine-try-java-1.0
I opened cmd and pasted this command. The following message appears:
appcfg.cmd is not recognized...
Then I executed just update target\appengine-try-java-1.0, however this did not deploy the app.
The problem is that in the previous steps they give you instructions to download the Google App Engine SDK, but this is just a package of directories and not an installer (much like how java is packaged). The appcfg.cmd exists within that set of directories, so the user will need to add the "bin" folder in that package to their path (or, as suggested, use the full path in the command). The Google documentation is not specific enough for a person just starting out IMHO. I had the same problem.

How to display changes in web browser when Building a RESTful Web Service using Spring?

I am following this tutorial:
https://spring.io/guides/gs/rest-service/
After completing the tutorial I run everything in my web browser on my local host and everything seems to work.However when I make changes in the java code (I made errors on purpose) I can still run everything in the web browser. What do I need to do in order for it to change due to my code changes? I guess I should mention that I am using eclipse and have installed maven as a plugin.
You are changing the source code, but not the compiled files. Your service is using the created "gs-rest-service-0.1.0.jar" file. This is not affected by your code changes.
Jump into the tutorial again where it says:
"Build an executable JAR"
This will rebuild your jar file. Afterwards you will have to restart your service like you did in the chapter "Run the service".
Instead of using maven as a plugin a choose to install it in order to use the command prompt.

Creating and debugging app with springmvc and eclipse with internal server

I currently have a sprimgmvc app that uses maven. I am currently using mvn:package to build war and deploy it to tomcat to develop and this is getting very cumbersome. I dont have the eclipse configured to automatically build and deploy to tomcat for that matter?
Can anyone please provide me steps that I need to take so that if I make any changes in my project I can just hit save and run and it will deploy to the tomcat OR a way in which I dont use tomcat but use maybe jetty or something else to build and test my app?
Thank you
download STS > Import your project as maven project to the new workspace > mvn install (only once to download all your dependencies) > run AS > Server > baam!
For any other eclipse version pretty much the same but you need to open the server window and configure tomcat , basically open the server tab > new > select your tomcat installation path and then .. just run it on the server. You can even modify code while running your app.
I was able to make this work using some helpers from: Running Tomcat from within Eclipse always gives me 404 (but index.html works) and following these steps:
I suspected that there was something wrong with the initial set up in eclipse. So, I closed the project in eclipse using: Right Click project > Close Project
Then I deleted any files related with eclipse from the folder. These were: .settings, .project, .classpath
I then Re-imported the project as maven project.
I used Window > Show view > server view
In the server view I created a new server and pointed it to XAMPP > tomcat since I already had tomcat.
Right click on the project > Run As > Run on Server.
It should run properly at that point in the browser as well
Make sure to check Right Click Project > Properties > Deployment Assembly - There should be Maven Dependencies added to the project and the deploy path for that should be "WEB-INF/lib"
here is a my way to debug and run maven web project with eclipse. though code is not hot deployed but it works fine for me.
Steps are as follows
open command prompt and go to your project directory. Lets say it is /opt/myhome/myproj
run mvnDebug tomcat:run command, make sure you have mvn and mvnDebug at system path
A message will be appeared like one mentioned in screenshot attached below, this states that maven is waiting for remote connection.
Now we need to Remotely connect to maven from IDE. To do that
Right click on the project and select "DebugAs" ---> "Debug configuration"
Add an new entry under Remote Java application with highlighted details and then select Debug button.
switch back to your terminal and you will get a screen like one displayed below
your web app is ready to debug, put a break point and call it and your IDE will switch to debug perspective
We are done with it. now if you make some changes in your code. you need to stop it from terminal with Ctrl-C and re-execute mvnDebug tomcat:run and then Remote Debug from IDE.
As i mentioned in starting code is not hot deployable as in local debug mode but it is pretty much better approach than rebuilding war and deploy it to external tomcat instance.
I hope this targets your query

Categories

Resources