I was wondering if IntelliJ has a built in Application Server (like Tomcat) that I can use without having to download Tomcat directly?
Right now when I go to Run | Edit Configurations, Defaults, Tomcat Server, Local, it asks me to specify the Tomcat home directory.
Previously I had used myEclipse and it came packaged with a Tomcat so I would be suprised if the ultimate version of IntelliJ does not have this.
Intellij does not include built in application server. It has simple web server they refer to as Webstorm. However it is not application server.
Here is excellent resource (official docs) for working with application servers in intellij which you may find to be useful including tips on integrating it IDE via plugins etc:
Working with Application Servers
You need to download an application server manually.
Or you could use a Maven/Gradle dependency to start Tomcat programmaticly from the Main method, or a plugin for starting it via command line e.g. mvn tomcat:run.
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 have a current setup of intellij 2016 which compiles my java files on the fly. Due to some configuration in intellij it is possible to propagate any changes directly to tomcat. This way I don't have to manually build a new application and deploy it to tomcat which increases user productivity.
We want to remove tomcat and start using wildfly10 but also keep the hotdeploy functionality. On top of that the wildfly server will be hosted in a docker container.
So what I did is that I mounted the wildfly/standalone/deployment/myapp.war using docker to my host directory myapp/target/myapp.war. In addition I configured a jboss remote server configuration with remote stating set to same file system and let maven build an exploded war. This way if a maven build is performed, the contents of the target/myapp.war directory is directly available in my docker container. When I run the container and perform a new maven package, I do see that wildfly states that the new changes are found and redeploying has succeeded. Unfortunately this only goes well once or two times in a row.
So coming from the tomcat hotdeploy where no maven build was involved and any changes where directly available in tomcat, I'm wondering if the same can be achieved with the setup: intellij, maven, wildfly and docker. So if a change of a java file in intellij is compiled and pushed to wildfly without redeploying or maven build?
Wild-fly - eclipse supports 100 % Hot Code replacement
you have to start web-app in debugging mode .
For every change in java code just do a maven install and refresh
the target .
Limitations :
you can only replace statements in method .
you are not allowed to change whole class and new methods .
I'm new to Angularjs and i'm trying to run first angular program with Spring. I downloaded the code from here: http://javahonk.com/spring-mvc-angularjs-integration/. Imported it as a maven project. Downloaded JSDT and AngualrJs plugin from eclipse marketplace but it's still not running. There is no error message. I'm running this on tomcat 7. What am I missing?
Any help would be appreciated?
I'm not a Eclipse user. so I have no idea for that. But you can use nodejs as a static server. it is explained here
1) Install nodejs for your OS
2) Run this command in a terminal (console)
> npm install http-server -g
3) Start server
> cd /path/to/your/project
> http-server -o --cors
Now you can access your project from browser http://localhost:8080/yourfile.html
Work in Eclipse and just refresh page on browser to see changes.
If you are working on a Spring Application within Eclipse IDE, your best alternative would be to start you appliction using an embedded Application Server (Best I would recommand are Jetty or Tomcat if you ain't need EE level components).
You can follow this link, which holds basic steps for adding a new Application Server within Eclipse IDE.
Once you have added a new application server, you can deploy your application in it then launch it and you should have your applcation reachable at http://localhost:8080/SpringMVCAngularJS.
A good alternative when using Maven as a build tool, is using an embedded AS plugin such as Tomcat7 Plugin or Jetty Plugin. This plugin will provide the ability to start your applcation using the Maven different goals (which does not require adding a new AS into Eclipse IDE).
I've pushed a sample module based on the tutorial you mentioned. YOu can test the above described plugin as follows in a *nix shell (You may need to setup git if not already done):
git clone https://github.com/tmarwen/stackoverflow-showcase.git
cd stackoverflow-showcase/springmvc-angularjs
mvn tomcat7:run
I am getting tired of all the bugs in eclipse and m2eclipse, and would like to build with maven using the command prompt, plus afterwards start the server, and deploy the application to the server and publish it using the command prompt. Normally I do that within eclipse servers tab.
If I make a change to the code, then I should just rebuild with maven and republish.
I am aware that you can deploy an EAR in Wepshere admin web console, but it is not ear I am thinking of, at least I don't think so. I want to be able for example, once application is deployed, jRebel should be able to reload the clases in the jvm, but I believe the ear file is standalone so that wouldn't work.
So,
How can I start the server from the command prompt, plus deploy a project and publish it ?
Thanks!
You can automate the build so that it deploys the app as well, at least with Maven. Have a look at this post: Maven 2 and WebSphere:
WebSphere has (had?) a Rapid Deploy feature that you can use for "hot" deployments. Essentially it fired up a headless Eclipse for this, but it was much faster than a full EAR build and just as dynamic as going through WTP.
At the time, we had an Ant task that we used to copy the files over to the WRD directory. I'm not sure how that would work with Maven, but I imagine one could rig up something.
My problem is with respect to debugging web application on an already installed glassfish using eclipse.
If I create a web project using eclipse then eclipse will let be deploy and debug application on an already installed glassfish application server. However, if I have created a web project using maven archetype, eclipse does not let me debug the application.
I can use maven's jetty or tomcat plugin and debug the application but I need to debug application on an already installed glassfish. Basically I have followings
1) Web application created using maven archetype
2) Eclipse IDE
3) Glassfish which is already installed outside of Eclipse IDE
I came across maven's glassfish plugin but as far as I understood it is not for debugging the application.
Please let me know your suggestions.
Thanks
If I create a web project using eclipse then eclipse will let be deploy and debug application on an already installed glassfish application server. However, if I have created a web project using maven archetype, eclipse does not let me debug the application.
This is not true. Whether you use the Maven Eclipse Plugin (which provides WTP support) or m2eclipse (with the optional Maven Integration for WTP installed from the m2eclipse Extras), you can deploy a project created outside Eclipse to an existing "Server" (that you can start in Debug mode), as long as you imported it appropriately (Import... > Existing Project into Workspace if you use the former, Import... > Maven Projects if you use the later).
Basically I have followings 1) Web application created using maven archetype 2) Eclipse IDE 3) Glassfish which is already installed outside of Eclipse IDE
I use the same setup with several projects with no problem (and can debug them on my locally installed GlassFish server).
I came across maven's glassfish plugin but as far as I understood it is not for debugging the application.
There is no need for extra Maven plugins, you can just rely on your IDE if you follow the right steps.
I don't know about eclipse, but IntelliJ IDEA has a remote debug feature. You start your server with something like
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5055
and then the IDE will connect to that port and you'll have a regular debug.
I'm sure eclipse has this feature.
EDIT: This article shows how to use this feature with eclipse.
I´m going to write it most for me in order to keep trace of my solution:
If you are using the maven.failsafe plugin just force the execution of glassfish internally the current JVM started by maven avoiding the fork with the parameter
-DforkCount=0
in such way you are able to debug both test and server from the usual way, ie. running a debug task from eclipse and setting break points both in test and in server side.
Extra parameter information could be found here, including setting different debug port:
http://maven.apache.org/surefire/maven-failsafe-plugin/examples/debugging.html