-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: NPE in the eg example and tutorial
PostPosted: Fri Sep 29, 2006 7:39 pm 
Newbie

Joined: Fri Sep 29, 2006 6:35 pm
Posts: 6
Hi,

I'm brand new to hibernate and thought I'd jump in with the tutorial and the "eg" example bundled with the hibernate download.

I worked my way through much of the tutorial without incident, but when I got to the part where one associates a Person with an Event I encountered a NPE. Here's the stack trace:

[java] Exception in thread "main" java.lang.NullPointerException
[java] at java.lang.Object.getClass (libgcj.so.7)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.createProxy (AbstractEntityTuplizer.java:372)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.createProxy (AbstractEntityPersister.java:3121)
[java] at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary (DefaultLoadEventListener.java:232)
[java] at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad (DefaultLoadEventListener.java:173)
[java] at org.hibernate.event.def.DefaultLoadEventListener.onLoad (DefaultLoadEventListener.java:87)
[java] at org.hibernate.impl.SessionImpl.fireLoad (SessionImpl.java:861)
[java] at org.hibernate.impl.SessionImpl.load (SessionImpl.java:782)
[java] at org.hibernate.impl.SessionImpl.load (SessionImpl.java:774)
[java] at java.lang.reflect.Method.invoke (libgcj.so.7)
[java] at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke (ThreadLocalSessionContext.java:301)
[java] at $Proxy0.load (Unknown Source)
[java] at events.EventManager.addPersonToEvent (EventManager.java:102)
[java] at events.EventManager.main (EventManager.java:32)

After troubleshooting this for a while I decided to shelve it for the time being and work on the example bundled with the download ("eg"). I followed the instructions in the readme.txt ...

Get Up And Running Quick
------------------------
Demo:

(1) copy your JDBC driver to the lib directory
[created link: lib/hsqldb.jar -> /opt/hsqldb/lib/hsqldb.jar]
(2) edit etc/hibernate.properties
[Nothing to do that I could fathom ... already set to use HSQL, AFAICT]
(3) run "ant eg" or "build eg"
[OK, here goes with "ant eg". Whoops, another NPE.]
(4) browse the sourcecode in eg/org/hibernate/auction
[Did not illuminate the problem.]

The full ant output is below. I apologize for the voluminous output, but I don't want to overlook something significant due to newbie ingorance.

The NPE is quite similar to the one I encountered with the tutorial. The top 7 lines are identical, starting with

[java] at java.lang.Object.getClass (libgcj.so.7)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.createProxy (AbstractEntityTuplizer.java:372)

I'm wondering if there is a version incompatibility issue. I'm running on Fedora 5, which has libgcj 4.1.1. I've searched the hibernate FAQs, this Forum, and other docs for info on this and not turned up anything yet.

$ java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.0 20060304 (Red Hat 4.1.0-3)

The hibernate doc says version 3.x requires java 1.4, so I should be OK, but that pesky NPE implies otherwise.

Any thoughts?

Thanks!!

Hibernate version: 3.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs: see below

Name and version of the database you are using: HSQLDB 1.7.3 rev 2

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

=== ant output ===

