Eclipse Vaadin plugin has cool autobuild feature. Just clicking "restart application" in debug console will bring up to date application version to live.
Unfortunately importing maven generated vaadin project(using m2e) and copy-pasting .project buildCommands and natures from vaadin eclipse plugin generated project does not works.
I'm unnable to "Run on server...", tomcat does not deploy app for unknown reason. I can see app in wtpapps folder but it still does not deploys.
You can build your Vaadin app as a regular Java library, by itself (not as a WAR, or anything complicated). Then do two things: Create another project that builds the actual WAR file, and create another project that sets up Jetty for direct execution (google for details on how to get Vaadin operating under Jetty standalone, using Jetty as a library). With that in place you can treat your Vaadin UI like a regular java program (fast, direct restart through the standard debug window), and still have it be a WAR file for deployment.
See this thread for details on how to set up Jetty (look for Launcher).
I have also stumbled upon this problem some time ago and eventually found this:
http://www.streamhead.com/maven-spring-vaadin-appengine/
It eventually helped me to get up and running after a scenario that has been very similar to what you have described.
Related
I have an application built in Spring Tool Suite and using angular as well for frontend. I am building my maven and the deploying the war in Tomcat. While the Spring dev-tools work fine for any application when it is deployed form the tomcat container within STS but not when I put the war in external Tomcat. Is there any way to hotSwap the application other than blackboxing my javascript in Chrome. Can anyone list down the complete steps to follow. I'm a noob.
I have already put a dependency sping-devtools in maven. There are many answers related to that but none of them is working. It is a big project and takes 4 minutes to build and then I need to deploy it in tomcat which is a lot of burden.
Looks like you are looking to hot reload the static files. In IntelliJ, it's simple as saving your code changes and doing a Build Project CTRL + F9. It's even better if you install a Live Reload extension for your browser so that any changes made is refreshed automatically. There are also other similar options for compile & build automatically in IntelliJ as well other IDEs such as Eclipse.
I'm trying to migrate a netbeans/ant gwt project to an eclipse/maven gwt project.
For that I used the archetype gwt-maven-archetypes, to create a maven project, and after that I copied the sources.
I had succesfully been able to run codeserver and the application itself, using maven comands, as suggested by the archetype author. I even can debug on chrome dev console.
The problem, is that I want to debug from eclipse, and it seems eclipse gwt plugin, doesn't support the current structure.
Any ideas?
Thanks
I ended up, giving up this archetype, and I'm using now simple webapp maven archetype. I figured it out, but still a little tricky on my project.
So, as #ElHoss, has suggested I'm using SDBG. Besides that, I'm not using jetty, but my own tomcat installation, so I've followed this video instructions, together with the SDBG page video's instruction.
At the end, I have 3 Running Configuration items:
The one that starts Tomcat;
The one that starts codeserver;
Chrome Launcher, as instructed on SDBG page.
If you need plus information, please comment.
Thanks.
I'm converting some backends to modules and am perplexed on setting up the development environment configuration. I'm using Java in Eclipse but not Maven. The architecture is very simple:
Front end module is default. Basic GAE/GWT app. Puts items on task queue.
Back end module processes task queue.
With the old backend architecture one debug configuration would start up the development server that would service the GWT DevMode UI and the backend task processing.
The crux of the issue is that the arguments to DevMode provide for a -war command line argument. Now that we no longer have a single war file (there is an ear containing two war files), we have to start them independently. This is fine, we can create a Launch Group that starts up the frontend and backend.
The problem is that each war file gets it's own
WEB-INF/appengine-generated/local_db.bin, which essentially creates two standalone applications. Am I missing something here? I need to be able to put a breakpoint on my front-end RPC service and in the servlet that handles task queue items in the new backend and have both of them hit in one debugging session.
Thanks for any thoughts.
If you follow the instructions here, this will create a modularized application structure in Eclipse, and not using Maven at all. You will need Eclipse WTP in order to have the required project types available (Enterprise Application Project and Dynamic Web Project).
The Eclipse project structure should look as follows:
<<Enterprise Application Project>> ear-app
|
| (refers to)
|
<<Dynamic Web Project>> app-module-1 "default"
<<Dynamic Web Project>> app-module-2 "any_name_2"
<<Dynamic Web Project>> app-module-3 "any_name_3"
<<Dynamic Web Project>> app-module-4 "any_name_4"
The value of "name" refers to the "module" element in appengine-web.xml, while the physical web project can have any name.
Please note that you need to switch into J2EE perspective in order to have the GPE WTP menu options available, they do not show up in the standard Java perspective.
Next, you need to link the EAR project to a new local server instance (of type "Google App Engine").
Only one of the web modules must be flagged as "default" in appengine-web.xml.
Upon deployment of the EAR to the local server, the datastore location is in WEB-INF/appengine-generated/local_db.bin of the default web module, and it is shared between the web modules.
I'm having similar problems figuring out how to implement multiple modules in the MyEclipse plugin for Google App Engine. The best information I've found just says to use Maven.
"Although Java EE supports WAR files, module configuration uses unpacked WAR directories only. App Engine's Java SDK includes an Apache Maven tool that can build a skeletal EAR structure for you." (source: https://developers.google.com/appengine/docs/java/modules/)
I also found this:
"A Maven project has a different layout than an Eclipse project. So, if you wish to use a Maven project with Eclipse, you need to do a bit more work. You have the following options:
1] Import a Maven project for App Engine into Eclipse as a Web Tools Platform (WTP) project, as described in Importing an Existing Maven Project.
2] Import the Maven project into Eclipse using an appropriate Maven integration plugin such as m2eclipse.
3] Set up two debug configurations, one for the Maven project in devserver (mvn appengine:devserver), and one for a Remote Java Application that you use to connect the Eclipse debug client to the devserver jvm. For details on how to do this, see ..." (source: https://developers.google.com/appengine/docs/java/tools/maven#creating_a_new_maven_app_engine_project_using_skeleton-archetype)
I know you said you're not using Maven, but might you consider trying it?
we recently migrated to Maven Build manager & git hub repository for our Java web-app. Also i switched to eclipse as eclipse has good set of plugins.
As a new bie, i am simply running mvn clean package from terminal at the code root directory. And then moving the compiled code i.e., /target/SNAPSHOT/* to tomcat/webapps/ROOT location.
And then starting Tomcat7 server. The process is time taking especially when i do code changes in Java & configuration .xml files.
I want to do it completely in IDE environment as i did earlier in Netbeans, update code -> build and run in debug mode, -> do code changes and then commit.
Heard of egit & m2e in eclipse for maven & github integration, but not sure how to use it.
Please walk me through the steps required in doing so. I am completely new to eclipse.
--
Thanks
You might want to consider using maven-jetty-plugin http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin for running the webapp. You will not need to copy over stuff to tomcat. After configuring this plugin, you can simply run your application by doing mvn jetty:run
I generally do not like running webapps inside Eclipse. It's a personal prefrence, but it is always nice to have an IDE neutral way of building and running your applications. If you have m2e things should work simply fine. I have seen maven-jetty-plugin having hot pluggability where if you changed your web.xml, jetty would reload your application.
We use Git for version control and Maven for dependency management and build automation. Once your project has successfully imported into Eclipse and recognized as a valid java web project, you don't need either Git or Maven in order to build/run it inside IDE. Just creat a server using you existing tomcat installation, add the project to server, then select Run as > Run on Server.
The Complete Guide:
Creating a server
Adding projects to a server
Starting a server
For more details, check out Testing and publishing on your server.
I am considering using Maven 3 for my Spring projects which I have been developing using Eclipse and Tomcat. Until now;
I have been disabling "Republish automatically" because sometimes I don't need publish, I only save .java files (classes) and keep development on debug mode.
I republish (by clicking Eclipse's "publish" button on Servers view) only when I changed js, jsp or htm-like files, not class files, so I can keep developing without restarting Tomcat.
Now I am going to use Maven for debug/run on development but whenever I changed my code, I don't know how to do this "publish" issues on Maven as it doesn't use Eclipse's Tomcat directly. I stop maven and start again. Do I have to do this for all changes on my code? How can I make this maven -tomcat:run- "publish/republish" for js/jsp/html files and "do nothing" for .java files?
Unfortunately, yes, you'll have to run maven for every change.
Maven't isn't really intended to be used this way - it assumes that you're going to use maven when you're ready to build (ie after development), but use something like Eclipse if you're trying to see your changes in real time. It has no mechanism for listening for changes.
For my webapps I use both maven and Eclipse, with the m2e and the 'Maven Integration for Eclipse WTP' plugins. With that setup I can see my changes in real time using an embedded Tomcat instance in Eclipse, and when I'm done, I use maven to build.
Give those two plugins a shot - I think it'll meet your needs.
I had the same problem. And it happens because I ran maven eclipse:eclipse. Then, Server stop publishing (click on publish and said it was synchronized). I downloaded again .classpath and .project and other innerit files of eclipse project structure from cvs and server starts publishing again. May be this could help.
Regards,
For the benefit of Googlers:
I was getting NoClassDefFound errors using tomcat:run to start the app.
It took some googling but the following post notes that using tomcat:run-war enables your dependencies to get picked up from the WAR:
http://www.hascode.com/2010/06/java-server-facesjsf-2-tutorial-step-1-project-setup-maven-and-the-first-facelet/
However, for debugging and hot code replace, it's simplest to run Tomcat from the Servers view in Eclipse.