alternative guide java log4j error starting

Followed the alternative guide but when i start youtrack, I'm getting the following error in the log. I should point out that I'm on Ubuntu 14 using Java 1.7

Jetty home folder is [/home/youtrack/.youtrack]
log4j:WARN No appenders could be found for logger (jetbrains.mps.webr.standalone.runtime.WebServer).
log4j:WARN Please initialize the log4j system properly.
2014-08-08 05:29:55.914:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
2014-08-08 05:29:55.995:INFO:oejw.WebInfConfiguration:Extract jar:file:/usr/local/youtrack/youtrack-5.2.3-8810.jar!/ to /home/youtrack/.youtrack/work/jetty-0.0.0.0-80-youtrack-5$


Link to the guide:

http://confluence.jetbrains.com/display/YTD5/Linux.+YouTrack+JAR+as+a+Service.+Alternative+Method
3 comments
Comment actions Permalink
ok, i fixed that by adding the following contents into the file /usr/local/youtrack/log4j.properties

##log4j.properties
# Root logger option
log4j.rootLogger=INFO, file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=./youtrack.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
prettyPrint();

and then adding -Dlog4j.configuration=file:$USR/log4j.properties to the java startup command in youtrack.sh so it now reads:

exec $JAVA_HOME/bin/java -Xmx512m -Djava.awt.headless=true -Dlog4j.configuration=file:$USR/log4j.properties -jar $JAR $PORT >> $LOG 2>&1 &


but now I'm getting the following errors in the log

Jetty home folder is [/home/youtrack/.youtrack]
2014-08-08 06:04:01 INFO  WebServer:57 - Added app context to handlers j.m.w.s.r.{,null},/usr/local/youtrack/youtrack-5.2.3-8810.jar
2014-08-08 06:04:01.176:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
2014-08-08 06:04:01.275:INFO:oejw.WebInfConfiguration:Extract jar:file:/usr/local/youtrack/youtrack-5.2.3-8810.jar!/ to /home/youtrack/.youtrack/work/jetty-0.0.0.0-80-youtrack-5.2.3-8810.jar--any-/webapp
2014-08-08 06:04:08.822:WARN:oejuc.AbstractLifeCycle:FAILED SelectChannelConnector@0.0.0.0:80: java.net.SocketException: Permission denied
java.net.SocketException: Permission denied
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at jetbrains.mps.webr.standalone.runtime.WebServer.start(WebServer.java:80)
    at jetbrains.charisma.standalone.CharismaStandalone.startServer(CharismaStandalone.java:111)
    at jetbrains.charisma.standalone.CharismaStandalone.main(CharismaStandalone.java:48)
2014-08-08 06:04:08.823:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@23cf4353: java.net.SocketException: Permission denied
java.net.SocketException: Permission denied
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at jetbrains.mps.webr.standalone.runtime.WebServer.start(WebServer.java:80)
    at jetbrains.charisma.standalone.CharismaStandalone.startServer(CharismaStandalone.java:111)
    at jetbrains.charisma.standalone.CharismaStandalone.main(CharismaStandalone.java:48)
2014-08-08 06:04:08 ERROR WebServer:83 - Can't start server
java.net.SocketException: Permission denied
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at jetbrains.mps.webr.standalone.runtime.WebServer.start(WebServer.java:80)
    at jetbrains.charisma.standalone.CharismaStandalone.startServer(CharismaStandalone.java:111)
    at jetbrains.charisma.standalone.CharismaStandalone.main(CharismaStandalone.java:48)
2014-08-08 06:04:08.832:INFO:oejsh.ContextHandler:stopped j.m.w.s.r.{,file:/home/youtrack/.youtrack/work/jetty-0.0.0.0-80-youtrack-5.2.3-8810.jar--any-/webapp/},/usr/local/youtrack/youtrack-5.2.3-8810.jar
Exception in thread "main" java.net.SocketException: Permission denied
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at jetbrains.mps.webr.standalone.runtime.WebServer.start(WebServer.java:80)
    at jetbrains.charisma.standalone.CharismaStandalone.startServer(CharismaStandalone.java:111)
    at jetbrains.charisma.standalone.CharismaStandalone.main(CharismaStandalone.java:48)
prettyPrint();
0
Comment actions Permalink
and i fixed that by realising that UNIX-based operating systems by design do not normally allow non-root users to bind to ports less than 1024.

So by me changing the port in the youtrack.sh file to port 80 and trying to skip having to install lighthttp as per the instructions, was the problem :(  Changed back to port 8112 and installed lighthttp!
0
Comment actions Permalink
for completeness, i also had to add -XX:MaxPermSize=150m to the java startup command
0

Please sign in to leave a comment.