Buildfile: build.xml
Trying to override old definition of datatype splash
[taskdef] Could not load definitions from resource checkstyletask.properties. It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[echo] remember to place your JDBC driver in the lib directory
[java] 15:56:33,288 INFO Environment:481 - Hibernate 3.1.3
[java] 15:56:33,458 INFO Environment:495 - loaded properties from resource hibernate.properties: {hibernate.connection.username=sa
, hibernate.proxool.pool_alias=pool1, hibernate.query.substitutions=yes 'Y', no 'N', hibernate.connection.driver_class=org.hsqldb.jdbcDr
iver, hibernate.cglib.use_reflection_optimizer=true, hibernate.jdbc.use_streams_for_binary=true, hibernate.dialect=org.hibernate.dialect
.HSQLDialect, hibernate.max_fetch_depth=1, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.format_s
ql=true, hibernate.connection.pool_size=1, hibernate.connection.url=jdbc:hsqldb:., hibernate.jdbc.batch_versioned_data=true, hibernate.c
onnection.password=****, hibernate.cache.region_prefix=hibernate.test}
[java] 15:56:33,604 INFO Environment:525 - using java.io streams to persist binary types
[java] 15:56:33,752 INFO Environment:529 - using CGLIB reflection optimizer
[java] 15:56:33,898 INFO Environment:555 - using JDK 1.4 java.sql.Timestamp handling
[java] 15:56:34,583 INFO Configuration:498 - Reading mappings from resource: org/hibernate/auction/AuctionItem.hbm.xml
[java] 15:56:37,068 INFO HbmBinder:315 - Mapping class: org.hibernate.auction.AuctionItem -> AuctionItem
[java] 15:56:37,720 INFO Configuration:498 - Reading mappings from resource: org/hibernate/auction/Bid.hbm.xml
[java] 15:56:38,138 INFO HbmBinder:315 - Mapping class: org.hibernate.auction.Bid -> Bid
[java] 15:56:38,450 INFO HbmBinder:830 - Mapping subclass: org.hibernate.auction.BuyNow -> Bid
[java] 15:56:38,453 INFO Configuration:498 - Reading mappings from resource: org/hibernate/auction/User.hbm.xml
[java] 15:56:38,884 INFO HbmBinder:315 - Mapping class: org.hibernate.auction.User -> AuctionUser
[java] 15:56:38,918 INFO HbmBinder:2356 - Mapping collection: org.hibernate.auction.AuctionItem.bids -> Bid
[java] 15:56:38,924 INFO HbmBinder:2356 - Mapping collection: org.hibernate.auction.User.bids -> Bid
[java] 15:56:38,927 INFO HbmBinder:2356 - Mapping collection: org.hibernate.auction.User.auctions -> AuctionItem
[java] 15:56:39,827 INFO DriverManagerConnectionProvider:42 - Using Hibernate built-in connection pool (not for production use!)
[java] 15:56:39,829 INFO DriverManagerConnectionProvider:44 - Hibernate connection pool size: 1
[java] 15:56:39,831 INFO DriverManagerConnectionProvider:47 - autocommit mode: false
[java] 15:56:39,849 INFO DriverManagerConnectionProvider:82 - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:.
[java] 15:56:39,851 INFO DriverManagerConnectionProvider:89 - connection properties: {user=sa, password=****}
[java] 15:56:41,007 INFO SettingsFactory:78 - RDBMS: HSQL Database Engine, version: 1.7.3
[java] 15:56:41,009 INFO SettingsFactory:80 - JDBC driver: HSQL Database Engine Driver, version: 1.7.3
[java] 15:56:41,111 INFO Dialect:104 - Using dialect: org.hibernate.dialect.HSQLDialect
[java] 15:56:41,288 INFO TransactionFactoryFactory:32 - Using default transaction strategy (direct JDBC transactions)
[java] 15:56:41,304 INFO TransactionManagerLookupFactory:34 - No TransactionManagerLookup configured (in JTA environment, use of r
ead-write or transactional second-level cache is not recommended)
[java] 15:56:41,305 INFO SettingsFactory:126 - Automatic flush during beforeCompletion(): disabled
[java] 15:56:41,307 INFO SettingsFactory:130 - Automatic session close at end of transaction: disabled
[java] 15:56:41,308 INFO SettingsFactory:137 - JDBC batch size: 15
[java] 15:56:41,310 INFO SettingsFactory:140 - JDBC batch updates for versioned data: enabled
[java] 15:56:41,323 INFO SettingsFactory:145 - Scrollable result sets: enabled
[java] 15:56:41,325 INFO SettingsFactory:153 - JDBC3 getGeneratedKeys(): disabled
[java] 15:56:41,327 INFO SettingsFactory:162 - Connection release mode: auto
[java] 15:56:41,332 INFO SettingsFactory:185 - Maximum outer join fetch depth: 1
[java] 15:56:41,334 INFO SettingsFactory:188 - Default batch fetch size: 1
[java] 15:56:41,335 INFO SettingsFactory:192 - Generate SQL with comments: disabled
[java] 15:56:41,337 INFO SettingsFactory:196 - Order SQL updates by primary key: disabled
[java] 15:56:41,338 INFO SettingsFactory:340 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[java] 15:56:41,358 INFO ASTQueryTranslatorFactory:25 - Using ASTQueryTranslatorFactory
[java] 15:56:41,508 INFO SettingsFactory:204 - Query language substitutions: {no='N', yes='Y'}
[java] 15:56:41,509 INFO SettingsFactory:210 - Second-level cache: enabled
[java] 15:56:41,511 INFO SettingsFactory:214 - Query cache: disabled
[java] 15:56:41,512 INFO SettingsFactory:327 - Cache provider: org.hibernate.cache.HashtableCacheProvider
[java] 15:56:41,552 INFO SettingsFactory:229 - Optimize cache for minimal puts: disabled
[java] 15:56:41,554 INFO SettingsFactory:234 - Cache region prefix: hibernate.test
[java] 15:56:41,556 INFO SettingsFactory:238 - Structured second-level cache entries: disabled
[java] 15:56:41,588 INFO SettingsFactory:265 - Statistics: disabled
[java] 15:56:41,590 INFO SettingsFactory:269 - Deleted entity synthetic identifier rollback: disabled
[java] 15:56:41,592 INFO SettingsFactory:284 - Default entity-mode: pojo
[java] 15:56:41,857 INFO SessionFactoryImpl:156 - building session factory
[java] 15:56:42,372 ERROR BasicLazyInitializer:132 - CGLIB Enhancement failed: org.hibernate.auction.BuyNow
[java] java.lang.NoClassDefFoundError: net.sf.cglib.core.DebuggingClassWriter$1
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at net.sf.cglib.core.DebuggingClassWriter.toByteArray (DebuggingClassWriter.java:73)
[java] at net.sf.cglib.core.DefaultGeneratorStrategy.generate (DefaultGeneratorStrategy.java:26)
[java] at net.sf.cglib.core.AbstractClassGenerator.create (AbstractClassGenerator.java:216)
[java] at net.sf.cglib.core.KeyFactory$Generator.create (KeyFactory.java:145)
[java] at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:117)
[java] at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:108)
[java] at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:104)
[java] at net.sf.cglib.proxy.Enhancer.<clinit> (Enhancer.java:69)
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)

