問題タブ [apache-commons-daemon]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - Java での Apache Commons Daemon の単体テスト
私はいろいろ調べましたが、Java で書かれた apache commons デーモンを JUnit でテストするのに役立つ適切なリソースが見つからないようです。デーモンが起動すると必ず起動し、シャットダウンすると必ずシャットダウンすることをテストできるようにしたいと思います。
以下は、ピリオドの後に開始および停止するデーモンのコード例です。
アップデート
ロガー クラスはテキスト ファイルを読み取り、このテキスト ファイルからランダムな行をログ ファイルに書き込みます *
どんな助けでも大歓迎です。
java - Cross-Platform Service で Apache Commons Daemon を使用するには?
実行可能な JAR として展開する必要がある Java デーモン (24 時間年中無休で実行されているシステム サービス) がありますが、ユーザー (Windows、Linux、Mac のいずれでも) が次の方法でアプリケーションを開始/停止できるようにしたいと考えています。
(または、Windows/Mac サービスに相当するもの)。myapp
明らかに、これには、 「サービス」をJavaアプリ内からの特定のメソッド呼び出しにマップするためにOSレベルで何かが必要です(おそらくLifecycleManager#start()
、LifecycleManager#stop()
それぞれ)。
Apache Commons Daemonをこの目的に使用できると聞きました。彼らのサイトを熟読したところ、まさにこれを行っているようです。ただし、それは古いプロジェクトのようで、探していることを達成するためのドキュメントは実際にはありません。
だから私は尋ねます:commons-daemon
私が必要とすることをすることができますか、それとも何か他のものが必要ですか?実行可能 JAR からクロスプラットフォーム デーモンを取得するにはどうすればよいですか? 前もって感謝します!
java - Apache Commons Daemon でログ ファイルのローテーションを実装する方法は?
標準の Unix デーモンは、シグナル HUP をサポートしてログ ファイルをローテーションします。デーモンはシグナルを受信するたびに、すべてのログ ファイルを閉じてから再度開きます。
Apache Commons Daemon を使用して、Java でデーモン プロセスを実行しています。デーモンの実装は、init、start、および stop の 3 つのメソッドをサポートしています。しかし、Unix シグナルのサポートが見つかりません。ログ ファイルをローテーションする HUP シグナルをサポートするにはどうすればよいですか?
java - Commons-Daemon は、実行可能な JAR をサービスにするために存在しますか?
という実行可能な JAR があるとしmyapp.jar
ます。Apache Commons-Daemonは存在するので、/etc/init.d/myapp
(サービスを開始/停止するための) サービス スクリプトを作成し、通常の Linux サービスのようmyapp
に扱うことができます:myapp
それとも何か他のことをしますか?
java - Windows Service - Apache commons daemon class not found
I have a Jar file that needs to be installed as a windows service. I'm using Apache commons daemon procrun.
Though the service appears in the Services tab in task manager its not running. Its in stopped state and attempting to start it seems not working.
*In commons daemons logs I noticed that it cannot load the main class which is the "AgentApp".
I installed 32bit jre too.
Mentioned here under the log file contents.
imageprocagent stderr:
crawford-daemon:
- `[2015-01-07 15:47:49] [error] FindClass com/fx358/fx9/agent/AgentApp failed
Here is the script I'm using to install the agent:
` Can someone point me out what I'm doing wrong? thanks in advance.
scala - jsvc の commons-daemon で Scala を実行する
commons-daemon を使用してデーモンとして実行できる基本的な Scala アプリケーションを作成しようとしています。次のコードは、この投稿の Java プログラムに基づいています。
これは、sbt から実行したり、jar をビルドしたりするときに問題なく動作します。ただし、jsvc からコードを実行することはできません。たとえば、次を実行した場合:
私はstderrで次を取得します
探しているメソッドであるinit(Array [String])で何が起こっているのかわかりません。scalac がメイン クラスをコンパイルする方法に、コードとデーモン インターフェイスとの互換性をなくしている何かがありますか?
ありがとう!
java - procrunを使用してdocuments4jサーバーをWindowsサービスとしてスタンドアロンでスケジュールする方法は?
RTFからPDFへの変換にprocrunを使用してdocuments4jをWindowsサービスとしてスケジュールしようとしましたが、次のエラーがスローされ続けます:
procrun用に次のbatファイルを作成しました
jarをWindowsサービスとして正常にインストールし、開始/停止できました
また、クラス com.documents4j.standalone.StandaloneServer がコマンド ライン経由で実行されると、変換が正しく行われます。
jetty - Config for Tika Windows Service with Apache Commons Daemon
I'm trying to get Tika JAXRS running as a Windows Service using Apache Commons Daemon.
I've got tika-server-1.7.jar from http://tika.apache.org/download.html
I've downloaded v1.0.15 of the Windows binaries for Apache Commons Daemon from http://commons.apache.org/proper/commons-daemon/binaries.html
I can get Tika started as a service, but I can't determine what to use for a stop method.
This starts, and works as I'd hope, but when trying to stop the service it doesn't respond. Obviously org.apache.tika.server.TikaServerCli.main(string[] args)
isn't a suitable stop method, but I'm lost for alternatives.
I'd also welcome any alternative methods for getting Tika running as a Windows Service, or otherwise auto-starting outside of an interactive session.