java.io.FileNotFoundException: http://localhost:8080/MyServlets/MyServlet
843842Mar 22 2009 — edited Mar 22 2009Hi everyone,
I have been experiencing problems with my applet / servlet / DB system for some days now (I even had it working at one point, but managed to mess it up again...!). I would be very grateful if someone could help to get my little project back on track - it's driving me insane at present! Despite having done a lot of research (and experimentation with the) WAR project structure, web.xml structure, classpaths, servlet tutorials etc., I cannot seem to resolve these problems. I'm hoping someone can help me get my software project functioning again.
So, the error:
java.io.FileNotFoundException: http://localhost:8080/GTDBServlets/TunesListServlet
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at jpg1980.HomeJPanel.displayTunes(HomeJPanel.java:163)
at jpg1980.HomeJPanel.refreshListButtonActionPerformed(HomeJPanel.java:186)
at jpg1980.HomeJPanel.access$1(HomeJPanel.java:184)
at jpg1980.HomeJPanel$2.actionPerformed(HomeJPanel.java:96)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I am using XAMPP 1.7 (includes Apache, MySQL 5 and Tomcat 6) on Windows XP (SP3). The servlet project is placed here: C:\Program Files\XAMPP\htdocs\GTDBServlets. htdocs is the right location for the servlet project directory as I have had my system (as well as demo Sevlets) up and running using this location).
So, to clarify: TuneListServlet is the name of my servlet class in the project (directory) called GTDBServlets, GTDBAppletMain is the name of my applet class in the project (directory) GTDBApplet and jpg1980 is the package name for the applet and servlet code.
Applet Code:
GTDBAppletMain - http://java.pastebin.ca/1368047 - the Applet code
HomeJPanel - http://java.pastebin.ca/1368049 - 'home page' (main) GUI
Servlet Code:
TuneSimple - http://pastebin.ca/1368052 - the serialized object passed between Servlet and Applet
TunesListServlet - http://pastebin.ca/1368054 - the Servlet code
TunesListAccessor - http://pastebin.ca/1368056 - helps out with the SQL connection / query
Other files
web.xml - http://pastebin.ca/1368057
Applet .classpth - http://pastebin.ca/1368061
Servlet .classpath - http://pastebin.ca/1368060
Whilst debugging, it is suggested the problem is at line 70 of the GTDBAppletMain code (see here http://java.pastebin.ca/1368047).
I have consulted the Tomcat logs (in C:\Program Files\XAMPP\Tomcat\logs), but there is nothing recent (i.e. a debug my code, run through until it crashes but the most recent log was an hour before).
Please could someone kindly help me get this up and running? Thanks for your time. Regards,
James