[java] 15:56:42,550 WARN PojoEntityTuplizer:174 - could not create proxy factory for:org.hibernate.auction.BuyNow
[java] org.hibernate.HibernateException: CGLIB Enhancement failed: org.hibernate.auction.BuyNow
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:132)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)
[java] Caused by: java.lang.NoClassDefFoundError: net.sf.cglib.core.DebuggingClassWriter$1
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at net.sf.cglib.core.DebuggingClassWriter.toByteArray (DebuggingClassWriter.java:73)
[java] at net.sf.cglib.core.DefaultGeneratorStrategy.generate (DefaultGeneratorStrategy.java:26)
[java] at net.sf.cglib.core.AbstractClassGenerator.create (AbstractClassGenerator.java:216)
[java] at net.sf.cglib.core.KeyFactory$Generator.create (KeyFactory.java:145)
[java] at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:117)
[java] at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:108)
[java] at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:104)
[java] at net.sf.cglib.proxy.Enhancer.<clinit> (Enhancer.java:69)
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] ...12 more

[java] 15:56:42,657 ERROR BasicLazyInitializer:132 - CGLIB Enhancement failed: org.hibernate.auction.Bid
[java] java.lang.NoClassDefFoundError: net.sf.cglib.proxy.Enhancer
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)

[java] 15:56:42,807 WARN PojoEntityTuplizer:174 - could not create proxy factory for:org.hibernate.auction.Bid
[java] org.hibernate.HibernateException: CGLIB Enhancement failed: org.hibernate.auction.Bid
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:132)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)
[java] Caused by: java.lang.NoClassDefFoundError: net.sf.cglib.proxy.Enhancer
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] ...12 more

[java] 15:56:42,868 ERROR BasicLazyInitializer:132 - CGLIB Enhancement failed: org.hibernate.auction.AuctionItem
[java] java.lang.NoClassDefFoundError: net.sf.cglib.proxy.Enhancer
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)

[java] 15:56:43,131 WARN PojoEntityTuplizer:174 - could not create proxy factory for:org.hibernate.auction.AuctionItem
[java] org.hibernate.HibernateException: CGLIB Enhancement failed: org.hibernate.auction.AuctionItem
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:132)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)
[java] Caused by: java.lang.NoClassDefFoundError: net.sf.cglib.proxy.Enhancer
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] ...12 more

