Client failed to launch on startup

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?

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

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

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

Try using the following command:

start C:\Windows\System32\javaws.exe -localfile “http://localhost:8088/main/system/launch/client/ASRS_01.jnlp

The -localfile might help it.

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.

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.

Sorry to resurrect this, but hey, it’s Easter! :mrgreen:

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… :laughing:

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… :open_mouth: )

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

@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"

[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”.

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

Updated to get context status using:
portqry V2
curl for windows

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]