Thursday, November 13, 2008

I am running oracle 10 xe and one of my users complained of error ORA-01652.

As all my tablespaces were more or less full I found the following command useful:
alter tablespace temp add tempfile 'C:\ORACLEXE\ORADATA\XE\TEMP1.DBF' SIZE 500M
using a different path.

I found this and much more helpful info on this page

Friday, July 25, 2008

Could not instantiate bean class Is it an abstract class?

Ran into an interesting error this afternoon. I have a base class which is abstract and when i deployed my app I received the above error.

The fix is simple add abstract=”true” to your bean defination:

Hey Presto!

Spring Hibernate hbm2ddl.auto & Annotations

Spent Yesterday and today drawing up a schema for www.justcars.ie Ireland’s newest and hottest place to source your car.

To create this schema I wanted to get hibernate generate it via the POJOs I create. I am using annotations. So here is what i did:

Step One:

Create the POJO:

@Entity
public class Manufacteur {

@Id
private Integer manufacteurlId;

…..

}

Make sure you import javax.persistence.*; & not the more intuitive sounding hibernate one .

Step Two:

I am using a hibernate.cfg.xml for neatness:



org.gjt.mm.mysql.Driver
yourPassword
jdbc:mysql://localhost:3306/YourScehma
YourUsername
jYourScehma
org.hibernate.dialect.MySQL5Dialect
true
true
create-drop



Change the pieces in bold as appropriate.

Step Three servlet:

Ensure your session factory bean if you are using annotations is using the AnnotationSession otherwise you will get an “Annotation Instance required ” exception.

Point the session factory to your hibernate.cfg.xml

/WEB-INF/hibernate.cfg.xml
true

Step Four:

Depoly & hey Presto hibernate is creating your schema! :)