[java] 15:56:43,174 ERROR BasicLazyInitializer:132 - CGLIB Enhancement failed: org.hibernate.auction.User
[java] java.lang.NoClassDefFoundError: net.sf.cglib.proxy.Enhancer
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)

[java] 15:56:43,322 WARN PojoEntityTuplizer:174 - could not create proxy factory for:org.hibernate.auction.User
[java] org.hibernate.HibernateException: CGLIB Enhancement failed: org.hibernate.auction.User
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:132)
[java] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate (CGLIBProxyFactory.java:41)
[java] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory (PojoEntityTuplizer.java:175)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.<init> (AbstractEntityTuplizer.java:131)
[java] at org.hibernate.tuple.PojoEntityTuplizer.<init> (PojoEntityTuplizer.java:50)
[java] at org.hibernate.tuple.TuplizerLookup.create (TuplizerLookup.java:64)
[java] at org.hibernate.tuple.EntityMetamodel.<init> (EntityMetamodel.java:257)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init> (AbstractEntityPersister.java:412)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init> (SingleTableEntityPersister.java:78)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister (PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init> (SessionFactoryImpl.java:216)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1176)
[java] at org.hibernate.auction.Main.main (Main.java:368)
[java] Caused by: java.lang.NoClassDefFoundError: net.sf.cglib.proxy.Enhancer
[java] at java.lang.Class.initializeClass (libgcj.so.7)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory (CGLIBLazyInitializer.java:116)
[java] ...12 more

