# Client failed to launch on startup

**URL:** <https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508>\
**Category:** Ignition\
**Created:** [January 13, 2011, 2:20pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508 "2011-01-13T14:20:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [January 13, 2011, 2:20pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/1 "2011-01-13T14:20:03Z")

</div>

I have a Panel Edition running on an embedded thin client. The shortcut for the project is in the startup folder. When I boot up the system the client fails to launch with this error:

“Error launching application:  
ConnectException: Connection refuse: connect”

If I click on “Retry” after the thin client is finished starting up it works on the 2nd try. The client must be timing out waiting for the gateway to respond because the thin client startup is so slow. If so, is there any way to increase this timeout value?

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [January 14, 2011, 7:45am UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/2 "2011-01-14T07:45:03Z")

</div>

It sounds like you’re trying to start the application before the gateway service starts.

Try Googling “windows startup delay utility” and see if those help. For example, [Launch Later](http://launchlater.codeplex.com/)

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [January 18, 2011, 2:24am UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/3 "2011-01-18T02:24:51Z")

</div>

I could make a simple batch file to delay the link during start-up. If I wanted to start a client from within a batch file, what would the proper “start” command look like?

I tried this:

@echo off  
ping -n 3 localhost \> nul  
start C:\Windows\System32\javaws.exe “[http://localhost:8088/main/system/launch/client/ASRS\_01.jnlp](http://localhost:8088/main/system/launch/client/ASRS_01.jnlp)”

I also tried it without the quotation marks. I just get a Java message window “internal error, unknown message”.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [January 18, 2011, 5:58pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/4 "2011-01-18T17:58:28Z")

</div>

Try using the following command:

start C:\Windows\System32\javaws.exe -localfile “[http://localhost:8088/main/system/launch/client/ASRS\_01.jnlp](http://localhost:8088/main/system/launch/client/ASRS_01.jnlp)”

The -localfile might help it.

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [January 18, 2011, 6:30pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/5 "2011-01-18T18:30:00Z")

</div>

I tried it with the -localfile and got the same results. The strange thing is that shortcuts on my desktops are now giving the same message, even ones that were working before. I tried re-installing Java and Ignition. I can launch the project from the Ignition home page just fine, and I verified the name of the project.

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [April 16, 2011, 2:55pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/6 "2011-04-16T14:55:37Z")

</div>

Update:

I have found that Java Web Start works much better on Windows 7 if you specify all the executables to Run As Administrator. You also have to set the User Account Control (UAC) to Never Notify to avoid the annoying pop-up windows and if you want to launch from within a batch file.

My time-delay project launch batch file is working perfectly now. I stick it in the Windows Startup folder and it allows the gateway to startup first before the client is launched on slower machines running Panel Edition.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 25, 2011, 12:05pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/7 "2011-04-25T12:05:52Z")

</div>

Sorry to resurrect this, but hey, it’s Easter! ![:mrgreen:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/d23659b203d2d24d394be983a52adb2fa6fe23d4.gif "Mr. Green")

Is there as way to get the status of the Ignition Server context (i.e. unknown/running/faulted/etc) outside of Ignition?

Yeah, I have a batch file I use to check network and even simple internet/DNS issues, but nothing specific on whether The Ignition server is accessible or not…

Right now I delay the snot out of some of the startups, and would like to be able to streamline a bit. Avoid cranky bosses and all that… 😆

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 25, 2011, 4:18pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/8 "2011-04-25T16:18:10Z")

</div>

Oh! In case anyone’s interested in the batch file…

Checks for network connectivity first, then checks that the Ignition service is running, then checks that the server’s port is being listened to. Still waits 30 seconds after all that (just because the ports being listened to doesn’t mean that the Ignition context is ready for business… 😮 )

Requires the portqry command line app, but it’s a freebie from Microsoft.

```auto
@echo off

SET host=192.168.140.18
SET port=8088
CLS
SET /A Try=0

:CHECK_PING

SET /A Try=%Try%+1
ECHO Checking network connection, please wait... Try %Try%
PING -n 1 %host% | FIND "TTL" > NUL
IF NOT ERRORLEVEL 1 GOTO :PING_SUCCESS
IF ERRORLEVEL 1 GOTO :PING_FAIL

:PING_FAIL
ECHO PING FAILED, retrying...
GOTO :CHECK_PING

:PING_SUCCESS
ECHO PING SUCCESSFUL          
SET /A TRY=0
:CHECK_SERVICE

SET /A TRY=%TRY%+1
ECHO CHECKING SERVICE... Try %TRY%
sc \\%host% query ignition | FIND "STATE" | FIND "RUNNING" > NUL

IF NOT ERRORLEVEL 1 GOTO :SERVICE_SUCCESS
IF ERRORLEVEL 1 GOTO :SERVICE_FAIL

:SERVICE_FAIL
ECHO Ignition Service not yet RUNNING, checking again.
TIMEOUT /t 3
GOTO :CHECK_SERVICE

:SERVICE_SUCCESS
ECHO SERVICE SUCCESSFUL          
SET /A TRY=0

:CHECK_PORT
SET /A TRY=%TRY%+1
ECHO Checking for Server listening on port %port%... Try %TRY%

portqry -n %host% -e %port% -q

IF NOT ERRORLEVEL 1 GOTO :SUCCESS
IF ERRORLEVEL 1 GOTO :PORT_FAILED

:PORT_FAILED
ECHO Ignition not listening on port %port%, checking again.
TIMEOUT /t 3
GOTO :CHECK_PORT

:SUCCESS
ECHO All Okay. Waiting a bit longer, just to be sure!
TIMEOUT /t 30
C:\Windows\SysWOW64\javaws.exe -localfile "C:\Users\jordanc\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\59\e48e0bb-26133902"
```

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 29, 2011, 10:09pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/9 "2011-04-29T22:09:41Z")

</div>

[quote=“JordanCClark”]Sorry to resurrect this, but hey, it’s Easter![/quote] Lol - that made me laugh.

Thanks for sharing the script. There is a way to get the running state outside of Ignition, but you’ll need some tool that can do an http get, like the linux command “[curl](http://en.wikipedia.org/wiki/CURL)”.

This URL: [tt][http://myserver](http://myserver):myport/main/StatusPing[/tt] will give you back a JSON string with the state in it.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 9, 2011, 3:14pm UTC](https://forum.inductiveautomation.com/t/client-failed-to-launch-on-startup/2508/10 "2011-05-09T15:14:20Z")

</div>

Updated to get context status using:  
[portqry V2](http://support.microsoft.com/kb/832919)  
[curl for windows](http://curl.haxx.se/download.html)

Because curl was always giving the same result for errorlevel, I had to create files to compare status. That way we can stick with standard DOS utilities as much as possible.

[code]@echo off

REM \*\* SET UP HOST PARAMETERS  
SET host=192.168.140.18  
SET port=8088  
CLS  
SET /A Try=0

:CHECK\_PING  
REM \*\*\* CHECK FOR NETWORK CONNECTION TO HOST  
SET /A Try=%Try%+1  
ECHO Checking network connection, please wait… Try %Try%  
PING -n 1 %host% | FIND “TTL” \> NUL

IF NOT ERRORLEVEL 1 GOTO :PING\_SUCCESS  
IF ERRORLEVEL 1 GOTO :PING\_FAIL

:PING\_FAIL  
ECHO PING FAILED, retrying…  
GOTO :CHECK\_PING

:PING\_SUCCESS  
ECHO PING SUCCESSFUL  
SET /A TRY=0

:CHECK\_PORT  
REM \*\*\* CHECK TO SEE IF HOST IS LISTENING ON CORRECT PORT  
SET /A TRY=%TRY%+1  
ECHO Checking for Server listening on port %port%… Try %TRY%

portqry -n %host% -e %port% -q

IF NOT ERRORLEVEL 1 GOTO :PORT\_SUCCESS  
IF ERRORLEVEL 1 GOTO :PORT\_FAILED

:PORT\_FAILED  
ECHO Ignition not listening on port %port%, checking again.  
TIMEOUT /t 3  
GOTO :CHECK\_PORT

:PORT\_SUCCESS  
ECHO Port check SUCCESSFUL!

:CHECK\_CONTEXT\_STATE  
REM \*\*\* CHECK TO SEE IF IGNITON CONTEXT IS IN RUNNING STATE  
ECHO Checking context state…  
c:\curl\curl http://%host%:%port%/main/StatusPing -o “igfind.txt”

REM \*\*\* CREATE FILE WITH GOOD RESULT TEXT TO COMPARE igfind.txt  
ECHO {“state”:“RUNNING”}\> iggood.txt

REM \*\*\* COMPARE THE TWO FILES  
fc /B findresult.txt goodresult.txt | FIND “no differences” \> NUL

IF NOT ERRORLEVEL 1 GOTO :SUCCESS  
IF ERRORLEVEL 1 GOTO :CONTEXT\_FAILED

:CONTEXT\_FAILED  
ECHO Context not in running state.  
ECHO Pausing before checking again.  
TIMEOUT /t 3  
GOTO :CHECK\_CONTEXT\_STATE

:SUCCESS  
ECHO All checks passed…  
TIMEOUT /t 5  
C:\Windows\SysWOW64\javaws.exe -localfile “C:\Users\jordanc\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\59\e48e0bb-26133902”

[/code]
