首页 文章

配置文件在zeppelin中点燃发现,即使存在IgniteConfiguration bean,config xml也不起作用

提问于
浏览
0

我使用基于zookeeper的发现来点燃集群,并且点燃节点正在正确连接 .

当我在zeppelin点击解释器中设置相同的config.xml文件时,我无法运行点火 . 它失败,但有以下异常 .

它给我以下错误的zepplin:找不到配置:file:////tmp/shared.xml无法在以下位置找到配置:file:////tmp/shared.xml

例外细节:please click this link

我正在使用的ignite_client.xml:

``
`<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="clientMode" value="true"/>
<property name="peerClassLoadingEnabled" value="false"/>

<property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
        <property name="ipFinder">
            <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder">
                <property name="zkConnectionString" value="zookeeper:2181"/>
            </bean>
        </property>
    </bean>
</property>
<property name="cacheConfiguration">
    <list>
        <bean class="org.apache.ignite.configuration.CacheConfiguration">
            <property name="name" value="testcache"/>
            <property name="startSize" value="10"/>
        </bean>
    </list>
</property>

</bean>`
`` 我看到了Ignite代码并发现它失败了,因为没有找到类型为IgniteConfiguration的spring bean,但是在xml中它实际上存在,如上面的共享xml中所示 .

Analysis so far

  • 调试zeppelin和Ignite代码并验证正确的xml文件传递给ignite.start

  • 甚至已验证的内容文件砥的双重肯定通过读取InputStream和文件内容是正确的,InputStream为从org.springframework.beans.factory.xml.XmlBeanDefinitionReader#loadBeanDefinitions(org.springframework.core.io.support.EncodedResource)

  • 进一步调试验证ApplicationContext中的beanDefinitionMap包含IgniteConfiguration,附加快照

enter image description here

  • 尝试通过名称获取bean,它可以...而不是cfgMap = springCtx.getBeansOfType(cls);在org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl #loadConfigurations(java.net.URL,java.lang.Class,java.lang.String ...)

  • 为了试用,我使用了sprintContext.getBean(),假设它会运行,但是它已经过时了,我得到了类转换异常

enter image description here

到目前为止经过分析后,我唯一能理解的是diff classloader加载的IgniteConfiguration是如何导致问题的,但不知道为什么会发生这种情况

Debugged further and confirmed, it is because IgniteConfiguration loaded by different class loader, one loaded already was from sun.misc.Launcher.AppClassLoader#AppClassLoader and in sprinContext IgnitConfiguration bean present is loded by scala.reflect.internal.util.ScalaClassLoader and that is why the error "Failed to find configuration in: file:////tmp/shared.xml" Logically I can think it as spark program is scala code and spring bean loaded at runtime that is why this mismatch Is this normal ?

1 回答

  • 0

    我尝试了你的配置,它适用于我 . 你之前有其他版本的文件吗?如果是这样,我认为它没有正确更新,因为获得此异常的唯一方法是使用有效的Spring XML文件,但没有 IgniteConfiguration bean .

    你确定你确实使用了正确的文件吗?这可能是因为你在 /tmp 文件夹中有它吗?

相关问题