Server Google App Engine (1.8.2) at localhost failed to start - eclipse

I am trying to create Dynamic Web Application in Eclipse on Google App Engine.
I have followed this tutorial exactly but whenever I Run on Server, I get the following error. I have shown both, error log and the dialog that appears when I run my project. And apparently there is no search result after Googling this error. Any help would be appreciated in this regard. Thanks.
UPDATE:
Point to note here is that if I use the tutorial available here then the project runs fine. The difference is that This way I create new project by clicking the New Web Application Project button in the toolbar:

It is because your launch configuration file is corrupt.
location: WORKSPACE/.metadata/.plugins/org.eclipse.debug.core/.launches.
All you need to do to solve this problem is to delete the existing launch configuration (in Run > Run configurations)
More precisely: Run > Run configurations > Web Application > right click in your project's name > Delete

Related

getting error message "Failed to load resource: the server responded with a status of 404 (Not Found)"

I have a simple MVC web application, which was running locally without problems 3 weeks ago.
When I now open the application in Netbeans and run it, everything seems to work fine as well. However, when I go to the browser (in my case google chrome) to look at the app's frontend (at http://localhost:8080/optimizer), I get the following error message:
HTTP Status 404 - Not Found
In Chrome's javascript console the following error message is given:
optimizer:1 Failed to load resource: the server responded with a status of 404 (Not Found)
"optimizer" is the name of the app. (What's the point of the "1" in "optimizer:1"? ... I don't get this either.)
The server (payara) is running:
I can also reach the server's admin page:
However, somehow the server cannot seem to find the application, although 3 weeks ago everything worked fine ... I just don't get it.
What's wrong? How can I fix this?
UPDATE:
Clicking on "List Deployed Applications" in Payara's Admin Console reveals that my app is not(!) deployed.
I tried to deploy it by clicking on "Deploy an Application" -> "Choose file".
I selected the jar-file "optimizer-1.0-SNAPSHOT.jar", selected Type "EJB Jar", then clicked on OK.
I got this error message:
Archive type of /private/var/folders/hh/hgq7wrjn5d51gy2tkbxkkbwh0000gn/T/optimizer-15075570634779987058.0-SNAPSHOT.jar was not recognized
How can I deploy my app? And why did it work automatically before and now it doesn't work any more?
UPDATE 2:
A difference I realise compared to before (3 weeks ago) is that the browser doesn't open automatically any more when I run the app.
Furthermore, Google Chrome used to be the IDE'S default browser ... now there is just a grey globe and I can no longer choose Chrome as my browser:
UPDATE 3:
I just noticed there is an error message that appears when the server is started (it's in the middle of hundred of rows of log output so I didn't notice it at first):
UPDATE 4:
-> NetBeans IDE 11.2
-> Payara Server 5.193
Error clearly shows, server is not able to recognize archive type of jar,
Archive type of
/private/var/folders/hh/hgq7wrjn5d51gy2tkbxkkbwh0000gn/T/optimizer-15075570634779987058.0-SNAPSHOT.jar
was not recognized
From payara blog,
If you set “Location” by “Packaged File to Be Uploaded to the Server”,
the suitable type would be selected.
So, the suitable type would be selected automatically.
Also, optimizer-15075570634779987058.0-SNAPSHOT.jar is not an original jar optimizer-1.0-SNAPSHOT.jar
It seems that issue is with the path of an archive, from thread
Code in uploadFrame.jsf:
<sun:form id="form">
I probe to change it to:
<sun:form id="form" enctype="multipart/form-data">
in uploadFrame.jsf into console-common.jar file. And it works.
You can try with changing uploadFrame.jsf into console-common.jar file.
(Not sure if chrome takes care of this, as it was working for you with chrome).
You may also want to try manual deployment,
install-directory/bin/asadmin deploy PATH_TO_ARCHIEVE/optimizer-1.0-SNAPSHOT.jar
Ok, I now found out how to run the app locally without problems: by creating a .war file instead of a .jar file - now I can run the app again without problems.

How to autorestart node.js application in Eclipse/Aptana Studio on source change while development?

