I have some problems.
I tried to introduce akka-http. But I never ever develop by scala, so I used akka-http for java.
As I finished programming, I wanted to run akka-http app on Apache Daemon for product.
I tried to run on the app on linux, and use maven package. But there are some problems.
I found below messages in Daemon.out
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:145)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:172)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:246)
at akka.actor.ActorSystem$Settings.<init>(ActorSystem.scala:315)
at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:683)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:245)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:288)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:233)
at akka.actor.ActorSystem.apply(ActorSystem.scala)
at com.tet.AkkaTestMinimalHttpApp.start(AkkaTestMinimalHttpApp.java:51)
at com.tet.DaemonLauncher.start(DaemonLauncher.java:34)
... 5 more
Cannot start daemon
Service exit with a return value of 5
This is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tet</groupId>
<artifactId>test-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>testapi</name>
<description>test-api</description>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http_2.12</artifactId>
<version>10.0.10</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http-jackson_2.12</artifactId>
<version>10.0.10</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.16.Final</version>
</dependency>
<!-- JDK 1.8+ compatible -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.5.4</version>
</dependency>
<!-- commons-daemon -->
<dependency>
<groupId>commons-daemon</groupId>
<artifactId>commons-daemon</artifactId>
<version>1.0.15</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>allinone</shadedClassifierName>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>akka.Main</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
and this is Daemon.sh
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
JSVC=/usr/bin/jsvc
USER=root
DAEMON_HOME=/home/web_admin
PID_FILE=$DAEMON_HOME/daemon.pid
OUT_FILE=$DAEMON_HOME/daemon.out
#ERR_FILE=$DAEMON_HOME/daemon.err
CLASSPATH=\
$DAEMON_HOME/test-SNAPSHOT.jar
JVM_ARGS="-Xms1024m -Xmx2048m"
MAIN_CLASS=com.tet.DaemonLauncher
case "$1" in
start)
#
# Start Daemon
#
rm -f $OUT_FILE
$JSVC \
$JVM_ARGS \
-user $USER \
-java-home $JAVA_HOME \
-pidfile $PID_FILE \
-outfile $OUT_FILE \
-errfile $OUT_FILE \
-cp $CLASSPATH \
$MAIN_CLASS
#
# To get a verbose JVM
#-verbose \
# To get a debug of jsvc.
#-debug \
exit $?
;;
stop)
#
# Stop Daemon
#
$JSVC \
-stop \
-nodetach \
-java-home $JAVA_HOME \
-pidfile $PID_FILE \
-outfile $OUT_FILE \
-errfile $OUT_FILE \
-cp $CLASSPATH \
$MAIN_CLASS
exit $?
;;
*)
echo "[Usage] TestDaemon.sh start | stop"
exit 1;;
esac
What is my problem? I tried many things, but i failed.
Thank you.