2016-09-02 5 views
1

Wenn beim Erstellen der JNDI-Datenquelle im WSO2 Data Services Server ein Fehler auftritt, verwende ich MarkLogic XCC/J-Anschluss wie kann JNDI Context-Klasse, aber ich habe einen Fehler ..java.lang.ClassCastException: com.marklogic.xcc.jndi.ContentSourceBeanFactory kann nicht in javax.naming.spi.InitialContextFactory] umgewandelt werden

DS Fault Message: Naming error occurred while trying to retrieve JDBC Connection from 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 to create InitialContext using factory specified in hash table. [Root exception is java.lang.ClassCastException: com.marklogic.xcc.jndi.ContentSourceBeanFactory cannot be cast to javax.naming.spi.InitialContextFactory] at org.wso2.carbon.dataservices.core.description.config.JNDIConfig.createDataSource(JNDIConfig.java:95) at org.wso2.carbon.dataservices.core.description.config.JNDIConfig.(JNDIConfig.java:49) at org.wso2.carbon.dataservices.core.description.config.ConfigFactory.getJNDIConfig(ConfigFactory.java:98) at org.wso2.carbon.dataservices.core.description.config.ConfigFactory.createConfig(ConfigFactory.java:62) at org.wso2.carbon.dataservices.core.DataServiceFactory.createDataService(DataServiceFactory.java:150) at org.wso2.carbon.dataservices.core.DBDeployer.createDBService(DBDeployer.java:785) at org.wso2.carbon.dataservices.core.DBDeployer.processService(DBDeployer.java:1139) at org.wso2.carbon.dataservices.core.DBDeployer.deploy(DBDeployer.java:195) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135) at org.wso2.carbon.core.CarbonAxisConfigurator.deployServices(CarbonAxisConfigurator.java:567) 

Hier ist meine Konfigurationsdatei

<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> 

Was ist falsch mit meiner Konfiguration? Bitte helfen Sie

+0

werfen Sie einen Blick auf diese: http://code.lds.org/maven-sites/stack/modules/marklogic/1.2.1/ – alexbt

+0

es funktioniert nicht für mich :( –

Antwort

1

Sieht aus wie WSO2 möchte etwas, das javax.naming.spi.InitialContextFactory implementiert, aber die ContentSourceFactoryBean implementiert nur javax.naming.spi.ObjectFactory.

Ich habe das nicht versucht, aber ich kann mir vorstellen, dass Sie eine Implementierung von InitialContextFactory schreiben können, die einen Context erzeugt, der sicherstellt, dass ContentSourceFactoryBean als ObjectFactory-Implementierung verwendet wird.

Verwandte Themen