Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-27-2013, 04:34 PM   PM User | #1
xxcorrosionxx
Regular Coder

 
Join Date: Jan 2011
Posts: 117
Thanks: 27
Thanked 0 Times in 0 Posts
xxcorrosionxx is an unknown quantity at this point
Cool Exception Error - Shed Some Light?

I need help with this problem please I would like to know what this error is telling me. Thank you guys <3

Problem One:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ftpserver/ftplet/FtpException
Caused by: java.lang.ClassNotFoundException: org.apache.ftpserver.ftplet.FtpException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.spilka.server.ChatServer. Program will exit
Problem Two:
Code:
C:\Users\Administrator>java -cp c:\server.zip com.spilka.server.ChatServer
Exception in thread "main" java.lang.NullPointerException
at com.spilka.server.ChatServer.q(Unknown Source)
at com.spilka.server.ChatServer.q(Unknown Source)
at com.spilka.server.ChatServer.<init>(Unknown Source)
at com.spilka.server.ChatServer.main(Unknown Source)
I just would like to know what the error is telling me, I do not need the solution. Thank you
xxcorrosionxx is offline   Reply With Quote
Old 01-28-2013, 03:33 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,652
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
The first one appears to be missing the external library. Make sure you add the library on the classpath when invoking it (or as a part of the manifest if its jar'd). It also appears to not be able to invoke the main method on com.spilka.server.ChatServer.

The second is simply caused by a non-instance of an object which you are attempting to dereference. To what depth, we don't know you'll need to trace the stack to get to the cause. So within the main, you can follow the tack to the q and find that something is being derferenced which is null. Perhaps the argument itself is null. It can be try/caught since its an Exception to prevent the program from terminating, but that only has use if you have a fallback to go on (which chances are would be an error message and then exit anyway).
Edit:
Maybe an example of that would help.
Code:
Integer myint = null;
try
{
    myint = Integer.parseInt("anint");
}
catch (NumberFormatException ex)
{
    // this is guaranteed to get here since 'anint' isn't parseable as an Integer.
}
System.out.println(myint.toString()); // throws NullPointerException since toString isn't available on null.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php

Last edited by Fou-Lu; 01-28-2013 at 03:36 PM..
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:16 PM.


Advertisement
Log in to turn off these ads.