com.mysql.jdbc.Driver was zu tun?

Ich erhalte dies, wenn ich versuche, unseren Java-Server zu starten: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Aber ich habe die mysql-connector-java-5.1.22-bin.jar im selben Ordner, in dem sich das Skript befindet, und mache dies, wenn ich das Skript ausführe:

   java -cp mysql-connector-java-5.1.22-bin.jar  -jar AvatarServer.jar

Aber immer noch so. Was ist zu tun? Ich benutze einen CentOS-Server.

 root@host [/home/nagoom/Server_Example]# java -cp mysql-connector-java-5.1.22-bin.jar       -jar AvatarServer.jar
 ************************
  **  FIRING UP SERVER! **
  ************************
   Running MySQLChatMessageSaver
   java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at items.ItemsDatabase.DownloadData(ItemsDatabase.java:35)
at items.ItemsDatabase.InitializeData(ItemsDatabase.java:24)
at network.SocketHandler.startListening(SocketHandler.java:84)
at server.AvatarServer.run(AvatarServer.java:44)
 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at gameInstances.RoomController.DownloadRoomData(RoomController.java:46)
at gameInstances.RoomController.InitializeRooms(RoomController.java:32)
at network.SocketHandler.startListening(SocketHandler.java:85)
at server.AvatarServer.run(AvatarServer.java:44)
  java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at gameInstances.RoomController.LoadLockedSeatsForAll(RoomController.java:121)
at gameInstances.RoomController.InitializeRooms(RoomController.java:33)
at network.SocketHandler.startListening(SocketHandler.java:85)
at server.AvatarServer.run(AvatarServer.java:44)
 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at gameInstances.RoomController.DownloadApartmentData(RoomController.java:89)
at gameInstances.RoomController.InitializeRooms(RoomController.java:34)
at network.SocketHandler.startListening(SocketHandler.java:85)
at server.AvatarServer.run(AvatarServer.java:44)
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at gameInstances.RoomController.LoadItemsForAllRooms(RoomController.java:160)
at gameInstances.RoomController.InitializeRooms(RoomController.java:35)
at network.SocketHandler.startListening(SocketHandler.java:85)
at server.AvatarServer.run(AvatarServer.java:44)
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at clothes.ClothesDatabase.DownloadGraphicsData(ClothesDatabase.java:42)
at clothes.ClothesDatabase.InitializeGraphics(ClothesDatabase.java:31)
at network.SocketHandler.startListening(SocketHandler.java:86)
at server.AvatarServer.run(AvatarServer.java:44)
      MySQL exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
     MySQL exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at moods.MoodsDatabase.DownloadData(MoodsDatabase.java:29)
at moods.MoodsDatabase.InitializeData(MoodsDatabase.java:16)
at network.SocketHandler.startListening(SocketHandler.java:89)
at server.AvatarServer.run(AvatarServer.java:44)
     java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at robots.RobotHandler.downloadBots(RobotHandler.java:31)
at network.SocketHandler.startListening(SocketHandler.java:90)
at server.AvatarServer.run(AvatarServer.java:44)
     java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at levels.LevelDatabase.DownloadData(LevelDatabase.java:21)
at network.SocketHandler.startListening(SocketHandler.java:91)
at server.AvatarServer.run(AvatarServer.java:44)
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at database.DatabaseConnection.connect(DatabaseConnection.java:13)
at network.SocketHandler.resetOnlineStatuses(SocketHandler.java:172)
at network.SocketHandler.startListening(SocketHandler.java:93)
at server.AvatarServer.run(AvatarServer.java:44)

Antworten auf die Frage(2)

Ihre Antwort auf die Frage