Attempt to fix exception during xa-datasource deployment #12

Closed
wants to merge 1 commit into from

2 participants

@jbrownfield

If adding xa-datasource-properties, an exception was generated because
the xa-datasource was enabled before any of the
xa-datasource-properties had been added. This changes the
enableResource to execute after all resources have been added. I
believe this is an imperfect solution. I will discuss this with the
other developers.

James: One of the reasons I implemented my patch as a "subresource" was that it appeared the xa-datasource-properties needed to be added before the xa-datasource was enabled. With 7.1.0.CR1b, I was getting the following exception (more text after the exception):

*** Start log excerpt ***
02:58:28,491 ERROR org.jboss.msc.service.fail MSC00001: Failed to start service jboss.data-source.java:jboss/datasources/RCATSPool: org.jboss.msc.service.StartException in service jboss.data-source.java:jboss/datasources/RCATSPool: JBAS010433: Error during the deployment of RCATSPool
at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:118)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]
at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]
Caused by: org.jboss.jca.common.api.validator.ValidateException: IJ010069: Missing required element xa-datasource-property in org.jboss.jca.common.metadata.ds.XADataSourceImpl
at org.jboss.jca.common.metadata.ds.XADataSourceImpl.validate(XADataSourceImpl.java:384)
at org.jboss.jca.common.metadata.ds.XADataSourceImpl.(XADataSourceImpl.java:115)
at org.jboss.as.connector.subsystems.datasources.ModifiableXaDataSource.getUnModifiableInstance(ModifiableXaDataSource.java:372)
at org.jboss.as.connector.subsystems.datasources.XaDataSourceService.getDeployer(XaDataSourceService.java:66)
at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:111)
... 5 more

*** End log excerpt ***

Reversing the order of the "resource" definitions so the xa-datasource would be started last caused the xa-datasource-properties not to be added at all.

I modified the code to only allow one "enableResource", and that enable is done after all the resources are added. This seems to have made my exception go away, but it's not a great solution. I think the resources need to be grouped into resources and sub-resources in some manner to allow a more generic implementation.

It's also, of course, possible that I'm missing some overarching concept here, but this is how it appears to work to me.

Take care,
Jim

@jbrownfield jbrownfield Changed "enableResource" to execute after all resources.
If adding xa-datasource-properties, an exception was generated because
the xa-datasource was enabled before any of the
xa-datasource-properties had been added.  This changes the
enableResource to execute after all resources have been added.  I
believe this is an imperfect solution.  I will discuss this with the
other developers.
9dbfea5
@jbrownfield

BTW, it would be possible to add more than one enable to the "finalOP," but I haven't thought through all the implications, so I just simplified for now (trying to get my xa-datasource to deploy ;) ).

@jamezp
jbossas member

My only concern with this is that it assumes all the resources would/are related, e.g. they are under the same address. It might make more sense to allow a resource to have a collection of sub-resources like you originally had.

@jamezp
jbossas member

Here is what I came up with jamezp@e2bcad0. What do you think? Would something like that work for you?

@jbrownfield
@jamezp
jbossas member

Hello Jim,
You've got it correct. A resource can have a collection of children resources.

I really appreciate all the help you've given me on this. And thanks for finding all the bugs :-)

James R. Perkins

@jamezp jamezp closed this Feb 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment