rawfilebuffer.resize(filesize/sizeof(myType)+(filesize%sizeof(myType)?1U:0U));
这是Crash-Log中的一行。 如果你可以帮助我会很好。 Sry 4英语不好,我是德语:D
// -------- 德语: 嘿,Ich habe ein问题... Jedes mal wennIchüberinBukkit Plugin eine Datenbank Tabelle erstelle,hörtderServer auf zu reagieren。 Erlädtimmerbis zu dem Punkt,ab dem er die Tabelle erstellen sollundlädtdannnicht mehr weiter。 Nachdem Ich den Server stoppe steht in den Crash-Logs dass folgende Zeilefehlerhaftwäre:
String tablename = "Test";
String request = "Spielername VARCHAR(100), Testvalue VARCHAR(100)";
con.createStatement().executeUpdate("CREATE TABLE IF NOT EXISTS "+tablename+" ("+request+")");
Bisher hat diese aber immer funktioniert und beim debuggen wird auch ausgegeben,dass der Server mit der Datenbank verbunden ist。
//附加信息(Stacktrace): ---- Minecraft崩溃报告---- //我只是不知道出了什么问题:(
String tablename = "Test";
String request = "Spielername VARCHAR(100), Testvalue VARCHAR(100)";
con.createStatement().executeUpdate("CREATE TABLE IF NOT EXISTS "+tablename+" ("+request+")");
*编辑: //全方法
Time: 4/15/16 3:36 PM
Description: Watching Server
java.lang.Error
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2526)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2968)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3516)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
at mysqllib.MySQL.createTable(MySQL.java:65)
at mysqllib.LibClass.<init>(LibClass.java:6)
at mysqllib.RankLib.<init>(RankLib.java:17)
at mysqllib.Main.onEnable(Main.java:48)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:341)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:313)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:721)
at org.bukkit.Bukkit.reload(Bukkit.java:543)
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:621)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:607)
at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:371)
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:336)
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:632)
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:540)
at java.lang.Thread.run(Thread.java:745)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2526)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2968)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3516)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
at mysqllib.MySQL.createTable(MySQL.java:65)
at mysqllib.Main.onEnable(Main.java:48)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:341)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:313)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:721)
at org.bukkit.Bukkit.reload(Bukkit.java:543)
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:621)
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:607)
at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:371)
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:336)
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:632)
-- Thread Dump --
Details:
Threads: "Timer-2" Id=97 TIMED_WAITING on java.util.TaskQueue@66be0ec4
at java.lang.Object.wait(Native Method)
- waiting on java.util.TaskQueue@66be0ec4
at java.util.TimerThread.mainLoop(Timer.java:552)
at java.util.TimerThread.run(Timer.java:505)
"pool-46-thread-1" Id=96 TIMED_WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@6879ec63
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@6879ec63
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
...
"EbeanCacheWarmer" Id=95 TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at com.avaje.ebeaninternal.server.core.DefaultServerFactory$CacheWarmer.run(DefaultServerFactory.java:509)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
"pool-26-thread-2" Id=93 TIMED_WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@6c4665b4
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@6c4665b4
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:522)
at java.util.concurrent.LinkedBlockingDeque.poll(LinkedBlockingDeque.java:684)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
...
"pool-29-thread-2" Id=92 TIMED_WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@2944e658
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@2944e658
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:522)
at java.util.concurrent.LinkedBlockingDeque.poll(LinkedBlockingDeque.java:684)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
...
"Netty Epoll Server IO #4" Id=26 RUNNABLE (in native)
at io.netty.channel.epoll.Native.epollWait(Native Method)
at io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)
"Netty Epoll Server IO #3" Id=25 RUNNABLE
at io.netty.channel.epoll.Native.epollWait(Native Method)
at io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)
"Netty Epoll Server IO #2" Id=24 RUNNABLE (in native)
at io.netty.channel.epoll.Native.epollWait(Native Method)
at io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)
"pool-4-thread-1" Id=91 WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@3f9a059a
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@3f9a059a
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"Netty Epoll Server IO #1" Id=23 RUNNABLE (in native)
at io.netty.channel.epoll.Native.epollWait(Native Method)
at io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)
"File IO Thread" Id=90 TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at net.minecraft.server.v1_8_R3.FileIOThread.c(SourceFile:51)
at net.minecraft.server.v1_8_R3.FileIOThread.run(SourceFile:30)
at java.lang.Thread.run(Thread.java:745)
"Server Watchdog" Id=71 RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
at sun.management.ThreadImpl.dumpAllThreads(ThreadImpl.java:454)
at net.minecraft.server.v1_8_R3.ThreadWatchdog.run(SourceFile:43)
at java.lang.Thread.run(Thread.java:745)
"Timer-1" Id=59 TIMED_WAITING on java.util.TaskQueue@1827ecfe
at java.lang.Object.wait(Native Method)
- waiting on java.util.TaskQueue@1827ecfe
at java.util.TimerThread.mainLoop(Timer.java:552)
at java.util.TimerThread.run(Timer.java:505)
"Timer-0" Id=55 TIMED_WAITING on java.util.TaskQueue@4713518b
at java.lang.Object.wait(Native Method)
- waiting on java.util.TaskQueue@4713518b
at java.util.TimerThread.mainLoop(Timer.java:552)
at java.util.TimerThread.run(Timer.java:505)
"pool-8-thread-1" Id=54 WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@496b1917
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@496b1917
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1081)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
...
"Ebean-TeleportSigns.0" Id=51 WAITING on java.lang.Object@26326375
at java.lang.Object.wait(Native Method)
- waiting on java.lang.Object@26326375
at java.lang.Object.wait(Object.java:502)
at com.avaje.ebeaninternal.server.lib.thread.PooledThread.run(PooledThread.java:75)
at java.lang.Thread.run(Thread.java:745)
"EbeanBackgroundThread" Id=50 TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at com.avaje.ebeaninternal.server.lib.BackgroundThread$Runner.run(BackgroundThread.java:168)
at java.lang.Thread.run(Thread.java:745)
"Java2D Disposer" Id=47 WAITING on java.lang.ref.ReferenceQueue$Lock@1d53b51
at java.lang.Object.wait(Native Method)
- waiting on java.lang.ref.ReferenceQueue$Lock@1d53b51
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at sun.java2d.Disposer.run(Disposer.java:148)
at java.lang.Thread.run(Thread.java:745)
"Netty Epoll Server IO #0" Id=22 RUNNABLE (in native)
at io.netty.channel.epoll.Native.epollWait(Native Method)
at io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)
"Server console handler" Id=18 RUNNABLE (in native)
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
- locked java.io.BufferedInputStream@5c17bde9
at org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:248)
at org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:261)
- locked org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream@4d25a4dd
at org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:198)
- locked org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream@4d25a4dd
at org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readCharacter(ConsoleReader.java:2145)
...
"Thread-4" Id=19 WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@78b94fc7
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@78b94fc7
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at com.mojang.util.QueueLogAppender.getNextLogEvent(QueueLogAppender.java:77)
at org.bukkit.craftbukkit.v1_8_R3.util.TerminalConsoleWriterThread.run(TerminalConsoleWriterThread.java:25)
at java.lang.Thread.run(Thread.java:745)
"DestroyJavaVM" Id=17 RUNNABLE
"Server thread" Id=15 RUNNABLE (in native)
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)
- locked com.mysql.jdbc.util.ReadAheadInputStream@509eec32
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2526)
...
"Server Infinisleeper" Id=16 TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at net.minecraft.server.v1_8_R3.DedicatedServer$1.run(DedicatedServer.java:53)
"Snooper Timer" Id=12 TIMED_WAITING on java.util.TaskQueue@5164a28c
at java.lang.Object.wait(Native Method)
- waiting on java.util.TaskQueue@5164a28c
at java.util.TimerThread.mainLoop(Timer.java:552)
at java.util.TimerThread.run(Timer.java:505)
"Signal Dispatcher" Id=4 RUNNABLE
"Finalizer" Id=3 WAITING on java.lang.ref.ReferenceQueue$Lock@63910810
at java.lang.Object.wait(Native Method)
- waiting on java.lang.ref.ReferenceQueue$Lock@63910810
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
"Reference Handler" Id=2 WAITING on java.lang.ref.Reference$Lock@4449972c
at java.lang.Object.wait(Native Method)
- waiting on java.lang.ref.Reference$Lock@4449972c
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)
Stacktrace:
at net.minecraft.server.v1_8_R3.ThreadWatchdog.run(SourceFile:59)
at java.lang.Thread.run(Thread.java:745)
onEnable code:
public static void createTable(){
if(isConnected()){
try {
String tablename = "Test";
String request = "Spielername VARCHAR(100), Testvalue VARCHAR(100)
con.createStatement().executeUpdate("CREATE TABLE IF NOT EXISTS "+tablename+" ("+request+")");
} catch (Exception e) {
e.printStackTrace();
}
}
}
没有例外......服务器只停止加载
答案 0 :(得分:0)
您没有粘贴异常,只粘贴了堆栈跟踪。