Detecting a problem with Ice client proxy object call using Javascript

in Help Center
I am using Ice for Javascript to write a single page web application to access a C++ application on the back end. As I'm going through the web development cycle, i.e. reloading page, executing Javascript in browser debugger, etc, sometimes the Javascript function call on the properly created client proxy does not reach the server object, or does not complete with either success or failure on the promise object on the client side. If I restart the web application, it will then work.
My question is what is the best way to detect this condition or determine why the call does not work every time.
The adapter and servant object are properly installed into the Ice run-time on the server side because if I refresh the web application, it then works.
I'm just looking for some guidance on how best to detect this situation, and perform some error logic to restore the communcation with having to refresh the browser.
My question is what is the best way to detect this condition or determine why the call does not work every time.
The adapter and servant object are properly installed into the Ice run-time on the server side because if I refresh the web application, it then works.
I'm just looking for some guidance on how best to detect this situation, and perform some error logic to restore the communcation with having to refresh the browser.
0
Comments
You should start by enabling network and protocol tracing in both client and sever by setting Ice.Trace.Network=3 and Ice.Trace.Protocol=1 configuration properties.
The tracing will help us determine what is causing this.
Regards,
José
In JavaScript with the browser the default logger sends the output to the JavaScript console.
Question:
After the calculateVisibilitiesWithMultipleTLEs operation completes, why is the ws connection being closed:
-- 06-25-2015 4:12:16 PM.462 Protocol: sending asynchronous request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 229
request id = 13
identity = ResourceAllocationManager-ESB
facet = VisibilityManager
operation = calculateVisibilitiesWithMultipleTLEs
mode = 0 (normal)
context =
encoding = 1.1
Ice.js (line 12413)
-- 06-25-2015 4:12:16 PM.465 Network: sent 229 of 229 bytes via ws
local address = <not available>
remote address = 127.0.0.1:8080
Ice.js (line 12413)
-- 06-25-2015 4:12:17 PM.67 Network: received 14 of 14 bytes via ws
local address = <not available>
remote address = 127.0.0.1:8080
Ice.js (line 12413)
-- 06-25-2015 4:12:17 PM.74 Network: received 1900 of 1900 bytes via ws
local address = <not available>
remote address = 127.0.0.1:8080
Ice.js (line 12413)
-- 06-25-2015 4:12:17 PM.77 Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 1914
request id = 13
reply status = 0 (ok)
Ice.js (line 12413)
vehicleId = 140
Visibil...dule.js (line 502)
gsId = 3
Visibil...dule.js (line 506)
-- 06-25-2015 4:13:06 PM.636 Protocol: sending close connection
message type = 4 (close connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14
Ice.js (line 12413)
-- 06-25-2015 4:13:06 PM.645 Network: sent 14 of 14 bytes via ws
local address = <not available>
remote address = 127.0.0.1:8080
Ice.js (line 12413)
-- 06-25-2015 4:13:06 PM.654 Network: closed ws connection
local address = <not available>
remote address = 127.0.0.1:8080
When executing the same operation again, all I see is the ws connection closing activity on both the client and server sides.
The connection seems being closed by ACM (Active Connection Management). It will be good if you can upgrade to Ice 3.6.0 and check if the problem still occurs.
Let us know if you need any help with the upgrade.
Regards,
José
Attachment not found.
I'm pretty sure I'm missing something subtle.Attachment not found.Attachment not found.
What Visual Studio version are you using?
Is there any messages in the output window?
After the project has been updated it should contain two new Imports
What is ..\Ice.props did you add this?
I'm upgrading an existing application with many project files across multiple solutions from 3.6b to 3.6.0.
I'm currently successfully building an executing with 3.6b without any problems. It's when I upgrade an existing project with the new Ice Builder plugin.
I'm reverting back to 3.6b for now, so I can continue. I'll need to figure and easy way ahead to completely migrate to 3.6 because something is not quite working right when the vcxproj files are converted using the new Ice Builder plugin.
I might have to rebuild the vcxrpoj files from scratch, but I have a lot of setup in the current vcxproj files, i.e. include directory paths, library directory paths, existing .prop files, etc. that I really don't want to re-create from scratch.
Did Ice Builder ask you to remove the Ice add-in? It is expected to do so as you cannot use both the add-in and the new extension.
I will also try adding the lines you referenced in your previous post to the vcxproj file manually without allowing the project to be converted.
Meanwhile you can disable the add-in, remove Ice.props from your project, then open your project and use "Tools > Add Ice Builder to Project" to get the builder added into your project.
This is the last thing that I tried.
At this point, I am going to attempt to get the older plugin working with the new Ice 3.6.0 installation because I cannot proceed. I know it is something subtle but I can't waste anymore time on it. I have snapshots of the above steps if you'd like but I can't get Ice Builder to work under any scenario other than rebuild vcxproj files from scratch, and even then I still have a few difficulties. It is putting the vcxproj files in a weird state.
I might be able to cut it down to a single ice file as well.
Of course in the end, I would like to use the Ice Builder but I just can't get it to work with my existing vcxproj files once they are converted.
If you can attach a sample project that helps me reproduce the issue I will be happy to look at it.
Regards,
José
I couldn't successfully attach the .vcxproj file and .ice file.
I build your project without problems:
I have made a few minor tweaks:
Do you still get the "build already in progress error" with this project or are you getting a different error?
What Visual Studio Version are you using? do you have any other extension/add-ins installed? I want to try to reproduce the issue with an environment setup more similar to yours.
Can you try to set the build otuput level to diagnostic and attach the build output. You can set this in Visual Studio "Tools > Options > Projects and Solutions > Build and Run" set both "MSbuild project build output verbosity" and "MSbuild project build log file verbosity" to "Diagnostic"
Can you also give a try to "Ice Demos" and see if those work for you or you get similar issues.
I am now having another problem: I've switched to the 3.6.0. version of the Ice.js file and now I am no longer able to communicate with my server objects. I've used the new version of slice2js to convert my ice files. If I switch back to the 3.6b version of Ice.js, it works fine. That is the only thing I am doing, and it works with 3.6b but not with 3.6, so it has to be something with changes to the Ice.js file. I just keep switching back and forth with the Ice.js files and nothing else. Is there some sort of setup that is now different with 3.6 from 3.6b?
I obtained the new version of the Ice Javascript files using npm as described in the documentation and copied Ice.js to the appropriate location under web root.
I can send Ice log data when running both the 3.6b version and the 3.6 version.
Attachment not found.Attachment not found.
Am I missing something now with the obtaining/using the proxies?
Not sure what is going on with your JavaScript client, It will be much easy to help you if you can reproduce the issue with a complete sample that we can use. Or modifying our hello demo sample.