Home Help Center

Detecting a problem with Ice client proxy object call using Javascript

alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
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.
«1

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    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é
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I will do that and get back to you.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    Should I be setting these properties on the client side where the web client is executing? If so, where will the log file be generated? Can I set the Ice.StdOut/Ice.StdErr properties to generate log files on the client?
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    You need to set this in both sides so we can look at server and client activity.

    In JavaScript with the browser the default logger sends the output to the JavaScript console.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I now have it configured. I have not reproduced the problem yet, but now that I'm seeing the underlying network activity, I'll probably have some additional questions to better understand what what I'm seeing :)

    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
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    Right after I posted that last reply....the problem occurred. I think it is related to the ws connection closing but I can't definitely prove that.

    When executing the same operation again, all I see is the ws connection closing activity on both the client and server sides.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    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é
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I've attempted to upgrade to Ice 3.6.0 from Ice 3.6b and the new Ice Builder is having a heck of time correctly handling my existing .vcxproj files that were originally processed using the Ice plugin. I can't build anything right now. I will continue to look into it, but if you have any insight that would be great.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Can you clarify what is the issue with IceBuilder vcxproj, what error are you seeing?
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    When I open the project that contains my .ice files, it asks me to upgrade to the new Ice Builder, so I do that. However, when I go to build, I get the following error:

    Attachment not found.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    References to my .prop files are also missing in the IDE even though they are in the .vcxproj file after the project was converted by the new Ice Builder plugin. See attachments.

    I'm pretty sure I'm missing something subtle.Attachment not found.Attachment not found.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    It is not clear what is causing this issue, build should be disabled when a build is in progress.

    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
    <Import Project="$(LOCALAPPDATA)\ZeroC\IceBuilder\IceBuilder.Cpp.props" />
    ...
    <Import Project="$(LOCALAPPDATA)\ZeroC\IceBuilder\IceBuilder.Cpp.targets" />
    

    What is ..\Ice.props did you add this?
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    That was added with the Ice 3.6b plugin.

    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.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    It didn't but I will try and disable the other plugin manually.

    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.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Not sure why the builder ins't asking you to remove the old add-in but that is an issue, I will try to reproduce and get back to you.

    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    Thanks for the info. I'll give it a shot and let you know.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I still can't get IceBuilder to work correctly.

    This is the last thing that I tried.
    • I have a project called BtIceInterface that has successfully built before converting it to Ice Build (see first attachment)
    • I manually add Ice Builder using Tools->Add Ice Build To Project.
    • I change the output directory of the generated files using Properties
    • Just to ensure everything is refreshed, I close and restart VS 2012.
    • Even though I already added Ice Builder to the project, it still asks me to convert the project, so I did.
    • Property file references were missing.
    • When I attempted to build the project previously built successfully, it got the "build already in progress error"

    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    If you'd like, I could send you my vcxproj that I used to build our ice file into a single dll.

    I might be able to cut it down to a single ice file as well.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    When I reverted back to the old plugin, it is always using slice2cpp from the 3.6b installation. How can I get it to use slice2cpp from the 3.6.0 location? For now, I've sliced the files manually to get it to build.

    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    In the meantime, I've created a custom build step for the *.ice files to reference the correct slice2cpp exe file.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    If you can attach a sample project that helps me reproduce the issue I will be happy to look at it.

    Regards,
    José
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    If you don't want to attach your project here you can send to me at [email protected]
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I have a sample project with the referenced Ice file.

    I couldn't successfully attach the .vcxproj file and .ice file.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Can you zip the files a try again.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I uploaded a BtIceInterface.zip file. It contains a .vcxproj file and a .ice file.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    I build your project without problems:
    1>------ Build started: Project: BtIceInterface, Configuration: Debug x64 ------
    1>Build started 30/06/2015 14:45:58.
    1>PrepareForBuild:
    1>  Creating directory "x64\Debug\BtIceInterface.tlog\".
    1>InitializeBuildStatus:
    1>  Creating "x64\Debug\BtIceInterface.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
    1>IceBuilder_Compile:
    1>  Compiling Common.ice -> Generating BtIceInterface\Common.h,cpp
    1>ClCompile:
    1>  Common.cpp
    1>Link:
    1>     Creating library BtIceInterfaced.lib and object BtIceInterfaced.exp
    1>  BtIceInterface.vcxproj -> C:\Users\pepe\Downloads\BtIceInterface\x64\Debug\BtIceInterfaced.dll
    1>FinalizeBuildStatus:
    1>  Deleting file "x64\Debug\BtIceInterface.tlog\unsuccessfulbuild".
    1>  Touching "x64\Debug\BtIceInterface.tlog\BtIceInterface.lastbuildstate".
    1>
    1>Build succeeded.
    1>
    1>Time Elapsed 00:00:16.31
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    

    I have made a few minor tweaks:
    • Updated IceBuilder Output Directory to: $(ProjectDir)\BtIceInterface, that was required to match the --include-dir used in your Ice Builder settings.
    • Remove the linking of qtmaind.lib as I don't have this library with my Qt5 setup, If you are only using Slice types in this libray shouldn't be required to link with QT.
    • Updated the output path as you where using ../../../lib and that isn't part of the zip
    • Remove the .rc file as you didn't include that in the zip

    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I will give that a try when I get a chance. Unfortunately, I have to keep switching back and forth between not using and using Ice Builder, so it's causing a rebuild of my projects, so I need to be strategic when I try it because I need to get other stuff done.

    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I do notice sendAsyncRequest function is different between the two versions. With the 3.6.0 version, the async request is never being sent, i.e. I do not see a trace log message.

    Attachment not found.Attachment not found.

    Am I missing something now with the obtaining/using the proxies?
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    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.
Sign In or Register to comment.