Windows Service Timeout

I've got an application that we are having issues with it timing out and so I need to extend the default timeout period. I believe the default timeout is 30 seconds.
The only info I could find on increasing the services timeout is for 2008 R2 and previous OS. I tried creating a DWord value of
ServicesPipeTimeout and setting the Decial entry of 120000 but the TimeOut still occurs after 30 seconds.
http://support.microsoft.com/kb/922918
How do you extend the a Windows Service timeout past 30 seconds on a 2012 R2 64 bit server?
Lossless Audio Addict

Hi,
Sorry for the delay reply.
So did you receive the event 7009 in event viewer?
If yes, I suggest you may refer to this article and try again to check the result:
https://technet.microsoft.com/en-us/library/cc756342(v=ws.10).aspx
Caution: Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data.
Regards.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Similar Messages

  • How to register DI RfcSvr as an Windows service

    Every time I must manully start DI RfcSvr program on windows. I want to know how to register it as a Windows service?
    I try to run below command:
    ntscmgr install SAPRFCService -b "D:\Business Objects\BusinessObjects Data Services\bin\rfcsvr.exe" -p "-a DI_SOURCE -g HOST_NAME -x gateway_name"
    It successfully register the command to NT service but It can not start. The error message in Event Manager is:
    Event ID 7009, Timeout (30000 milliseconds) waiting for the SAPRFCService service to connect. I though this is caused by no return code returned by program rfcsvr.exe.
    Anybody has good idea?
    TIA

    Hi,
    I'm in the same situation, I need to know if it's possible to record DI RFCSVR as a Windows service or not.
    When I try to start the service, I get the same error
    Event ID 7009, Time (30000 milliseconds) waiting for <name Service> of service to connect.
    I have searched without success guides.
    Any suggestions.

  • Windows Service Error 1053 - Service did not respond to start or control request

    I'm presuming it's logging on as a domain user.  Has that user got "Logon as a Service" rights?

    I've been working on this issue with our developers for the past week, and so far we're stumped. We have a Windows Service that was created in-house to process our customers imaging requests with assured delivery that are past the start date. We currently have this service, and a few others like it, running on 12 different bus servers. The servers all run .NET Framework 4.5, and all the other servers run it with no problem. This particular service bus gives us the "Error 1053" as so on as we try to start the service. I've increased the timeout to 60 seconds, but it was set at 30 before and it times out IMMEDIATELY after pressing start. I've uploaded the .config file we use. I modified the IP addresses for security reasons. The service logs on with an administrator password that has domain access rights. We've tested the connectivity...
    This topic first appeared in the Spiceworks Community

  • Registering tnameserv as a windows service

    Hi,
    Could anyone help me on registering and starting tnameserv as a windows service.
    Any help would be very very helpful.
    Regards,
    Hayath

    Here is code I have written to do this. It is deployed using the wrapper utility (see http://wrapper.tanukisoftware.org), and I am including the wrapper config file that I use. You need to have the tnameserv.exe executable and tools.jar available - I simply deploy them in the same directory as the jar file I build form the cod below.
    This may not be very elegant, but it works, and is in use on a daily basis in live newspaper publishing sites that use our software, so it works well.
    Here is the code, which I provide as is with no liabilities etc.:
    import java.io.*;
    public class corbaasservice {
    public static void main(String arguments[]) {
    try {
    String tnameservpath = "./tnameserv.exe";
    if (arguments.length > 0) tnameservpath=arguments[0];
    startCorbaThread(tnameservpath);
    catch (Exception e) {
    e.printStackTrace();
    static SetantaThread setanta;
    private static void startCorbaThread(String tnameservpath) throws IOException {
    setanta = new SetantaThread(tnameservpath);
    setanta.start();
    class shutdowncorbaasservice extends Thread {
    private SetantaThread setanta;
    public shutdowncorbaasservice(SetantaThread s) {
    setanta = s;
    public void run() {
    try {
    Process tnameservProcess = setanta.getTnameservProcess();
    tnameservProcess.destroy();
    System.out.println("CORBA As Service interrupted");
    catch (Exception e) {
    e.printStackTrace();
    // we do this to make it possible to start the program as a Windows Service without problems
    // using a separate thread, prevents the service manager locking up if the startup time is too long
    class SetantaThread extends Thread {
    private String tnameservPath;
    private Process tnameservProcess;
    public SetantaThread(String path) {;
    tnameservPath = path;
    tnameservProcess = null;
    public Process getTnameservProcess() { return tnameservProcess; }
    public void run() {
    int status = 0;
    try {
    System.out.println("CORBA As Service starting");
    Runtime.getRuntime().addShutdownHook(new shutdowncorbaasservice(this));
    tnameservProcess = Runtime.getRuntime().exec(tnameservPath);
    status = tnameservProcess.waitFor();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    System.out.println("CORBA As Service exiting with status: "+status);
    Here is the wrapper configuration file I use. You can install the service by running the wrapper progam with this config file:.
    wrapper.java.command=java
    wrapper.java.maxmemory=128
    wrapper.java.mainclass=com.silveregg.wrapper.WrapperSimpleApp
    wrapper.app.parameter.1=corbaasservice
    wrapper.java.classpath.1=./corbaasservice.jar
    wrapper.java.classpath.2=./wrapper.jar
    wrapper.java.classpath.3=./tools.jar
    wrapper.java.library.path=.
    wrapper.port=1777
    wrapper.startup.timeout=300
    wrapper.ping.timeout=300
    wrapper.shutdown.timeout=300
    wrapper.disable_shutdown_hook=TRUE
    wrapper.request_thread_dump_on_failed_jvm_exit=TRUE
    wrapper.ntservice.name=CORBAServices
    wrapper.ntservice.displayname=CORBA Services
    wrapper.ntservice.description=Provide CORBA Services for Java Applications
    wrapper.ntservice.starttype=AUTO_START
    wrapper.ntservice.process_priority=NORMAL
    Hope this helps,
    Colin Manning
    Setanta-Media Limited

  • Connection Timout in Windows Service

    Trying to connect to the db running in a windows service generates the error "ORA-12535: TNS: Timeout".
    When running in a WinForms-app, everything is OK. The service runs under the same account as the WinForms-app.
    Any ideas?

    There are two things you can try for ORA-12535 as the Oracle9i Net Services Administrator Documentation states:
    1) Use the IP address rather than names in your tnsnames.ora of your client machine to speed up connection.
    2) Increase (or add) the CONNECT_TIMEOUT_<lisenter name> parameter in the listener.ora of your server machine with a larger value than the default of 10 seconds.

  • BizTalk 2013 R2: SB-Messaging Windows Service Bus On Premise 1.1 (Not Windows Azure)

    Let me preface this by saying that I have been able to connect to the destination Service Bus Topics and Queue using traditional .NET methods (e.g. System.ServiceBus.Messaging namespace) and the applications using those components are running fine on the
    same local VM.  This uses the connection string that is provided from GET-SBAuthorizationRule.
    Development Environment:
    Windows Server 2012
    SQL Server 2014
    BizTalk 2013 R2
    Local VM that is not on the Domain (but can connect to computers on the network)
    I am trying to create a simple BizTalk 2013 R2 Messaging Solution that will use the SB-Messaging adapter features with Windows Service Bus On-Premise.  My solution is using a Static One-Way Send Port to send messages to an existing topic on with Windows
    Service Bus 1.1 using the SB-Messaging Adapter.  After using the programmatic approach, the configurations were not as intuitive, but I believe I am close to the resolution.  I have tried several combinations of key data but I am still not able to
    connect.  This seems like I am missing something small that is causing the problem but I am at a loss for the moment.  The error I receive is below:
    A message sent to adapter "SB-Messaging" on send port "SBSendPort" with URI "sb://<SERVERNAME>/NsServiceBus/collateraltopic" is suspended.
    Error details: System.UnauthorizedAccessException: The token provider was unable to provide a security token while accessing 'https://<SERVERNAME>:7355/WRAPv0.9/'. Token provider returned message: '<Error><Code>400</Code><Detail>Namespace cannot be resolved 'https://<SERVERNAME>:7355/WRAPv0.9/'.TrackingId:6bcd22e8-1741-41fc-a84c-9aa3f7146ab5_GUS2522512,TimeStamp:6/30/2014 8:35:35 PM</Detail></Error>'. ---> System.IdentityModel.Tokens.SecurityTokenException: The token provider was unable to provide a security token while accessing 'https://<SERVERNAME>:7355/WRAPv0.9/'. Token provider returned message: '<Error><Code>400</Code><Detail>Namespace cannot be resolved 'https://<SERVERNAME>:7355/WRAPv0.9/'.TrackingId:6bcd22e8-1741-41fc-a84c-9aa3f7146ab5_GUS2522512,TimeStamp:6/30/2014 8:35:35 PM</Detail></Error>'. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
    at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    at Microsoft.ServiceBus.TokenProviderHelper.TokenRequestAsyncResult.<GetAsyncSteps>b__8(TokenRequestAsyncResult thisPtr, IAsyncResult r)
    at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.EnumerateSteps(CurrentThreadType state)
    --- End of inner exception stack trace ---
    Server stack trace:
    Exception rethrown at [0]:
    at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at Microsoft.ServiceBus.TokenProviderUtility.GetMessagingToken(TokenProvider tokenProvider, Uri baseAddress, String appliesTo, String action, Boolean bypassCache, TimeSpan timeout)
    --- End of inner exception stack trace ---
    Server stack trace:
    at Microsoft.ServiceBus.TokenProviderUtility.GetMessagingToken(TokenProvider tokenProvider, Uri baseAddress, String appliesTo, String action, Boolean bypassCache, TimeSpan timeout)
    at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.GetAuthorizationToken(String appliesTo, String action)
    at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.GetAuthorizationHeader(String action)
    at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.CreateWcfMessageInternal(String action, Object body, Boolean includeToken, String parentLinkId, RetryPolicy policy, TrackingContext trackingContext)
    at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.GetOverheadSize()
    at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender..ctor(String path, SbmpMessagingFactory messagingFactory, SbmpMessageCreator messageCreator, RetryPolicy retryPolicy)
    at Microsoft.ServiceBus.Messaging.Sbmp.CreateSenderLinkSettings..ctor(SbmpMessagingFactory messagingFactory, String entityName, Nullable`1 entityType, String transferDestinationEntityName, RetryPolicy retryolicy)
    at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessagingFactory.OnBeginCreateMessageSender(String transferDestinationEntityName, String viaEntityName, TimeSpan timeout, AsyncCallback callback, Object state)
    at Microsoft.ServiceBus.Messaging.MessagingFactory.CreateMessageSenderAsyncResult.<GetAsyncSteps>b__52(CreateMessageSenderAsyncResult thisPtr, TimeSpan t, AsyncCallback c, Object s)
    at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.EnumerateSteps(CurrentThreadType state)
    at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.Start()
    Exception rethrown at [0]:
    at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
    at Microsoft.ServiceBus.Messaging.OpenOnceManager.<>c__DisplayClass4`1.<Begin>b__3(IAsyncResult r, T& output)
    at Microsoft.ServiceBus.Messaging.OpenOnceManager.OpenOnceManagerAsyncResult`1.OperationComplete(IAsyncResult result)
    at Microsoft.ServiceBus.Common.AsyncResult.SyncContinue(IAsyncResult result)
    at Microsoft.ServiceBus.Messaging.OpenOnceManager.OpenOnceManagerAsyncResult`1.BeginOperation()
    at Microsoft.ServiceBus.Messaging.OpenOnceManager.OpenOnceManagerAsyncResult`1.OpenComplete(IAsyncResult result)
    at Microsoft.ServiceBus.Common.AsyncResult.SyncContinue(IAsyncResult result)
    at Microsoft.ServiceBus.Messaging.OpenOnceManager.OpenOnceManagerAsyncResult`1..ctor(OpenOnceManager openOnceManager, TimeSpan openTimeout, AsyncCallback callback, Object state, Func`3 beginOperation, EndOperation`1 endOperation)
    at Microsoft.ServiceBus.Messaging.OpenOnceManager.Begin[T](AsyncCallback callback, Object state, Func`3 beginOperation, Func`2 endOperation)
    at Microsoft.ServiceBus.Messaging.MessagingFactory.BeginCreateMessageSender(String transferDestinationEntityPath, String viaEntityPath, Boolean tryPairSender, TimeSpan timeout, AsyncCallback callback, Object state)
    at Microsoft.ServiceBus.Messaging.Channels.ServiceBusOutputChannel.OpenMessagingFactoryAndMessageSenderAsyncResult.CreateFactoryComplete(IAsyncResult result)
    at Microsoft.ServiceBus.Common.AsyncResult.SyncContinue(IAsyncResult result)
    at Microsoft.ServiceBus.Messaging.Channels.ServiceBusOutputChannel.OpenMessagingFactoryAndMessageSenderAsyncResult..ctor(ServiceBusOutputChannel outputChannel, TimeSpan timeout, AsyncCallback callback, Object state)
    at Microsoft.ServiceBus.Messaging.Channels.ServiceBusOutputChannel.OnOpen(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Open()
    at Microsoft.BizTalk.Adapter.SBMessaging.SBMessagingOutputChannelFactory.OnCreateChannel(EndpointAddress address, Uri via)
    at System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
    at System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)
    at System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverOutput.CreateInnerChannelBinder(EndpointAddress to, Uri via)
    at System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
    at System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
    at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
    at System.ServiceModel.ChannelFactory`1.CreateChannel()
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.GetChannel[TChannel](IBaseMessage bizTalkMessage, ChannelFactory`1& cachedFactory)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)
    MessageId: {28428716-88C2-437B-953F-D471DA00C5A6}
    InstanceID: {18C48B89-D9C0-47A8-ADF0-0CA62746FBB1}
    Below are my Send Port Adapter Configurations:
    URI is blacked out
    /Namespace/Topic/ are next in the path
    Can someone confirm that the Issuer Name is the Namespace and the Issuer Key is the Primary Key from the get-SBAuthorizationRule?  I also tried Shared Access Signature (SAS) but that service was connecting to a default port and do not believe that is
    how I need to connect.
    Also, there is nothing on the Properties Tab as I do not have anything custom for the initial step.
    Any and all help is appreciated.

    Glenn,
    Thank you very much for the response, I will go down this route in further detail.  A couple of quick questions for you to help further my understanding.
    Where is the SAS limitation documented?  I am sure I glossed over it and it did not register, but your help in where to look next time will be helpful.
    Also, can I change the default Port for which it is listening on the BizTalk Server or the Service Bus Location?  The connection string I get from get-SBAuthorization Rule is as follows:
    Endpoint=sb://{ServiceBusLocation}/NsServiceBus;StsEndpoint=https://{ServiceBusLocation}:7355/NsServiceBus;RuntimePort=7354;ManagementPort=7355;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KeyValue}
    The exception I get is:
    A message sent to adapter "SB-Messaging" on send port "SBSendPort" with URI "sb://<ServiceBusLocation>/NsServiceBus/collateraltopic" is suspended.
    Error details: System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://<ServiceBusLocation>:9354/. The connection attempt lasted for a time span of 00:00:04.0250873. TCP error code 10061: No connection could be made because the target machine actively refused it <IPAddress>:9354. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
    at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
    at System.ServiceModel.Channels.SocketConnectionInitiator.ConnectAsyncResult.OnConnect(IAsyncResult result)
    --- End of inner exception stack trace ---
    It looks like it is going to 9354 for the authentication when the Service Bus is configured for
    7355.  I believe I have opened the ports on both ends but do not think it will matter since it looks like it is sending the
    request to a different location.
    Thank you

  • DBCnsole service timeout

    I'm installing Oracle 10g R2 on a Windows 2000 Server with all patches and upgrades. No previous version of Oracle on this machine. The installation works fine except for the Enterprise Manager component. By "works fine", I mean that all the services are created and I can use the database, including sqlplus and the iSQL*Plus browser interface. But during the install it times out waiting for the dbconsole service to start up, so I can't access the http://{server}:{port}/em site. ("The page cannot be displayed.")
    I've repeated this several times using emca.bat and I've found that it will create the OracleDBConsole{xxx} service just fine, but in monitoring the service it takes a little over 8 minutes before the service makes it to the started state each time. Once it's in the started state, I can run "emctl status dbconsole" and it will return "Oracle Enterprise Manager 10g is running." Unfortunately, the EMCA is configured to wait for 5 minutes for the service to start (EMD_HANG_CHECK_STATUS_TIME=300) before it throws in the towel. (I tried changing that to 600 wherever I found it referenced but it doesn't take...it still timesout after 5 minutes.)
    Aside from the obvious question as to why would it take 8 minutes for the service to start, does anyone how to make emca either continue from where it left off, or how to extend the timeout period? Is there any form of the emca or emctl that does this?
    Thanks!

    Ugonic,
    Here an excerpt from the EMCA log from the point where it attempts to start the service to the point where it times out. FYI, there are no corresponding errors in any of the Windows event logs, so that didn't help in pointing me in any particular direction.
    If there's another log that you are interested in, let me know.
    Thanks!
    Snie
    Aug 23, 2006 10:10:54 AM oracle.sysman.emcp.util.PortManager addPortEntries
    CONFIG: File D:\oracle\product\10.2.0\db_1\install\portlist.ini is successfully updated
    Aug 23, 2006 10:10:54 AM oracle.sysman.emcp.ParamsManager getParam
    CONFIG: No value was set for the parameter ORACLE_HOSTNAME.
    Aug 23, 2006 10:10:54 AM oracle.sysman.emcp.util.DBControlUtil startOMS
    INFO: Starting Database Control (this may take a while) ...
    Aug 23, 2006 10:10:54 AM oracle.sysman.emcp.util.PlatformInterface serviceCommand
    CONFIG: cmdType: 0
    Aug 23, 2006 10:10:54 AM oracle.sysman.emcp.util.PlatformInterface serviceCommand
    CONFIG: Starting Windows service...OracleDBConsoleMSHTST
    Aug 23, 2006 10:10:54 AM oracle.sysman.emcp.util.PlatformInterface serviceCommand
    CONFIG: Waiting for service 'OracleDBConsoleMSHTST' to fully start
    Aug 23, 2006 10:11:04 AM oracle.sysman.emcp.util.PlatformInterface serviceCommand
    CONFIG: Waiting for service 'OracleDBConsoleMSHTST' to fully start
    again and again and again.
    Aug 23, 2006 10:15:54 AM oracle.sysman.emcp.EMConfig perform
    SEVERE: Error starting Database Control
    Refer to the log file at D:\oracle\product\10.2.0\db_1\cfgtoollogs\emca\MSHTST\emca_2006-08-23_10-07-42-AM.log for more details.
    Aug 23, 2006 10:15:54 AM oracle.sysman.emcp.EMConfig perform
    CONFIG: Stack Trace:
    oracle.sysman.emcp.exception.EMConfigException: Error starting Database Control
         at oracle.sysman.emcp.EMDBPostConfig.performConfiguration(EMDBPostConfig.java:569)
         at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:181)
         at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:150)
         at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:155)
         at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
         at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
         at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
         at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)
    ----------------------------------------------------------------------------------------------------------------------

  • What is windows service self-aware

    Hi
    How to make windows service self-aware
    I tried single ton pattern but no use
    Issue is :http://social.msdn.microsoft.com/Forums/office/en-US/5031074e-bab7-4659-b4b3-909a7d32ec6f/exchange-web-service-error-while-moving-mail-to-other-folder?forum=exchangesvrdevelopment 
    Regards,
    Jagdish
    Jagdish

    I
    got the Answer 
    Threading with Mutex (Mutual exclusion):
    When two or more threads need to access a shared resource at the same time, the system needs a synchronization mechanism to ensure that only one thread at a time uses the resource. Mutex is
    a synchronization primitive that grants exclusive access to the shared resource to only one thread. If a thread acquires a mutex, the second thread that wants to acquire that mutex is suspended until the first thread releases the mutex.
    Steps:
    Instantiating a new Mutex object that's accessible from each thread.
    Wrapping whatever code you want to be executed in the critical section with that object's WaitOne() and ReleaseMutex() methods in each thread
    Implementation:
    Add class
    SingleGlobalInstance to your project
    class
    SingleGlobalInstance :
    IDisposable
        public
    bool hasHandle = false;
        Mutex
    mutex;
        private
    void
    InitMutex()
            string
    appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute),
    false).GetValue(0)).Value.ToString();
            string
    mutexId = string.Format("Global\\{{{0}}}",
    appGuid);
            mutex =
    new
    Mutex(false,
    mutexId);
            var
    allowEveryoneRule = new
    MutexAccessRule(new
    SecurityIdentifier(WellKnownSidType.WorldSid,
    null),
    MutexRights.FullControl,
    AccessControlType.Allow);
            var
    securitySettings = new
    MutexSecurity();
            securitySettings.AddAccessRule(allowEveryoneRule);
            mutex.SetAccessControl(securitySettings);
        public
    SingleGlobalInstance(int
    TimeOut)
            InitMutex();
            try
                if(TimeOut
    <= 0)
                    hasHandle = mutex.WaitOne(Timeout.Infinite,
    false);
                else
                    hasHandle = mutex.WaitOne(TimeOut,
    false);
                if
    (hasHandle == false)
                    throw
    new
    TimeoutException("Timeout
    waiting for exclusive access on SingleInstance");
            catch
    (AbandonedMutexException)
                hasHandle =
    true;
        public
    void
    Dispose()
            if
    (mutex != null)
                if
    (hasHandle)
                    mutex.ReleaseMutex();
                mutex.Dispose();
    Add following condition to check whether thread is already running
    using (new
    SingleGlobalInstance(1000))
    //code which should be executed in single thread
    Regards,
    Jagdish Kotian
    Jagdish

  • Windows Service Enterprise Library Data Access Application Blocks Connection Pooling Issue

    Hello,
    We are developing a windows service using c# .net v 4.5.1 which communicates with SQL database (SQL 2008 R2 x64), communication with SQL server is done using Enterprise Library data access block v 6, The windows service does a file copy process in bulk &
    updates the database about the status of file copy, it is observed that as soon as we start the service the number of connections get max out & we start receiving a "Timeout expired.  The timeout period elapsed prior to obtaining a connection
    from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached."
    This issue is only observed when we run the code logic by deploying it as a windows service, When we run the exactly same code as a standalone exe (right click -> run as administrator) / non windows service, the connections on database are not exceeded
    & we do not receive the above mentioned error.
    The code block which makes calls to the database is under the c# "using" statement, hence connection pooling should be handled by default.
    Could you please recommend any suggestions on areas which I might have missed on to investigate this issue.
    Thanks in advance.

    Hi
    The issue got resolved after refresh the SCOM Data base access service  account in SQL 2012.
    Unable to launch the operations manager 2012 R2 console after extended the C drive of the SQl server ,getting error "The Data
    Access service is either not
    running or not yet initialized.
    Got to your SQL server -->databases-operationsmanager--security-users--locate the daa service account and refresh.issue fixed and am able to luanch.

  • Classic JVM hangs when running Tomcat as Windows Service

    Hi!
    I am running a Tomcat 3.2.4 application, written with Java 1.3.1_01.
    To run it as a Windows Service (W2000), I am using a slightly altered version of JavaService, which works fine so far: I can use both the "hotspot" and the "server" JVM's (by selecting the jvm.dll from the respective subfolder of the JDK/jre/bin folder).
    However, when I try to run the same application with the "classic" JVM, the service starts, inside of it Tomcat starts, the first output appears (to the stdout logfile) and after some time Tomcat simply hangs - it doesn't respond to anything anymore, 0% CPU, no output to logfiles anymore, doesn't even respond to normal Tomcat shutdown (e.g. when stopping the service, Windows waits the standard timeout then just kills it).
    Using the classic JVM in a console (e.g. not through JavaService and the classic/jvm.dll) works fine! No problems!
    Anyone here who can offer any help on this?
    Any hints why Tomcat may behave correctly in 5 out of six possible configurations (hotspot-server/client as service or console or classic as console) but hanging with 1 configuration (classic as service)?
    Also, on my W2000 box where this happens, the moment Tomcat hangs, I hear a Windows warning sound being played (the standard warning gong), like it happens when an info dialog pops up - only there is no dialog or whatever and the same moment Tomcat's CPU usage drops to 0% (although the app is still in startup and should do some more work for a few seconds).
    This also doesn't always happen at the same moment during startup, but each time at a different moment, e.g. I can not pin it down to something that is done during startup, it just happens a short while (sometimes earlier, sometimes later) after startup...
    Of course, I could simply say "forget classic, it's being phased out anyway", only: The SAME thing happens with IBM's Java 1.3 VM too (except for the gong sound, which seems to be Sun-JVM specific ;-)! And I would very much like my app to be able to run on IBM's VM (usually I'm using Sun's VMs everywhere, but we have a few stray W2000 boxes with SP2 where Sun's 1.3.1_0x VMs crash with our application [not hang like described above, but really crash, even when run as a console]) and on those boxes the IBM JVM in a console works fine - now I only have to get it working as a service too (and while researching why it hangs I saw that Sun's classic JVM hangs too, so I figured, I first find out why that happens, with the hope that the fix is applicable to IBM's JVM too...).
    Thanks already,
    Johannes

    re setting classpath when using JavaService
    for Win2k, Tomcat 3.3.1a, JDK1.2
    below is my script for creating/installing JavaService
    (based on Alexandria web site version). However, if i
    try to add .jar files to classpath (ie, CP environment
    variable), the service does not work. It only works
    when this single .jar file is there. How can .jar or
    .zip files be added to classpath for this service?
    I've not been working with Tomcar as a service, so can't help directly, but can offer some comments that might be of use (apologies if they aren't!).
    There are Tomcat scripts for V3.1, V3.2 and V4 with the JavaService code from Alexandria SC. Looks like you need one for V3.3 as well?
    In these others, there are fairly long lists of jar files in the classpath, so I would expect it to work correctly for the version you are using (unless there is a problem with the way that classloaders are involved, which is something that is known to get in the way for some app server-based programs).
    I would expect the classpath to work if changed from what you have listed to something like the following:
    set CP=%TOMCAT_HOME%\lib\tomcat.jar;%TOMCAT_HOME%\lib\jaxp.jar;%TOMCAT_HOME$\lib\other_library.jar
    Is that what you have tried to do, and found problems?
    Does this version of Tomcat bundle all of its resources into a single jar file (tomcat.jar), or is that a file you have created yourself?
    Is the problem found when loading and starting Tomcat itself, or from within your server-based application?
    Does it fail to load a 'standard' Tomcat library archive, or a jar file containing your own program code?
    set CP=%TOMCAT_HOME%\lib\tomcat.jar
    echo %CP%
    JavaService.exe -install "Jakarta-Tomcat"
    %java_home%\jre\bin\classic\jvm.dll
    -Djava.class.path=%CP% -Dtomcat.home=%TOMCAT_HOME%
    -Djava.security.policy=%TOMCAT_HOME%/conf/tomcat.policy
    -Xms128m -Xmx128m -start
    org.apache.tomcat.startup.Main -params start -stop
    org.apache.tomcat.startup.Main -params stop -out
    %TOMCAT_HOME%\logs\stdout.log -err
    %TOMCAT_HOME%\logs\stderr.log
    Regards,
    John Rutter

  • Help, which windows Service msut be on to run Adobe Bridge CS3?

    hi all,
    I'm having trouble opening Adobe Bridge CS3, theres a windows popup that says "Adobe Bridge has encountered a problem and needs to close" error message when i try to start.
    I can run the other Adobe Cs3 applications fine, i've been playing around with the disabling of windows services to increase bootup time. i'm afraid i may have accidentally disabled something necessary
    pls advice on how to get it working.. i'm on win xp pro sp2
    thanks

    When you get the "Bridge has encountered an error" popup box, check the technical info hyperlink to see what's the problem. It may point to a DLL that had an error.
    From there, check the web to see what that DLL relates to, which may or may not give you a lead. Maybe something that needs to be running in WinXP, maybe a 3rd party product that needs to be fixed/removed/re-installed.
    Why do I say this? I had the same issue on Bridge after getting the trial version. Worked for a while, then suddenly stopped working with the same startup dialog box and a quick shutdown. Digging a bit as above pointed to a DLL that was related to Quicktime. I went to the Apple site and downloaded/installed the latest version of Quicktime, and the Brige problem was cured.

  • How to create a client console to connect to server in windows service using c#

    my code is error
    can you check the code please
    client console code
    partial class Program : ServiceBase
            public static void Main(string[] args)
                serverservice ss = new serverservice();
                ss.myserver();
                    TcpClient tcpc = new TcpClient();
                    Console.WriteLine("connecting.......");
                    tcpc.Connect("10.128.1.116", 80);
                    Console.WriteLine("connected........");
                    Console.Write("enter msg to be transimitt");
                    string str = Console.ReadLine();
                    Stream stm = tcpc.GetStream();
                    ASCIIEncoding asc = new ASCIIEncoding();
                    byte[] ba = asc.GetBytes(str);
                    Console.WriteLine("transmitting..........");
                    stm.Write(ba, 0, ba.Length);
                    byte[] bb = new byte[100];
                    int k = stm.Read(bb, 0, 100);
                    for (int i = 0; i < k; i++)
                        Console.Write(Convert.ToChar(bb[i]));
                    tcpc.Close();
                windows service for server code is
      public partial class serverservice : ServiceBase
            public serverservice()
                InitializeComponent();
            protected override void OnStart(string[] args)
                myserver();
               Thread mythread = new Thread(new ThreadStart(myserver));
                 mythread.Start();
            public void myserver()
                char d;
                IPAddress ipad1 = IPAddress.Parse("10.128.1.116");
                TcpListener tcpc = new TcpListener(ipad1, 80);
                tcpc.Start();
               // System.Diagnostics.Process.Start(@"C:\Users\PC\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\webs\webs\clientconsole\clientconsole\bin\Debug\clientconsole.exe");
                Console.WriteLine("server is running at port 80");
                Console.WriteLine("local end point is" + tcpc.LocalEndpoint);
                Console.WriteLine("waiting for connection");
              // var client=new TestExecutionEngine
                Socket s = tcpc.AcceptSocket();
                Console.WriteLine("connection is accepted from" + s.RemoteEndPoint);
                byte[] b = new byte[100];
                int k = s.Receive(b);
                Console.WriteLine("received");
                for (int i = 0; i < k; i++)
                    d = Convert.ToChar(b[i]);
              Console.WriteLine(char.ToUpper(d));
                ASCIIEncoding asc = new ASCIIEncoding();
                s.Send(asc.GetBytes("msg is recveived"));
                Console.WriteLine("\n send aknwldge");
                s.Close();
                tcpc.Stop();
               protected override void OnStop()
                EventLog.WriteEntry("stopped");

    kavya --
    You have erroneously posted this question in a user forum dedicated to questions about Project Online, an enterprise project management application.  I would recommend you repost your question in a user forum that deals with C sharp programming questions. 
    Hope this helps.
    Dale A. Howard [MVP]

  • Permissions for Windows Service on Server

    Post Author: bdimon
    CA Forum: Authentication
    I wrote a Windows service running as an Active Directory user. It cannot print on the Windows Server so I wrote a windows application to test the permissions. When a user with local admin rights runs the test application, it prints. He starts the program using the "Run As" option and enters the Active Directory user from the service, he gets the same error as the Windows Service gets. This must be permissions-based.
    When I installed this Windows Service on a staging server, everything was fine. However the staging server was not "secured" by the network team so the Active Directory user had Read/Execute permissions on the C: drive. I do not want to ask for these permissions on the production server's C: drive.
    The error is:
    System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800002AD): Error in File UNKNOWN.RPT:
    The request could not be submitted for background processing.
       at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       --- End of inner exception stack trace ---
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
       at WindowsApplication1.frmTestServerPrint.PrintCrystalReport(String& ErrorText, String ReportFileName, String PrinterLocation, Int32 PayTransStatusCode)

    Post Author: jgreg311
    CA Forum: Authentication
    I believe I'm having a similar problem, and was hoping to see if either you have found an answer to the problem or reactivate this thread in hopes someone will finally answer us.I'm creating reports using a windows service as well.  The report files are compiled into the DLL, and they are being exported to save them to disk.   The error is being generated when the report object is first accessed (which happens to be when attempting to set the Text property on a TextObject).  It works fine on my development machine.  I've installed the service on the production server using a Visual Studio 2005 Setup and Deployment project.  I added the 2005 Crystal merge module to the setup, so all necessary files should exist on the server.  The service is running as a domain user that has admin rights on the local machine, but we're still getting this error that seems, according to posts I've found online, to be a permissions issue.Here is the exception in its entirety:
    Exception Type:
    System.Exception
    Exception Message:
    Load report failed.
    Exception Stack Trace:
    at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
    at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
    filename, OpenReportMethod openMethod, Int16 parentJob) at
    CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String
    reportName, OpenReportMethod openMethod, Int16 parentJob) at
    CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()
    at
    CrystalDecisions.CrystalReports.Engine.ReportDocument.get_ReportDefinition()
    at ...
    Inner Exception:
    System.Runtime.InteropServices.COMException (0x800002AD): Error in File
    UNKNOWN.RPT: The request could not be submitted for background
    processing. at
    CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&
    DocumentPath, Int32 Options) at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&
    DocumentPath, Int32 Options) at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() Any help with this would be GREATLY appreciated.  Once again Crystal Reports are the only thing holding up an important project.

  • Diff b/w Web service and window service

    What is the difference between web service and window service, whether the both are same or not, Give some explain about that each one and give some examples also.

    An XML Web service is a component that implements program
    logic and provides functionality for diseparate
    applications. These applications use standard protocols,
    such as HTTP, XML, and SOAP, to access the functionality.
    XML Web services use XML-based messaging to send and
    receive data, which enables heterogeneous applications to
    interoperate with each other. You can use XML Web services
    to integrate applications that are written in different
    programming languages and deployed on different platforms.
    In addition, you can deploy XML Web services within an
    intranet as well as on the Internet. While the Internet
    brings users closer to organizations, XML Web services
    allow organizations to integrate their applications.
    A Windows service starts much before any user logs in to
    the system (if it has been setup to start at boot up
    process). A Windows service can also be setup in such a way
    that it requires a user to start it manually ? the ultimate
    customization!
    Windows services run as background processes. These
    applications do not have a user interface, which makes them
    ideal for tasks that do not require any user interaction.
    You can install a Windows service on any server or computer
    that is running Windows 2000, Windows XP, or Windows NT.
    You can also specify a Windows service to run in the
    security context of a specific user account that is
    different from the logged on user account or the default
    computer account. For example, you can create a Windows
    service to monitor performance counter data and react to
    threshold values in a database.

  • How to launch an application with elevated administrator account privilege from windows service even if the account has not yet logon

    Here is the case:
    OS environment: Windows 7
    There are two user accounts in my system, standard user "S" and administrator account "A", and there is a windows service running with "Local System" privilege.
    Now i logged-in with account "S", and i want to launch an application with elevated administrator account "A" from that service program, so here is the code snippet:
    int LaunchAppWithElevatedPrivilege (
    LPTSTR lpszUsername, // client to log on
    LPTSTR lpszDomain, // domain of client's account
    LPTSTR lpszPassword, // client's password
    LPTSTR lpCommandLine // command line to execute e.g. L"C:\\windows\\regedit.exe"
    DWORD dwExitCode = 0;
    HANDLE hToken = NULL;
    HANDLE hFullToken = NULL;
    HANDLE hPrimaryFullToken = NULL;
    HANDLE lsa = NULL;
    BOOL bResult = FALSE;
    LUID luid;
    MSV1_0_INTERACTIVE_PROFILE* profile = NULL;
    DWORD err;
    PTOKEN_GROUPS LocalGroups = NULL;
    DWORD dwLength = 0;
    DWORD dwSessionId = 0;
    LPVOID pEnv = NULL;
    DWORD dwCreationFlags = 0;
    PROCESS_INFORMATION pi = {0};
    STARTUPINFO si = {0};
    __try
    if (!LogonUser( lpszUsername,
    lpszDomain,
    lpszPassword,
    LOGON32_LOGON_INTERACTIVE,
    LOGON32_PROVIDER_DEFAULT,
    &hToken))
    LOG_FAILED(L"GetTokenInformation failed!");
    __leave;
    if( !GetTokenInformation(hToken, (TOKEN_INFORMATION_CLASS)19, (VOID*)&hFullToken,
    sizeof(HANDLE), &dwLength))
    LOG_FAILED(L"GetTokenInformation failed!");
    __leave;
    if(!DuplicateTokenEx(hFullToken, MAXIMUM_ALLOWED, NULL,
    SecurityIdentification, TokenPrimary, &hPrimaryFullToken))
    LOG_FAILED(L"DuplicateTokenEx failed!");
    __leave;
    DWORD dwSessionId = 0;
    WTS_SESSION_INFO* sessionInfo = NULL;
    DWORD ndSessionInfoCount;
    bResult = WTSEnumerateSessions(WTS_CURRENT_SERVER_HANDLE, 0, 1, &sessionInfo, &ndSessionInfoCount);
    if (!bResult)
    dwSessionId = WTSGetActiveConsoleSessionId();
    else
    for(unsigned int i=0; i<ndSessionInfoCount; i++)
    if( sessionInfo[i].State == WTSActive )
    dwSessionId = sessionInfo[i].SessionId;
    if(0 == dwSessionId)
    LOG_FAILED(L"Get active session id failed!");
    __leave;
    if(!SetTokenInformation(hPrimaryFullToken, TokenSessionId, &dwSessionId, sizeof(DWORD)))
    LOG_FAILED(L"SetTokenInformation failed!");
    __leave;
    if(CreateEnvironmentBlock(&pEnv, hPrimaryFullToken, FALSE))
    dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT;
    else
    pEnv=NULL;
    if (! ImpersonateLoggedOnUser(hPrimaryFullToken) )
    LOG_FAILED(L"ImpersonateLoggedOnUser failed!");
    __leave;
    si.cb= sizeof(STARTUPINFO);
    si.lpDesktop = L"winsta0\\default";
    bResult = CreateProcessAsUser(
    hPrimaryFullToken, // client's access token
    NULL, // file to execute
    lpCommandLine, // command line
    NULL, // pointer to process SECURITY_ATTRIBUTES
    NULL, // pointer to thread SECURITY_ATTRIBUTES
    FALSE, // handles are not inheritable
    dwCreationFlags, // creation flags
    pEnv, // pointer to new environment block
    NULL, // name of current directory
    &si, // pointer to STARTUPINFO structure
    &pi // receives information about new process
    RevertToSelf();
    if (bResult && pi.hProcess != INVALID_HANDLE_VALUE)
    WaitForSingleObject(pi.hProcess, INFINITE);
    GetExitCodeProcess(pi.hProcess, &dwExitCode);
    else
    LOG_FAILED(L"CreateProcessAsUser failed!");
    __finally
    if (pi.hProcess != INVALID_HANDLE_VALUE)
    CloseHandle(pi.hProcess);
    if (pi.hThread != INVALID_HANDLE_VALUE)
    CloseHandle(pi.hThread);
    if(LocalGroups)
    LocalFree(LocalGroups);
    if(pEnv)
    DestroyEnvironmentBlock(pEnv);
    if(hToken)
    CloseHandle(hToken);
    if(hFullToken)
    CloseHandle(hFullToken);
    if(hPrimaryFullToken)
    CloseHandle(hPrimaryFullToken);
    return dwExitCode;
    I passed in username and password of account "A" to method "LaunchAppWithElevatedPrivilege", and also the application i want to launch, e.g. "C:\windows\regedit.exe", but when i run the service program, i found it do launch
    "regedit.exe" with elevated account "A", but the content of regedit.exe is pure back. screenshot as below:
    Can anyone help me on this?

    You code is not dealing with the DACL access to Winsta0\Default.  Only the LocalSystem account will have full access and the interactively logged on user which is why regedit is not displaying properly.  You'll need to grant access to your user. 
    You also need to deal with UAC since that code is going to give you a non-elevated token via LogonUser().  You need to get the full token via a call to GetTokenInformation() + TokenLinkedToken.
    thanks
    Frank K [MSFT]
    Follow us on Twitter, www.twitter.com/WindowsSDK.

Maybe you are looking for