Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Anyone know Java Servlets?

Name: Anonymous 2006-07-13 17:17

Trying to get an assignment done for my Advanced Java and I keep getting the following exception:

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: entry/PhoneBookEntry
    assignment4.AddEntry.doGet(AddEntry.java:37)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

[url]http://dat.4chan.org/b/src/1152823595563.jpg[/url] for a screenshot of it.

The thing is entry.PhoneBookEntry exists, but for some stupid reason the servlet isn't finding it (note: this didn't seem to be an issue when I compiled).

Any ideas/suggestions? If you need more info just ask.

Name: Anonymous 2006-07-13 17:28

Incorrect permissions on PhoneBookEntry file or directory that contains it, perhaps?

Name: Anonymous 2006-07-13 17:45

I don't think so ... everyone has permission to read the file.

Name: Anonymous 2006-07-13 17:52

Could you post the full directory structure?

Name: Anonymous 2006-07-13 18:04

/root/jakarta-tomcat-5.5.9/webapps/bmr041000/WEB-INF/classes/assignment4/entry/PhoneBookEntry.class

and

/root/jakarta-tomcat-5.5.9/webapps/bmr041000/WEB-INF/classes/assignment4/AddEntry.class

are the full paths to the files in questions, give me a sec I'll take a few screenshots of the related files/code

Name: Anonymous 2006-07-13 18:15

Name: Anonymous 2006-07-13 18:53

Why is AddEntry.class four days older than AddEntry.java?

Name: Anonymous 2006-07-13 19:04

Because the date on the server is all fucked up for some reason.

Name: Anonymous 2006-07-13 19:04

Also, I don't know all the details of import and packages, but maybe the hierarchy is rooted in classes/, and you should import assignment4.entry.* (and have 'package assignment4.entry;')? I remember when I had to do servlets, we had our base servlet class right in the classes dir...

Name: Anonymous 2006-07-13 19:22

I don't THINK that would be a problem, but I could be wrong ... I'll try messing with that later, for some reason my account on the server is fucked up at the moment and I can't get anything to work right, so I'm not going to be able to do any more testing until that gets fixed ....

ugh ...

Name: Anonymous 2006-07-18 17:35

Just move everything from /classes/assignment4 to /classes and get rid of assignment4 dir and everything should be fine. Or at least the exception thrown will change. ;)

Name: Anonymous 2006-07-24 18:38

Servers don't just screw up file dates; you're clearly editing and compiling the local copy. You have only AddEntry.java on the local machine and left everything else on the server, which is why its not working.

Name: Anonymous 2006-07-24 18:49

>>12
Nevermind, it seems you're updating the file on the server after all. Are you sure you're compiling the server copy and not the local copy?

How are you compiling this? If you're compiling from the command line, paste the command you're giving it here. If you're compiling from inside some IDE, then obviously it's not going to work unless you directly edit the remote file.

Name: Anonymous 2006-07-24 21:22

Shouldn't the container automatically recompile if the source is newer than the class file?

Name: Anonymous 2006-07-26 12:47

>>14
AFAIK the ontainers hardly ever recompile anything. It's the best to give them a nice *.war ball straight into he deployment dir. the .war file can be created by hand or by ant :)

Name: Anonymous 2006-07-26 13:01

<span class="spoiler" onmouseover="this.style.color='#FFF';" onmouseout="this.style.color=this.style.backgroundColor='#000'">BLACK</span>

Name: Anonymous 2006-07-26 13:02

LOLZ

Name: Anonymous 2006-07-28 11:11 (sage)

>>16
you're doing it wrong.

Name: Anonymous 2009-01-14 13:55

Welcome to the botnet

Name: Anonymous 2009-08-17 0:49

Lain.

Name: Anonymous 2010-06-26 9:59

ur gay

Name: Anonymous 2010-06-28 10:55

beware the army of 12 year old autistics

Name: Anonymous 2010-12-20 19:15

Name: Anonymous 2011-12-30 3:31

ENTERPRISE BUMP

Name: Sgt.Kabuᑭ寍kiman⩢꒚ 2012-05-28 19:28

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List