GUJ
Notícias, artigos e o maior fórum brasileiro sobre Java
home
fórum
notícias
tópicos recentes
empregos
artigos
Bem-vindo ao GUJ.
Crie seu login
, ou digite-o para logar no site.
Usuário:
Senha:
Problemas com HIbernate e Persistence
Índice dos Fóruns
»
Desenvolvimento Web
Autor
Mensagem
20/02/2011 17:09:38
Assunto:
Problemas com HIbernate e Persistence
fer.ferreira6
JavaChild
Membro desde: 16/05/2010 14:31:09
Mensagens: 114
Localização: São Paulo
Offline
Boa Tarde Galera,
To com um problema muito chato e venho pedir a ajuda de vocês.
Uso o ubuntu 10.10 e netbeans 6.9.1.
Bom, o problema é o seguinte, sempre que tento usar algum serviço do hibernate ou persistence, apareçe o seguinte erro:
run: 20/02/2011 16:18:03 org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.1.GA 20/02/2011 16:18:03 org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.2.5 20/02/2011 16:18:03 org.hibernate.cfg.Environment <clinit> INFO: hibernate.properties not found 20/02/2011 16:18:03 org.hibernate.cfg.Environment buildBytecodeProvider INFO: Bytecode provider name : cglib 20/02/2011 16:18:03 org.hibernate.cfg.Environment <clinit> INFO: using JDK 1.4 java.sql.Timestamp handling 20/02/2011 16:18:03 org.hibernate.cfg.Configuration configure INFO: configuring from resource: /hibernate.cfg.xml 20/02/2011 16:18:03 org.hibernate.cfg.Configuration getConfigurationInputStream INFO: Configuration resource: /hibernate.cfg.xml 20/02/2011 16:18:03 org.hibernate.cfg.Configuration addResource INFO: Reading mappings from resource : appconvite/Convite.hbm.xml 20/02/2011 16:18:03 org.hibernate.cfg.Configuration doConfigure INFO: Configured SessionFactory: null 20/02/2011 16:18:03 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues INFO: Mapping class: appconvite.Convite -> convite 20/02/2011 16:18:03 org.hibernate.cfg.AnnotationConfiguration secondPassCompile INFO: Hibernate Validator not found: ignoring 20/02/2011 16:18:03 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Using Hibernate built-in connection pool (not for production use!) 20/02/2011 16:18:03 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Hibernate connection pool size: 20 20/02/2011 16:18:03 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: autocommit mode: false 20/02/2011 16:18:03 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/appconvite 20/02/2011 16:18:03 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: connection properties: {user=root, password=****} 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: RDBMS: MySQL, version: 5.1.49-1ubuntu8.1 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} ) 20/02/2011 16:18:03 org.hibernate.dialect.Dialect <init> INFO: Using dialect: org.hibernate.dialect.MySQLDialect 20/02/2011 16:18:03 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory INFO: Using default transaction strategy (direct JDBC transactions) 20/02/2011 16:18:03 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic flush during beforeCompletion(): disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic session close at end of transaction: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch size: 15 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch updates for versioned data: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Scrollable result sets: enabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC3 getGeneratedKeys(): enabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Connection release mode: auto 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Maximum outer join fetch depth: 2 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Default batch fetch size: 1 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Generate SQL with comments: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Order SQL updates by primary key: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Order SQL inserts for batching: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 20/02/2011 16:18:03 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> INFO: Using ASTQueryTranslatorFactory 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Query language substitutions: {} 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: JPA-QL strict compliance: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Second-level cache: enabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Query cache: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory createCacheProvider INFO: Cache provider: org.hibernate.cache.NoCacheProvider 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Optimize cache for minimal puts: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Structured second-level cache entries: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Statistics: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Deleted entity synthetic identifier rollback: disabled 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Default entity-mode: pojo 20/02/2011 16:18:03 org.hibernate.cfg.SettingsFactory buildSettings INFO: Named query checking : enabled 20/02/2011 16:18:04 org.hibernate.impl.SessionFactoryImpl <init> INFO: building session factory 20/02/2011 16:18:04 org.hibernate.impl.SessionFactoryObjectFactory addInstance INFO: Not binding factory to JNDI, no JNDI name configured Exception in thread "main" org.hibernate.HibernateException: No CurrentSessionContext configured! at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:542) at appconvite.Main.main(Main.java:24) Java Result: 1 CONSTRUÍDO COM SUCESSO (tempo total: 1 segundo)
Alguêm sabe o que pode ser esse erro, e como resolver?
Valeu pela atenção.
20/02/2011 22:12:53
Assunto:
Re:Problemas com HIbernate e Persistence
dbenedit
What is classpath?
Membro desde: 28/11/2010 04:24:52
Mensagens: 5
Offline
Olá !!!
No seu hibernate.cgf.xml vc tem esta propriedade? Caso nao tenha...acredito que irá funcionar... já tive este mesmo problema e resolvi colocando esta propiedade..
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
Até mais
06/02/2012 20:34:04
Assunto:
Re:Problemas com HIbernate e Persistence
brunoconte
Entusiasta Java
Membro desde: 18/12/2009 09:51:23
Mensagens: 15
Offline
Cara obrigado eu tava com esse problema e coloquei essa propriedade..
veleuu....
abraçosss
Analista e Desenvolvedor Java
Índice dos Fóruns
»
Desenvolvimento Web
Ir para:
Selecione um Fórum
Notícias
Assuntos gerais (Off-topic)
MundoJ - Artigos, Notícias e Debates
Artigos e Tutoriais
Java Básico
Java Avançado
Ferramentas, Frameworks e Utilitários
Desenvolvimento Web
Interface Gráfica
Google Android e Java Micro Edition (ME)
Certificação Java
Persistência: Hibernate, JPA, JDBC e outros
Java Enterprise Edition (Java EE)
Frameworks e Bibliotecas brasileiros
RIA - Flex, JavaFX e outros
Arquitetura de Sistemas
Metodologias de Desenvolvimento e Testes de Software
JavaScript
Ruby & Ruby on Rails
Outras Linguagens
Powered by
JForum 2.1.8
©
JForum Team