Hi Maduranga,

Yeah, seems like the packages exported from the stub is not correct. We
will have to fix those eventually, @Chanika please note.

But for your requirement, I'm guessing you will have your own admin service
operations when adding user stores and all. So calling another service from
through a backend service is overkill, you can directly call the required
functionality directly. Check here [1] to see how
"testDataSourceConnection()" is implemented, you just have to use a logic
similar to do it.

But then again, if your requirement is directly from the UI to check the
validity of database connection information, then yeah, do fix the data
source UI component as you've done, but you have to check all the usages of
those packages and fix those as well.

[1]
https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/core/org.wso2.carbon.ndatasource.core/4.2.0/src/main/java/org/wso2/carbon/ndatasource/core/services/NDataSourceAdminService.java

Cheers,
Anjana.


On Thu, Apr 3, 2014 at 1:32 PM, Maduranga Siriwardena <[email protected]>wrote:

> Hi all,
> In the IS, when a secondary JDBC user store is creating the database
> connection is not tested. So when we do a operation on the user store,
> exceptions are thrown. So to fix the issue, I need to check the database
> connection before creating the user store.
>
> Same scenario happens in DSS. It uses org.wso2.carbon.ndatasource.stub and
> generate a client and call the relevant methods. But as you can see imports
> are done as org.wso2.carbon.ndatasource.ui.stub in [1]. So if I do the
> same thing and build my component, I builds without errors. But when I add
> the jar to the pack and run the server it gives runtime errors(can't
> remember the exact error. but it was about problems with finding the
> correct packages and classes.). But if I add
> the org.wso2.carbon.ndatasource.ui component also to the dropins folder, it
> works without errors.
>
> But I can't add the UI component to the IS as it will change the UI of the
> IS.
> When I checked the folder structure of the jar of the stub, it was like 
> org/wso2/carbon/ndatasource/ui/stub.
> So I think there is a problem with exporting the packages in the stub. So I
> did some changes to the pom of the stub (in the maven-antrun-plugin
> section) changing some package names when generating the stub from
> wsdl2java (changed pom and diff are attached here). So by doing this, I can
> test the connection in IS without a problem.
> As changing the stub will break the other components that user the stub, I
> changed the above mentioned UI component. Now it is working without a
> problem. (not much sure of any other component that use the stub)
>
> Can someone please comment about the suitability of this approach.
>
>
>
> [1]
> https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/ndatasource/org.wso2.carbon.ndatasource.ui/4.2.2/src/main/java/org/wso2/carbon/ndatasource/ui/NDataSourceAdminServiceClient.java
>
> Thank you,
> Maduranga
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Anjana Fernando*
Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to