So I have installed Tomcat and that is working just fine. Currently I’m using Maven in Eclipse for a project. I want to run a servlet on tomcat with a maven project, how do I do that? It’s not as easy as just putting the files in the tomcat/webapps folder.
Related
I have read every page that shows up on the first Google result page with that search. But nothing seems to help.
Of course I can run "mvn clean install" in or out of Eclipse and get the .war generated in the target folder. I can copy the .war in the deployments folder of JBoss installation myself. And then I can start the server through the server adapter in Eclipse.
But I want that "manual copy of war" to be automatic as well.
How can I do this? What do I need to do to add a new item to "Run As" menu, say, "Maven JBoss Deploy" where underneath, it does a clean, install, deploy (copy to deployments)?
I have Maven 3.1.1 installed separately (outside of Eclipse) and I have told Eclipse where my Maven is. I have JBoss Tools (latest version) installed with JBoss Maven Integration part of it.
I just don't see any way to integrate JBoss and Maven within Eclipse :(
You can do with fileName tag
<fileName>${basedir}/target/webapp.war</fileName> in pom.xml
or
You can go with Profiles in pom.xml
More 1
More 2
By trial and error, I was able to get Eclipse to deploy a maven project WAR on JBoss.
I just needed to have "Dynamic Web Module" facet attached to the project. I did that using the Project properties in eclipse.
Now I am able to right click the project and Run As Server and that deploys to JBoss. And the project is still a Maven project. Yay!
I'm working with Maven and WebLogic. When building my application with Maven, I can successfully install it manually on my local Weblogic, using the Admin Console.
When trying to deploy this same application on the server using Eclipse IDE, I get a NoClassDefFoundError. (I tried both with "Publish as virtual application" and "Publish as an exploded archive" in the Oracle Weblogic Server tools in Eclipse).
The structure of my application is the following:
MyApp.ear contains:
- MyWar1.war
- MyWar2.war
- MyEjb.jar (ejb module, using maven-ejb-plugin)
- MyJar.jar (another project, as dependency)
And it's this MyJar.jar that seems to be not found in the classpath. I've checked that in the Eclipse settings, this project is include in the Java Build Path\Project, Java Build Path/Order and Export and in the Deployment Assembly for the MyEjb project.
I've also checked the folder build by Eclipse, eclipse-workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\MyApp, where I can see the folder APP-INF\lib\MyJar.jar with the corresponding .class files. And when I try to manually manually install this folder, I got the same error (NoClassDefFoundError).
I'm using Weblogic 10.3.3, Maven 3.2.1, Eclipse 4.4.0 (20140612-0600) and Oracle WebLogic Server Tools 7.2.1.201407111426.
Any ideas how I can investigate this problem ?
Moving the dependencies from APP-INF/lib/ to lib/ folder seems to fix the problem, but I have no idea why.
Hello all master minds,
I have created a java spring application in eclipse with mysql db.
Now I can run this application using >Run on server in eclipse,but I want to know how to deploy this application on my own laptop(windows 7).
I have already configured server,by localhost://8080 I can see Apache tomcat is configured.
Give me simple steps so that i can just run that software using browser via its link like
http://localhost:8080/PMS
PMS is my project name.
Thanks in advance.
You can install tomcat-manager in order to deploy your war using a web interface: Tomcat 7 manager
Another option is to copy your war file into tomcat webapps folder. Your container will auto deploy your war: http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html#Deployment_With_Tomcat.
The easiest way, since you are using eclipse is to just export your project as war and then put that war (naming it PMS) in webapps directory in your tomcat.
Once started, Tomcat will deploy that war on http://localhost:8080/PMS
You have to do the following steps:
Right click on project>> Export (Export as WAR file).
or if you are using a maven project then you can give a maven build.
Copy that WAR file, (you will get that war file inside the project folder in your workspace) to the tomcat_Installed_Folder/ webapps
Inorder to deploy the app from outside eclipse,
goto tomcat_Installed_Folder/bin
and double click on startup.bat
then you could see a console.
For detailed logs of deployment, goto tomcat_Installed_Folder/logs
ALL THE BEST :)
I'm using maven and the embedded tomcat through the tomcat-maven-plugin to run my Spring MVC project. Now I've got a another war file which I also want to run on this tomcat. Is there a way to achieve this? It doesn't seem to work, when I put the war file in the webapps folder of the embedded tomcat.
support of this feature is in snapshot version of the plugin see https://issues.apache.org/jira/browse/MTOMCAT-169
When i make the war i see the XCV.Jar, but I add the project on Tomcat (IDE eclipse), and when I deploy it, I have all jars except XCV.Jar (This jar is the parent of the project I deployed).
When you deploy to Tomcat from Eclipse it often fails to clean up the work directory directory. Try to clean $TOMCAT_HOME/work/Catalina// and the web apps directory then try redeploying.
If you are running tomcat inside eclipse you're asking for trouble. Its often better to build and validate the .war independently(with ant or maven) then deploy manually or with a script.