This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Run As --> Run on server in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Run As --> Run on server in Eclipse" Watch "Run As --> Run on server in Eclipse" New topic
Author

Run As --> Run on server in Eclipse

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi,

I have 2 different web projects in eclipse..For a jsp file in one web project, I am able to select Run As-->Run on Server. But, For a jsp file in other web project, I am NOT able to select Run As-->Run on Server. I see Run Configurations instead of Run on Server..Tomcat is installed..If I deploy both of these projects, they are working fine. Please le me know why I am not able to see Run As-->Run on Server.Thanks !!


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 557
Has the second project, the one that doesn't present the "Run As > Run on Server" option, been added to the server? You can determine whether the project has been added to the server and add it if it hasn't been by:

Add the server(s) view: select the Eclipse main menu item Window, Show View, Servers
With the servers tab selected in the bottom panel, right click on your server, select "Add and Remove"
You can use the resulting Add/Remove tool to add the second project to the Server.

Once the project has been added to the server, you should get the "Run As>Run on Server" option.


Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi Greg, I tried that option already. I have attached the screenshots for the same. Please let me know if I need to do anything else.


[Thumbnail for P1.png]

[Thumbnail for P2.png]

Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 557
I can't read your screenshots too well, but it's not your fault. It's a combination of bad eyes and low-res monitor at my end. Even so, I can tell from the pictures that I would be doing what you're trying to do differently. Mine may not be the right way or yours the wrong - just different.

To "run" that jsp file on the Tomcat server, I would open a browser and point to it using the address:

http://localhost:8080/projectname/filename.jsp

8080 - you may have changed this to another port as occasionally suggested by some
projectname - change this to you project name
filename.jsp - change this to the name of the jsp that you're trying to run

This assumes your server has been started, no errors, the project has been added to it, etc., etc. If there is something wrong with those assumptions, you'll get an error message from either the browser or the server to get you pointed in the right direction.

I apologize if my answer is limited by my own minimal experience. I'm new at this myself so struggling through many of the same adventures.

Also, I've been having good luck with the typical Eclipse setup, using Web Tools Platform (WTP) and Eclipse's otherwise built-in server support. I've seen others complain about the limitations or bugginess of that setup, recommending the sysdeo Eclipse plugin for Tomcat as a solution. I have no experience with sysdeo so can't recommend one setup over the other.
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi Greg, It works if I deploy into Web/Application server. But, My concern is why I am not able to leverage Run As--> Run on Server feature for only one project. Rest everything works fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Run As --> Run on server in Eclipse
 
Similar Threads
Creating a J2EE Project using Eclipse Gallelio
Unable to view images
applet is not running in jsp
Dynamic Web project with multiple Java projects
Adding Flex capabilities to an existing J2EE Enterprise Application Project