Hi Jorge,
The root cause here is this,
DS Fault Message: Setter method for property 'URL' cannot be found
DS Code: UNKNOWN_ERROR
At
org.wso2.carbon.dataservices.
core.description.xa.XADataSourceInfo.initXA(XAD
ataSourceInfo.java:59)
Which means, the XADataSource property "URL" is not available. That means,
simply, there should be a setter named "setURL" in Postgres XADataSource
implementation. But as I just checked here [1], there's no such thing.
Seems this is a bug in our wizard, where we auto-populate some well known
properties like "URL", "username" and "password" properties. We've made an
assumption that all XADataSource implementations will contain those three
properties in any possible names like, some will have "user" and another
"username" and so on, we've made the presets like that, but obviously we
got it wrong with Postgres, where it doesn't really have the URL property
in anyway. So what we have to do is, we have to give the properties:
"serverName", "databaseName", "portNumber" as mentioned here [1], to get
the similar functionality. Normally you can add them from the XADataSource
page in the wizard, but because of the URL property, you will have to add
these from the XML edit view, and remove the URL property also.
And please create an issue for this in Carbon JIRA under data services UI
component.
[1]
http://jdbc.postgresql.org/development/privateapi/org/postgresql/ds/common/BaseDataSource.html#setServerName(java.lang.String)
Cheers,
Anjana.
On Sun, Dec 11, 2011 at 8:45 AM, Jorge Infante Osorio <[email protected]>wrote:
> Hi Anjana, thanks.
>
> Tool: AS 4.1.2.
>
> I follow your suggestion and create a DS with the postgreSQL driver
> postgresql-9.0-801.jdbc4.jar , with this simple configuration:
>
> <data name="transaccion1">
> <config id="rr">
> <property
>
> name="org.wso2.ws.dataservice.xa_datasource_class">org.postgresql.xa.PGXADat
> aSource</property>
> <property name="org.wso2.ws.dataservice.xa_datasource_properties">
> <property
> name="URL">jdbc:postgresql://127.0.0.1:5432/pruebas</property>
> <property name="User">user</property>
> <property name="Password">pass</property>
> </property>
> </config>
> <query id="selecALL" useConfig="rr">
> <sql>select * from estudiantes</sql>
> <result element="estudiantes" rowName="estudiante"
> defaultNamespace="http://estudiantes.cdae.uci.cu">
> <element name="nombre" column="nombre" xsdType="xs:string" />
> </result>
> </query>
> <operation name="SeleccionarTodos">
> <call-query href="selecALL" />
> </operation>
> </data>
>
> Is the AS I see this error after deploy the DS in the UI console:
>
> DS Fault Message: Cannot create XADataSource instance using the class:
> org.postgresql.xa.PGXADataSource DS Code: UNKNOWN_ERROR Source
> DataService:-
> Name: transaccion1 Location: \transaccion1.dbs Description: N/A
> Default Namespace: http://ws.wso2.org/dataservice Nested Exception:-
> DSFault
> Message: Setter method for property 'URL' cannot be found DS Code:
> UNKNOWN_ERROR at
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.initXA(XAD
> ataSourceInfo.java:59) at
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.(XADataSou
> rceInfo.java:50) at
>
> org.wso2.carbon.dataservices.core.description.config.RDBMSConfig.createXADat
> aSourceInfo(RDBMSConfig.java:83) at
>
> org.wso2.carbon.dataservices.core.description.config.RDBMSConfig.(RDBMSConfi
> g.java:49) at
>
> org.wso2.carbon.dataservices.core.description.config.ConfigFactory.getRDBMSC
> onfig(ConfigFactory.java:74) at
>
> org.wso2.carbon.dataservices.core.description.config.ConfigFactory.createCon
> fig(ConfigFactory.java:52) at
>
> org.wso2.carbon.dataservices.core.DataServiceFactory.createDataService(DataS
> erviceFactory.java:151) at
>
> org.wso2.carbon.dataservices.core.DBDeployer.createDBService(DBDeployer.java
> :717) at
>
> org.wso2.carbon.dataservices.core.DBDeployer.processService(DBDeployer.java:
> 1068) at
> org.wso2.carbon.dataservices.core.DBDeployer.deploy(DBDeployer.java:175) at
>
> org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(Deploy
> mentFileData.java:136) at
>
> org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:
> 813) at
>
> org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.jav
> a:144) at
>
> org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.jav
> a:371) at
>
> org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListe
> ner.java:254) at
>
> org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListe
> ner.java:365) at
>
> org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(Schedule
> rTask.java:73) at
>
> org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:9
> 4) at
>
> org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Sched
> uler.java:93) at java.util.TimerThread.mainLoop(Timer.java:512) at
> java.util.TimerThread.run(Timer.java:462) Caused by: DS Fault Message:
> Setter method for property 'URL' cannot be found DS Code: UNKNOWN_ERROR at
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.assignProp
> s(XADataSourceInfo.java:70) at
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.initXA(XAD
> ataSourceInfo.java:57) ... 20 more
>
>
> In the AS console I have this:
>
> [2011-12-10 11:44:58,294] INFO
> {org.apache.axis2.deployment.DeploymentEngine}
> -org.apache.axis2.deployment.DeploymentException: The transaccion1.dbs
> service, which is not valid, caused {1}
> [2011-12-10 11:48:38,232] ERROR
> {org.wso2.carbon.dataservices.core.DBDeployer} - The transaccion1.dbs
> service, which is not valid, caused {1}
> DS Fault Message: Cannot create XADataSource instance using the class:
> org.postgresql.xa.PGXADataSource
> DS Code: UNKNOWN_ERROR
> Source Data Service:-
> Name: transaccion1
> Location: \transaccion1.dbs
> Description: N/A
> Default Namespace: http://ws.wso2.org/dataservice
> Nested Exception:-
> DS Fault Message: Setter method for property 'URL' cannot be found
> DS Code: UNKNOWN_ERROR
> At
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.initXA(XAD
> ataSourceInfo.java:59)
> at
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.<init>(XAD
> ataSourceInfo.java:50)
> at
>
> org.wso2.carbon.dataservices.core.description.config.RDBMSConfig.createXADat
> aSourceInfo(RDBMSConfig.java:83)
> at
>
> org.wso2.carbon.dataservices.core.description.config.RDBMSConfig.<init>(RDBM
> SConfig.java:49)
> at
>
> org.wso2.carbon.dataservices.core.description.config.ConfigFactory.getRDBMSC
> onfig(ConfigFactory.java:74)
> at
>
> org.wso2.carbon.dataservices.core.description.config.ConfigFactory.createCon
> fig(ConfigFactory.java:52)
> at
>
> org.wso2.carbon.dataservices.core.DataServiceFactory.createDataService(DataS
> erviceFactory.java:151)
> at
>
> org.wso2.carbon.dataservices.core.DBDeployer.createDBService(DBDeployer.java
> :717)
> at
>
> org.wso2.carbon.dataservices.core.DBDeployer.processService(DBDeployer.java:
> 1068)
> at
> org.wso2.carbon.dataservices.core.DBDeployer.deploy(DBDeployer.java:175)
> at
>
> org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(Deploy
> mentFileData.java:136)
> at
>
> org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:
> 813)
> at
>
> org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.jav
> a:144)
> at
>
> org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.jav
> a:371)
> at
>
> org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListe
> ner.java:254)
> at
>
> org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListe
> ner.java:365)
> at
>
> org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(Schedule
> rTask.java:73)
> at
>
> org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:9
> 4)
> at
>
> org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Sched
> uler.java:93)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: DS Fault Message: Setter method for property 'URL' cannot be
> found
> DS Code: UNKNOWN_ERROR
>
> At
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.assignProp
> s(XADataSourceInfo.java:70)
> at
>
> org.wso2.carbon.dataservices.core.description.xa.XADataSourceInfo.initXA(XAD
> ataSourceInfo.java:57)
> ... 20 more
>
>
> Any idea?
>
> Saludos,
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> Fac. 5.
> UCI.
> De: Anjana Fernando [mailto:[email protected]]
> Enviado el: sábado, 10 de diciembre de 2011 7:17
> Para: Jorge Infante Osorio
> Asunto: Re: XA Transactions
>
> Hi Jorge,
>
> You have to create the XADataSources from DSS. There in the data sources
> page, you can select the type a XA data source and create it.
>
> Cheers,
> Anjana.
> 2011/12/10 Jorge Infante Osorio <[email protected]>
> Hi Anjana.
> About your post: XA Transactions with Apache DBCP
>
> Where I need to put the XADataSource in carbon framework?
> Can you provide me an example of this config?
>
> Thanks,
> Saludos,
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> Fac. 5.
> UCI.
> --
> Anjana Fernando
> Senior Software Engineer
> WSO2 Inc. | http://wso2.com
> lean . enterprise . middleware
>
>
>
> Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE
> ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU!
> http://www.antiterroristas.cu
> http://justiciaparaloscinco.wordpress.com
>
--
*Anjana Fernando*
Senior Software Engineer
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev