Hello 1) I assume Userss is a typo: <class name="test.Userss" table="users">, your class appears to be test.User. 2 Check that the dtd "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> is for the Hibernate version you are using (this one is for 1.x ?) 2) Turn on debugging in Hibernate and verify that it: a) Can open your database connection b) Understands your mapping (hbm) file c) Check for cfg,hs,sf not being null in your add function in Class User. But I suppose you checked that the error message in the exception in this function is not printed. d) BTW, I do not know whether this should work; an instance of a class saving itself. In my case Hibernate gives a lot of debugging info in the Tomcat console. You cannot develop without that.
Regards Hugo Burm -----Original Message----- From: beyaNet Consultancy [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 4:18 AM To: [EMAIL PROTECTED] Subject: Cocoon -Hibernate problems part 2 hi, as a follow on to the first email, I am adding here some further information as to the installation procedure I followed: 1. copied xalan.jar, xercesImpl.jar, xml-apis.jar to TOMCAT_HOME/common/endorsed 2. created the following users table to my test database: CREATE TABLE "users" ( "LogonID" character varying(20) NOT NULL DEFAULT 0, "Name" character varying(40), "Password" character varying(20), "EmailAddress" character varying(40), "Lastlogon" date, CONSTRAINT "logkey" PRIMARY KEY ("LogonID") ) WITH OIDS; 3. User.class to TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/test 4. copied User.hbm.xml to TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/test: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> <hibernate-mapping> <class name="test.Userss" table="users"> <id name="ID" column="LogonId" type="string"> <generator class="assigned"/> </id> <property name="userName" column="Name" type="string"/> <property name="password" type="string"/> <property name="emailAddress" type="string"/> <property name="lastLogon" type="date"/> </class> </hibernate-mapping> 5. copied hibernate.properties to TOMCAT_HOME/webapps/cocoon/WEB-INF/classes: hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect hibernate.connection.driver_class=org.postgresql.Driver hibernate.connection.url=jdbc:postgresql://localhost:5432/test hibernate.connection.username=root hibernate.connection.password=m013644825 hibernate.query.substitutions='Y' hibernate.connection.pool_size=5 6. copied hibernate2.jar odmg.jar, j2ee.jar, jcs.jar, jdom.jar, junit.jar, connector.jar, commons-pool.jar, commons-dbcp.jar, commons-beanutils.jar, dom4j.jar, cglib.jar, c3p0.jar to TOMCAT_HOME/webapps/cocoon/WEB-INF/lib 7. http://localhost:8080/cocoon/userhomes/test username is written to the screen, but no data is written to the database. what is going on here? what have I missed? Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
