[ 
https://issues.apache.org/jira/browse/IGNITE-5966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16172949#comment-16172949
 ] 

Pavel Konstantinov commented on IGNITE-5966:
--------------------------------------------

Tried to execute
{code}
    public static void main(String[] args) throws Exception {
        try (Ignite ignite = Ignition.start("sample-client.xml")) {
            System.out.println(">>> Loading caches...");

            System.out.println(">>> Loading cache: ActCache");
            ignite.cache("ActCache").loadCache(null);

            System.out.println(">>> All caches loaded!");
            System.out.format("1->%s\n", ignite.cache("ActCache").get(10));
        }
    }
{code}

 and got the following exception
{code}
Exception in thread "main" javax.cache.integration.CacheLoaderException: 
javax.cache.CacheException: Failed to find mapping description [cache=ActCache, 
typeId=class java.lang.Integer]. Please configure JdbcType to associate cache 
'ActCache' with JdbcPojoStore.
        at 
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:327)
        at 
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:282)
        at 
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:418)
        at 
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:384)
        at 
org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:2024)
        at 
org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:2022)
        at 
org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6629)
        at 
org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:967)
        at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.cache.CacheException: Failed to find mapping description 
[cache=ActCache, typeId=class java.lang.Integer]. Please configure JdbcType to 
associate cache 'ActCache' with JdbcPojoStore.
        at 
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.entryMapping(CacheAbstractJdbcStore.java:654)
        at 
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.load(CacheAbstractJdbcStore.java:830)
        at 
org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:98)
        at 
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:316)
        ... 11 more
{code}

> IgniteCache#get() fails with "Requesting mapping from grid failed" when 
> deserialising binary object loaded from CacheJdbcPojoStoreFactory
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-5966
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5966
>             Project: Ignite
>          Issue Type: Bug
>         Environment: Ignite 2.1.4
>            Reporter: Alexey Kukushkin
>            Assignee: Alexey Kukushkin
>             Fix For: 2.3
>
>
> STEPS TO REPRODUCE
> 1. A running MySQL database with at least one table with an Integer key and 
> some data
> 2. Use WebConsole to automatically generate an Ignite project from the RDBMS. 
> In the WebConsole add a cache for the table containing data
> 3. Build the project
> 4. Start the cluster (run ServerNodeSpringStartup)
> 5. Load the data (run LoadCaches)
> 6. Run simple "get data" code against the running cluster with the data 
> loaded. Make sure you do NOT keep binary and do NOT put anything to the cache 
> except loading data on step #5. For example, if the cache is "AircraftCache", 
> the type is "Aircraft" and a row with ID 1 exists in the DB, then:
> IgniteCache<Integer, Aircraft> aircraftCache = 
> ignite.getOrCreateCache("AircraftCache");
> System.out.format("1->%s\n", aircraftCache.get(1));
> EXPECTED:
> 1...5: Project is generated, cluster runs, data is loaded
> 6: The entry with ID 1 is output to the console
> ACTUAL:"
> 1..5: As expected
> 6: javax.cache.CacheException: class 
> org.apache.ignite.IgniteCheckedException: Requesting mapping from grid failed 
> for [platformId=0, typeId=-1267085398]
> ANALYSIS
> The “typeId -> MappedName” mappings are stored in the 
> MarshallerContextImpl$allCaches[platformId] map.
> My understanding is according to the existing implementations it is expected 
> the mapping will always be registered when BinaryContext#descriptorForClass() 
> -> MarshallerContextImpl#registerClassName(typeId) is called either from 
> BinaryWriterExImpl or BinaryReaderExImpl.
> However, that mechanism is never called when 
> CacheJdbcPojoStore@buildBinaryObject builds the object, calling 
> BinaryObjectBuilderImpl#build(). The latter method still requests 
> BinaryContext#updateMetadata, which updates 
> CacheObjectBinaryProcessorImpl#metadataFileStore on all server nodes. But the 
> metadataFileStore is not the place where MarshallerContextImpl get mappings 
> from.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to