rarcher / couch-potato-server

Server application for the Couch Potato Android app. Allows you to control your computer with your phone.
Apache License 2.0
3 stars 0 forks source link

illegal reflective access #27

Open bhooshanaj opened 6 years ago

bhooshanaj commented 6 years ago

This is what happens when I try to run the portable mode Server.jar.


WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.esotericsoftware.reflectasm.AccessClassLoader (file:/home/bhooshanaj/Downloads/Setups/couch-potato-server/lib/reflectasm-1.07.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.reflectasm.AccessClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

This what happens if I try to install using the .deb file.

WARNING: Illegal reflective access by com.esotericsoftware.reflectasm.AccessClassLoader (file:/usr/share/couch-potato-server/lib/reflectasm-1.07.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.reflectasm.AccessClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Invalid MIT-MAGIC-COOKIE-1 keyxcb_connection_has_error() returned true
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
Invalid MIT-MAGIC-COOKIE-1 keyException in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
    at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
    at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
    at java.desktop/java.awt.Robot.<init>(Robot.java:96)
    at codes.soloware.couchpotato.server.Main.main(Unknown Source)

I don't use java .. So honestly. I don't understand much of this. Any help?

rarcher commented 6 years ago

Hey @bhooshanaj, thanks for the report!

Looking at the errors, I'm actually seeing two distinct problems:

For troubleshooting, first of all, what Java version are you using? You can get this information by typing java -version into a console.

Beyond that, have you tried running the Android app, to see if it can connect to your PC? The warnings are just warnings...they shouldn't cause any actual problems, beyond a visual annoyance. The keyException error will kill the server, but it should only effect the .deb version, and only on the first time it runs, immediately after installation. You can work around that by rebooting, or by running the portable version instead.

bhooshanaj commented 6 years ago

Yes. Sorry. I should've mentioned that. The Portable version runs and works as expected.

On normal (non-root) user though. It shows several more Warnings.

19:31:08,207 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
19:31:08,208 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
19:31:08,220 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/bhooshanaj/Downloads/Setups/couch-potato-server/config/logback.xml]
19:31:08,539 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
19:31:08,564 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
19:31:08,567 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console]
19:31:08,779 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
19:31:08,968 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
19:31:08,970 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [file]
19:31:08,991 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
19:31:08,994 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern server.%d{yyyy-MM-dd}.log for the active file
19:31:08,998 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'server.%d{yyyy-MM-dd}.log'.
19:31:08,998 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
19:31:09,037 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Wed Oct 03 17:12:49 IST 2018
19:31:09,039 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
19:31:09,051 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[file] - Active log file name: /tmp/Couch Potato/server.log
19:31:09,051 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[file] - File property is set to [/tmp/Couch Potato/server.log]
19:31:09,053 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file] - openFile(/tmp/Couch Potato/server.log,true) call failed. java.io.FileNotFoundException: /tmp/Couch Potato/server.log (Permission denied)
    at java.io.FileNotFoundException: /tmp/Couch Potato/server.log (Permission denied)
    at  at java.base/java.io.FileOutputStream.open0(Native Method)
    at  at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
    at  at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
    at  at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
    at  at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:149)
    at  at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
    at  at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
    at  at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
    at  at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
    at  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
    at  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
    at  at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
    at  at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
    at  at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
    at  at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
    at  at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
    at  at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
    at  at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
    at  at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
    at  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
    at  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
    at  at codes.soloware.couchpotato.server.Main.<clinit>(Unknown Source)
19:31:09,053 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
19:31:09,053 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [file] to Logger[ROOT]
19:31:09,054 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
19:31:09,054 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@46238e3f - Registering current configuration as safe fallback point

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.esotericsoftware.reflectasm.AccessClassLoader (file:/home/bhooshanaj/Downloads/Setups/couch-potato-server/lib/reflectasm-1.07.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.reflectasm.AccessClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

java -version output.

openjdk version "11" 2018-09-25 OpenJDK Runtime Environment (build 11+28-Debian-1) OpenJDK 64-Bit Server VM (build 11+28-Debian-1, mixed mode, sharing)

rarcher commented 6 years ago

No problem!

Regarding the extra errors when not running as root, that's happening because the root user currently owns the server log file, so the regular user can't write to it. You can fix it by going into /tmp/ and deleting the Couch Potato folder (which will probably require root to do).

Additionally, am I correct in thinking that you're running Debian?

bhooshanaj commented 6 years ago

Yes. Debian Testing.

I suspected it was some kind of access privileges.

rarcher commented 6 years ago

I figured. I'm running Ubuntu and the issues don't happen here. Looks like Debian has a slightly different build of Java as default.