Brief Tutorial on getting Hibernate to work with Smartfox

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

starzero
Posts: 28
Joined: 19 Jun 2009, 18:41

Brief Tutorial on getting Hibernate to work with Smartfox

Postby starzero » 16 Oct 2009, 15:35

http://ideacandi.com/blogzero/?p=34

Feel free to comment.

Thanks!
User avatar
Lapo
Site Admin
Posts: 20217
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Oct 2009, 08:47

Thank you. I have made your post a sticky.
Lapo
--
gotoAndPlay()
...addicted to flash games
helloniklas
Posts: 21
Joined: 14 Sep 2009, 10:18
Location: London
Contact:

org.hibernate.MappingNotFoundException

Postby helloniklas » 26 Oct 2009, 16:17

Hey, I'm new the Java world, so sorry for newbie question.

I have Hibernate hooked up and trying a simple test.

I get this exception

Exception in ExtensionHandler: org.hibernate.MappingNotFoundException: resource: net/pubpals/data/user/User.hbm.xml not found

Exception type: org.hibernate.MappingNotFoundException
org.hibernate.MappingNotFoundException: resource: net/pubpals/data/user/User.hbm.xml not found


Basically, I have a class called User in it's package in javaExtensions together with the User.hbm.xml but somehow it seems it doesn't find the mapping file.

It does load the hibernate.cfg.xml in which I have
<mapping resource="net/pubpals/data/user/User.hbm.xml"/>

Am I not suposed to keep my DAO classes in the javaExtensions folder? Just as the other java code for the extensions?
helloniklas
Posts: 21
Joined: 14 Sep 2009, 10:18
Location: London
Contact:

Postby helloniklas » 26 Oct 2009, 16:56

Ok, I now got this working, very nice...

It seems I had to put my classes in

Server/mypackage...

Rather then in javaExtensions/

Which I guess is correct then?

Any guidelines from someone experienced on as where to put stuff would be much appreciated.
starzero
Posts: 28
Joined: 19 Jun 2009, 18:41

Postby starzero » 26 Oct 2009, 19:18

Hi,

In your wrapper.conf file you should have a classpath delcaration similar to wrapper.java.classpath.3=/opt/SFS_PRO_1.6.6/Server/javaExtensions/. If not, then place that line in your file (noting the classpath.# format and the full path to your extensions folder).

The way you have it now is fine, but if you want to further separate your extension code from the smartfox server resources, then you can specify any path you would like in your wrapper. The important thing is that it is accessible from your classpath.

paul

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 1 guest