Axiom jars are probably packaged inside your webapp. Axiom is also exposed
from Carbon.

On Mon, Feb 23, 2015 at 6:09 PM, Danushka Fernando <[email protected]>
wrote:

> Seems a class like loading issue. Do you have same class in two places in
> the server.
> On Feb 23, 2015 3:30 PM, "Pubudu Dodangoda" <[email protected]> wrote:
>
>> I am trying to access the local registry (to save and to get a resource)
>>
>> I get the following exception,
>>
>> java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: loader
>> constraint violation: when resolving method
>> "org.apache.axis2.util.XMLUtils.toOM(Lorg/w3c/dom/Element;)Lorg/apache/axiom/om/OMElement;"
>> the class loader (instance of
>> org/wso2/carbon/webapp/mgt/loader/CarbonWebappClassLoader) of the current
>> class, org/wso2/carbon/utils/multitenancy/CarbonContextHolder, and the
>> class loader (instance of
>> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved
>> class, org/apache/axis2/util/XMLUtils, have different Class objects for the
>> type MElement; used in the signature
>>
>> Last time when I got this exception, adding <scope>Provided</scope> to
>> the respective artifact dependency solved the problem
>> But here, when I do that I get a NoSuchMethod Exception for the line
>> where the Carbon Context is defined
>>
>>
>> Notes-
>> I used the following code for registry access
>>
>>                 CarbonContext cctx= CarbonContext.getCurrentContext();
>> Registry registry=cctx.getRegistry(RegistryType.LOCAL_REPOSITORY);
>> try{
>> Resource resource=registry.newResource();
>> resource.setContent("Dashboard_Test");
>> registry.put("RandomPath", resource);
>> }catch(RegistryException re){ re.printStackTrace();}
>>
>> Thank You
>> --
>> Pubudu Dodangoda
>> BSc Engineering(Hon's) Undergraduate
>> Department of Computer Science Engineering
>> University of Moratuwa
>> 0716053681 / 0775192994
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
email: kasung AT spamfree wso2.com
linked-in: http://lk.linkedin.com/in/gajasinghe
blog: http://kasunbg.org
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to