Spring 4 with kundera and couchdb

57 views
Skip to first unread message

Rajasri Abilash

unread,
Oct 14, 2015, 2:04:15 AM10/14/15
to kundera-discuss
Hi,

Newbee

unread,
Oct 14, 2015, 2:12:17 AM10/14/15
to kundera-discuss


On Wednesday, October 14, 2015 at 11:34:15 AM UTC+5:30, Newbee wrote:
Hi,
          Am trying Spring 4 with kundera 2.17 to connect couchdb. Am actually trying a sample to fetch a user by id. But the log shows me status 200 ok for the response by anyhow am unable to get the entity. I get the following exception..

2015-10-14 11:11:01 [] DEBUG (PoolingClientConnectionManager.java:272) - Connection [id: 1][route: {}->http://localhost:5984] can be kept alive indefinitely
2015-10-14 11:11:01 [] DEBUG (PoolingClientConnectionManager.java:278) - Connection released: [id: 1][route: {}->http://localhost:5984][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
2015-10-14 11:11:01 [] ERROR (CouchDBClient.java:911) - Error while executing query, Caused by {}.
java.lang.NullPointerException
at com.impetus.client.couchdb.CouchDBClient.executeQuery(CouchDBClient.java:960)
at com.impetus.client.couchdb.CouchDBClient.createAndExecuteQuery(CouchDBClient.java:907)
at com.impetus.client.couchdb.CouchDBQuery.populateEntities(CouchDBQuery.java:80)
at com.impetus.kundera.query.QueryImpl.fetch(QueryImpl.java:1377)
at com.impetus.kundera.query.QueryImpl.getResultList(QueryImpl.java:200)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:362)
at com.sun.proxy.$Proxy54.getResultList(Unknown Source)
at calories.tracker.app.dao.UserRepository.findUserByUsername(UserRepository.java:42)
at calories.tracker.app.security.SecurityUserDetailsService.loadUserByUsername(SecurityUserDetailsService.java:33)

Thanks in advance for any help..


Chhavi Gangwal

unread,
Oct 20, 2015, 6:53:13 AM10/20/15
to kundera-discuss
Sorry for late reply , but can you share your entity definition ? Which version of CouchDB are you using?

Chhavi

Newbee

unread,
Dec 28, 2015, 4:16:22 AM12/28/15
to kundera-discuss
Anyhow thank you for the reply.. We actually solved the problem, I was missing the document id in the view to fetch user details. Fixed it by debugging the source files..
But I have another problem.. Am trying to connect both mysql and couchdb (2 persistence units) using spring's LocalContainerEntityManagerFactoryBean. But no success. I get the following exception.

Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory] is defined: expected single matching bean but found 2: entityManagerFactorySQL,entityManagerFactoryCouch

Thanks in advance for any help!!.

Thanks for the support!
Reply all
Reply to author
Forward
0 new messages