| Autor |
Mensagem |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 01/10/2004 18:42:59
|
felipesp
Debugger
![[Avatar]](/images/avatar/c9efe5f26cd17ba6216bbe2a7d26d490.jpg)
Membro desde: 14/04/2004 14:16:52
Mensagens: 69
Localização: São Paulo
Offline
|
Olá,
Estou implementando um aplicativo 3 camadas (dados, negocio, aplicacao) e estou configurando o hibernate 2 para fazer a consistência de dados. Com sou novo com hibernate surgiu um problema que nao sei resolver.
Na main class do meu projeto eu inicio o HibernateUtil que copiei da referencia do hibernate. (http://technology.amis.nl/blog/index.php?p=137)
static br.gov.sp.al.chinchilla.dados.HibernateUtil hibernate4Chinchilla =
new br.gov.sp.al.chinchilla.dados.HibernateUtil();
Ele inicia o factory numa boa, mapeia o driver para oracle 9i, carrega o hbm do meu bean, tudo normal. Se eu não chamar um session o programa roda perfeitamente, mas quando chamo o session ele levanta o seguinte erro:
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:313)
Já tive vários outros grilos no meu código, mas este estou com dificuldades de resolver. A maioria se relacionava a dependencias que precisavam ser mapeadas no projeto. Se alguém tiver uma idéia eu agradesço.
PS: estou usando o JBuilder X, compilando com o java 1.3. O bd é oracle 9i. Segue os erros:
01/10/2004 18:44:05 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.6
01/10/2004 18:44:05 net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.username=rh, hibernate.connection.password=***, hibernate.cglib.use_reflection_optimizer=true, hibernate.connection.url=jdbc:oracle:thin:@alsrv101.al.sp.gov.br:1575:workflow, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver}
01/10/2004 18:44:05 net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
01/10/2004 18:44:05 net.sf.hibernate.cfg.Configuration configure
INFO: configuring from resource: /chinchilla.cfg.xml
01/10/2004 18:44:05 net.sf.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /chinchilla.cfg.xml
01/10/2004 18:44:05 net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: br/gov/sp/al/chinchilla/dados/expediente.hbm.xml
01/10/2004 18:44:06 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: br.gov.sp.al.chinchilla.dados.expediente -> expediente
01/10/2004 18:44:06 net.sf.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
01/10/2004 18:44:06 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
01/10/2004 18:44:06 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
01/10/2004 18:44:06 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
01/10/2004 18:44:06 net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.Oracle9Dialect
01/10/2004 18:44:06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: true
01/10/2004 18:44:06 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
01/10/2004 18:44:06 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
01/10/2004 18:44:06 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@alsrv101.al.sp.gov.br:1575:workflow
01/10/2004 18:44:06 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=rh, password=***}
01/10/2004 18:44:06 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
01/10/2004 18:44:08 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
01/10/2004 18:44:08 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
01/10/2004 18:44:08 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
01/10/2004 18:44:09 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
01/10/2004 18:44:09 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
01/10/2004 18:44:09 net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
01/10/2004 18:44:09 net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
01/10/2004 18:44:10 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:313)
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:326)
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:334)
at br.gov.sp.al.chinchilla.dados.HibernateUtil.currentSession(HibernateUtil.java:30)
at br.gov.sp.al.chinchilla.aplicacao.sistemaRH.initHibernate(sistemaRH.java:50)
at br.gov.sp.al.chinchilla.aplicacao.sistemaRH.<init>(sistemaRH.java:21)
at br.gov.sp.al.chinchilla.aplicacao.sistemaRH.main(sistemaRH.java:69)
Exception in thread "main"
|
Felipe S. Gomes
phillmelon@gmail.com
http://felipe.blog.br/ |
|
|
 |
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 01/10/2004 20:06:45
|
ricardolecheta
GUJ Master
![[Avatar]](/images/avatar/b59c67bf196a4758191e42f76670ceba.jpg)
Membro desde: 17/05/2003 13:42:10
Mensagens: 1486
Localização: Curitiba
Offline
|
felipesp wrote:java.lang.NoClassDefFoundError: javax/transaction/Synchronization
|
Ricardo R. Lecheta
Livro - Google Android (português)
http://www.livroandroid.com.br/
http://livroandroid.blogspot.com/
http://www.livetouch.com.br/ |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 04/10/2004 09:36:30
|
Filipe Sabella
GUJ Expert
Membro desde: 12/03/2003 11:25:57
Mensagens: 4680
Offline
|
Como o lecheta frisou, este erro indica que seu sistema tentou acessar uma classe, mas não a encontrou. Portanto, coloque esse jar no classpath da sua aplicação
|
Former LIPE. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 08/10/2004 19:21:17
|
felipesp
Debugger
![[Avatar]](/images/avatar/c9efe5f26cd17ba6216bbe2a7d26d490.jpg)
Membro desde: 14/04/2004 14:16:52
Mensagens: 69
Localização: São Paulo
Offline
|
Obrigado pela ajuda.
Na verdade eu estava olhando cada erro e mapeando cada um dos pacotes jar do hibernate 2. Estava fazendo assim para ter um controle maior sobre os pacotes que estava utilizando, mas o erro que eu postei aqui não deu para identificar o pacote 'faltante'.
Mapeei todo o diretório no projeto e tudo rodou bem.
Mais uma vez obrigado.
|
Felipe S. Gomes
phillmelon@gmail.com
http://felipe.blog.br/ |
|
|
 |
|
|