Problem with persistence with spring

Asked

Viewed 58 times

0

The mistake: java.lang.Illegalargumentexception: Not an Entity: class br.com.api.entities.Characters

My Class

package br.com.api.entities;

import java.time.LocalDateTime;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Characters {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String description;
private LocalDateTime modified;
private String resourceURI;

public Characters() {

}

// Getters and Setters

The big unknown here is that when I catch the Metamodel to check if my entity is there, it actually appears Characters.

public static void getAnnotatedClasses() {
    EntityManager em = null;
    try {
        em = sessionFactory.createEntityManager();
        em.getMetamodel().getEntities().forEach(System.out::println); // Characters 
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (em != null) {
            em.close();
        }
    }
}

My Controller

package br.com.api.controls;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import br.com.api.entities.Characters;
import br.com.hcf.HCFConnection;

@RestController
@RequestMapping("api/v1/public")
public class CharacterControl {

    @GetMapping("/characters")
    public ResponseEntity<Object> getAll() {
        try {
            return ResponseEntity.ok(new HCFConnection<>(Characters.class).all());
        } catch (Exception e) {
            return ResponseEntity.status(HttpStatus.NOT_FOUND).body("Characters not found");
        }
    }

}

Stacktrace

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.4)

2021-04-14 19:49:08.650  INFO 1300 --- [  restartedMain] br.com.api.ApiApplication                : Starting ApiApplication using Java 15.0.2 on DESKTOP-TEEJGQ6 with PID 1300 (C:\Users\karpi\Desktop\api-hcf\target\classes started by karpi in C:\Users\karpi\Desktop\api-hcf)
2021-04-14 19:49:08.656  INFO 1300 --- [  restartedMain] br.com.api.ApiApplication                : No active profile set, falling back to default profiles: default
2021-04-14 19:49:08.802  INFO 1300 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-04-14 19:49:08.803  INFO 1300 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2021-04-14 19:49:10.889  INFO 1300 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2021-04-14 19:49:10.912  INFO 1300 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-04-14 19:49:10.913  INFO 1300 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.44]
2021-04-14 19:49:11.104  INFO 1300 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-04-14 19:49:11.105  INFO 1300 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2300 ms
2021-04-14 19:49:11.521  INFO 1300 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-04-14 19:49:11.958  INFO 1300 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2021-04-14 19:49:12.062  INFO 1300 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-04-14 19:49:12.081  INFO 1300 --- [  restartedMain] br.com.api.ApiApplication                : Started ApiApplication in 4.132 seconds (JVM running for 5.101)
2021-04-14 19:49:18.535  INFO 1300 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-04-14 19:49:18.535  INFO 1300 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2021-04-14 19:49:18.536  INFO 1300 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2021-04-14 19:49:18.700  INFO 1300 --- [nio-8080-exec-1] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.29.Final
2021-04-14 19:49:18.705  INFO 1300 --- [nio-8080-exec-1] org.hibernate.cfg.Environment            : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.format_sql=false, hibernate.hbm2ddl.auto=update, hibernate.c3p0.max_size=10, hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect, hibernate.c3p0.min_size=5, hibernate.connection.username=root, hibernate.enable_lazy_load_no_trans=true, hibernate.connection.url=jdbc:mysql://localhost:3306/springboot?useTimezone=true&serverTimezone=America/Sao_Paulo, hibernate.show_sql=false, hibernate.connection.driver_class=com.mysql.cj.jdbc.Driver, hibernate.c3p0.max_statements=30, hibernate.connection.password=****, hibernate.c3p0.timeout=3000, hibernate.bytecode.use_reflection_optimizer=false}
2021-04-14 19:49:23.659  INFO 1300 --- [nio-8080-exec-1] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-04-14 19:49:23.812  WARN 1300 --- [nio-8080-exec-1] o.h.e.j.c.i.ConnectionProviderInitiator  : HHH000022: c3p0 properties were encountered, but the c3p0 provider class was not found on the classpath; these properties are going to be ignored.
2021-04-14 19:49:23.815  WARN 1300 --- [nio-8080-exec-1] org.hibernate.orm.connections.pooling    : HHH10001002: Using Hibernate built-in connection pool (not for production use!)
2021-04-14 19:49:23.825  INFO 1300 --- [nio-8080-exec-1] org.hibernate.orm.connections.pooling    : HHH10001005: using driver [com.mysql.cj.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/springboot?useTimezone=true&serverTimezone=America/Sao_Paulo]
2021-04-14 19:49:23.826  INFO 1300 --- [nio-8080-exec-1] org.hibernate.orm.connections.pooling    : HHH10001001: Connection properties: {password=****, user=root}
2021-04-14 19:49:23.827  INFO 1300 --- [nio-8080-exec-1] org.hibernate.orm.connections.pooling    : HHH10001003: Autocommit mode: false
2021-04-14 19:49:23.833  INFO 1300 --- [nio-8080-exec-1] .c.i.DriverManagerConnectionProviderImpl : HHH000115: Hibernate connection pool size: 20 (min=1)
2021-04-14 19:49:24.398  INFO 1300 --- [nio-8080-exec-1] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2021-04-14 19:49:25.263  INFO 1300 --- [nio-8080-exec-1] org.hibernate.orm.connections.access     : HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@3818bf61] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.
2021-04-14 19:49:25.310  INFO 1300 --- [nio-8080-exec-1] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
java.lang.IllegalArgumentException: Not an entity: class br.com.api.entities.Characters
    at org.hibernate.metamodel.internal.MetamodelImpl.entity(MetamodelImpl.java:566)
    at org.hibernate.query.criteria.internal.QueryStructure.from(QueryStructure.java:127)
    at org.hibernate.query.criteria.internal.CriteriaQueryImpl.from(CriteriaQueryImpl.java:158)
    at br.com.hcf.HCFConnection.all(HCFConnection.java:139)
    at br.com.api.controls.CharacterControl.getAll(CharacterControl.java:19)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:832)

