[Dev] [AF] Dataservice apps cannot read datasources created via App Factory.

2014-06-03 Thread Danushka Fernando
Hi all,
I came through the problem above. So after lot of debugging I managed to
make it work with following changes.

1. Change the sample dataservice as below
change
property name=carbon_datasource_nameTestDS/property
to
property name=jndi_resource_namejdbc/TestDS/property

2. Change DB deployer to set application name to carbon context at the
start of deployment and remove it at the end. Diff is attached.

So I can go ahead with first change in AF side. But we need the second
change in AS/DSS side to make this work. So can we add this to DBDeployer.

I guess we need this in all service deployers. AFAIK we already have this
in webapp deployers.

WDYT?


Thanks  Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729
Index: 
org.wso2.carbon.dataservices.core/4.2.1/src/main/java/org/wso2/carbon/dataservices/core/DBDeployer.java
===
--- 
org.wso2.carbon.dataservices.core/4.2.1/src/main/java/org/wso2/carbon/dataservices/core/DBDeployer.java
 (revision 204457)
+++ 
org.wso2.carbon.dataservices.core/4.2.1/src/main/java/org/wso2/carbon/dataservices/core/DBDeployer.java
 (working copy)
@@ -125,6 +125,7 @@
 */
public void deploy(DeploymentFileData deploymentFileData)
throws DeploymentException {
+   
PrivilegedCarbonContext.getThreadLocalCarbonContext().setApplicationName(deploymentFileData.getName());
try {
 RealmService realmService = 
DataServicesDSComponent.getRealmService();
 if (realmService != null) {
@@ -234,6 +235,7 @@
 } catch (Exception e) {
 log.error(Cannot register faulty service with Carbon, e);
 }
+   
PrivilegedCarbonContext.getThreadLocalCarbonContext().setApplicationName(null);
}
}
}
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [AF] Dataservice apps cannot read datasources created via App Factory.

2014-06-03 Thread Manjula Rathnayake
Hi Amani,

Is this the same fix that we did for logging related issues?

thank you.


On Tue, Jun 3, 2014 at 9:44 PM, Danushka Fernando danush...@wso2.com
wrote:

 Hi all,
 I came through the problem above. So after lot of debugging I managed to
 make it work with following changes.

 1. Change the sample dataservice as below
 change
 property name=carbon_datasource_nameTestDS/property
 to
 property name=jndi_resource_namejdbc/TestDS/property

 2. Change DB deployer to set application name to carbon context at the
 start of deployment and remove it at the end. Diff is attached.

 So I can go ahead with first change in AF side. But we need the second
 change in AS/DSS side to make this work. So can we add this to DBDeployer.

 I guess we need this in all service deployers. AFAIK we already have this
 in webapp deployers.

 WDYT?


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729




-- 
Manjula Rathnayaka
Software Engineer
WSO2, Inc.
Mobile:+94 77 743 1987
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev