Rohit Bajaj
asked on
Error getting output to stdout log4j spring application
HI,
In my spring application i have configured log4j . Normally all the logs are going into the log file.
But when say there is some startup error while starting the application like :
java -DFLOCK_APPS_CONFIG=dev -jar target/snippet.jar &
Logs do get pushed to log files but also the error only gets output to the console. I want to get rid of this and why its happening as i have configured log4j.
Error :
In my spring application i have configured log4j . Normally all the logs are going into the log file.
But when say there is some startup error while starting the application like :
java -DFLOCK_APPS_CONFIG=dev -jar target/snippet.jar &
Logs do get pushed to log files but also the error only gets output to the console. I want to get rid of this and why its happening as i have configured log4j.
Error :
Exception in thread "main" java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:326)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:244)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:384)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.directi.code.AppStart.start(AppStart.java:52)
at org.directi.code.AppStart.main(AppStart.java:35)
[2]+ Exit 1 java -DFLOCK_APPS_CONFIG=dev -jar target/snippet.jar
This happened when i tried to run the application twice on the same port
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)