gpt4 book ai didi

java.lang.ClassCastException : com. marklogic.xcc.jndi.ContentSourceBeanFactory 无法转换为 javax.naming.spi.InitialContextFactory]

转载 作者:行者123 更新时间:2023-11-30 07:10:47 26 4
gpt4 key购买 nike

我在 WSO2 数据服务服务器中创建 JNDI 数据源时遇到错误,我正在使用 MarkLogic XCC/J 连接器,也可能使用 JNDI 上下文类,但我遇到了错误。

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)

这是我的配置文件

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

我的配置有什么问题吗?请帮忙

最佳答案

看起来 WSO2 想要实现 javax.naming.spi.InitialContextFactory 的东西,但 ContentSourceFactoryBean 仅实现 javax.naming.spi.ObjectFactory。

我还没有尝试过这个,但我想您可以编写一个 InitialContextFactory 的实现,它生成一个 Context,以确保将 ContentSourceFactoryBean 用作 ObjectFactory 实现。

关于java.lang.ClassCastException : com. marklogic.xcc.jndi.ContentSourceBeanFactory 无法转换为 javax.naming.spi.InitialContextFactory],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39284715/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com