B4J Question [ABMaterial] Web app with MsSQl database - illegal character Error

Bladimir Carrillo

Member
Licensed User
Longtime User
This error is related to web app posted here https://www.b4x.com/android/forum/threads/web-app-with-mssql-database.71243/#post-455994

Message related to an illegal character it appears repeatedly
In this case the error persists even when I restart the app or close windows session or restart the computer, and in some cases do not allow to clients to enter to app on any browser, this makes it critical.

From starting app ...
c:\SMAC0434_WEB>java -jar STs.jar
Oct 06, 2016 10:33:01 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Oct 06, 2016 10:33:02 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true
; trace: 10]
GZipping HTML, JavaScript and CSS files...
Optimizing new and updated PNG files...
2016-10-06 22:33:05.415:INFO::main: Logging initialized @4596ms
2016-10-06 22:33:05.744:INFO:eek:ejs.Server:main: jetty-9.3.z-SNAPSHOT
2016-10-06 22:33:05.958:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletC
ontextHandler@365185bd{/,file:///C:/SMAC0434_WEB/www/,AVAILABLE}
2016-10-06 22:33:05.968:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\SMAC043
4_WEB\logs\b4j-2016_10_07.request.log
2016-10-06 22:33:06.051:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@
7303cb2{HTTP/1.1,[http/1.1]}{0.0.0.0:40434}
2016-10-06 22:33:06.054:INFO:eek:ejs.Server:main: Started @5235ms
java.lang.RuntimeException: org.eclipse.jetty.websocket.api.WebSocketException:
RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED
]
at anywheresoftware.b4j.object.WebSocket.setEvents(WebSocket.java:378)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run
(WebSocketModule.java:190)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint un
available, current state [CLOSED], expecting [OPEN or CONNECTED]
at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSock
etSession.java:299)
at anywheresoftware.b4j.object.WebSocket.sendText(WebSocket.java:107)
at anywheresoftware.b4j.object.WebSocket.setEvents(WebSocket.java:375)
... 6 more
2016-10-06 22:33:06.991:WARN:eek:ejh.HttpParser:qtp64830413-19: Illegal character 0
x16 in state=START for buffer HeapByteBuffer@578eb2e9[p=1,l=198,c=8192,r=197]={\
x16<<<\x03\x01\x00\xC1\x01\x00\x00\xBd\x03\x03\xB3\x15\ne\x9c\x91N...\x04\x02\x0
3\x01\x03\x02\x02\x01\x02\x02\x00\x0f\x00\x01\x01>>>Sec-WebSocket-Acc...\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2016-10-06 22:33:06.994:WARN:eek:ejh.HttpParser:qtp64830413-19: bad HTTP parsed: 40
0 Illegal character 0x16 for HttpChannelOverHttp@214bd1e8{r=0,c=false,a=IDLE,uri
=null}
2016-10-06 22:33:07.213:WARN:eek:ejh.HttpParser:qtp64830413-25: Illegal character 0
x16 in state=START for buffer HeapByteBuffer@58ffe3ae[p=1,l=198,c=8192,r=197]={\
x16<<<\x03\x01\x00\xC1\x01\x00\x00\xBd\x03\x03\xB6\xEc\xE3\x14\x9d\x93u...\x04\x
02\x03\x01\x03\x02\x02\x01\x02\x02\x00\x0f\x00\x01\x01>>>\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00}
2016-10-06 22:33:07.223:WARN:eek:ejh.HttpParser:qtp64830413-25: bad HTTP parsed: 40
0 Illegal character 0x16 for HttpChannelOverHttp@1dfd76d5{r=0,c=false,a=IDLE,uri
=null}
2016-10-06 22:33:07.444:WARN:eek:ejh.HttpParser:qtp64830413-15: Illegal character 0
x16 in state=START for buffer HeapByteBuffer@578eb2e9[p=1,l=116,c=8192,r=115]={\
x16<<<\x03\x01\x00o\x01\x00\x00k\x03\x01;\xD6\xC4rP\xAf;...ac.net\x00#\x00\x00\x
00\x0f\x00\x01\x01>>>\x00\t\x00\x14\x00\x11\x00\x08\x00\x06\x00\x03\x00\xFf\x01\
x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2016-10-06 22:33:07.448:WARN:eek:ejh.HttpParser:qtp64830413-15: bad HTTP parsed: 40
0 Illegal character 0x16 for HttpChannelOverHttp@4c831714{r=0,c=false,a=IDLE,uri
=null}

Any idea please?
 

billzhan

Active Member
Licensed User
Longtime User
Caused by: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint un
available, current state [CLOSED], expecting [OPEN or CONNECTED]
at

It seems that the websocket is closed. Any exception which is not handled (try... catch...) in websocket handler will cause the handler exit.

If possible run in Debug mode to find any detailed logs.
 
Upvote 0

Bladimir Carrillo

Member
Licensed User
Longtime User
Based on the logs a client is sending requests. Check the server log files (not the log output). The client ip address will probably appear there.

At this point I had to recompile the app to republish it and the error disappeared. I deleted the temp and log folders.
I will be pending if the error appears again.

Thanks.
 
Upvote 0

Bladimir Carrillo

Member
Licensed User
Longtime User
You cannot see it from the logs.

Based on the logs a client is sending requests. Check the server log files (not the log output). The client ip address will probably appear there.

Right now the error is appearing again repeatedly ...

2016-10-19 10:39:35.396:WARN:eek:ejh.HttpParser:qtp112061925-192: Illegal character 0x16 in state=START for buffer HeapByteBuffer@693dda0[p=1,l=116,c=8192,r=115]={
\x16<<<\x03\x01\x00o\x01\x00\x00k\x03\x01)\xA0}\xDe\xFc`\x88...ac.net\x00#\x00\x00\x00\x0f\x00\x01\x01>>>\x00\t\x00\x14\x00\x11\x00\x08\x00\x06\x00\x03\x00\xFf\
x01\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2016-10-19 10:39:35.412:WARN:eek:ejh.HttpParser:qtp112061925-192: bad HTTP parsed: 400 Illegal character 0x16 for HttpChannelOverHttp@91eccb{r=0,c=false,a=IDLE,uri
=null}

I attach the log file ...

Thank you in advance for your suggestions.
 

Attachments

  • b4j-2016_10_19.request.log.TXT
    43.6 KB · Views: 331
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
B4X:
AboutPage/donotdelete.conn?rand=162398 HTTP/1.1" 200 0

It seems that it's ABMaterial server. It's better to add [AbMaterial] tag to thread title, so some one else can help.

You'd better to run it from you local machine in debug mode to find out which lines cause the exceptions.

Provide more details. Upload the project or a reproducible demo will help.
 
Upvote 0
Top