patsonluk / airline

Apache License 2.0
109 stars 71 forks source link

Error when trying to use airline-web #566

Closed foxyfred closed 1 year ago

foxyfred commented 1 year ago

I very much may be blind, but when i try to connect to the localhost:9000 I get this error in the web console:

image
drvntechnologies commented 1 year ago

Is this when initializing in the console or after it's up and running? Are you able to connect in the web browser? Asking because I have some similar errors right now

foxyfred commented 1 year ago

everything is initialized and the mainsim console says its simulating, but when I run the web side of the system it gives that error when trying to connect to it in the browser, in which the browser screen shows the same error.

foxyfred commented 1 year ago

I'm unsure what caused the error, but I wiped the old install and reinstalled the whole system, including the database and the error disappeared.

kimbon30 commented 9 months ago

@patsonluk I have this same issue when installing from an unzipped directory on MacOS. I'm using xampp on localhost:3306 for SQL and the airline_v2 as db name. It shouldn't be empty on install right? Java is installed. How can I host this solution externally? I feel the readme could go into more detail.

Inside airline-data folder:

`~ % cd Documents/airline-master/airline-data airline-data % bash activator publishLocal error: bad constant pool index: 0 at pos: 48445 while compiling: during phase: globalPhase=, enteringPhase= library version: version 2.12.10 compiler version: version 2.12.10 reconstructed args: -classpath /Users/X/.sbt/boot/scala-2.12.10/lib/scala-library.jar -Yrangepos

last tree to typer: EmptyTree tree position: tree tpe: symbol: null call site: in

== Source file context for tree position ==

Exception in thread "sbt-parser-init-thread" java.lang.ExceptionInInitializerError at sbt.internal.parser.SbtParserInit$$anon$2.run(SbtParser.scala:171) Caused by: scala.reflect.internal.FatalError: bad constant pool index: 0 at pos: 48445 while compiling: during phase: globalPhase=, enteringPhase= library version: version 2.12.10 compiler version: version 2.12.10 reconstructed args: -classpath /Users/X/.sbt/boot/scala-2.12.10/lib/scala-library.jar -Yrangepos

last tree to typer: EmptyTree tree position: tree tpe: symbol: null call site: in

== Source file context for tree position ==

at scala.reflect.internal.Reporting.abort(Reporting.scala:68)
at scala.reflect.internal.Reporting.abort$(Reporting.scala:64)
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:28)
at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.errorBadIndex(ClassfileParser.scala:384)
at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.getExternalName(ClassfileParser.scala:248)
at scala.tools.nsc.symtab.classfile.ClassfileParser.readParamNames$1(ClassfileParser.scala:838)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttribute$1(ClassfileParser.scala:844)
at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseAttributes$7(ClassfileParser.scala:911)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:911)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseMethod(ClassfileParser.scala:620)
at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseClass$4(ClassfileParser.scala:533)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:533)
at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$2(ClassfileParser.scala:161)
at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:146)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:129)
at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:329)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:230)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1542)
at scala.reflect.internal.Definitions.scala$reflect$internal$Definitions$$enterNewMethod(Definitions.scala:50)
at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus$lzycompute(Definitions.scala:1128)
at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus(Definitions.scala:1128)
at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods$lzycompute(Definitions.scala:1414)
at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods(Definitions.scala:1396)
at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1426)
at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1426)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1482)
at scala.tools.nsc.Global$Run.<init>(Global.scala:1199)
at sbt.internal.parser.SbtParser$.<init>(SbtParser.scala:121)
at sbt.internal.parser.SbtParser$.<clinit>(SbtParser.scala)
... 1 more

java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release at java.base/java.lang.System.setSecurityManager(System.java:429) at sbt.TrapExit$.installManager(TrapExit.scala:53) at sbt.StandardMain$.runManaged(Main.scala:127) at sbt.xMain$.run(Main.scala:67) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at sbt.internal.XMainConfiguration.run(XMainConfiguration.scala:46) at sbt.xMain.run(Main.scala:39) at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109) at xsbt.boot.Launch$.withContextLoader(Launch.scala:128) at xsbt.boot.Launch$.run(Launch.scala:109) at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35) at xsbt.boot.Launch$.launch(Launch.scala:117) at xsbt.boot.Launch$.apply(Launch.scala:18) at xsbt.boot.Boot$.runImpl(Boot.scala:41) at xsbt.boot.Boot$.main(Boot.scala:17) at xsbt.boot.Boot.main(Boot.scala) Error during sbt execution: java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release`

patsonluk commented 9 months ago

I have only tried it on linux (our prod) and windows env (my dev). not sure if there are any gotchas for mac 😓

