On Fri, Oct 14, 2011 at 4:22 PM, Senaka Fernando <sen...@wso2.com> wrote:

> Hi Kishan,
>
> Set -Dcarbon.repo.write.mode=true. This was an issue until very recently
> and was fixed.
>

Adding more to this, since the carbon.xml is not accessible in a remote
client, for the exact same code to work at client side, we introduced the
above system property. Please note that this is only a requirement of the
standard Java clients.

Thanks,
Senaka.


> Thanks,
> Senaka.
>
>
> On Fri, Oct 14, 2011 at 3:26 PM, Kishan Navaratne <kis...@wso2.com> wrote:
>
>> Hi,
>>
>>  I tried to create a client to import a wsdl to G-Reg using WS-API +
>> Governance API. I have intentionally left setting carbon home parameter in
>> the test client. Since this client is going to be used inside automation
>> framework, keeping G-Reg build on client side and pointing the location is
>> not practical. So in order to continue with governance automation, Is there
>> any other way I can use Governance API without setting carbon home?
>>
>>
>>  Exception
>>
>> =========================
>>
>>
>>  Exception in thread "main" java.lang.NullPointerException
>>
>> at java.util.Hashtable.put(Hashtable.java:394)
>>
>> at java.util.Properties.setProperty(Properties.java:143)
>>
>> at java.lang.System.setProperty(System.java:729)
>>
>> at org.wso2.carbon.utils.CarbonUtils.getCarbonHome(CarbonUtils.java:178)
>>
>> at
>> org.wso2.carbon.utils.CarbonUtils.getCarbonConfigDirPath(CarbonUtils.java:204)
>>
>> at org.wso2.carbon.utils.CarbonUtils.getServerXml(CarbonUtils.java:169)
>>
>> at
>> org.wso2.carbon.utils.CarbonUtils.getServerConfiguration(CarbonUtils.java:465)
>>
>> at
>> org.wso2.carbon.registry.core.utils.RegistryUtils.isRegistryReadOnly(RegistryUtils.java:1053)
>>
>> at
>> org.wso2.carbon.registry.core.session.UserRegistry.importResource(UserRegistry.java:677)
>>
>> at
>> org.wso2.carbon.governance.api.wsdls.WsdlManager.addWsdl(WsdlManager.java:96)
>>
>> at SimpleWsdl_Upload.main(SimpleWsdl_Upload.java:37)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>>
>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
>>
>>
>>  Once I set “*CarbonHome*” as a system property it worked perfectly, wsdl
>> was uploaded to Greg with no issues
>>
>>
>>  For your reference, client code is attached here with.
>>
>>
>>
>> Best Regards,
>>
>> Kishan
>>
>
>
>
> --
> *Senaka Fernando*
> Product Manager - WSO2 Governance Registry;
> Associate Technical Lead; WSO2 Inc.; http://wso2.com*
> Member; Apache Software Foundation; http://apache.org
>
> E-mail: senaka AT wso2.com
> **P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818
> Linked-In: http://linkedin.com/in/senakafernando
>
> *Lean . Enterprise . Middleware
>
>


-- 
*Senaka Fernando*
Product Manager - WSO2 Governance Registry;
Associate Technical Lead; WSO2 Inc.; http://wso2.com*
Member; Apache Software Foundation; http://apache.org

E-mail: senaka AT wso2.com
**P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818
Linked-In: http://linkedin.com/in/senakafernando

*Lean . Enterprise . Middleware
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to