wso2 - java.lang.ClassCastException: com.marklogic.xcc.jndi.ContentSourceBeanFactory cannot be cast to javax.naming.spi.InitialContextFactory] -


im having error while creating jndi datasource in wso2 data services server, i'm using marklogic xcc/j connector may jndi context class got error..

ds fault message: naming error occurred while trying retrieve jdbc connection jndi tree. ds code: unknown_error source data service:- name: marklogicserver location: /marklogicserver.dbs description: n/a default namespace: http://ws.wso2.org/dataservice nested exception:- javax.naming.noinitialcontextexception: failed create initialcontext using factory specified in hash table. [root exception java.lang.classcastexception: com.marklogic.xcc.jndi.contentsourcebeanfactory cannot cast javax.naming.spi.initialcontextfactory] @ org.wso2.carbon.dataservices.core.description.config.jndiconfig.createdatasource(jndiconfig.java:95) @ org.wso2.carbon.dataservices.core.description.config.jndiconfig.(jndiconfig.java:49) @ org.wso2.carbon.dataservices.core.description.config.configfactory.getjndiconfig(configfactory.java:98) @ org.wso2.carbon.dataservices.core.description.config.configfactory.createconfig(configfactory.java:62) @ org.wso2.carbon.dataservices.core.dataservicefactory.createdataservice(dataservicefactory.java:150) @ org.wso2.carbon.dataservices.core.dbdeployer.createdbservice(dbdeployer.java:785) @ org.wso2.carbon.dataservices.core.dbdeployer.processservice(dbdeployer.java:1139) @ org.wso2.carbon.dataservices.core.dbdeployer.deploy(dbdeployer.java:195) @ org.apache.axis2.deployment.repository.util.deploymentfiledata.deploy(deploymentfiledata.java:136) @ org.apache.axis2.deployment.deploymentengine.dodeploy(deploymentengine.java:807) @ org.apache.axis2.deployment.repository.util.wsinfolist.update(wsinfolist.java:144) @ org.apache.axis2.deployment.repositorylistener.update(repositorylistener.java:377) @ org.apache.axis2.deployment.repositorylistener.checkservices(repositorylistener.java:254) @ org.apache.axis2.deployment.deploymentengine.loadservices(deploymentengine.java:135) @ org.wso2.carbon.core.carbonaxisconfigurator.deployservices(carbonaxisconfigurator.java:567) 

here configuration file

<data name="marklogicserver" transports="http https local">    <config enableodata="false" id="mlsource">       <property name="jndi_context_class">com.marklogic.xcc.jndi.contentsourcebeanfactory</property>       <property name="jndi_provider_url"></property>       <property name="jndi_resource_name">marklogic/contentsource</property>    </config>    <query id="getquery" useconfig="mlsource">       <sql>let $x := cts:search(fn:collection(""),cts:and-query(("","")))&#xd;&#xd;return $x</sql>       <result element="documents" rowname="document">          <element column="data" name="data" xsdtype="string"/>       </result>    </query>    <operation name="getqueryoperation">       <call-query href="getquery"/>    </operation>    <resource method="get" path="getquery">       <call-query href="getquery"/>    </resource> </data> 

what wrong configuration? please help

looks wso2 wants implements javax.naming.spi.initialcontextfactory, contentsourcefactorybean implements javax.naming.spi.objectfactory.

i have not tried this, imagine can write implementation of initialcontextfactory produces context ensure contentsourcefactorybean used objectfactory implementation.


Comments