Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

running the sample code in eclipse with tomcat

I was trying to run following examples from link below
http://www.manning.com/deshmukh2/
'Simulator and Source Code'
It has about many directories/folders like chapter01, chapter02.....etc.

I am using eclipse with tomcat.
I pasted the folder(say chapter0) at tomcat webapp directory.
When I start tomcat and go to the url


http://localhost:8080/chapter07/filter
It is not working

 Please advise
Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
Avatar of basav_com
basav_com
Flag of India image

Did you try to start tomcat alone (instead of using eclipse) ?
What is the error message you are getting ?
Avatar of girionis
What happens when you go here: http://localhost:8080 after you start tomcat.
Avatar of gudii9

ASKER

C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin

clicked on startup.bat

nothing is happening
Avatar of gudii9

ASKER

http://localhost:8080/ shows

You've opened a new tab
   
   
With tabs you can:
Use one Internet Explorer window to view all your webpages.
Open links in a background tab while viewing the page you're on.
Save and open multiple webpages at once by using favorites and home page tabs.


To get started:
Press the CTRL key while clicking links (or use the middle mouse button).
Click any tab with the middle mouse button to close it.
Press ALT+ENTER from the address bar or search box to open the result in a new tab.
 
please advise
Avatar of gudii9

ASKER

i was able to start server from eclipse.

I pasted chapter04 war as well inside
C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\webapps

when i go to
http://localhost:8080/ 
or
http://localhost:8080/ chapter04 gives

'HTTP Status 404 - /

please advise
Avatar of gudii9

ASKER

when i ran from command prompt on my windows machine got following error message. Please advise



C:\>cd C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin

C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin>startup.bat

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin>
Avatar of gudii9

ASKER

http://wso2.org/project/wsas/java/1.1/docs/setting-java-home.html

i followed above link to set the java_home
Avatar of gudii9

ASKER

It finally worked. thank you all.
 
So I do not have copy paste the war file. Just pasting chapter04 etc folder/directory should be fine.

It worked fine with

http://localhost:8080/ chapter04

when I pasted chapter04 folder/directory in webapp directory
Avatar of gudii9

ASKER

It worked fine with

http://localhost:8080/ chapter04

when I pasted chapter04 folder/directory in webapp directory

How can I run run this web application example in the eclipse. I mean how to import in the eclipse this project so that I can debug easily as eclipse application.

Please advise
If you need to be able to debug your application from eclipse have a look here: http://blogs.mulesoft.org/debugging-your-tomcat-webapp-with-eclipse/

Bythe way if you go to http://localhost:8080 you should see the default Tomncat page.
Avatar of gudii9

ASKER

File | Import | General | Import existing project into Eclipse. In the import dialog

Here I see two radio button options

I selected first option

1. select root directory


Then eclipse is giving error like

 No projects are found to import


Please advise on how to import no eclipse project folder into eclipse.
No projects are found to import

This means that the project is not an eclipse project. Are you sure that the project has an Eclipse structure?
Avatar of gudii9

ASKER

no i do not think it has eclipse structure. How to make it eclipse structure. say chapter04 folder from this link


http://www.manning.com/deshmukh2/
'Simulator and Source Code'
Nope they are not in Eclipse format. You have to manually create a project and copy/paste the files. There is no other solution.
Avatar of gudii9

ASKER

I cannot copy paste .project file from some other existing eclipse project folder and edit it then import as eclipse project right?
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial