http://ideacandi.com/blogzero/?p=34
Feel free to comment.
Thanks!
Brief Tutorial on getting Hibernate to work with Smartfox
-
- Posts: 21
- Joined: 14 Sep 2009, 10:18
- Location: London
- Contact:
org.hibernate.MappingNotFoundException
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?
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?
-
- Posts: 21
- Joined: 14 Sep 2009, 10:18
- Location: London
- Contact:
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
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 25 guests