Exception in thread “main” java.util.zip.ZipException: invalid LOC header (bad signature) วันนี้ผมลองหา ClassInfo จาก Classpath ดูครับ แต่ปรากฎว่าเจอ Error ดังนี้ ตามด้านล่าง Exception in thread “main” java.util.zip.ZipException: invalid LOC header (bad signature) at java.util.zip.ZipFile.read(Native Method) at java.util.zip.ZipFile.access$1400(ZipFile.java:60) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734) at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at sun.misc.IOUtils.readFully(IOUtils.java:65) at java.util.jar.JarFile.getBytes(JarFile.java:425) at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193) at java.util.jar.JarFile.getManifest(JarFile.java:180) at com.google.common.reflect.ClassPath$Scanner.scanJar(ClassPath.java:336) at com.google.common.reflect.ClassPath$Scanner.scanFrom(ClassPath.java:323) at com.google.common.reflect.ClassPath$Scanner.scan(ClassPath.java:312) at
Show Heap status ใน Eclipse ในบทความนี้ผมจะแนะนำวิธีการแสดง heap status ใน Eclipse กันครับ ซึ่งวิธีทำก็ให้เราไปที่ Windows แล้วเลือก Preference จะได้หน้าต่างขึ้น Preference ขึ้นมา ให้ไปที่ส่วนของ General แล้วตรงด้านขวามือ จะมีติ๊กถูกหน้า Show heap status อยู่ ให้เราติ๊กถูกข้างหน้า แค่นี้เราก็จะสามารถแสดง heap status ได้แล้ว ถ้าเราทำการเปิดการแสดง heap status แล้ว เราก็ได้จะได้ดังรูปด้านล่าง
The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path ผมลองสร้าง index.jsp ขึ้นมาดูแต่ปรากฎว่าได้เจอกับ Error บอกว่า The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path แสดงด้วยตัวอย่างด้านล่าง ถ้าเราดูจาก Error มันบอกไว้ว่าไม่เจอ HttpServlet ใน Build Path นั่นเองครับ ส่วนวิธีแก้ก็มีอยู่ 2 วิธี คือ ไปเพิ่ม Lib ของ HttpServlet ครับ ส่วนวิธีที่ 2 ให้เราไปเพิ่ม Target runtime เพราะใน Target runtime นั้นจะมี servlet runtime