public class Test {

    public static void main(String[] args) throws IOException {
        CacheManager cacheManager = 
Caching.getCachingProvider().getCacheManager(new 
ClassPathResource("ignite-config-simple.xml").getURI(), null);
        Cache<Integer, MyObject> cache = cacheManager.getCache("myCache", 
Integer.class, MyObject.class);
    }
}

Exception in thread "main" java.lang.ClassCastException
        at org.apache.ignite.cache.CacheManager.getCache(CacheManager.java:203)
        at Test.main(Test.java:15)


ignite-config-simple.xml

<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 id="grid.cfg" 
class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="metricsLogFrequency" value="0"/>
        <property name="gridLogger">
            <bean class="org.apache.ignite.logger.slf4j.Slf4jLogger"/>
        </property>
        <property name="cacheConfiguration">
            <list>
                <bean 
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="myCache"/>
                    <property name="cacheMode" value="PARTITIONED"/>
                    <property name="atomicityMode" value="ATOMIC"/>
                    <property name="backups" value="1"/>
                </bean>
            </list>
        </property>
    </bean>
</beans>



> On 03 Jan, 2017, at 9:05 AM, vkulichenko <[email protected]> 
> wrote:
> 
> Can you show the trace?
> 
> -Val
> 
> 
> 
> --
> View this message in context: 
> http://apache-ignite-users.70518.x6.nabble.com/JCache-and-CacheManager-getCache-tp9847p9848.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to