I found that in main works 100%, the problem and with the same spring.


19:26:33.039 [main] DEBUG org.hibernate.loader.plan.build.internal.FetchStyleLoadPlanBuildingAssociationVisitationStrategy - Building LoadPlan...
19:26:33.050 [main] DEBUG org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor - processing queryspace <gen:0>
19:26:33.054 [main] DEBUG org.hibernate.loader.plan.build.spi.LoadPlanTreePrinter - LoadPlan(entity=br.com.api.entities.Persona)
    - Returns
       - EntityReturnImpl(entity=br.com.api.entities.Persona, querySpaceUid=<gen:0>, path=br.com.api.entities.Persona)
    - QuerySpaces
       - EntityQuerySpaceImpl(uid=<gen:0>, entity=br.com.api.entities.Persona)
          - SQL table alias mapping - persona0_
          - alias suffix - 0_
          - suffixed key columns - {id1_0_0_}

19:26:33.056 [main] DEBUG org.hibernate.loader.entity.plan.EntityLoader - Static select for entity br.com.api.entities.Persona [NONE]: select persona0_.id as id1_0_0_, persona0_.description as descript2_0_0_, persona0_.modified as modified3_0_0_, persona0_.name as name4_0_0_, persona0_.resourceURI as resource5_0_0_ from Persona persona0_ where persona0_.id=?
19:26:33.102 [main] INFO org.hibernate.orm.connections.access - HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@52b959df] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.
19:26:33.124 [main] DEBUG org.hibernate.mapping.Table - No alter strings for table : Persona
19:26:33.125 [main] DEBUG org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator - No JtaPlatform was specified, checking resolver
19:26:33.126 [main] DEBUG org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformResolverInitiator - No JtaPlatformResolver was specified, using default [org.hibernate.engine.transaction.jta.platform.internal.StandardJtaPlatformResolver]
19:26:33.134 [main] DEBUG org.hibernate.engine.transaction.jta.platform.internal.StandardJtaPlatformResolver - Could not resolve JtaPlatform, using default [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
19:26:33.134 [main] INFO org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
19:26:33.135 [main] DEBUG org.hibernate.query.spi.NamedQueryRepository - Checking 0 named HQL queries
19:26:33.135 [main] DEBUG org.hibernate.query.spi.NamedQueryRepository - Checking 0 named SQL queries
19:26:33.151 [main] DEBUG org.hibernate.internal.SessionFactoryRegistry - Initializing SessionFactoryRegistry : org.hibernate.internal.SessionFactoryRegistry@2dd1086
19:26:33.153 [main] DEBUG org.hibernate.internal.SessionFactoryRegistry - Registering SessionFactory: ec49aefc-f7c7-4367-97a4-ab4156937eee (<unnamed>)
19:26:33.153 [main] DEBUG org.hibernate.internal.SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured
19:26:33.215 [main] DEBUG org.hibernate.stat.internal.StatisticsInitiator - Statistics initialized [enabled=false]
19:26:33.237 [main] DEBUG org.hibernate.query.criteria.internal.CriteriaQueryImpl - Rendered criteria query -> select generatedAlias0 from Persona as generatedAlias0
19:26:33.250 [main] DEBUG org.hibernate.hql.internal.QueryTranslatorFactoryInitiator - QueryTranslatorFactory: org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory@2c6c302f
19:26:33.273 [main] DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - parse() - HQL: select generatedAlias0 from br.com.api.entities.Persona as generatedAlias0
19:26:33.277 [main] DEBUG org.hibernate.hql.internal.ast.ErrorTracker - throwQueryException() : no errors
19:26:33.284 [main] DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - --- HQL AST ---
 \-[QUERY] Node: 'query'
    \-[SELECT_FROM] Node: 'SELECT_FROM'
       +-[FROM] Node: 'from'
       |  \-[RANGE] Node: 'RANGE'
       |     +-[DOT] Node: '.'
       |     |  +-[DOT] Node: '.'
       |     |  |  +-[DOT] Node: '.'
       |     |  |  |  +-[DOT] Node: '.'
       |     |  |  |  |  +-[IDENT] Node: 'br'
       |     |  |  |  |  \-[IDENT] Node: 'com'
       |     |  |  |  \-[IDENT] Node: 'api'
       |     |  |  \-[IDENT] Node: 'entities'
       |     |  \-[IDENT] Node: 'Persona'
       |     \-[ALIAS] Node: 'generatedAlias0'
       \-[SELECT] Node: 'select'
          \-[IDENT] Node: 'generatedAlias0'

19:26:33.301 [main] DEBUG org.hibernate.hql.internal.antlr.HqlSqlBaseWalker - select << begin [level=1, statement=select]
19:26:33.313 [main] DEBUG org.hibernate.hql.internal.ast.tree.FromElement - FromClause{level=1} : br.com.api.entities.Persona (generatedAlias0) -> persona0_
19:26:33.314 [main] DEBUG org.hibernate.hql.internal.ast.tree.FromReferenceNode - Resolved : generatedAlias0 -> persona0_.id
19:26:33.316 [main] DEBUG org.hibernate.hql.internal.antlr.HqlSqlBaseWalker - select : finishing up [level=1, statement=select]
19:26:33.316 [main] DEBUG org.hibernate.hql.internal.ast.HqlSqlWalker - processQuery() :  ( SELECT ( {select clause} persona0_.id ) ( FromClause{level=1} Persona persona0_ ) )
19:26:33.322 [main] DEBUG org.hibernate.hql.internal.ast.util.JoinProcessor - Tables referenced from query nodes:
 \-QueryNode
    +-SelectClause
    | referencedTables(entity Persona): [Persona]
    |  +-IdentNode
    |  | persister: SingleTableEntityPersister(br.com.api.entities.Persona)
    |  | originalText: generatedAlias0
    |  \-SqlFragment
    \-FromClause
       \-FromElement

19:26:33.325 [main] DEBUG org.hibernate.hql.internal.ast.util.JoinProcessor - Using FROM fragment [Persona persona0_]
19:26:33.325 [main] DEBUG org.hibernate.hql.internal.antlr.HqlSqlBaseWalker - select >> end [level=1, statement=select]
19:26:33.326 [main] DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - --- SQL AST ---
 \-[SELECT] QueryNode: 'SELECT'  querySpaces (Persona)
    +-[SELECT_CLAUSE] SelectClause: '{select clause}'
    |  +-[ALIAS_REF] IdentNode: 'persona0_.id as id1_0_' {alias=generatedAlias0, className=br.com.api.entities.Persona, tableAlias=persona0_}
    |  \-[SQL_TOKEN] SqlFragment: 'persona0_.description as descript2_0_, persona0_.modified as modified3_0_, persona0_.name as name4_0_, persona0_.resourceURI as resource5_0_'
    \-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[generatedAlias0], fromElementByTableAlias=[persona0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
       \-[FROM_FRAGMENT] FromElement: 'Persona persona0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=generatedAlias0,role=null,tableName=Persona,tableAlias=persona0_,origin=null,columns={,className=br.com.api.entities.Persona}}

19:26:33.326 [main] DEBUG org.hibernate.hql.internal.ast.ErrorTracker - throwQueryException() : no errors
19:26:33.331 [main] DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - HQL: select generatedAlias0 from br.com.api.entities.Persona as generatedAlias0
19:26:33.331 [main] DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - SQL: select persona0_.id as id1_0_, persona0_.description as descript2_0_, persona0_.modified as modified3_0_, persona0_.name as name4_0_, persona0_.resourceURI as resource5_0_ from Persona persona0_
19:26:33.331 [main] DEBUG org.hibernate.hql.internal.ast.ErrorTracker - throwQueryException() : no errors
19:26:33.344 [main] DEBUG org.hibernate.SQL - select persona0_.id as id1_0_, persona0_.description as descript2_0_, persona0_.modified as modified3_0_, persona0_.name as name4_0_, persona0_.resourceURI as resource5_0_ from Persona persona0_
19:26:33.348 [main] DEBUG org.hibernate.loader.Loader - Result set row: 0
19:26:33.351 [main] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[br.com.api.entities.Persona#1]
19:26:33.357 [main] DEBUG org.hibernate.loader.Loader - Result set row: 1
19:26:33.357 [main] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[br.com.api.entities.Persona#2]
19:26:33.357 [main] DEBUG org.hibernate.loader.Loader - Result set row: 2
19:26:33.357 [main] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[br.com.api.entities.Persona#3]
19:26:33.357 [main] DEBUG org.hibernate.loader.Loader - Result set row: 3
19:26:33.357 [main] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[br.com.api.entities.Persona#4]
19:26:33.359 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving attributes for [br.com.api.entities.Persona#1]
19:26:33.360 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `description` : value = Teste
19:26:33.360 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`description`)  - enhanced for lazy-loading? - false
19:26:33.360 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `modified` : value = null
19:26:33.361 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`modified`)  - enhanced for lazy-loading? - false
19:26:33.361 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `name` : value = T
19:26:33.361 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`name`)  - enhanced for lazy-loading? - false
19:26:33.361 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `resourceURI` : value = null
19:26:33.361 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`resourceURI`)  - enhanced for lazy-loading? - false
19:26:33.362 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [br.com.api.entities.Persona#1]
19:26:33.362 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving attributes for [br.com.api.entities.Persona#2]
19:26:33.362 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `description` : value = Teste
19:26:33.362 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`description`)  - enhanced for lazy-loading? - false
19:26:33.362 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `modified` : value = null
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`modified`)  - enhanced for lazy-loading? - false
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `name` : value = T
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`name`)  - enhanced for lazy-loading? - false
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `resourceURI` : value = null
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`resourceURI`)  - enhanced for lazy-loading? - false
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [br.com.api.entities.Persona#2]
19:26:33.363 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving attributes for [br.com.api.entities.Persona#3]
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `description` : value = Teste
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`description`)  - enhanced for lazy-loading? - false
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `modified` : value = null
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`modified`)  - enhanced for lazy-loading? - false
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `name` : value = T
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`name`)  - enhanced for lazy-loading? - false
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `resourceURI` : value = null
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`resourceURI`)  - enhanced for lazy-loading? - false
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [br.com.api.entities.Persona#3]
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving attributes for [br.com.api.entities.Persona#4]
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `description` : value = Teste
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`description`)  - enhanced for lazy-loading? - false
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `modified` : value = null
19:26:33.364 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`modified`)  - enhanced for lazy-loading? - false
19:26:33.365 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `name` : value = T
19:26:33.365 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`name`)  - enhanced for lazy-loading? - false
19:26:33.365 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Processing attribute `resourceURI` : value = null
19:26:33.365 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Attribute (`resourceURI`)  - enhanced for lazy-loading? - false
19:26:33.365 [main] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [br.com.api.entities.Persona#4]
19:26:33.368 [main] DEBUG org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl - Initiating JDBC connection release from afterTransaction
Persona [id=1, name=T, description=Teste, modified=null, resourceURI=null]
Persona [id=2, name=T, description=Teste, modified=null, resourceURI=null]
Persona [id=3, name=T, description=Teste, modified=null, resourceURI=null]
Persona [id=4, name=T, description=Teste, modified=null, resourceURI=null]

2 answers

0

Your application is probably missing a JAR. Try adding the library hibernate-jpa-2.1-api. Depending on the version of Hibernate this JAR is already included, just make sure.

  • Dependency <dependency> <groupid>org.hibernate.javax.persistence</groupid> <artifactId>Hibernate-jpa-2.1-api</artifactId> <version>1.0.2.Final</version> </dependency> .

0

Make sure that the Hibernate and Spring versions are compatible. If you can put the dependencies you are using into the project

Browser other questions tagged

You are not signed in. Login or sign up in order to post.