Using eclipse & tomcat to test a war - java

I have several web services packaged as a .war file that is build by ant. I would like to test these wars as an Eclipse Dynamic Web Service. All the examples and help I've seen are based on Eclipse building the war file but I've not seen anyone deploy an externally build war file to an Eclipse hosted Tomcat service.
I am aware that you can create a war file from a Eclipse Dynamic Web Service, but since we have multiple developers using multiple IDEs and even multiple platforms the wars need to be created via an IDE agnostic Ant script.
Wars were developed so that a service could be portable. I just want to plug one into the Eclipse Tomcat Web Server to test.
Thank you but I don't want to create the war from Eclipse (export), nor import a war into my eclipse as a project. (I know how to do these and they don't do what I want). I want to deploy a war into a Eclipse/Tomcat service to test.
Thanks for reading this.

Related

What's the meaning of "Web exploded" mean in IntelliJ IDEA?

I am a new java learner and choose idea as my ide.
Now I am confused of the meaning of "Web exploded" as the image shows.
Exploded = unpacked. Normally web apps are deployed in war/ear archives (essentially zip). Using exploded deployment allows updating application without redeploying or restarting the server. The server doesn't need to unpack the web application when it's deployed, it just uses the files that are present in the directory.
This way you can test your changes much faster when developing and debugging, then you can build war/ear artifact and deploy it on the production server.

Can I deploy multiple WAR archive files to local Tomcat with IntelliJ IDEA?

I have two applications with two separate WAR artifacts. One is a WAR exploded directory for my front-end Angular app, and one is a WAR archive file for my back-end Spring REST api. I'm currently using IntelliJ IDEA to deploy my front-end to a local Tomcat server and was wondering how, if at all possible, I could configure IntelliJ to run my two artifacts on Tomcat simultaneously. I know I can do this by putting both under Tomcat webapps directory manually, but I was wondering if it was configurable in IntelliJ, and if so, how?
Yes, you should be able to do that.
If you are using Ultimate, you can create a "Local Tomcat" run
configuration in Project1, and go to the "Deployment" tab and drop in
the WAR file for your Project1. Then drop in the WAR file from your
other project (call it Project2) as an External Source. You would
then have both WARs in one run configuration.
This is the answer I found out under this link.

How do I export a GWT project into a executable JAR file with Eclipse?

There's a huge legacy codebase that I'm working with and I need to export it into an executable JAR file to make it easier for my co-workers to run it. It's a web application built on top of GWT, but I'm not sure what kind of application server it uses (e.g. Apache Tomcat, Eclipse tells me it uses a "built-in" server).
The run configuration shows up when I try to run the project, but not when I'm trying to export it as an executable JAR. All it does is run an application server on the machine, and allows a user to access it via 127.0.0.1:8888 in a web browser. Any ideas?
Right click on the project.
Google
GWT Compile
Zip the output (I think the war folder) into a war file which can be deployed in tomcat or jetty or something else.
(Creating an executable jar from a GWT project is not possible, you should create a war).
(Make sure to have the eclipse google plugin installed (https://developers.google.com/eclipse/docs/getting_started))

Is there a way to deploy a Maven project with "jar" packaging into Tomcat7?

My project generates a Jar as the output package and uses an external War file, available on our Artifactory, as the Web Application to be deployed on Tomcat (currently using version 7). This War file contains all libs and modules required for the application to run.
I have already packaged and ran those projects outside eclipse on a "vanilla" Tomcat installation. In this scenario, the Jar my project generates is loaded on the context.xml file this way:
<Loader className="org.apache.catalina.loader.VirtualWebappLoader" virtualClasspath="/home/igor/workspace/myapp/myapp-2.4.3.jar"/>
Is there a way I can deploy this project on Tomcat using Eclipse and still be able to debug it? Can I use the Jar generated for this purpose or do I have to deploy the workspace project?
As for the War file, do (or can) I have to add it as an dependency?
Thanks in advance!
EDIT
We actually provide an Web Framework, which is packaged as a war. Other applications that use that framework are exported as jars and loaded into the framework through the context file as cited above.
Your question is confusing probably because of your custom plugin/classloader and deployment which is sort of orthogonal to debugging.
What I recommend is you keep whatever system you have to build/package/deploy and use JVM remote debugging. That is do not use the Eclipse WTP since you seem to have custom steps for deployment but rather build your code deploy & run a separate Tomcat instance and then run the remote debugger in Eclipse.
You will get some hotcode swapping with this method but not as much as something like JRebel.. (which you could use also) it will certainly be better than constantly redeploying.

deploying Java web application in exploded directory outside the Tomcat server, using Eclipse

I have been using IntelliJ IDE (version 5.1) with Tomcat server (version 5.5) to build my Java web applications. I'm now trying to migrate my project to Eclipse IDE.
When I run my web application from IntelliJ IDE, it creates a exploded directory inside my web application project folder and then starts the server and runs the web app. (i.e. no WAR files and no copy to tomcat\webapps folder).
But in Eclipse IDE, it usually deploys the web app inside Tomcat's webapps folder.
Is there any way to deploy web applications to a exploded directory outside the Tomcat server, from Eclipse IDE?
There is pretty neat Eclipse plug-ins you can install that will allow you to do that.
Have a look at Plug-in, tutorial and from Sysdeo.
Sysdeo is the one that both Apache and IBM suggests.
There are actually quite a bunch of these plug-ins from different vendors.
The trick is to find the one that best suits your needs.
Hope this helps.

Categories

Resources