jsettlers / settlers-remake

A Remake of "The Settlers III" for Windows, Linux, Mac and Android
http://www.settlers-android-clone.com
MIT License
356 stars 100 forks source link

NullPointerException on Game start #775

Closed homoroselaps closed 5 years ago

homoroselaps commented 5 years ago

Hej I just pulled the most recent master and tried it out. Now I get an endless stream of NullPointerExceptions the moment the game field is about to be drawn (compile & run on Win10)

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at go.graphics.swing.GLContainer.resize_gl(GLContainer.java:44)
    at go.graphics.swing.AreaContainer.resize_gl(AreaContainer.java:62)
    at go.graphics.swing.contextcreator.JAWTContextCreator$1.paint(JAWTContextCreator.java:101)
    at go.graphics.swing.contextcreator.JAWTContextCreator$1.update(JAWTContextCreator.java:78)
    at sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
    at sun.awt.RepaintArea.paint(RepaintArea.java:232)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
    at java.awt.Component.dispatchEventImpl(Component.java:4967)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
paulwedeck commented 5 years ago

Is there any previous exception ? like an Error in LWJGL20DrawContext ?

homoroselaps commented 5 years ago
Warning: Could not load LocaleSuffix [locale=en_US, useCountry=true]. Falling back to next file.
OS version: Windows 10 amd64 10.0
Java version: Oracle Corporation 1.8.0_73
JsettlersGame(): seed: 1564480875970 playerId: 0 availablePlayers: [PlayerSetting{available=true, teamId=0, civilisation=ROMAN, playerType=HUMAN}, PlayerSetting{available=true, teamId=1, civilisation=ROMAN, playerType=AI_VERY_HARD}] multiplayer: false mapCreator: jsettlers.logic.map.loading.original.OriginalMapLoader@140e5a13
Calculating partitions needed: 55 ms
found 7 partitions.
Loading original map data required: 948 ms
grid filled
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/joml/Matrix4f
    at go.graphics.swing.opengl.LWJGL20DrawContext.<init>(LWJGL20DrawContext.java:33)
    at go.graphics.swing.GLContainer.wrapNewContext(GLContainer.java:54)
    at go.graphics.swing.contextcreator.WGLContextCreator.onNewConnection(WGLContextCreator.java:128)
    at go.graphics.swing.contextcreator.JAWTContextCreator.regenerateWindowInfo(JAWTContextCreator.java:65)
    at go.graphics.swing.contextcreator.JAWTContextCreator.access$000(JAWTContextCreator.java:31)
    at go.graphics.swing.contextcreator.JAWTContextCreator$1.paint(JAWTContextCreator.java:86)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
    at sun.awt.RepaintArea.paint(RepaintArea.java:240)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
    at java.awt.Component.dispatchEventImpl(Component.java:4967)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.joml.Matrix4f
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 29 more
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at go.graphics.swing.GLContainer.resize_gl(GLContainer.java:44)
    at go.graphics.swing.AreaContainer.resize_gl(AreaContainer.java:62)
    at go.graphics.swing.contextcreator.JAWTContextCreator$1.paint(JAWTContextCreator.java:101)
    at go.graphics.swing.contextcreator.JAWTContextCreator$1.update(JAWTContextCreator.java:78)
    at sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
    at sun.awt.RepaintArea.paint(RepaintArea.java:232)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
    at java.awt.Component.dispatchEventImpl(Component.java:4967)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
homoroselaps commented 5 years ago

Just did a clean + build without any problem. Though AndroidStudio shows "cannot resolve symbol joml" at import org.joml.Matrix4f;

paulwedeck commented 5 years ago

Replace implementation in go.graphics.swing/build.gradle:32 with compile. Does it work?

homoroselaps commented 5 years ago

Yes, this fixed it!