Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1279

Injecting the resource adapter from the example leads to IllegalArgumentException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2017.3.3, 2017.4.0
    • Fix Version/s: 2017.5.0
    • Component/s: examples
    • Labels:
      None
    • Sprint:
      2017-Apr-B
    • Steps to Reproduce:
      Hide
      1. Download the official examples from the swarm project and modify FileIOBean to be @Singleton and @Startup, so that an instance is actually created when swarm starts. (like https://github.com/Ladicek/wildfly-swarm-examples/commit/8f122748e9483edb7fed0b1c02f9c0aa3b1713c5 but the init()-method is not necessary; tested also with the most recently released 2017.4.0-version)
      2. Run Main.main()
      Show
      Download the official examples from the swarm project and modify FileIOBean to be @Singleton and @Startup, so that an instance is actually created when swarm starts. (like https://github.com/Ladicek/wildfly-swarm-examples/commit/8f122748e9483edb7fed0b1c02f9c0aa3b1713c5 but the init()-method is not necessary; tested also with the most recently released 2017.4.0-version) Run Main.main()

      Description

      Modifying the example example-resource-adapter-deployment to actually (try to) inject the deployed resource adapter leads to a java.lang.IllegalArgumentException: Can not set org.xadisk.connector.outbound.XADiskConnectionFactory field org.wildfly.swarm.examples.rar.deployment.FileIOBean._xaDiskConnectionFactory to org.xadisk.connector.outbound.XADiskConnectionFactoryImpl

      Debugger shows, that the class loaders of XADiskConnectionFactory (declared type of to be assigned to) and XADiskConnectionFactoryImpl (type of the factory from the resource adapter to inject) do not match, so this seems to be a packaging issue.

      Connected with this issue is the fact, that the test does not really instantiate the FielIOBean, so it does not test, if the deployed resource-adapter can be used.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bob.mcwhirter Bob McWhirter
                Reporter:
                mschoell Michael Schöll
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: