-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate2.1 and jdk1.3?
PostPosted: Sun Aug 22, 2004 9:11 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 5:08 am
Posts: 21
Hi guys!Im doing a web application using hibernate2.1, jdk1.3 and tomcat4.0.3 but Im getting an error.


Here's my java class

public class Material implements Serializable{
private String code = "";
private String description = "";
private String creUser = "";
private String modUser = "";
private Date creDate = null;
private Date modDate = null;
private char hw;
....
}


my xml mapping

<hibernate-mapping default-cascade="save-update">

<class name="vo.Material" table="eqp_material_types">
<id name="code">
<generator class="uuid.string"/>
</id>
<property name="description" length="60"/>
<property name="creUser" column="CREUSR" length="20"/>
<property name="modUser" column="MODUSR" length="20"/>
<property name="hw"/>
<property name="creDate"/>
<property name="creDate"/>
</class>
</hibernate-mapping>

when i try to load the class using the following code

try{
Configuration cfg = new Configuration()
.addClass(Material.class);
SessionFactory sf = cfg.buildSessionFactory();
Session session = sf.openSession();
Material material = (Material)session.load(vo.Material.class,"TSTSY");
System.out.println("Material is " + material.getCode());
}catch (Exception e) {
e.printStackTrace();
}

here's the error

java.lang.ExceptionInInitializerError: java.lang.NullPointerException
at java.util.HashMap.put(HashMap.java:327)
at net.sf.hibernate.type.TypeFactory.<clinit>(TypeFactory.java:50)
at net.sf.hibernate.util.ReflectHelper.reflectedPropertyType(ReflectHelper.java:70)
at net.sf.hibernate.mapping.SimpleValue.setTypeByReflection(SimpleValue.java:170)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:258)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1204)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:247)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:281)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:322)
at servlet.WebAppInit.init(WebAppInit.java:31)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2479)
at org.apache.catalina.loader.WebappContextNotifier.run(WebappLoader.java:1329)
at java.lang.Thread.run(Thread.java:484)

btw, im using oracle91 db.

thanks.


raymond


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 7:59 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Give more details about your Configuration object, your datasource...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 8:59 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 5:08 am
Posts: 21
As of the moment Im using the hibernate.property.


hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username equipment
hibernate.connection.password lifegoeson
hibernate.connection.url jdbc:oracle:thin:@mios29:1551:ORAT9


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.