Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Redis om spring dependency in spring cloud stream project gives startup error #111

Closed
praks84 opened this issue Sep 30, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@praks84
Copy link

praks84 commented Sep 30, 2022

Hello,

I have a spring cloud stream project with kafka streams binder dependency - no issues at startup.
Next I add redis om spring dependency 0.6.0, add a model object annotate it with @document and annotate main class with @EnableRedisDocumentRepositories. Now I get below error at startup

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at com.redis.om.spring.RedisModulesConfiguration.getBeanDefinitionsFor(RedisModulesConfiguration.java:392)

Apologies for any mistake in posting this issue with details - new to this, so please guide me.

@praks84 praks84 changed the title Adding Resis om spring dependency in spring cloud stream project gives startup error Adding Redis om spring dependency in spring cloud stream project gives startup error Sep 30, 2022
@roux-jerome
Copy link

roux-jerome commented Oct 4, 2022

Hello,
I have same issue.
versions :
Spring-boot : 2.6.12
spring-cloud : 2021.0.4
redis-om-spring : 0.6.0

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
 at com.redis.om.spring.RedisModulesConfiguration.getBeanDefinitionsFor(RedisModulesConfiguration.java:392) ~[redis-om-spring-0.6.0.jar:na]
 at com.redis.om.spring.RedisModulesConfiguration.createIndicesFor(RedisModulesConfiguration.java:196) ~[redis-om-spring-0.6.0.jar:na]
 at com.redis.om.spring.RedisModulesConfiguration.ensureIndexesAreCreated(RedisModulesConfiguration.java:157) ~[redis-om-spring-0.6.0.jar:na]


@roux-jerome
Copy link

Map<String, Object> annotatedBeans = ac.getBeansWithAnnotation(SpringBootApplication.class); // return an empty LinkedHashMap
Class<?> app = annotatedBeans.values().toArray()[0].getClass();

@roux-jerome
Copy link

roux-jerome commented Oct 4, 2022

RedisModulesConfiguration.ensureIndexesAreCreated is invoked twice. The first one ac.getBeansWithAnnotation(SpringBootApplication.class) is empty. The second one is not

@bsbodden bsbodden self-assigned this Oct 4, 2022
@bsbodden bsbodden added the bug Something isn't working label Oct 4, 2022
DavidFischer1010 referenced this issue Oct 22, 2022
…ityStreams, general clean up (#84) - (resolves gh-81, resolved gh-78)

* fix: add missing apply (aggregation transformations) parameter

* refactor: replace printStackTrace calls with logging statements

* refactor: add accessor for underlying RedisKeyValueAdapter in CustomRedisKeyValueTemplate

* refactor: test and clean tuples implementation

* feature: introduce KeyspaceToIndexMap to track Entity Indexes

* refactor: remove printStackTrace calls, default empty return value on exception

* refactor: correct invalid identifier type message

* feature: add RedisOMCustomConversions to handle type conversions for Hash mappings

* refactor: clean query utils and account for custom conversions (for hashes)

* test: add tests for ObjectUtils class

* feature: add missing Gson adapters for Ulid to GsonBuilderFactor

* feature: improve Hash repositories to catch up with Document repositories querying features

* feature: handle metamodel generation for Hashed mapped fields, and general clean up of the metamodel API

* test: add test when deleting all suggestion entries

* feature: introduce keyspace resolution for document repositories

* refactor: consolidate get methods

* refactor: add pass-thru RedisOMCustomConversions to RedisJSONKeyValueAdapter

* feature: add getAllKeysOf method to retrieve paginated keys

* test: cover all cases of Ulid ID generation

* refactor: remove unused template from test, clear all repos before tests

* test: add test for language stemming in queries

* refactor: remove sysouts and format

* refactor: consolidate ignore exceptions in BloomQueryExecutor

* feature: finish implementing terminal JSON actions on EntityStreams

* test: add tests for modules operations API

* refactor: update TODO for issue #88 - #88
@DavidFischer1010
Copy link

See my Comment in the commit, this might be the cause. My previous fix has somehow regressed, I don't know the consequences of reverting this, since a lot has changed, so you might look into this @bsbodden.

The error occurs when I try to send an event via Spring Cloud Stream.

Best,
David

@daveish
Copy link

daveish commented Oct 22, 2022

Oops, wrong account. This is the one... :D

@praks84
Copy link
Author

praks84 commented Oct 28, 2022

I am stuck because of this issue - any workaround suggestions to get going till the fix?

@bsbodden
Copy link
Contributor

Next release will have solve this issue. Likely out by Monday.

bsbodden added a commit to bsbodden/redis-om-spring that referenced this issue Nov 1, 2022
@bsbodden
Copy link
Contributor

bsbodden commented Nov 3, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants