Profiling Google App Engine Project With Eclipse TPTP? - java

How can I profile a google app engine project locally with the Eclipse Test & Performance Tools Platform?
I already installed the plugin, but when I choose to profile it, there is no option to profile it as a web application, only as a java application which doesn't work.
Update: It asks for a main class and I choose com.google.appengine.tools.development.DevAppServerMain which is the same Main class my run configuration uses, but then there is an error under the Monitor tab that says "IWAT0435E An error occured when connecting to the host."
UPDATE 2: I got rid of the error from update 1 by reinstalling eclipse. Now it doesn't throw any errors, but it doesn't seem like it's starting the server at all because no log messages show up on the console, and I can't connect to the web app on localhost.

I suggest not to use the TPTP plugin anymore as it is kind of dead (-> project plan).
Take a look at the CodePro Plugin contributed to the eclipse platform recently (by google).

Related

Debugging Java Plugin in Ionic Framework application

I'm working on a Ionic Application and there are a few bugs on Custom Java Plugin imported to the app.
I'm not a Java developer but I wish to understand what happen in those plugins while I run the Ionic Application.
Looking on Google I found a few things like adb logcat that is something terrible and impossible to read.
I tried creating a few messages in the Java Plugin in this way:
Log.d("MyMessage", "Something is happening");
And using grep in the adb logcat to see only my messages but unfortunately it is not enough even because I can not pass a variable as message... so I don't exactly know what is going on in the Plugin while using the app.
I know about JDB but I don't know how to run it together with the Ionic App.
Basically I just wish to create breakpoints or to print dynamic variables while the Plugin is executed to understand where are bugs but I can not find anything useful.
I'm a Javascript developer and I have several tools to debug my Front-End stuff so I think it is quite weird it doesn't exist a way to debug much more complex, back-end, code...
I hope you can help me to do that.
For those still looking for a solution:
You can debug java plugins with Android studio and an Android emulator.
Step 1:
Install Android studio and SDK tools.
Step 2: Get a virtual device running. In order to use the emulator you need to have the Intel x86 emulator accelerator installed. I personally had issues here, I had to disable Hyper-V before it would run. This and other solutions can be found here: The intel x86 emulator accelerator (HAXM installer) revision 6.0.5 is showing not compatible with windows.
Step 3: Do a build for Android in your Ionic project (if you haven't already done so)
Step 4: Navigate to
File > New > Import Project and then navigate to your Ionic project. Don't import the entire project, just the Android folder ( {ProjectName} > platforms > android)
*WARNING: Don't update the gradle if you are presented with the option to do so. This may break the ability to build Android from within the Ionic folder. *
Not updating the gradle may result in a "Gradle project sync failed" error. In my case the solution was to run File -> Invalidate caches / Restart
And that's pretty much it. Once the project is loaded you can use the project tab to navigate to the plugin you want to debug, place breakpoints where you want them, and run debug.

How can I enable debugging with breakpoints in IntelliJ for gradle based Google App Engine project?

I have created a Google app engine project using gradle and am using IntelliJ for implementation.
I am able to run the application using gradle task but when I try to debug it the application doesn't stop at the break points.
The debugger always seems to be listening at a different port.
I have added the following JVM flags in gradle.build but with no luck.
jvmFlags = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999']
Any help is appreciated.
You can create a run/debug configuration by going to the drop-down for your run configurations in the toolbar. Use the 'Google App Engine Dev Server' configuration and you don't need to worry about setting the jvmFlags. I have written many Gradle/App Engine projects and have debugged them this way without issue.
You will need to specify your app engine application server. If you hit the ... next to the drop-down you can navigate to where you have it downloaded. I have always used the app-engine gradle task to download gradle. Then you find the latest app engine download in your .gradle directory.

Android failed to export application (due to google-play-services.jar )

I have problem when trying to sign my application in release mode from over two/three days now. I've tried everything which I find as information in internet/stackoverflow and nothing worked for me.
I did not have problem with building debug version and running on device. The only problem I get is only when I try to sign my application on release mode and I get this error message. “Android library project cannot be exported” and I noticed that this happen when I added “google-play-services.jar” to my project android library for adMob.
Instead of using the Google Play Services jar as dependency, add the Google Play Services library project in your application. Instructions for this can be found at http://developer.android.com/google/play-services/setup.html#Setup

Android Facebook SDK no class def found com.facebook.android.Facebook

I'm using a version of the Facebook SDK, I'm not sure which version as I was given the eclipse project and told to use it but it was given to me before SDK 3.0 was released, so most likely 2.0, in an Android app. The app's project has the SDK project listed as a required project to enable us to prompt for Facebook login within the app.
I've tried telling eclipse to export the project with or without the Facebook project but it makes no difference.
I have also tried running the app both with and without the official Facebook app installed.
Every time I try to initiate the login for Facebook, I get the message:
01-24 19:05:11.863: E/AndroidRuntime(12697): Caused by: java.lang.NoClassDefFoundError: com.facebook.android.Facebook
Any help or insight is greatly appreciated.
As it turns out, one of my team-mates loaded up the project from Git, compiled it, and ran it with no changes and it works just fine. Clearly something is messed up with my setup somewhere whether it is with the Facebook SDK or Eclipse. I'm running Eclipse Juno, he is running Eclipse Indigo.
This turned out to be because I hadn't included the library project in the "Android" section of the project's properties.

How to use Heroku eclipse plugin ? An error encounter

I am using Heroku eclipse plugin to create a Heroku template. Sorry that I am quite a beginner in Heroku and Maven build. I totally don't know how to use Heroku belt tool to build and push the app to server, so I choose eclipse plugin. Now I encounter an error right after I create a Heroku template:
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e. pom.xml /herokutesting123123 line 48 Maven Project Build Lifecycle Mapping Problem
What could be the problem?
One more problem is how am I going to run the program? Which one should I choose below to build? I thought it should work like how am I working with Tomcat, but I cannot find "run on server" function in the list below. How?
Last problem is how am I going to push the app to the server? I already got the API key after I key in account and password, but I cannot find any function in eclipse to push the app to the server. I thought it work as simple as Google App Engine, one click will do. So, how can I push the app?
As James mentioned, that is a bug with the Maven Eclipse plugin, but if you want to get rid of the error, you can add an exclusion similar to this in your pom.xml's pluginManagement section:
https://github.com/heroku/template-java-jaxrs/commit/1e68c44a4356216d7077738f87ee9b97545d4bb5
As far as your second question, you deploy the app to Heroku via git push. See this doc for details how to do that from Eclipse:
https://devcenter.heroku.com/articles/getting-started-with-heroku-eclipse#deploying-changes-to-heroku
You can ignore that error. It's a bug in the Maven Eclipse Plugin. To run the app from Eclipse, see the webapp-runner instructions:
https://github.com/jsimone/webapp-runner#running-your-application-in-eclipse

Categories