Geronimo
  1. Geronimo
  2. GERONIMO-4131

Problems with WebSphere MQ RA deployment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.0.2, 2.1, 2.1.1, 2.1.2
    • Fix Version/s: 2.1.2, 2.2
    • Component/s: connector
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      A user reported problems deploying an MQ RA on Geronimo. Looks like there are several problems.

      1) we don't like config-property-name values in ra.xml to start with a lower case letter
      2) our mechanism for introspecting the implementation classes (e.g. managedconnectionfactory-class) is not working properly. there can be multiple "set" methods taking different parameter types. This is leading to type-mismatches as we try to set attributes.

        Activity

        Hide
        Kevan Miller added a comment -

        Closing, per Forrest's recommendation... Thanks Forrest!

        Show
        Kevan Miller added a comment - Closing, per Forrest's recommendation... Thanks Forrest!
        Hide
        Forrest Xia added a comment -

        Verified on AG 2.1.3, the two issues:
        1. property name first letter case sensitive
        2. primitive type cast exception

        have been fixed. Now user can either use upper case or lower case for first letter of property name, and some primitive type property value(e.g. Port) can be casted successfully.

        I think this jira could be closed. thanks!

        Show
        Forrest Xia added a comment - Verified on AG 2.1.3, the two issues: 1. property name first letter case sensitive 2. primitive type cast exception have been fixed. Now user can either use upper case or lower case for first letter of property name, and some primitive type property value(e.g. Port) can be casted successfully. I think this jira could be closed. thanks!
        Hide
        Jarek Gawor added a comment -

        Since the MQ connector can be successfully deployed now, I'm resolving this issue. However, I opened GERONIMO-4216 for the remaining issue of using the setter methods instead of the getter methods to figure out the type of the gbean attributes.

        Show
        Jarek Gawor added a comment - Since the MQ connector can be successfully deployed now, I'm resolving this issue. However, I opened GERONIMO-4216 for the remaining issue of using the setter methods instead of the getter methods to figure out the type of the gbean attributes.
        Hide
        Jarek Gawor added a comment -

        Committed another fix to handle properties names to start either with lower or upper case letter to trunk (revision 678534) and branches/2.1 (revision 678535).

        Show
        Jarek Gawor added a comment - Committed another fix to handle properties names to start either with lower or upper case letter to trunk (revision 678534) and branches/2.1 (revision 678535).
        Hide
        Jarek Gawor added a comment -

        I committed the latest patch to trunk (revision 677814) and branches/2.1 (revision 677816). The latest patch enables the mq connector to be deployed ok, however, there are still questions how the connector builder should be setting up the dynamic gbean attributes and so I'm leaving the bug open.

        Show
        Jarek Gawor added a comment - I committed the latest patch to trunk (revision 677814) and branches/2.1 (revision 677816). The latest patch enables the mq connector to be deployed ok, however, there are still questions how the connector builder should be setting up the dynamic gbean attributes and so I'm leaving the bug open.
        Hide
        Jarek Gawor added a comment -

        Latest patch. Deals with property name cases.

        Show
        Jarek Gawor added a comment - Latest patch. Deals with property name cases.
        Hide
        Jarek Gawor added a comment -

        Updated the patch to handle the port property (the port property has two setters setPort(int) and sertPort(String) so updated the code to also lookup the setters using the corresponding primitive type (if any)).

        Show
        Jarek Gawor added a comment - Updated the patch to handle the port property (the port property has two setters setPort(int) and sertPort(String) so updated the code to also lookup the setters using the corresponding primitive type (if any)).
        Hide
        Kevan Miller added a comment -

        Jarek, I don't have MQ installed either. However, I did note that there is still a deployment problem, if you attempt to configure the 'port' config-property.

        This note to our user list contains a sample geronimo-ra.xml deployment plan:

        http://mail-archives.apache.org/mod_mbox/geronimo-user/200806.mbox/%3c17811963.post@talk.nabble.com%3e

        Show
        Kevan Miller added a comment - Jarek, I don't have MQ installed either. However, I did note that there is still a deployment problem, if you attempt to configure the 'port' config-property. This note to our user list contains a sample geronimo-ra.xml deployment plan: http://mail-archives.apache.org/mod_mbox/geronimo-user/200806.mbox/%3c17811963.post@talk.nabble.com%3e
        Hide
        Jarek Gawor added a comment -

        A patch that addresses the issues I described before.

        Currently, I don't have MQ installed so I can't quite fully test it but at least I'm not seeing the deployment errors mentioned before.

        Show
        Jarek Gawor added a comment - A patch that addresses the issues I described before. Currently, I don't have MQ installed so I can't quite fully test it but at least I'm not seeing the deployment errors mentioned before.
        Hide
        Jarek Gawor added a comment -

        There are two main issues as I understand it:

        1) First, the resource adapter class has multiple setters for the same property and a getter for that property that returns a primitive type. The ConnectorModuleBuilder.setUpDynamicGBean() sets up a dynamic gbean with attribute types based on the return types of the getter methods and the ConnectorModuleBuilder.getValue() tries to convert the property value specified in the deployment descriptor into the value of expected type. Now, since the expected type is a primitive type, the classLoader.loadClass fails. That explains the initial "Could not load attribute class: type: int" error.

        The simplest solution for this problem is to map all the primitive types into their corresponding complex types.

        2) The second problem, after fixing the first issue, is that connector deployment might fail with "java.lang.ClassCastException" errors while setting the attributes on the dynamic gbean. The problem is in DynamicGBeanDelegate.java. It creates a separate propertyName->operation map for all getters and all setters. The problem arises if there are multiple setters for the same property. Only the last setter method discovered will be stored in the setters map. So, when an attribute is being set (using the setAttribute() method) a wrong setter method might be used for the value (type) being passed. That explains the "java.lang.ClassCastException" errors.

        The solution for that problem is to change DynamicGBeanDelegate.java to support multiple setters and to pick the right setter based on the type of the value passed in when setting an attribute on the dynamic gbean.

        Show
        Jarek Gawor added a comment - There are two main issues as I understand it: 1) First, the resource adapter class has multiple setters for the same property and a getter for that property that returns a primitive type. The ConnectorModuleBuilder.setUpDynamicGBean() sets up a dynamic gbean with attribute types based on the return types of the getter methods and the ConnectorModuleBuilder.getValue() tries to convert the property value specified in the deployment descriptor into the value of expected type. Now, since the expected type is a primitive type, the classLoader.loadClass fails. That explains the initial "Could not load attribute class: type: int" error. The simplest solution for this problem is to map all the primitive types into their corresponding complex types. 2) The second problem, after fixing the first issue, is that connector deployment might fail with "java.lang.ClassCastException" errors while setting the attributes on the dynamic gbean. The problem is in DynamicGBeanDelegate.java. It creates a separate propertyName->operation map for all getters and all setters. The problem arises if there are multiple setters for the same property. Only the last setter method discovered will be stored in the setters map. So, when an attribute is being set (using the setAttribute() method) a wrong setter method might be used for the value (type) being passed. That explains the "java.lang.ClassCastException" errors. The solution for that problem is to change DynamicGBeanDelegate.java to support multiple setters and to pick the right setter based on the type of the value passed in when setting an attribute on the dynamic gbean.
        Show
        Lin Sun added a comment - Link to user's post - http://www.nabble.com/Cannot-deploy-wmq.jmsra.rar-%28WebSphere-MQ%29-to17811963s134.html#a17811963

          People

          • Assignee:
            Jarek Gawor
            Reporter:
            Kevan Miller
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development