Closed ingconti closed 2 years ago
We fixed the exception location error
yet crashing.
pls see these two fixes I did:
and POM I sent by mail. AHG cannot see You mail.
I will put devliveries. PLS remove when done.
Updated in one of the last commits
a new warning is now present: [WARNING] Can't extract module name from javafx-18.pom: zip END header not found
tried some fixes discussed online, like deleting the related folder to have intellij reimport it from scratch, but nothing we tried managed to rid us of this warning (so far)
I will try. anyway better s warning than a crash... :) I will investigate cloning your repo
the log I get:
/Users/ingconti/Library/Java/JavaVirtualMachines/openjdk-17.0.2/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/ingconti/IdeaProjects/master/ingsw2022-AM12 -Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3 -Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf -Dmaven.ext.class.path=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven-event-listener.jar -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=51834:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds.license:/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version=2021.3.2 package [INFO] Scanning for projects... [INFO] [INFO] ----------------------< it.polimi:ingsw2022-AM12 >---------------------- [INFO] Building ingsw2022-AM12 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ingsw2022-AM12 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ ingsw2022-AM12 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 54 source files to /Users/ingconti/IdeaProjects/master/ingsw2022-AM12/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ingsw2022-AM12 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/ingconti/IdeaProjects/master/ingsw2022-AM12/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ ingsw2022-AM12 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 9 source files to /Users/ingconti/IdeaProjects/master/ingsw2022-AM12/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ ingsw2022-AM12 --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running it.polimi.ingsw2022am12.server.CoinCollectionTest [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 s - in it.polimi.ingsw2022am12.server.CoinCollectionTest [INFO] Running it.polimi.ingsw2022am12.server.GameTest [INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in it.polimi.ingsw2022am12.server.GameTest [INFO] Running it.polimi.ingsw2022am12.server.NoEntryCollectionTest [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in it.polimi.ingsw2022am12.server.NoEntryCollectionTest [INFO] Running it.polimi.ingsw2022am12.server.TowerCollectionTest [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in it.polimi.ingsw2022am12.server.TowerCollectionTest [INFO] Running it.polimi.ingsw2022am12.server.IslandTileListTest [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in it.polimi.ingsw2022am12.server.IslandTileListTest [INFO] Running it.polimi.ingsw2022am12.server.StudentDiskCollectionTest [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in it.polimi.ingsw2022am12.server.StudentDiskCollectionTest [INFO] Running it.polimi.ingsw2022am12.server.BagTest [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in it.polimi.ingsw2022am12.server.BagTest [INFO] Running it.polimi.ingsw2022am12.server.IslandTileSetTest [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in it.polimi.ingsw2022am12.server.IslandTileSetTest [INFO] Running it.polimi.ingsw2022am12.server.SchoolBoardTest [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in it.polimi.ingsw2022am12.server.SchoolBoardTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 30, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ ingsw2022-AM12 --- [INFO] Building jar: /Users/ingconti/IdeaProjects/master/ingsw2022-AM12/target/ingsw2022-AM12-1.0-SNAPSHOT.jar [INFO] [INFO] --- maven-shade-plugin:3.2.0:shade (default) @ ingsw2022-AM12 --- [INFO] Including org.openjfx:javafx-controls:jar:18 in the shaded jar. [INFO] Including org.openjfx:javafx-controls:jar:mac-aarch64:18 in the shaded jar. [INFO] Including org.openjfx:javafx-graphics:jar:18 in the shaded jar. [INFO] Including org.openjfx:javafx-graphics:jar:mac-aarch64:18 in the shaded jar. [INFO] Including org.openjfx:javafx-base:jar:18 in the shaded jar. [INFO] Including org.openjfx:javafx-base:jar:mac-aarch64:18 in the shaded jar. [INFO] Including org.openjfx:javafx-fxml:jar:18 in the shaded jar. [INFO] Including org.openjfx:javafx-fxml:jar:mac-aarch64:18 in the shaded jar. [INFO] Including org.controlsfx:controlsfx:jar:11.1.1 in the shaded jar. [INFO] Including com.dlsc.formsfx:formsfx-core:jar:11.5.0 in the shaded jar. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.513 s [INFO] Finished at: 2022-03-28T07:31:27+02:00 [INFO] ------------------------------------------------------------------------
Process finished with exit code 0
You have another error running JAR alone:
Error: Could not find or load main class it.polimi.ingsw2022am12 Caused by: java.lang.ClassNotFoundException: it.polimi.ingsw2022am12
you are missing main class in POM. see here to compare: https://github.com/ingconti/JavaFXWithImagesAndText
The main class is now the correct one and packaging appears to work
is the site step of the lifecycle also necessary?
no You can safely skip if You got a working JAR
Exception in Application start method java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:467)