This is not a question really, but a guide in some sense.
I did not find a better place to post it. I hope someone finds this helpful.
I was fed up with stopping and starting node.js application to pick up code changes.
So I wanted a solution without too much hassle and installation of additional plug-ins, packages or anything else. The pure solution using standard Aptana Studio 3.4 (Eclipse) features on Windows 8.1 x64 as follows:
Right-click on your project in Project Explorer > Properties > Builders
New... > Program > OK
Name: Terminate existing node.js process(es)
Location: C:\Windows\System32\taskkill.exe (${env_var:SystemRoot}\System32\taskkill.exe did not work for me, it might for you)
Working Directory: Browse Workspace... > select your project > OK
Arguments: /IM node.exe /F
Switch to Build Options tab and tick During auto builds, untick Launch in background > OK
Create another builder: New... > Program > OK
Name: Start <your-project-name>
Location: C:\Program Files\nodejs\node.exe (you can try ${env_var:ProgramFiles}\nodejs\node.exe as well)
Working directory: same as point #5
Arguments: app.js (or any other file for application entry point)
Switch to Build Options tab and tick both During auto builds and Launch in background > OK
Turn on project autobuild: Window > Preferences > General > Workspace, tick Build automatically > OK
Change default build order: Window > Preferences > General > Workspace > Build Order, untick Use default build order and remove all projects except your node.js project > OK
Restart Aptana/Eclipse (There are bugs, so sometimes preference changes are just not saved and get lost. You have to double-check.)
So if you have not changed too many default preferences in Aptana Studio 3/Eclipse by saving a file within your project should trigger its builders. First builder will kill existing instance to overcome 'port already in use' exception and start an application again. Console tab related to that process should pop up.
This works perfectly for me developing one node.js project at a time and medium size application restarts instantly. There is still space for improvements, e.g. killing just that particular instance instead of all. Suggestions are welcome (except the ones to install Nodeclipse or node.js packages, etc.)!
I hope this easy to do solution will help someone. Also I hope Aptana Studio 3 will start supporting node.js type of projects/server natively very soon.
You can use nodemon to restart node application whenever the code changes. Have a look https://github.com/remy/nodemon/
Welcome to Nodeclipse. Your solution is added to Nodeclipse Help Run page,
please edit. That is to answer "a better place to post it".
Alternatively, this question should have been broken into problem and solution part to fit stackoverflow.com Q&A format. Also constrains (like without plugin or Node.js modules) should be said in the topic as some percentage of stackoverflow.com users don't really read whole (especially long) question.
Then my answer is just use Debug View. (Actually it should be named Launch as it is both for Run and Debug) In your favorite perspective: Window -> Show View -> Others.. -> Debug. (In Nodeclipse Node perspective Debug View is visible by default)
Then you can right-click on launched application in Debug View and select Terminate and Relaunch. That is more explicit and allows to run many applications.
I also don't understand why you first say "without plugins" and don't suggest "to install Nodeclipse", but in the end add "I hope Aptana Studio 3 will start supporting". Wouldn't it be another plugin/extension? Nodeclipse as of 0.10 has code completion for base Node.js modules and improved support for black background color themes. Open an issue when ready to discuss/work together. Nodeclipse was started by developers like you who stopped hoping and waiting and just did it. One small piece at a time. Just like you did.
My two cents:
If you want to enable debugging too, you can do it by creating a Standalone V8 VM configuration and launching it with eclipse_remote_control. Steps:
Help > Install new software...
Work with: https://github.com/marook/eclipse-remote-control/raw/master/workspaces/erc/update_site
Select and install the plugin
Important: download eclipse_remote_control_client.jar form https://github.com/marook/eclipse-remote-control/raw/master/workspaces/erc/release/eclipse_remote_control_client_1.3.0.jar and place it where you later know (I placed in /Applications/eclipse/plugins/eclipse_remote_control_client_1.3.0.jar)
Restart eclipse
Once installed the new plugin, create a new debug configuration and project builder:
Run > Debug Configurations... > Right click Standalone V8 VM > New
Name: NodeV8-5858 (or whatever, remember it)
Port: 5858
Apply, Close
Project Explorer > Right click your project > Properties > Builders
New... > Program > Ok
Name: Start NodeV8
Location: /Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home/bin/java (find your java location)
Working Directory: Browse Workspace... > select your project > OK
Arguments: -jar /Applications/eclipse/plugins/eclipse_remote_control_client_1.3.0.jar execute_command NodeV8-5858 DEBUG (replace with your .jar location and the name you selected in step 2)
Ok (then make sure that "Start NodeV8" remains the last entry in the list)
Select "Start " and click Edit...
Arguments: --debug-brk=5858 --harmony app.js (or any other file for application entry point)
Arguments: --debug=5858 --harmony app.js (if you don't want it to
wait at the beggining)
Ok and enjoy!
If you are working with mac, then to kill all node process you can create an script killallnode.sh with the following code:
#!/bin/bash
killall node
Place it somewhere you know and fill it in the location field for step 4.

Setting up libgdx in IntelliJ Idea with GWT Support?

