I have a web application(Myapp) configured in eclipse.
So in order to Deploy it in Websphere v5.1 I have to export it to EAR.
Scenario 1: In eclipse--> new --> Enterprise Application Project
-->Named as MyappEAR--> Selected Existing Module(Myapp)--> Finish. Now I got MyappEAR in Project Explorer. Right click on MyappEAR export to
EAR. Done. Got MyappEAR.ear file with Myapp.war inside it.(Includes
META-INF and xml)
Deployed MyappEAR.ear in Websphere, Deployed Successfully. But when i
tried to start MyappEAR it ends up with this error SRVE0054E: An error
occurred while loading Web application (No more information found).
Scenario 2: Eclipse--> right click on Myapp export to war--> Got
Myapp.war--> Deleted existing myapp from Project explorer.
File-->Import-->WAR--> enabled Add project to an EAR and named it as
MyappEAR-->finish Right click on MyappEAR-->export to EAR. Done . Got
MyappEAR.ear with same stuff as above.
Deloplyed and Started working fine.
Now my question is What's the difference in both ways causing that error? (even checked with beyond compare, everything is same).
Websphere app server v5.1,
Java 1.4,
Eclipse Indigo.
We have a Maven project and it builds the EAR after we run mvn clean install.Then I take EAR from target folder and deploy it in server.
In local setup,Just add the project in server and start the server.Normally it works.
Related
To my knowledge, to deploy my web application to tomcat, I need to move the war file under webapps in tomcat home. And in eclipse, in order to do that I right click on the server and select "Add and Remove", then add the projects to deploy them when ran.
Without eclipse, I have to make the war file myself by using jar -cf projectname.war * but I don't at which directory should I use this command. Also, should I compile all the sources in the src folder first?
To sum up my question, what is the step to run my web app on tomcat without using eclipse? I want to know what eclipse have done for me under the hood.
Thanks in advance!
I've inherited a Spring web app. It's a gradle web app project that I've imported into Eclipse. We're using Eclipse 4.7.3, Tomcat 7.0.47 and JDK 1.8.0.151.
The problem is that when I deploy the project to Tomcat from Eclipse, some of the dependency jars are not copied to the project lib directory. When TC tries to start the web app, there are ClassNotFoundException errors.
I'm new to Java web apps, so what I need is some tips for verifying my project import/build/deploy.
Here's what I've done so far:
Install Tomcat 7.0.47 (don't start it after install) Install Eclipse
4.7.3 JavaEE flavor (which comes with Buildship Gradle integration 2.0 installed)
Import my project as a Gradle project (File -> Import -> Gradle ->
Existing Gradle Project). I point at the project root, choose the
web project for deployment, and use the default settings.
Add a server to the project (from Server view click Add -> choose
Tomcat 7.0 -> point to TC root)
Right click the web target and select Run As -> Run As Server and
choose the TC 7 server I added.
At this point the project builds and deploys. The console shows the TC log. TC starts but the shows an error when it attempts to start the web app (for example):
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
I could copy jars but it's my impression Gradle should be grabbing the dependency jars during deployment. I can verify that some are copied, but others are missing. How can I debug this issue?
Here's part of my build.gradle file
buildscript {
repositories {
maven {
url projectDownloadUrl
}
}
dependencies {
classpath lib_license_gradle_plugin
}
}
The web app is deployed to ...eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0. The lib directory here contains some of the deployed dependency jars. The gradle.properties file contains a list of dependencies, for example
lib_apache_tomee=org.apache.openejb:apache-tomee:1.7.1
This is apparently not the place to ask and answer Gradle/Tomcat questions. I figured out the issue shortly after posting, and not wanting to disappoint the 40 people who've come here for help since then, thought I should finally answer my own question.
First, I was on the right track on how to debug deployment of a gradle/maven app in Eclipse. After it deploys you can check which jars are in the deployment directory. Eclipse deploys locally to a place similar to c:\users\\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core.
Second, the immediate problem I was having was due to using Tomcat instead of Tomcat EE. The answer to this was right in the question:
lib_apache_tomee=org.apache.openejb:apache-tomee:1.7.1
Tomee is Tomcat + Java Enterprise Edition, which includes some extra logging and other jars, the ones I was missing.
I have a project that is dependent on two war files being deployed to Tomcat. So every time I want to test it, I need to build an artifact and manually deploy it alongside the two wars. Is there a way to somehow add those war files to my Idea project so they can be deployed automatically by pressing Shift+F10.
I would deploy it manually, but I have several people working on the project and it would greatly simplify the communication.
Wars are external and they have no sources, so creating new modules/artifacts out of their source is out of the question.
Could you help me?
Since the link on the accepted answer is dead, here is the process, step by step (I'm using Intellij 14):
1) Select Run/Edit Configuration
2) If no Tomcat Run Config exists yet, create one
3) Select the Tomcat run config just created, on Deployment tab, under Deploy at server startup section, click the "+" (right sidebar), select External source, and select your war file.
You can add external webapps to deploy at startup at the Deployment-Tab of your tomcat runtime configuration page.
https://www.jetbrains.com/idea/help/run-debug-configuration-tomcat.html?search=tomcat#d884440e708
I just started to work on JSF. And i followed some steps. At last step i created project configured it. After build the project, eclipse created target folder inside of my jsf project. i moved the war file to webapps folder of apache tomcat.
After localhost:8080/firstJsfApp it worked successfully.
But when I changed something on this project and it recreates the .war file. and I have to move it to tomcat folder again (repeatedly).
Is there anyway to make this easier?
You can deploy your webapp to tomcat directly from Eclipse:
1st. Open the "Servers" view in Eclipse, and it will allow you to configure a tomcat instance.
2nd. Add your webapp to the tomcat
Then you can debug and hot deploy any changes to the project.
Here is a link were you can run tomcat in eclipse: http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html
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 :)