Ich habe ein ausführbares Glas und habe versucht, einen Windows -Dienst mit sc.exe zu erstellen. Ich habe den folgenden Code zum Erstellen von Dienst verwendet: < /p>
sc create "TestService" binPath= "C:\Program Files\Java\jdk1.6.0_03\jre\bin\java.exe -jar C:\abc\MainClass.jar"
< /code>
Der Dienst wurde erstellt, aber als ich versuchte, den Dienst zu starten, habe ich den folgenden Fehler erhalten: < /p>
Error 1053: The service did not respond to the start or control request in a timely fashion.
< /code>
Später habe ich versucht, Java Service Wrapper (Community Edition) zu verwenden, der Service beginnt einige Zeit, wird jedoch jedes Mal gestoppt. Das Wrapper -Protokoll sagt so etwas wie: < /p>
Advice:
The Wrapper consists of a native component as well as a set of classes
which run within the JVM that it launches. The Java component of the
Wrapper must be initialized promptly after the JVM is launched or the
Wrapper will timeout, as just happened. Most likely the main class
specified in the Wrapper configuration file is not correctly initializing
the Wrapper classes:
com.MainClass
While it is possible to do so manually, the Wrapper ships with helper
classes to make this initialization processes automatic.
Please review the integration section of the Wrapper's documentation
for the various methods which can be employed to launch an application
within the Wrapper
< /code>
Könnte mir jemand bitte sagen, wie ich Jar als Windows -Dienst ausführen kann, ohne externe Software zu verwenden, da ich keine App für Drittanbieter für das Produkt von Kunden verwenden kann. < / p>
Wenn nicht welche anderen Konfigurationen ich in Java Service Wrapper tun muss, um den Service zu starten. Finden Sie einige Informationen dazu auf Stackoverflow, aber ich habe nichts bekommen. Wenn jemand etwas auf Stackoverflow hat>
Ausführen von Java -Gläern als Windows -Service ⇐ Java
-
- Similar Topics
- Replies
- Views
- Last post