DMCC JDK Error - Illegal Character

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • avc871238673786
    Whiz
    • Aug 2024
    • 29

    DMCC JDK Error - Illegal Character

    Hi, i'm trying to use DMCC JDK provided at devconnect portal.

    When i try to run the Click2Call Example, it throws an error saying that an illegal character is present in one of the jar files of the dev kit:

    "java.net.URISyntaxException: Illegal character in path at index 96: file:/C:/Users/me/Downloads/cmapijava/cmapijava-sdk-10.2.0.0.0.198/cmapijava-sdk/lib/${jakarta-rexexp.jar}"


    I'm migrating from JS, so i could be making a simple mistake, but i can't figure it out.

    I tried with JDK 19 and JDK 7 (As told by the Programmer reference) with Intellij IDE.

    Click image for larger version  Name:	image.png Views:	0 Size:	5.2 KB ID:	48524


    When i try to write my own code from scratch and import the ServiceProvider Class i face the same error. Am i doing something wrong?
    Last edited by avc871238673786; 09-12-2024, 01:14 PM.
  • flynn1
    Brainiac
    .
    • Jun 2011
    • 82

    #2
    <DMCC JAVA SDK>/lib/proxy.jar has a somewhat complex manifest file. Previously, Java compilers were able to parse it but, some more recent versions cannot for some reason. There is an existing MR, AES-29776, for this.

    This does not seem to be a problem with Java8 - I can build the sample code using zulu8.80.0.17-ca-jdk8.0.422-win_x64.

    So you can workaround this in one of several ways:
    1. Use JDK 8
    2. Unzip proxy.jar and extract the class files. You can then include the folder holding the class files in your classpath, instead of proxy.jar
    3. Unzip proxy.jar and build a new jar file from the class files.

    Martin

    Comment

    • avc871238673786
      Whiz
      • Aug 2024
      • 29

      #3
      JDK 8 Works!

      You saved the day again, Martin. Thank you!

      Comment

      • avc871238673786
        Whiz
        • Aug 2024
        • 29

        #4
        I'm stuck again. Following the docs, i reached the part of Getting a device ID, but my request is timing out. The session is being established, but the moment i request the device id, it times out.


        I can get the device id for the same extension using .Net Dashboard with no problem.


        Click image for larger version

Name:	image.png
Views:	66
Size:	16.6 KB
ID:	48535


        Here is my code:

        Code:
         ServiceProvider servProv = ServiceProvider.getServiceProvider(prop);
                    DeviceServices devServ = (DeviceServices)servProv.getService(DeviceServices.class.getName());
                    GetDeviceId deviceId = new GetDeviceId();
                    deviceId.setExtension("MY_EXT_HERE");
                    deviceId.setSwitchName("MY_SWITCH_HERE");
        
        
                    try {
        
                        devServ.getDeviceID(deviceId);
        
                    }catch(Exception e){
        
                        System.out.println("REQUEST ERROR: " + e);
        
                    }

        Same extension with the same switch name at .Net DashBoard:

        Click image for larger version

