I have a simple rest server in Scala. Run this project via intellij on localhost:8080
. I tried to send POST
or GET
request into this server via postman and curl, but it cannot connect with it, don't know why. I pinged localhost and it answer, but localhost:8080 where the app runs only loading and nothing more. I run intellij and start my server (scala, cats, Blaze). Everything works correctly yesterday, but today it's not.
I looked into intellij logs, and they look like good:
2019-04-21 19:29:08,912 [14101080] INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2019-04-21 19:29:08,919 [14101087] INFO - j.compiler.server.BuildManager - Using preloaded build process to compile /home/project
2019-04-21 19:29:11,565 [14103733] INFO - lij.compiler.impl.CompilerUtil - COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 2662 ms: 0 min 2sec
2019-04-21 19:29:11,565 [14103733] INFO - s.CompilerReferenceServiceBase - backward reference index reader doesn't exist
2019-04-21 19:29:12,358 [14104526] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /home/intellij/idea-IU-183.5912.21/lib/jps-launcher.jar:/usr/lib/jvm/java-1.11.0-openjdk-amd64/lib/tools.jar:/home/intellij/idea-IU-183.5912.21/lib/optimizedFileManager.jar
2019-04-21 19:29:12,419 [14104587] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2019-04-21 19:29:12,419 [14104587] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2019-04-21 19:29:12,419 [14104587] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2019-04-21 19:29:14,496 [14106664] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: An illegal reflective access operation has occurred
2019-04-21 19:29:14,496 [14106664] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/home/intellij/idea-IU-183.5912.21/lib/protobuf-java-3.4.0.jar) to field java.nio.Buffer.address
2019-04-21 19:29:14,496 [14106664] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
2019-04-21 19:29:14,496 [14106664] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2019-04-21 19:29:14,496 [14106664] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: All illegal access operations will be denied in a future release
Everything builds well. I don't know where the problem could be. I also tried to turn on proxy in postman but it did not help. Cleared also cache in intellij, nothing help. I'm using newest Ubuntu. Does anyone had same problem and know how to solve it? Maybe it is a stupid question but I really don't have any idea what could happend.
EDIT
I ckecked if something else using port 8080
with this command:
netstat -tulpn | grep 8080
, but I only got one result:
tcp6 0 0 127.0.0.1:8080 :::*LISTEN 18125/java
.
It looks like only my running app is using this port.
That is correct. Only your server should be using that port. Nothing else is attempting to connect to it.
Try:
telnet 127.0.0.1 8080
. If you get back(which you should, given the output of
netstat
) then the port is open. What your code is doing with it is beyond the scope of this forum; try a scala forum maybe?