Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Java exception error #783

Open
PiusBranzeuCenter opened this issue Apr 15, 2020 · 7 comments
Open

Java exception error #783

PiusBranzeuCenter opened this issue Apr 15, 2020 · 7 comments

Comments

@PiusBranzeuCenter
Copy link

Hi, I tried to run the jar under Mac osX Catalina 10.5.2. using Terminal command
java -jar JSettlers.jar

I got the following exception:

jsettlers alex$ java -jar JSettlers.jar
No default command line options file found.
Options loaded: {}
Source: (file:/Users/alex/Documents/Games/Settlers/JSettlers/JSettlers.jar )
java.lang.ArrayIndexOutOfBoundsException: Index 232 out of bounds for length 232
at jsettlers.graphics.reader.AdvancedDatFileReader.getSettlerPointers(AdvancedDatFileReader.java:614)
at jsettlers.graphics.image.MultiImageMap.addSequences(MultiImageMap.java:104)
at jsettlers.graphics.reader.AdvancedDatFileReader.generateImageMap(AdvancedDatFileReader.java:646)
at jsettlers.graphics.map.draw.ImagePreloadTask.run(ImagePreloadTask.java:121)
at java.base/java.lang.Thread.run(Thread.java:830)
Exception in thread "main" java.lang.ExceptionInInitializerError
at jsettlers.main.swing.lookandfeel.JSettlersLookAndFeel.install(JSettlersLookAndFeel.java:69)
at jsettlers.main.swing.SwingManagedJSettlers.createJSettlersFrame(SwingManagedJSettlers.java:204)
at jsettlers.main.swing.SwingManagedJSettlers.main(SwingManagedJSettlers.java:65)
Caused by: java.awt.image.RasterFormatException: (x + width) is outside raster
at java.desktop/sun.awt.image.IntegerInterleavedRaster.createWritableChild(IntegerInterleavedRaster.java:463)
at java.desktop/java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1202)
at jsettlers.main.swing.lookandfeel.ui.SettlersLabelUi.(SettlersLabelUi.java:61)
at jsettlers.main.swing.lookandfeel.factory.LabelUiFactory.(LabelUiFactory.java:40)
... 3 more

@paulwedeck
Copy link
Contributor

what version are you using?
where is your gfx folder from?

@PiusBranzeuCenter
Copy link
Author

The gfx folder was dowloaded form Die Siedler 3 - Multiplayer Demo (https://www.siedler-maps.de/downloads.php?action=download&downloadid=42), unzipped and recognized by the JSettlers when launching.

JSettlers is Release v0.4.0-alpha from official page (https://www.settlers-android-clone.com/download/)

Running on Mac osX Catalina 10.5.2 with Java installed

@paulwedeck
Copy link
Contributor

Official releases are completely outdated.
try latest master:
https://github.com/jsettlers/settlers-nightlies/tree/gh-pages/master/2019-08-27_12-29-17__88ba0d9

@PiusBranzeuCenter
Copy link
Author

Thanks! This solved the launch issue, the game start screen loads now.
But when choosing two players, with one computer enemy, it just freezes at "Waiting for other players".
What am I doing wrong?

Screen Shot 2020-04-15 at 1 45 34 PM

@paulwedeck
Copy link
Contributor

what is the output of JSettlers when run with --console-output ?

@PiusBranzeuCenter
Copy link
Author

java -jar JSettlers.jar --console-output
Source: (file:/Users/alex/Documents/Games/Settlers/JSettlers/JSettlers.jar )
java.lang.ArrayIndexOutOfBoundsException: Index 232 out of bounds for length 232
at jsettlers.graphics.image.reader.AdvancedDatFileReader.getSettlerPointers(AdvancedDatFileReader.java:694)
at jsettlers.graphics.image.MultiImageMap.addSequences(MultiImageMap.java:101)
at jsettlers.graphics.image.reader.AdvancedDatFileReader.generateImageMap(AdvancedDatFileReader.java:728)
at jsettlers.graphics.map.draw.ImagePreloadTask.run(ImagePreloadTask.java:121)
at java.base/java.lang.Thread.run(Thread.java:830)
Warning: Could not load LocaleSuffix [locale=en_US, useCountry=true]. Falling back to next file.
Exception in thread "main" java.lang.ClassCastException: class java.lang.String cannot be cast to class go.graphics.swing.contextcreator.EBackendType (java.lang.String is in module java.base of loader 'bootstrap'; go.graphics.swing.contextcreator.EBackendType is in unnamed module of loader 'app')
at go.graphics.swing.contextcreator.BackendSelector.actionPerformed(BackendSelector.java:39)
at java.desktop/javax.swing.JComboBox.fireActionEvent(JComboBox.java:1264)
at java.desktop/javax.swing.JComboBox.contentsChanged(JComboBox.java:1337)
at java.desktop/javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:123)
at java.desktop/javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:94)
at java.desktop/javax.swing.DefaultComboBoxModel.addElement(DefaultComboBoxModel.java:132)
at java.desktop/javax.swing.JComboBox.addItem(JComboBox.java:716)
at go.graphics.swing.contextcreator.BackendSelector.lambda$new$0(BackendSelector.java:56)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at go.graphics.swing.contextcreator.BackendSelector.(BackendSelector.java:56)
at jsettlers.main.swing.menu.settingsmenu.SettingsMenuPanel.(SettingsMenuPanel.java:50)
at jsettlers.main.swing.menu.mainmenu.MainMenuPanel.(MainMenuPanel.java:83)
at jsettlers.main.swing.JSettlersFrame.(JSettlersFrame.java:76)
at jsettlers.main.swing.SwingManagedJSettlers.createJSettlersFrame(SwingManagedJSettlers.java:179)
at jsettlers.main.swing.SwingManagedJSettlers.main(SwingManagedJSettlers.java:62)
jsettlers.network.infrastructure.channel.socket.SocketConnectException: java.net.ConnectException: Operation timed out
at jsettlers.network.infrastructure.channel.socket.standard.JavaSocketFactory.generateSocket(JavaSocketFactory.java:37)
at jsettlers.network.infrastructure.channel.Channel.(Channel.java:80)
at jsettlers.network.infrastructure.channel.AsyncChannel.(AsyncChannel.java:35)
at jsettlers.network.client.NetworkClient.(NetworkClient.java:81)
at jsettlers.main.AsyncNetworkClientConnector$1.run(AsyncNetworkClientConnector.java:44)
Caused by: java.net.ConnectException: Operation timed out
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:493)
at java.base/sun.nio.ch.Net.connect(Net.java:482)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:339)
at java.base/java.net.Socket.connect(Socket.java:603)
at java.base/java.net.Socket.connect(Socket.java:552)
at java.base/java.net.Socket.(Socket.java:475)
at java.base/java.net.Socket.(Socket.java:249)
at jsettlers.network.infrastructure.channel.socket.standard.JavaSocketFactory.generateSocket(JavaSocketFactory.java:35)
... 4 more

@paulwedeck
Copy link
Contributor

The first error seams to be meaningless.

The second one is a know bug 840f51a
You can try installing java8 or compile from #778

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants