Java 无法使用Ignite V2.0从Oracle连接和加载数据

Java 无法使用Ignite V2.0从Oracle连接和加载数据,java,ignite,in-memory-database,Java,Ignite,In Memory Database,我正在尝试配置和读取现有Oracle表中的数据 但是,我在调用cache.loadCache()时收到错误消息这行 它将错误消息显示为 消息作为 session:javax.cache.integration.CacheWriterException: Failed to start store session [tx=null]Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@192

我正在尝试配置和读取现有Oracle表中的数据 但是,我在调用
cache.loadCache()时收到错误消息这行

它将错误消息显示为 消息作为

session:javax.cache.integration.CacheWriterException: Failed to start store
session [tx=null]Caused by: java.sql.SQLException: No suitable driver found
for jdbc:oracle:thin:@192.168.2.218:1521:xe at
org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:190)  at
org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:351)    at
org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:383)    at
org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:226)
at
org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:198)
at




CacheConfiguration<String, TempClass> cacheCfg = new CacheConfiguration<String, TempClass>();
            cacheCfg.setName("Test_CacheConfig");
            IgniteConfiguration igniteConfig = new IgniteConfiguration();
            Factory<TempClassCacheStore> factory = FactoryBuilder.factoryOf(TempClassCacheStore.class);

            cacheCfg.setReadThrough(true);
            cacheCfg.setWriteThrough(true);
            cacheCfg.setIndexedTypes(String.class, TempClass.class);
            cacheCfg.setCacheStoreFactory(factory);
            cacheCfg.setCacheStoreSessionListenerFactories(new Factory<CacheStoreSessionListener>() {
                @Override
                public CacheStoreSessionListener create() {
                    CacheJdbcStoreSessionListener lsnr = new CacheJdbcStoreSessionListener();
                    lsnr.setDataSource(JdbcConnectionPool.create("jdbc:oracle:thin:@192.168.2.218:1521:xe", "test", "test"));
                    return lsnr;
                }
            });
Ignite ignite = Ignition.start(igniteConfig);
            IgniteCache<String, TempClass> cache = ignite.getOrCreateCache(cacheCfg);
            cache.loadCache(null);
            SqlFieldsQuery sql = new SqlFieldsQuery("SELECT ID_, NAME_  FROM TEST_TABLE");

            QueryCursor<List<?>> cursor = cache.query(sql);
会话:javax.cache.integration.CacheWriterException:启动存储失败
会话[tx=null]由以下原因引起:java.sql.SQLException:未找到合适的驱动程序
对于jdbc:oracle:thin:@192.168.2.218:1521:xeat
org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:190)位于
org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:351)位于
org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:383)位于
org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:226)
在
org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:198)
在
CacheConfiguration cacheCfg=新的CacheConfiguration();
setName(“Test_CacheConfig”);
IgniteConfiguration igniteConfig=新IgniteConfiguration();
Factory Factory=FactoryBuilder.factoryOf(TempClassCacheStore.class);
cacheCfg.setReadThrough(true);
cacheCfg.setWriteThrough(true);
cacheCfg.setIndexedTypes(String.class、TempClass.class);
cacheCfg.setCacheStoreFactory(工厂);
setCacheStoreSessionListenerFactorys(新工厂(){
@凌驾
public CacheStoreSessionListener create(){
CacheJdbcStoreSessionListener lsnr=新的CacheJdbcStoreSessionListener();
lsnr.setDataSource(JdbcConnectionPool.create(“jdbc:oracle:thin:@192.168.2.218:1521:xe”,“test”,“test”);
返回lsnr;
}
});
点火=点火。启动(点火配置);
IgniteCache cache=ignite.getOrCreateCache(cacheCfg);
loadCache(空);
SqlFieldsQuery sql=新SqlFieldsQuery(“从测试表中选择ID、名称”);

QueryCursor当您试图从oracle加载数据到Ignite时,您需要在类路径中安装oracle JDBC驱动程序。在启动节点之前,只需将驱动程序JAR放入IGNITE_HOME/libs文件夹,然后再次运行加载。

谢谢@Evgenii这有点让人困惑,我正在从java程序本身启动IGNITE服务器,我认为这与我存储在本地计算机上的IGNITE二进制文件无关,我甚至还没有设置IGNITE HOME。因此,我很困惑它如何访问存储在本地计算机上的ignite实例?是的,我的项目的类路径中已经有了oracle jar。我不明白你们的意思,你们在哪里以及如何启动ignite server?在服务器的类路径中有库吗?我在java项目的maven配置中包含了ingine库,如下所示。使用上面的代码,我启动了ignite实例。我没有在我的电脑上运行或设置任何其他节点。也就是说,我没有使用/ignite.bat文件启动服务器。错误清楚地表明找不到JDBC驱动程序。请仔细检查并确保它在类路径上。已解决,是的,JDBCJAR在类路径中,但在清理了几次错误更改后。实际上,我所指的POJO类的名称与数据库表名称不同。顺便说一句,谢谢你的回答。