Doug Johnson

Greenhorn
+ Follow
since Dec 13, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Doug Johnson

I think I misspoke by referring to the 'working directory'. I am a pea-green newbie when it comes to J2EE. I am just transitioning from application programming and hopefully will learn something. I have been following along with the HeadFirst JSP book and it does show a pretty basic directory structure using Tomcat 5. I was just noting that I did get my single page to work by putting it all by itself in my (only) app directory. I haven't gotten to the creating a WAR parts yet but I do have mine set up with the structure described in the book. There is just nothing in any of the other folders yet.

In Eclipse there is a server setting titled Deploy Path which is what I think I meant to refer to. I assume you can use that to tell Tomcat where to look for your webapps if you don't use the default directory. I noticed that Eclipse created a much more complex directory structure when using Tomcat 7. Antigioni originally had his page in what I assume is the Java src file, which I am pretty sure is not where anything but java source files should go and is what I assume you meant...

J2EE - meaning webapps - does not have a "working directory". Using the stock Java working directory is done at your peril, since you never know what may be changing it externally and asynchronously.





11 years ago
Do you mean where the .jsp file is stuck? That is the default place Tomcat expects to find it but if you get to the server options I think you can change the working directory to where ever you want probably. I am no expert though so I don't know what the side effects might be - it certainly would make it harder to move it to a different install. If you are just doing it like I did...just for learning purposes...I guess it would be OK!
11 years ago
Probably already did this, but did you add the TestTomcat app to the server? Open the Servers tab, right click on the server, chose Add/Remove... and select TestTomcat fromt the left column, click on the add arrow in the middle. It should now be in the right column. Hit OK. Any luck?

Also, it could be where you put the .jsp file. My working install has it located in MyWebApp/WebContents/index.jsp. At least I think that is where I had it. Busy day today so I won't be able to get that system all rigged up to check.
11 years ago
Yes, they are all in the webapps folder. I double-checked the paths to be sure they were correct as well. Is there a log somewhere besides 'logs' that might give me more of an idea of why it is getting the 404 message for those pages?
After restarting my computer I noticed that $JAVA_HOME is still pointing to java-6-sun. It is a complete installation and has all the directories that java-6-opejkd-amd64 has so I don't see why that might make a difference, but???

So far, today, it is working in both places. I have stopped and re-started the server from the command line and it is still working. Everything is working now in Eclipse as well. Maybe something caught up, maybe I just haven't done whatever it is I did before yet to break it??

I changed the Eclipse Server Locations setting to use the Tomcat installation instead of the workspace metadata (based on your observation re:environment settings) and that may have done the trick. It is still working when I start it from inside of Eclpse.

Thanks again for your time.

Doug
11 years ago
Thanks.
When I start from the command line I get the following:
Using CATALINA_BASE: /home/kenneth/Tomcat7/apache-tomcat-7.0.34
Using CATALINA_HOME: /home/kenneth/Tomcat7/apache-tomcat-7.0.34
Using CATALINA_TMPDIR: /home/kenneth/Tomcat7/apache-tomcat-7.0.34/temp
Using JRE_HOME: /usr/lib/jvm/java-6-openjdk-amd64/jre
Using CLASSPATH: /home/kenneth/Tomcat7/apache-tomcat-7.0.34/bin/bootstrap.jar:/home/kenneth/Tomcat7/apache-tomcat-7.0.34/bin/tomcat-juli.jar

I didn't want to install in the default /usr/share directory as I was having issues with rights there...those are root only to modify. It was easier to put it in /home and I only need to be able to practice here at home with a working server.

JAVA_HOME is at: /usr/lib/jvm/java-6-sun. I changed that to /usr/lib/jvm/java-6-openjdk-amd64 but suspect that won't show up until I restart Ubuntu.
I am not sure what changed but now when I start the server either via command line or from Eclipse everything works fine in FF, but not in the Eclipse internal browser. Eclipse shows the welcome page but no links work. Correction: In FF the manager app worked once but now the link gives a 404 error. Manager/html and host-manager/html are not working now??? I tried restarting the server but still can't get the manager apps to work. changelog and release notes don't work either.

Strange how some are working, some not.

Thanks for any guidance/insight you can provide


11 years ago
I am using Ubuntu 12.04 and installed Tomcat 7.0.34...apparently successfully. I also added the same server to my Eclipse (Juno) application.
I can get to the Tomcat welcome page both ways but nothing else works. I get 404 errors for every link from that page...docs, manager, etc. It does this from inside Eclipse as well as in a regular Firefox browser.
Am I missing somehing simple? I tried checking the logs but there isn't much there.
11 years ago