From the stack trace it seems to be java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release issue?

We are using a pretty old sbt/scala version, perhaps u r running a very new java version which triggers that issue? Can u try java 11?

patsonluk commented 9 months ago

I also think it's related to this? https://stackoverflow.com/questions/76151072/error-during-sbt-launcher-java-lang-unsupportedoperationexception-the-security

kimbon30 commented 9 months ago

Have you got a hosting solution that you use @patsonluk ?? Sorry, I don't know how else to contact you.

kimbon30 commented 9 months ago

Purchased a VPS, on debian 12, mysql set up as 5.7 with defaults and airline_v2 as db name.

root@localhost:/www/wwwroot/admin/airline-data# chmod 700 activator
root@localhost:/www/wwwroot/admin/airline-data# ./activator publishLocal
[info] Loading project definition from /www/wwwroot/admin/airline-data/project/project
[info] Loading settings for project airline-data-build from plugins.sbt ...
[info] Loading project definition from /www/wwwroot/admin/airline-data/project
[info] Loading settings for project airline-data from build.sbt ...
[info] Set current project to airline-data (in build file:/www/wwwroot/admin/airline-data/)
[info] Wrote /www/wwwroot/admin/airline-data/target/scala-2.13/airline-data_2.13-2.1.pom
[info] Main Scala API documentation to /www/wwwroot/admin/airline-data/target/scala-2.13/api...
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:12:8: object http is not a member of package java.net
[error] import java.net.http.HttpClient;
[error]        ^
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:13:8: object http is not a member of package java.net
[error] import java.net.http.HttpRequest;
[error]        ^
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:14:8: object http is not a member of package java.net
[error] import java.net.http.HttpResponse;
[error]        ^

[info] No documentation generated with unsuccessful compiler run
[error] three errors found
[info] Compiling 181 Scala sources and 2 Java sources to /www/wwwroot/admin/airline-data/target/scala-2.13/classes ...
[warn] there were 99 deprecation warnings (since 2.13.0); re-run with -deprecation for details
[warn] there were four feature warnings; re-run with -feature for details
[warn] two warnings found
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:12:1: package java.net.http does not exist
[error] java.net.http.HttpClient
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:13:1: package java.net.http does not exist
[error] java.net.http.HttpRequest
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:14:1: package java.net.http does not exist
[error] java.net.http.HttpResponse
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:39:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:82:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:82:1: cannot find symbol
[error]   symbol:   variable HttpClient
[error]   location: class com.patson.init.WeatherImporter
[error] HttpClient
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:83:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:87:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:87:1: cannot find symbol
[error]   symbol:   variable HttpRequest
[error]   location: class com.patson.init.WeatherImporter
[error] HttpRequest
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:92:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:92:1: package HttpResponse does not exist
[error] HttpResponse.BodyHandlers
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:97:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:105:1: cannot find symbol
[error]   symbol:   variable HttpRequest
[error]   location: class com.patson.init.WeatherImporter
[error] HttpRequest
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:111:1: package HttpResponse does not exist
[error] HttpResponse.BodyHandlers
[error] /www/wwwroot/admin/airline-data/src/main/scala/com/patson/init/WeatherImporter.java:116:1: cannot find symbol
[error]   symbol:   class var
[error]   location: class com.patson.init.WeatherImporter
[error] var
[error] (Compile / compileIncremental) javac returned non-zero exit code
[error] (Compile / doc) Scaladoc generation failed
[error] Total time: 885 s (14:45), completed Jan 11, 2024 3:50:40 PM
patsonluk commented 9 months ago

I was using digital ocean, and now using google cloud. you will need a host that u have full control of all the installed packages (such as java). it's a bit concerning that it's placed under /www/wwwroot/admin which seems to be website hosting for me. The airline-club requires more than just website hosting, it needs the part that runs the simulation.

It still look like a java problem to me, java.net.http is a very basic package for java and it should present in all versions. The problem indicate that your java compiler somehow cannot lookup that class. This indicate classpath looking issue from sbt.

Your VPS seems to have java installed, but probably in some rather different way such that classpath lookup works differently.

kimbon30 commented 9 months ago

I have uploaded the files to an FTP with a free web panel on a Debian 12 VPS. I assume this does not deploy as a website but as an app? I had a scan through the source code, and I understand most of the syntax, just not how the app is structured / dependencies etc. I'm afraid that google cloud will become too costly for a deploy that will be private.

It would help if you could share your workflow? I would even pay.

patsonluk commented 9 months ago

u likely need full shell access instead of FTPing files over. The workflow is as in the README https://github.com/patsonluk/airline?tab=readme-ov-file#setup