So far the documentation doesn't include the set up of GWT project in IDEA, and my limited google skill can't find the solution. Is it possible?
If you generated your libgdx project using the gdx-setup.jar file, then you should import your project by using the following link: https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA
HTML: View -> Tool Window -> Terminal, in the terminal, make sure you are in the root folder of your project. Then execute gradlew.bat html:superDev (Windows) or ./gradlew html:superDev (Linux, Mac OS X). This will take a while, as your Java code is compiled to Javascript.
Once you see the message The code server is ready, fire up your browser and go to http://localhost:8080/html. This is your app running in the browser! When you change any of your Java code or assets, just click the SuperDev refresh button while you are on the site and the server will recompile your code and reload the page! To kill the process, simply press CTRL + C in the terminal window.
Once this bug in the Gradle tooling API is fixed, we can simplify running the HTML5 by using the Gradle integration. At the moment, the Gradle process will run forever even if canceled.
Also just a heads up, after you have run the gradle command it might say something like this:
The code server is ready.
Next, visit: http://localhost:9876/
Building 91% > :html:superDev
Even though it says 91%, don't worry it will still work, just go here to run it: http://localhost:8080/html/, NOT the url mentioned in the log.
Also to deploy you need to run ./gradlew html:dist to generate production code, you want to copy everything inside ./html/build/dist/ to your server. Running that command produces the code in that directory. https://gamedev.stackexchange.com/a/82588/54396
I was able to make GWT work with libgdx simply by:
downloading (http://www.gwtproject.org/download.html) the GWT SDK,
extracting it,
then in the project structure -> project-name-html -> dependencies,
just press the + and add the extracted GWT directory
A dialog appears and I just unticked all the samples
The "Dependencies Storage Format" needed to be "Intellij IDEA", not Eclipse for this to work for me.

Need help setting up a (Tomcat) web app in Eclipse for debugging

I've been using both eclipse and tomcat for years but have always deployed my web apps externally and never had a problem. Now I'd like to use eclipse to debug my web app and I can't figure out how to make it work. I started by trying to get my existing web app to deploy through eclipse but after hours of trying different things I decided to start fresh. Unfortunately, I didn't get much further. I'm hoping if I can figure out how things work with a fresh webapp I can get things to work on my existing. Sorry, this will be long, but here are the steps I tried on the latest eclipse (Juno):
Installed new version of tomcat 7.0.34 at /usr/java.
In eclipse, used "servers" view to add server, pointing to the new install (I didn't add any resources because there weren't any available yet). Starting the server worked and got a 404 as expected at http://localhost:8080/ ... then I stopped it.
Created a new "dynamic web project", named it TomcatDebug, set the location to ~/tomcat-debug, chose the server just created above (the only one), chose default config, tomcat-debug is empty so chose defaults for build paths, defaults for module settings and had it generate web.xml.
In the "tomcat-debug" folder it creates WebContent, build, and src. I throw a sample "hello, world" index.html into WebContent.
Now the project TomcatDebug is created so I try to run it, tell it to "run on server", and it goes to http://localhost:8080/TomcatDebug/ but gives a 404. I even try to add index.html but it still gives a 404.
This is about as basic as it can possibly get so what did I do wrong?
Continuing to try and figure this out I stop the server, change the server setting to "use tomcat installation", but still get a 404 in the same way when I restart. I tried changing my module context path and still 404.
I'm completely stumped. I believe I followed all the wizards as basically as possible. Where did I go wrong?
Thanks for taking a look.
I haven't run tomcat through eclipse in a while, so can't answer that aspect of the question. But, to get at the heart of what you're trying to do (debug a webapp in eclipse through tomcat), you shouldn't necessarily need to. This may serve you instead:
EDIT: Eh, look here for instructions ("Debugging" section). The below is how I did it (JUNO and TC 7) and has an annoying quirk in point #1.
edit the startup.sh (assuming *NIX/OS X) - the last line will probably be
exec "$PRGDIR"/"$EXECUTABLE" start "$#"
change this to
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$#"
to activate debugging. (there are other ways to do this that may be better - i think tomcat/the VM may pause for listeners before proceeding, so when you aren't debugging this is not ideal)
Create a Debug Configuration in eclipse, under the "Remote Java Application" set. Default port should be fine, and presumably host. Choose your project.
Add sources of relevance to your debugging in the Source tab.
Start server and run your new debug configuration. App should stop at breakpoints you've set.
Right Click your index.html Run As -> Run On Server you will see Tomcat will automatically run the page.

Google App Engine Eclipse Launch Local Host Multiple App Conflict?

I have two GAE projects created through pydev in eclipse 4.2 (windows 7) and the first one I had no issues running the localhost:8080 but when I created a second project, I duplicated the Run Configuration for local run adn just changed the project name to the new one.
However- when I run that config the inital HelloWorld project shows up[ in my browser, I tried completely removing the first project, but then it just ocmplains it cant fint app.yaml in the old directory (because the old directory isnt where it was).
So clearly I'm missing some setting in the launch procedure where it sets the root path.
The run config is a PyDeb Google App Run, main module points to
C:\program files (x86)\google\google_appengine\dev_appserver.py
And the arguments are
${project_loc}\src
Everything else is on the default settings.
Any help would be greatly appreciated as pushing to Google (which works fine for both) for every little debug iteration is driving me a bit crazy.
Thanks!
*EDIT: Forgot to mention I have already tried to delete all runconfigs and remake.
Have you tried Run as : PyDev Google App Engine Run, to create a new runconfig?
Turns out I'm just a bit silly. In eclipse, I wasn't properly turning off (not sure on the correct term there) the LocalHost for the first project before starting the second. To fix, I needed to go Into eclipses console window, and select "display selected console" and choose the project I wanted to stop and hit the stop all button. Then it runs fine.
Hope this helps someone in the future, that is as determined as me that "It can't be my fault".
Cheers.