Run JHipster SpringApplication via eclipse - eclipse

I'm trying to run the JHipster application via my Eclipse Juno, using jdk 1.7.
The app seems to be loading properly (no console errors), but when i'm trying to reach the server with the client side (or via Postman, by sending a request to the REST servlets in port 8080), it's not responding.
However, when i'm running "mvn spring-boot:run" in the command shell, the server is loaded successfully and is responding to the exact same requests. Also, I managed to run the same command via eclipse with some maven configuration but it seems to be running only the target files (jars) and not the source code. I still haven't been able to run the source code of this app using eclipse in order to properly debug it.
Any suggestions?
Thanks!

So the answer is quite trivial, but since I spent several hours to reach it, it might save some time for others-
Download & install STS IDE.
Import the project as existing Maven project.
Run/Debug the project.
I tried to run it via Eclipse the whole time (wasn't familiar with STS to be honest) and this probably needs some extra configuration (another comment with explanations on eclipse configuration will be much appreciated). Once you work with STS, it's easy.

You should not need STS, just Eclipse with the J2EE stuff.
I've imported the sample jhipster in Eclipse (without STS) as a Maven project and everything was OK, after installing the maven dependencies.
To run the project, run as an application and search for the Application (com.mycompany.myapp.Application)

This app works for me: https://github.com/jhipster/jhipster-sample-app. It is stuck on Boot RC5 which probably means it's a bit old. Maybe Julien can comment on that (or update it)?

Related

Is it possible to do Hotswapping of ATG classes

The deployment we follow is that we use runAssembler.bat to build an ear file and deploy it in a app server. We are using weblogic and jboss for testing purposes of the modules we built. However for every small change, we need to run runAssembler and build a new ear and deploy it in app server and restart the server.
I would like to find out if anyone figured out a way to do Hotswapping of class files which are generated by the code we write in ATG environment in either weblogic or jboss.
By attaching your IDE to your Application server on the Debug port it is generally possible to do hotswapping. Setting this up on Eclipse and JBoss is documented here, here and here. There is some information for setting it up in WebLogic here.
Attach your debugger, edit the java file, click 'save' and with hot code replacement in your IDE it should now update the running class file. In Eclipse it usually gives a popup if it was unable to do the sync. If you are using Eclipse, make sure the 'Build Automatically' flag under projects is ticked or you'll be waiting forever. I've not had any issues doing this via JBOSS (exploded ATG EAR) and variable success in doing this on WebSphere 7. It may also be prudent to make sure the same JAVAC you use to compile your build is the one loaded into your IDE compile path.
Another way to at least reduce the build/deploy time would be to deploy an unpacked/exploded EAR and simply copy your class files across (you could use the Eclipse FileSync plugin) and restart the server.
There are also some commercial options available, like JRebel
In our organization, we had good success in using DCEVM. It simply patches your JDK (in Windows: jvm.dll).
Download and patch your JDK
Launch your JBoss/Weblogic with the patched JDK
Set up Eclipse's Installed JRE's to point to patched JDK (restart and rebuild once)
Start the server, Launch debugger and connect
Ensure Eclipse's Debug view shows "Dynamic Code Evolution VM" (instead of something like "HotSpot VM")
Change your code, and voila!
You can do this with JRebel. After hotswapping you don't need to restart the server, only reload you deployment from Weblogic.

Eclipse juno deployment requires clean and build everytime

I have a web application developed in Eclipse Juno, I am using Tomcat 7.0.32 as a web server. When ever I'm doing small changes and deploying the application, changes are not taken by the tomcat.
Under Eclipse tomcat deploy path wtpwebapps, I have found the following:
Few/all JAR's given in the build path are missing
Recently compiled java files are not updated
These things led into ClassNotFoundException sometimes and Unexpected functionality sometimes.
So, when I do clean and build the project for small changes every time,deployment works fine. But clean and build takes more time
Is it a problem with eclipse deployment plug-in? Help me out to overcome, thanks

Using "Persist" annotation in Tapestry is causing Problems with RunJettyRun

I am going through the Tapestry beginner tutorial at: http://tapestry.apache.org/tapestry-tutorial.html
I just downloaded the template project and tried running it as is.
The problem is adding the #Persist annotation to the property my application hangs indefinitely. I realized that it happens when I launch my application from Eclipse using a RunJettyRun configuration. If I run it form the command prompt with mvn jetty:run it works fine.
I notice that the RunJettyRun version on my machine does not match up exactly with the screenshots in the Tapestry tutorial. Mine allows you to select from three different Jetty versions:
Jetty 6.1
Jetty 7.5
Jetty 8.0
Version 8 doesn't launch at all. 6 and 7 have the hanging error.
Using Jdk1.7, Eclipse Indigo and Windows XP.
I realized that it happens when I launch my application from Eclipse using a RunJettyRun configuration. If I run it form the command prompt with mvn jetty:run it works fine.
I am a maintainer of RJR team , that sounds more like a RunJettyRun bug if you could run it well with "mvn jetty:run".
Because I am not familiar with Tapestry, if you could provide the reproducible war file and reproduce steps, and file a issue on RJR's tracker,
then I will try to check if there's anything we could do for it.
It sounds more like configuration conflict or version issue, but it's just a quick guess.
http://code.google.com/p/run-jetty-run/issues/list
I'm using jetty 7 and it's working fine for me
Did you try downloading the tutorial source code from GitHub and run that?
Also note that any field with a #Persist annotation must not be initialized and should be private
T5 tutorial source code on GitHub

Can't get compile on save / hot deploy feature to work with maven based webapp in eclipse or netbeans

So our new webapp project is based on maven. I'm really liking the dependency management and IDE agnostic approach but I'm having problems with compilation and debugging.
Here's how I would currently get a clean copy of the project working
Check out the main project from SVN
Open the project in IDE (I've tried in eclipse 3.4 and netbeans 6.7)
The IDE will automatically open two subprojects one being the webapp, the other being a supporting utils jar.
From the command line I run mvn war:inplace on the webapp module which builds a working copy of the webapp with all dependencies in WEB-INF/lib/
This then runs fine but whenever I change a java class I have to clean and build / reload the app context.
I've googled high and low but no one seems to be complaining about this so I guess there must be something really obvious I'm missing. How is everyone else handling incremental compilation and hot deploy with maven?
To clarify all I'm looking for is the replicate the behavior I used to have before maven where I could make simple changes to java classes and they would be instantaneously compiled and hot deployed to a running webapp. I don't need anything fancy like jRebel etc I just want the new tool to give me the same functionality I enjoyed with my old tools.
If you can use mvn jetty:run it will read the classes and resources directly from the project. Using Maven2 Eclipse plugin and running the server embedded in Eclipse has auto-publishing, which gets you there in the end, although it's slower. And JRebel starting with 2.0 (as you may know) can map the Maven module directly to the deployed application, so you get instant build and redeploy. Those are the only solutions I know of.
Netbeans should support it out of the box. Though, there remains a bug related to this: http://netbeans.org/bugzilla/show_bug.cgi?id=177230
In-place deployment works for me with Netbeans 7.0.1 and Tomcat 6.0.x if I use Tomcat 7.0.x in-place deployment doesn't work. Tomcat always copies application to $CATALINA_HOME/temp :(

Tomcat & Eclipse integration

I'm developing on a Ubuntu 8.04 machine using Eclipse Ganymede. I installed Tomcat 5.5 using sudo apt-get install tomcat5.5 tomcat5.5-admin and using an Ant script I deploy my WAR file by copying it to $CATALINA_HOME/webapps.
I then created an Eclipse project and I have it output compiled source in a similar but separate directory structure under $PROJECT_ROOT/target/. I still deploy the WAR file by right clicking on the build.xml and choosing my deploy-war task.
As Tomcat is running as a deamon, automatically started up on booting, I'm not instructing it when to start or exit.
My problems with this setup are:
Using this approach I do not get any output to the Eclipse console, as Tomcat is running under the tomcat55 user and I have a different login and no access to Stdout of tomcat55.
The logging which occurs is also directed to Stdout at the moment, which I find pretty nice during development. But it's not nice when I can't see it. :-)
I don't have any servers under the Server tab and no Run configurations. This makes it impossible for me to use the Debug mode of Eclipse, which otherwise is quite convenient.
What do you think I should do to integrate them and in turn make my development environment much better?
I'd say forget the pre-packaged Tomcat. Grab the apache-tomcat-x.y.z.zip from the site, unzip it somewhere in your $HOME and add a Server to your eclipse workspace, pointing to your local installation of tomcat. Of course you need the j2ee/wtp Eclipse bundle. Works fine on Windows, can't see a reason for it not working on Linux.
Edit: You may have to fiddle with server ports if you have two tomcat installs.
Add Tomcat to the list of Eclipse servers and run your web-app on the server. If you need more details click here.
I never cared about 1 and 2, so I can't really help you with them.
regarding 3:
You don't need any servers under the server tab for debugging to work. Just start tomcat with these environment variables
export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket
and configure eclipse accordingly: run - open debug dialog - select remote java app and create a new configuration.
You need eclipse to manage a copy of tomcat, then it can debug it. The clue to the problem was that you have to push deploy-war, this means the files are leaving your development environment and entering an external server. On a properly configured development environment, you only need to save your java file, it will auto-compile and already be on the local tomcat install, which might try to auto reload the web-app, and you can refresh your browser without reloading anything on the server. Look up some more tomcat plugins, there are a few different ways to do this.
If you want to do regular debugging and relaunching of Tomcat apps, you might want to take a look at MyEclipse - it can make things a lot easier.