You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Abhishek Ubhe <ab...@gmail.com> on 2023/03/02 04:09:05 UTC

Unable create a Cache SQL table on Ignite Node.

Hello,

Please check the below case and help with your suggestions.

Case :

   - I have started Ignite node on the kubernetes pod.
   - Also load some caches there after starting that ignite server node in
   the same code flow. You can check the attachment for reference.
   - Now I want to create a cache SQL table on that K8s pod where I have
   started ignite server nodes.
   - But when I try to create it through a script on K8s job I get a null
   pointer for ignite instance.
   - You can verify my java API below.

CacheConfiguration<String, UserURMCacheSQLTable> userURMCacheConfig =
(CacheConfiguration<String, UserURMCacheSQLTable>) CommonCacheConfiguration
.getCommonCacheConfig("USER_URM_CACHE");

userURMCacheConfig.setIndexedTypes(String.class,
UserURMCacheSQLTable.class);
userURMCacheConfig.setCacheMode(CacheMode.REPLICATED);
userURMCacheConfig.setBackups(2);

IgniteCache<String, UserURMCacheSQLTable> userURMCache =
*ignite.getOrCreateCache(userURMCacheConfig);*

Note : Getting null pointer at bolded line in above code.
-- 
*Regards,*
*Abhishek Ubhe*

Re: Unable create a Cache SQL table on Ignite Node.

Posted by Abhishek Ubhe <ab...@gmail.com>.
Hello,

UserURMCacheLoaderScript : createUserURMCache : EXCEPTION :
java.lang.NullPointerException : StackTrace :
[{"com.clouds.database.test.main.UserURMCacheLoaderScript.createUserURMCache":205},{"com.clouds.database.test.main.UserURMCacheLoaderScript.callCacheInitiator":168},{"com.clouds.database.test.main.UserURMCacheLoaderScript.createCache":158},{"com.clouds.database.test.main.UserURMCacheLoaderScript.main":85}]


Code : PFA

On Thu, Mar 2, 2023 at 9:53 AM Jeremy McMillan <je...@gridgain.com>
wrote:

> Java exception troubleshooting usually begins with an error message and a
> stack trace. Can we get that added to your fine description of how you
> found the error? We still don't know what error you found.
>
> Also please provide your config, with secrets redacted, of course. Both
> the details of the error and exceptions in the log are almost always
> necessary information.
>
> On Wed, Mar 1, 2023, 22:09 Abhishek Ubhe <ab...@gmail.com>
> wrote:
>
>> Hello,
>>
>> Please check the below case and help with your suggestions.
>>
>> Case :
>>
>>    - I have started Ignite node on the kubernetes pod.
>>    - Also load some caches there after starting that ignite server node
>>    in the same code flow. You can check the attachment for reference.
>>    - Now I want to create a cache SQL table on that K8s pod where I have
>>    started ignite server nodes.
>>    - But when I try to create it through a script on K8s job I get a
>>    null pointer for ignite instance.
>>    - You can verify my java API below.
>>
>> CacheConfiguration<String, UserURMCacheSQLTable> userURMCacheConfig =
>> (CacheConfiguration<String, UserURMCacheSQLTable>) CommonCacheConfiguration
>> .getCommonCacheConfig("USER_URM_CACHE");
>>
>> userURMCacheConfig.setIndexedTypes(String.class,
>> UserURMCacheSQLTable.class);
>> userURMCacheConfig.setCacheMode(CacheMode.REPLICATED);
>> userURMCacheConfig.setBackups(2);
>>
>> IgniteCache<String, UserURMCacheSQLTable> userURMCache =
>> *ignite.getOrCreateCache(userURMCacheConfig);*
>>
>> Note : Getting null pointer at bolded line in above code.
>> --
>> *Regards,*
>> *Abhishek Ubhe*
>>
>>

-- 
*Regards,*
*Abhishek Ubhe*

Re: Unable create a Cache SQL table on Ignite Node.

Posted by Jeremy McMillan <je...@gridgain.com>.
Java exception troubleshooting usually begins with an error message and a
stack trace. Can we get that added to your fine description of how you
found the error? We still don't know what error you found.

Also please provide your config, with secrets redacted, of course. Both the
details of the error and exceptions in the log are almost always necessary
information.

On Wed, Mar 1, 2023, 22:09 Abhishek Ubhe <ab...@gmail.com> wrote:

> Hello,
>
> Please check the below case and help with your suggestions.
>
> Case :
>
>    - I have started Ignite node on the kubernetes pod.
>    - Also load some caches there after starting that ignite server node
>    in the same code flow. You can check the attachment for reference.
>    - Now I want to create a cache SQL table on that K8s pod where I have
>    started ignite server nodes.
>    - But when I try to create it through a script on K8s job I get a null
>    pointer for ignite instance.
>    - You can verify my java API below.
>
> CacheConfiguration<String, UserURMCacheSQLTable> userURMCacheConfig =
> (CacheConfiguration<String, UserURMCacheSQLTable>) CommonCacheConfiguration
> .getCommonCacheConfig("USER_URM_CACHE");
>
> userURMCacheConfig.setIndexedTypes(String.class,
> UserURMCacheSQLTable.class);
> userURMCacheConfig.setCacheMode(CacheMode.REPLICATED);
> userURMCacheConfig.setBackups(2);
>
> IgniteCache<String, UserURMCacheSQLTable> userURMCache =
> *ignite.getOrCreateCache(userURMCacheConfig);*
>
> Note : Getting null pointer at bolded line in above code.
> --
> *Regards,*
> *Abhishek Ubhe*
>
>