John Freshman

Greenhorn
+ Follow
since Jun 19, 2005
Merit badge: grant badges
For More
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 John Freshman

(Thanks Gregg for the re-location advice...)

I have heard that Hibernate is known to really bog down e-commerce types sites that have a high volume of users hitting the db. Does anybody have a source reference for benchmarking its performance?
I have heard that Hibernate is known to really bog down e-commerce types sites that have a high volume of users hitting the db. Does anybody have a source reference for benchmarking its performance?
Thanks for helping to clarify (URL rewriting, not redirect). Initially it seems that cookies would not be the best way, but I am the student here.

Do you know if companies like Google and Yahoo depend on cookies as well?
18 years ago
I have read many thoughts from authors regarding the use of these different strategies for tracking users. As I get more and more specific with my own designs for a user environment, I am really interested to hear what is used most prominently in the real world and why.

What do some of the big boys use? Google? Yahoo? MSN?

I'm curious what you think...
18 years ago
I stand corrected:

I was missing the all important ";classes;" in my -classpath statement.

Since the examples in the book are shown using a MAC (which uses Unix, hence forward directory slashes), I assumed the :classes: statement was foreign to Windows and would not work in Windows.

I'll never doubt again
18 years ago
I am sorry, my post has a typo. The

classes\com\examples\model

should be

classes\com\example\model



The 'example' reference is singular, not plural.
18 years ago
If someone has read this book or has prior info which might get me back on track, I would really appreciate it.

I am getting a

package com.example.model does not exist

error and yet I have followed the book instruction to a tee (code, directories, etc). I am wondering if the book may be in error since the import statement points to a directory that contains only a java file instead of a class file (as shown below). As instructed by the book, the class file, which the import statement points to, is not in the

src\com\example\model

directory -- rather it is in the

classes\com\examples\model

directory (right where the -d command SHOULD put it).

Below is the directory structure and the servlet code

DIRECTORY STRUCTURE:
beerV1
---src
------com
---------example
------------web
---------------BeerSelect.java

------------model
---------------BeerExpert.java

---classes
------com
---------example
------------web

------------model
---------------BeerExpert.class


SERVLET CODE (as instructed by book):


Thanks in advance for your help.
18 years ago
Thanks all for the help.

Regarding JavaRanch, I will gladly obey the rules of the site and voluntarily help when I can as well (if I can).

To James, I apologize for my rudeness, I am sure you have a lot to offer any newbie like myself.

Also, to get back on topic, I am now able to compile the code as it is right from the book. I thought I had correctly configured my CLASSPATH but I was wrong. It had an incorrect reference to the bin directory in my project directory, which I removed. That did it!

Thanks again to all.
18 years ago

Originally posted by L�szl� Kov�cs:
Having just tested it out, I can see that my guess was wrong. Your classes both compile and run here. I should carry on reading my book and not butt in!

However, you (or someone else reading this) might be interested to know that the first time I tried to compile MovieTestDrive.java I got the exact same error that you did. Then I tried to run some of the other packageless examples that I've made while following the book I'm reading and I got the same error: the reason, in my case was that I had set a classpath environment variable which meant that javac was looking for the class in the wrong folder - not looking in the same folder as the one I compiled the Movie class in.




L�szl� -
Thank you for your help!
My CLASSPATH was jacked-up... I am now able to compile.

To others, my name has been changed to comply with site "rules." (By the way, the single most promenent rule that was presented to me when posting was "be nice." Hmmmm.)
18 years ago
Thanks for at least trying to help, L�szl�.

And James, what is the point of posting useless replies and quoting rules instead? Seems like bureacratic nonsense to me. If all you're going to do is arrogantly quote rules, then the book AND the site are meaningless.
18 years ago
No, there are no packages being used in either of these little class tests.

I think it's interesting that I do have both Apache and Tomcat installed and have been successfully compiling servlets for about a week now. I have not needed a single package for any of my testing. I have spent weeks properly configuring all my setups... except for packages (argh!).

I do appreciate your suggestion, but do not understand why a teaching book as good as the Head First series would publish small, simple classes to play with, but omit the fact that they should be used within packages.

All that aside, both these test classes are in the same folder and I am attempting to compile them both from there. The first works, the second called MovieTestDrive does not, assuming because it is not aware of the first.

Here is the code:

(this class compiles)

class Movie {
String title;
String genre;
int rating;

void playit() {
System.out.println("Playing the movie");
}
}


(this one does not)

public class MovieTestDrive {
public static void main(String[] args) {
Movie one = new Movie();
one.title = "Gone along with my brain";
one.playit();

}
}


Thanks in advance for helping me properly set up the package which will allow this to compile and run.

~Mark
18 years ago
Hi everyone -
I am brand new to java, and have recently purchased "Head First Java" (great book - by the way). In chapter 2, on page 37, I was able to compile the simple class called "Movie" but I was not able to compile the "MovieTestDrive" class. When I tried, it reports that it "cannot find symbol - class Movie"

So I guess my question is simple:
Are the book samples missing some kind of Import or Includes statement at the beginning of the Test Drive code to include the main class file?

Thanks in advance for all the help.
18 years ago