Name:	image.png
Views:	64
Size:	3.3 KB
ID:	48536


        Am i doing sth wrong?

        Comment

        • flynn1
          Brainiac
          .
          • Jun 2011
          • 82

          #5
          I've come across something like this a couple of times before. What happened in those cases is that the DMCC Java client was not able to decode the response from AES. This was due to an incompatibility that had crept in between the DMCC SDK and older versions of the DMCC protocol.

          1. What version of AES are you using?
          2. What version of the DMCC Java SDK are you using?
          3. What DMCC protocol version did you select when you get the ServiceProvider?

          Martin

          Comment

          • avc871238673786
            Whiz
            • Aug 2024
            • 29

            #6
            I'm using AES 8.1 and using the DMCC SDK 10.2, provided at DevConnect Portal (Is it possibile to download older versions?)


            I'm did not set the protocol version at code because when i set it up, it returns a timeout when trying to establish a session.

            Comment

            • flynn1
              Brainiac
              .
              • Jun 2011
              • 82

              #7
              Oh, so the problem is with starting the session, not getting the device ID?

              Comment

              • avc871238673786
                Whiz
                • Aug 2024
                • 29

                #8
                If i set the protocol version the session does not start. But if i don't set the version, the session gets started (i even can get the session id), but i get stuck at getting the device ID.

                This code works until the part of getting the session id.

                Code:
                ServiceProvider servProv = ServiceProvider.getServiceProvider(prop);
                DeviceServices devServ = (DeviceServices)servProv.getService(DeviceServices.class.getName());
                GetDeviceId deviceId = new GetDeviceId();
                deviceId.setExtension("MY_EXT_HERE");
                deviceId.setSwitchName("MY_SWITCH_HERE");
                
                
                
                try {
                
                devServ.getDeviceID(deviceId);
                
                }catch(Exception e){
                
                System.out.println("REQUEST ERROR: " + e);
                
                }

                But if i add this line before starting the session (prop is a Properties object)

                Code:
                prop.setProperty(CmapiKeys.SESSION_PROTOCOL_VERSION, APIProtocolVersion.VERSION_8_1);
                ​
                It does not start the session.

                Comment

                • avc871238673786
                  Whiz
                  • Aug 2024
                  • 29

                  #9
                  If i do set the protocol up:


                  (I tried to paste the error message here but it keeps returning 403 error to me )


                  Click image for larger version

Name:	image.png
Views:	63
Size:	16.8 KB
ID:	48543

                  Click image for larger version  Name:	image.png Views:	0 Size:	11.1 KB ID:	48542


                  If i don't set the protocol up:

                  The session starts well

                  Click image for larger version

Name:	image.png
Views:	66
Size:	61.9 KB
ID:	48544
                  Last edited by avc871238673786; 09-17-2024, 05:26 AM.

                  Comment

                  • flynn1
                    Brainiac
                    .
                    • Jun 2011
                    • 82

                    #10
                    I have attached a file to this post. If you rename it to logging.properties and include it in your classpath, it should cause the DMCC Client trace to appear in client-trace.log. That should give more information
                    Attached Files

                    Comment

                    • avc871238673786
                      Whiz
                      • Aug 2024
                      • 29

                      #11
                      Should i use it with log4j? Or just put it on my classpath?

                      I tried to just put it on my resources path and it did not create the file:

                      Click image for larger version

Name:	image.png
Views:	67
Size:	144.1 KB
ID:	48548

                      I'm using a code of my own, importing the packages that are written on documentation.

                      I'm sorry if my question is trivial, but i'm not used to java.

                      Comment

                      • flynn1
                        Brainiac
                        .
                        • Jun 2011
                        • 82

                        #12
                        I always have trouble with log4j config files.

                        It should actually be added to the command line something like this (not in the CP itself):

                        java.exe "-Dlog4j.configuration=C:\DMCC_JAVA\DMCC102\logging. properties"-classpath "...etc.

                        Comment

                        • avc871238673786
                          Whiz
                          • Aug 2024
                          • 29

                          #13
                          I'm confused. Is it possible to do it via Intellij or any other IDE?

                          I must use the java.exe?

                          Comment

                          • flynn1
                            Brainiac
                            .
                            • Jun 2011
                            • 82

                            #14
                            The IDE is just going to run the java command - I harvested that example from Eclipse. Your IDE will have some way to insert "-Dlog4j.configuration=C:\DMCC_JAVA\DMCC102\logging. properties" onto the command line.

                            Comment

                            • avc871238673786
                              Whiz
                              • Aug 2024
                              • 29

                              #15
                              Ok, i'm gonna try it.

                              Another Question: Do you know if it is possible to download older SDK versions?

                              Would it be a good idea to try out older versions to check compatibility issues?

                              Comment

                              Loading