Deploy and debug application on OC4J in eclipse - eclipse

I have a tomcat webapp project checked out in eclipse (call it 'xyz'). I use eclipse tomcat plugin with Devloader. Everything runs fine. etc, etc, happy.
Now I want to run the same project on OC4J app server and debug in eclipse. For that, I have downloaded and installed standalone OC4J server. I created a OC4J server instance in eclipse. Question is how do I deploy the earlier checked out project 'xyz' to run on OC4J server in eclipse.
Additionally, is there any plugin for OC4J similar to tomcat in eclipse, that makes life easier.
Thanks in advance for your replies.

Package your application in an EAR file and deploy it to OC4J
Start OC4J with VM arguments that enable remote debugging (See http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/jdb.html)
Create a Debug Configuration of type Remote Java Application in Eclipse, and use that to connect to the running VM

Related

How do I change instance when debugging Eclipse through Tomcat

I have a Java servlet application to maintain and have downloaded both the Live version and the Test version rom SVN to Eclipse (Helios) and have associated my Tomcat 7 with Eclipse to debug the applications. But when I attempt to Run or Debug the Test instance of the servlet on the associated Tomcat server Tomcat always seems to start the Live instance. For example when I attempt to start the Live Instance - in Eclipse it shows the URL to be;
https://localhost:8443/SWFinanceLive/WEB-INF/classes/path/to/web/request/entry/point.java
When I am expecting;
https://localhost:8443/SWFinanceTest/WEB-INF/classes/path/to/web/request/entry/point.java
How do I change the instance when running through the server in Eclipse?
This link seemed promising but then doesn't tell you how to change the setting;
tomcat server instance debugging in the eclipse
With the assistance of #Susie I was able to change the project root context. Things are working as I desire now

Connecting eclipse to my server

I'm not sure if this is possible, but we are doing a dynamic web project in school, (java,html,css,mysql) and we have a home server running (apache, tomcat, php, mysql) is there a way to connect Eclipse to that server so that i dont always have to pack a new war file and upload it through tomcat manager ? It would be easier if the result could be seen instantly on the server.
Eclipse supports local tomcat deployment. To deploy to a remote tomcat you can either use Maven or Ant.
There is a cargo plugin as well but personally I have not used. My preference is maven plugin.

Eclipse running a web app on an existing tomcat installation

I have an existing tomcat server running on my local machine that is being started from outside of eclipse. Is there a way to deploy my web app from eclipse to that tomcat instance without having eclipse trying to start that instance of tomcat?
It's possible using ANT scripts in eclipse which will deploy war file into tomcat directory and tomcat will take care rest of the things.
For those ant scripts you can see this below links
How Apache Ant deploys .war file to Tomcat
http://www.coderanch.com/t/423905/tools/automate-deployment-war-Tomcat-through

Eclipse + JBoss Tools won't run webapp to configured JBoss AS

I am using Eclipse 3.7.2 with JBoss Tools 3.3 under Ubuntu 12 and have configured a locally installed copy of JBoss AS 7.1.1 in Eclipse under "Preferences::Server::Runtime" Environments.
However, when trying to run a Java EE application by double-clicking on the project or an .xhtml page I only see "Run As / Run" on Server as an option and I get an HTTP 404 from Apache Tomcat/7.0.26 at localhost:8080. That is, it seems like Eclipse is trying to deploy to a Tomcat server as opposed to the JBoss AS I have configured in "Preferences::Server::Runtime" and I don't get an option like "Run on JBoss" or anything. When I export my application as a war and manually deploy to JBoss AS the app runs fine.
The idea is to add your application to a specific server that you have configured. Additionally; just adding the server runtime isn't enough.
You need to open the Servers view, and from there right click on the background and select New, and then Server. If you choose JBoss Community -> JBoss AS 7.1 here, you can select your previously created Server runtime in the Server runtime environment, or optionally create a new one.
Then comes the mental twist that you need to make. In WTP you don't use the Run As command, but instead right click the server in the Servers view (default name should be JBoss 7.1 Runtime Server, and select Add and Remove. Select one or more applications from your workspace that you would like to run on your server. Click finish when done.
Now right click again on your server, and choose either Start or Debug.

how to stepin/debug a Maven web project in eclipse

I have a Maven project which is a web project and is packaged as a war.
I use tomcat-maven-plugin v1.2-SNAPSHOT to do a tomcat:deploy when i want to deploy.
But my question is how do i debug it / set breakpoints like i can do for normal web projects in eclipse (where a Debugging perceptive is shown and the server is paused.)
(i am a noob in this field)
[EDIT] I am not asking how to deploy to TOMCAT. i am rather asking how to setup the debug mode .FYI i am not able to right click on my project and select run> run on server, even though i have generated WTP specific files through maven.
mvn tomcat:deploy deploys an app to an external Tomcat server. If you want to debug that, you'll need to run that Tomcat server with debugging enabled and set up a remote debugging profile in Eclipse.
Edit: There's a succinct guide to doing this on the Tomcat wiki. The simplest approach is to start Tomcat with catalina jpda start. That will start Tomcat in debug mode listening on port 8000 for debugger connections. Then in Eclipse, you create a "remote" launcher configuration and tell it to connect to localhost:8000.
It doesn't matter whether you deploy it with maven or with Eclipse WTP as long as you started the server to which you deploy from eclipse and eclipse knows where the sources of the code you deployed are placed.
Keep attention if you have set the CATALINA_HOME environment variable, this will used to deploy to with mvn tomcat:deploy. But you can also define this in the configuration of the pom.xml.
<configuration>
<url>http://www.mydomain.com:1234/mymanager</url>
</configuration>
I'm not sure that it is feasible through the Maven plugin.
But you can generate eclipse specific files: mvn eclipse:eclipse -Dwtp.version=2.0 (The WTP version depends on the WTP version of your Eclipse).
Then, you can update your project and deploying it into a Tomcat like you can do for normal web projects.
This solution worked in my case, you can try this
Add module to Server
Go to the Servers view.
Double click on the Tomcat server.
You will get the server editor view.
Click on Modules tab in view (at bottom)
Click add External Web Module enter the path to your built files (e.g., C:\svn\projectName\trunk\test\project\target\webapp) and give a path.
Save.
Debug Server
Right-click on Tomcat in Servers view.
Choose Debug.
Debugging Startup
If you are debugging the startup of your application you might need to increase the startup timeout in the server view.
Thanks.