Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate query return empty list after deployment  RSS feed

 
nan xiang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, guys, I have some problems setting up my endpoints in my project.I am using using wildfly 10.1.0.Final, hibernate ogm 5.0.10.Final and Cassandra 3.0.9.



I have 32 rows in a table named "IO_CONFIGURATION" in my cassandra database.



Here is the code for my DAO:

   



  



   



Here is the query that I am trying to run:

   



My query runs perfect as a standalone java application. Here is the code I wrote for test the query:

   

And after run this test, it will give me a result:

   
***************** init CassandraDAO *************************** 
    Mar 06, 2017 5:53:39 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation 
    INFO: HHH000204: Processing PersistenceUnitInfo [ 
        name: JPAService 
        ...] 
    Mar 06, 2017 5:53:39 PM org.hibernate.Version logVersion 
    INFO: HHH000412: Hibernate Core {5.0.9.Final} 
    Mar 06, 2017 5:53:39 PM org.hibernate.cfg.Environment <clinit> 
    INFO: HHH000206: hibernate.properties not found 
    Mar 06, 2017 5:53:39 PM org.hibernate.cfg.Environment buildBytecodeProvider 
    INFO: HHH000021: Bytecode provider name : javassist 
    Mar 06, 2017 5:53:39 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit> 
    INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 
    Mar 06, 2017 5:53:39 PM org.hibernate.ogm.datastore.impl.DatastoreProviderInitiator initiateService 
    INFO: OGM000016: NoSQL Datastore provider: org.hibernate.ogm.datastore.cassandra.impl.CassandraDatastoreProvider 
    Mar 06, 2017 5:53:39 PM org.hibernate.ogm.datastore.cassandra.impl.CassandraDatastoreProvider start 
    INFO: OGM001601: Connecting to Cassandra at 127.0.0.1:9042 
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
    SLF4J: Defaulting to no-operation (NOP) logger implementation 
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
    Mar 06, 2017 5:53:40 PM org.hibernate.ogm.dialect.impl.GridDialectInitiator$GridDialectInstantiator newInstance 
    INFO: OGM000017: Grid Dialect: org.hibernate.ogm.datastore.cassandra.CassandraDialect 
    Mar 06, 2017 5:53:40 PM org.hibernate.ogm.dialect.impl.GridDialectInitiator$GridDialectInstantiator newInstance 
    INFO: Grid dialect logs are disabled 
    Mar 06, 2017 5:53:40 PM org.hibernate.dialect.Dialect <init> 
    INFO: HHH000400: Using dialect: org.hibernate.ogm.dialect.impl.OgmDialect 
    Mar 06, 2017 5:53:40 PM org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl makeLobCreatorBuilder 
    INFO: HHH000422: Disabling contextual LOB creation as connection was null 
    Mar 06, 2017 5:53:40 PM org.hibernate.id.UUIDHexGenerator <init> 
    WARN: HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead 
    Mar 06, 2017 5:53:40 PM org.hibernate.boot.internal.SessionFactoryBuilderImpl$SessionFactoryOptionsStateStandardImpl <init> 
    WARN: Unrecognized hbm2ddl_auto value : off.  Supported values include create, create-drop, update, and validate.  Ignoring 
    Mar 06, 2017 5:53:40 PM org.hibernate.search.engine.Version <clinit> 
    INFO: HSEARCH000034: Hibernate Search 5.5.3.Final 
    Mar 06, 2017 5:53:40 PM org.hibernate.ogm.cfg.impl.Version <clinit> 
    INFO: OGM000001: Hibernate OGM 5.0.4.Final 
    Mar 06, 2017 5:53:40 PM org.hibernate.search.engine.impl.ConfigContext getLuceneMatchVersion 
    WARN: HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT. 
    32 
    ***************** destroying CassandraDAO ************************* 
    Mar 06, 2017 5:53:41 PM org.hibernate.ogm.datastore.cassandra.impl.CassandraDatastoreProvider stop 
    INFO: OGM001602: Closing connection to Cassandra 




But when I try to do the same call on my endpoints after deploy my project, it will just give me an empty list.

Here is the code for the endpoints I set up:

   

But when I go to localhost:8080/aigateway/rest/ioconfiguration, it will give me an empty list.



Here is my persistence.xml for setting up the connection:





I don't know what the problem is, someone please help me!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!