Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android forum!

Greg Vaslo

Greenhorn
+ Follow
since Sep 13, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Greg Vaslo

Hello all.

I have installed Tomcat 6.0 in Windows Vista. When I initially install it, it gives me a point at the end of the windows installer where you can click a check box to start apache. I click close on the window and apache starts, and an Icon appears in my system tray in windows and the thing starts no problem. I need to make some changes to my setup for my project, and so I exit apache tomcat. When I try to restart using the "Tomcat" icon in the bin folder, nothing happens except a window that runs for a bit and then closes.

I am confused at how to restart this program. I have tried anything executable in the startup menu (Configure Tomcat, Monitor Tomcat, etc.) and I get warnings like: Unable to open the service 'Tomcat6'.

Again, I do nothing after I exit Apache in the system tray. Am I not supposed to exit from the tray? Why does it work fine on a new installation, but once I exit and try to restart, I have issues.

Thanks for all your help in advance.
11 years ago
Hi everyone,

I have a question about servlets in Netbeans. I am using Netbeans 5.5. When I try to import the follow things, they come up as not existing:

import javax.servlet.*;
import javax.servlet.http.*;

I was trying to do this from a regular Java file, not a JSP file. That said, when I tried to look up how to create a "JSP" file, the directions in the help do not turn up the correct menus. For example, it says go to New File/Folder -> Web -> JSP. There is no "Web" listing under new file/folder.

Thanks for all your help Java geniuses!!!
Thanks, that worked, but now I got a null pointer exception. -I am so lost, I can't stand this Objects First with BlueJ book-VERY hard for a beginning. Like teaching algebra by showing you calculus.
11 years ago

Originally posted by Henry Wong:


It's a compile error. The get() method returns an Object type (unless you use generics). You need to cast it to the object type that you are expecting. Of course, it needs to actually be that type, or you will get a runtime exception.

Thanks for fixing your screen name.

Henry



Thanks for getting back to me so quickly on this, and I appreciate your advice on this, and understand what you are saying, but how does one do that? I know how to typecast something, but no idea how to do it in an arrayList.
11 years ago
Is that better on the screen name?

It gives me the error: found java.lang.Object but expected Location

Basically, like I said, how does one "Pull" an object from a list and then set it equal to another variable?

Thanks!
11 years ago
Hi everyone,

I need a very quick tutorial with array lists-I have used the API and searched through 3 books but just can't get it. I have the following code in a program:

public void pickup(Passenger passenger)
{
passengers.add(passenger);
destinations.add(passenger.getDestination());

}

Both destinations and passengers are ArrayLists (or could be linked lists, doesn�t matter)�A passenger object and their destination is added to a "shuttle".

I have a function that I would like to access the destinations list. The function looks like this:

private Location chooseTargetLocation()
{
target = destinations.get(0);
return target;

}

Of course, this doesn�t work, and I don�t know why. Basically I want to pull a location from the destinations and set it equal to target-so basically, how do I pull an object from an Array or linked list and set it equal to another object type variable, so I can get it, set it, all that?

Thanks in advance!
11 years ago