[java] 15:56:43,875 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
[java] 15:56:43,912 INFO SchemaExport:154 - Running hbm2ddl schema export
[java] 15:56:43,916 DEBUG SchemaExport:171 - import file not found: /import.sql
[java] 15:56:43,917 INFO SchemaExport:178 - exporting generated schema to database
[java] 15:56:43,925 DEBUG SchemaExport:302 -
[java] alter table AuctionItem
[java] drop constraint FK522A9BD6F65B1FAF
[java] 15:56:43,935 DEBUG SchemaExport:287 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD6F65B1FAF
[java] 15:56:43,936 DEBUG SchemaExport:280 - Table not found: AUCTIONITEM in statement [alter table AuctionItem]
[java] 15:56:43,938 DEBUG SchemaExport:302 -
[java] alter table AuctionItem
[java] drop constraint FK522A9BD61107FE9B
[java] 15:56:43,942 DEBUG SchemaExport:287 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD61107FE9B
[java] 15:56:43,944 DEBUG SchemaExport:280 - Table not found: AUCTIONITEM in statement [alter table AuctionItem]
[java] 15:56:43,945 DEBUG SchemaExport:302 -
[java] alter table Bid
[java] drop constraint FK104DDEE6E7E98
[java] 15:56:43,950 DEBUG SchemaExport:287 - Unsuccessful: alter table Bid drop constraint FK104DDEE6E7E98
[java] 15:56:43,951 DEBUG SchemaExport:280 - Table not found: BID in statement [alter table Bid]
[java] 15:56:43,953 DEBUG SchemaExport:302 -
[java] alter table Bid
[java] drop constraint FK104DDF43A3910
[java] 15:56:43,958 DEBUG SchemaExport:287 - Unsuccessful: alter table Bid drop constraint FK104DDF43A3910
[java] 15:56:43,959 DEBUG SchemaExport:280 - Table not found: BID in statement [alter table Bid]
[java] 15:56:44,168 DEBUG SchemaExport:302 -
[java] drop table AuctionItem if exists
[java] 15:56:44,171 DEBUG SchemaExport:302 -
[java] drop table AuctionUser if exists
[java] 15:56:44,173 DEBUG SchemaExport:302 -
[java] drop table Bid if exists
[java] 15:56:44,175 DEBUG SchemaExport:302 -
[java] create table AuctionItem (
[java] id bigint generated by default as identity (start with 1),
[java] seller bigint not null,
[java] shortDescription varchar(200) not null,
[java] description varchar(1000),
[java] ends timestamp,
[java] "CONDITION" integer,
[java] successfulBid bigint,
[java] primary key (id),
[java] unique (seller, shortDescription)
[java] )
[java] 15:56:44,237 DEBUG SchemaExport:302 -
[java] create table AuctionUser (
[java] id bigint generated by default as identity (start with 1),
[java] userName varchar(10) not null,
[java] "password" varchar(15) not null,
[java] email varchar(255),
[java] firstName varchar(50) not null,
[java] "initial" char(1),
[java] lastName varchar(50) not null,
[java] primary key (id),
[java] unique (userName)
[java] )
[java] 15:56:44,243 DEBUG SchemaExport:302 -
[java] create table Bid (
[java] id bigint generated by default as identity (start with 1),
[java] isBuyNow char(1) not null,
[java] item bigint not null,
[java] amount float not null,
[java] "datetime" timestamp not null,
[java] bidder bigint not null,
[java] primary key (id),
[java] unique (item, amount)
[java] )
[java] 15:56:44,249 DEBUG SchemaExport:302 -
[java] alter table AuctionItem
[java] add constraint FK522A9BD6F65B1FAF
[java] foreign key (successfulBid)
[java] references Bid
[java] 15:56:44,253 DEBUG SchemaExport:302 -
[java] alter table AuctionItem
[java] add constraint FK522A9BD61107FE9B
[java] foreign key (seller)
[java] references AuctionUser
[java] 15:56:44,256 DEBUG SchemaExport:302 -
[java] alter table Bid
[java] add constraint FK104DDEE6E7E98
[java] foreign key (item)
[java] references AuctionItem
[java] 15:56:44,259 DEBUG SchemaExport:302 -
[java] alter table Bid
[java] add constraint FK104DDF43A3910
[java] foreign key (bidder)
[java] references AuctionUser
[java] 15:56:44,262 INFO SchemaExport:196 - schema export complete
[java] Setting up some test data
[java] Viewing all auction item objects
[java] Exception in thread "main" java.lang.NullPointerException
[java] at java.lang.Object.getClass (libgcj.so.7)
[java] at org.hibernate.tuple.AbstractEntityTuplizer.createProxy (AbstractEntityTuplizer.java:372)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.createProxy (AbstractEntityPersister.java:3121)
[java] at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary (DefaultLoadEventListener.java:232)
[java] at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad (DefaultLoadEventListener.java:173)
[java] at org.hibernate.event.def.DefaultLoadEventListener.onLoad (DefaultLoadEventListener.java:87)
[java] at org.hibernate.impl.SessionImpl.fireLoad (SessionImpl.java:861)
[java] at org.hibernate.impl.SessionImpl.internalLoad (SessionImpl.java:831)
[java] at org.hibernate.type.EntityType.resolveIdentifier (EntityType.java:266)
[java] at org.hibernate.type.EntityType.resolve (EntityType.java:303)
[java] at org.hibernate.engine.TwoPhaseLoad.initializeEntity (TwoPhaseLoad.java:116)
[java] at org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:841)
[java] at org.hibernate.loader.Loader.doQuery (Loader.java:719)
[java] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections (Loader.java:224)
[java] at org.hibernate.loader.Loader.doList (Loader.java:2145)
[java] at org.hibernate.loader.Loader.listIgnoreQueryCache (Loader.java:2029)
[java] at org.hibernate.loader.Loader.list (Loader.java:2024)
[java] at org.hibernate.loader.hql.QueryLoader.list (QueryLoader.java:375)
[java] at org.hibernate.hql.ast.QueryTranslatorImpl.list (QueryTranslatorImpl.java:308)
[java] at org.hibernate.engine.query.HQLQueryPlan.performList (HQLQueryPlan.java:153)
[java] at org.hibernate.impl.SessionImpl.list (SessionImpl.java:1106)
[java] at org.hibernate.impl.QueryImpl.list (QueryImpl.java:79)
[java] at org.hibernate.auction.Main.viewAllAuctionsSlow (Main.java:87)
[java] at org.hibernate.auction.Main.main (Main.java:373)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 01, 2006 12:08 am 
Regular
Regular

Joined: Tue Sep 26, 2006 11:37 am
Posts: 115
Location: Sacramento, CA
It looks like some cglib classes cannot be located. You can try re-downloading. Also make sure that you do not have more than one version in your class path.

I hope this helps :)

Marius


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 01, 2006 5:09 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Quote:
$ java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.0 20060304 (Red Hat 4.1.0-3)


http://java.sun.com/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 12:07 am 
Regular
Regular

Joined: Tue Sep 26, 2006 11:37 am
Posts: 115
Location: Sacramento, CA
Thanks Christian ... I did not notice the incompatible java version ... :-|


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.