ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Hibernate help

yuanbohan
16 Mar 2010 06:26:01 GMT
16 Mar 2010 06:26:01 GMT

I want to integrate hibernate 3.2 to ZK, but when I import necessary jars to the WEB-INF/lib directory, I find that there are commons-collections.jar and commons-logging.jar existed in that directory. The versions I import are commons-collections-2.1.1.jar and commons-logging-1.0.4.jar. I want to know which one I should keep in the directory? The purpose is to integrate Hibernate3.2 successfully.
Thanks a lot for help. ^_^

lazzha
16 Mar 2010 16:31:39 GMT
16 Mar 2010 16:31:39 GMT

Use the collections-21.1 and logging-1.04, I've been using them withzk+hibernate+spring and there's no problem :D

Cheers

yuanbohan
18 Mar 2010 07:33:13 GMT
18 Mar 2010 07:33:13 GMT

Hi lazzha,

thanks for your help. Now I am trying to integrate hibernate and spring to ZK, you know I am a newer for it, I encounter problems. I want to know if it is ok for you to tell me where to put the ApplicationContext.xml to the right folder? and what should I add to the web.xml? When I run my test.zul to test if I have integrated hibernate and spring successfully to ZK, it always tells me that it can not find the ApplicationContext.xml. My God!!! help me... !!!

danielgoodwin
18 Mar 2010 07:37:37 GMT
18 Mar 2010 07:37:37 GMT

Might be worthwhile taking a look at the excellent zksample2 demo app which uses hibernate/spring etc and is an excellent reference application for many other constructs as well
It is a complete working app which IMO is better than some of the small talks on ZK with Spring / Hibernate

Quick search of zksample2 in forums should send you on right path - project itself comes with excellent documentation.

techvts
18 Mar 2010 07:39:31 GMT
18 Mar 2010 07:39:31 GMT

if u want to integrate spring and hibernate in zk first create project using DB form Builder it takes all necessary jars for sring-hibernate-ZK integration it itself creates application-context.xml in src/config folder u can further modify u r application-context.xml according to u r need.and


2nd solution plz see that u have given below configuration in web.xml may be that's why application-context.xml is mot found

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/config/application-context.xml,classpath:/config/datasource-context.xml</param-value>
</context-param>

terrytornadoTop Contributor
18 Mar 2010 08:42:55 GMT
18 Mar 2010 08:42:55 GMT

No one knows what buld system you use??? If your projects is created as 'default' Eclipse Web project build with ant or asa Maven project.
So the folder structur can be difficult. You can play with following:


	<!-- ====================================================== -->
	<!--                  CONFIGURATION FILES                   -->
	<!-- ====================================================== -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			classpath:applicationContext.xml
 OR 
			/WEB-INF/applicationContext.xml
		</param-value>
	</context-param>

a look in your exported war-file can be helpful to see where your configuration file is stored.

best
Stephan

yuanbohan
18 Mar 2010 09:57:04 GMT
18 Mar 2010 09:57:04 GMT

hi danielgoodwin, I have use svn to download the zksample2, but the hierarchy is so complex and ... I am not familiar with svn, I can not know anything from that project. Can you just pack it and send it to me ? My email is: wukong_1988@yahoo.com.cn . Thanks a lot. I want to integrate zk with spring and hibernate, my god, difficult for me now!!!! help me ...

yuanbohan
18 Mar 2010 09:59:16 GMT
18 Mar 2010 09:59:16 GMT

hi techvts,

from what you said "f u want to integrate spring and hibernate in zk first create project using DB form Builder it takes all necessary jars for sring-hibernate-ZK integration it itself creates application-context.xml in src/config folder u can further modify u r application-context.xml according to u r need", can you give me some advice how to use DB form builder? and how to get it? some links or advice, vedio. Thank you very much for offering me your help.

yuanbohan
18 Mar 2010 10:00:18 GMT
18 Mar 2010 10:00:18 GMT

hi terrytornado,

can you tell me how to download zksample2 project without svn? I can not get some helpful information from the hierarchy of the svn project. Thanks a lot for helping me .

terrytornadoTop Contributor
18 Mar 2010 16:06:44 GMT
18 Mar 2010 16:06:44 GMT

on the sourceforge.net page of our Zksample2 project you can download the packed war-file too. It's packed with the sources.
Please read the documentation too.

best
Stephan

techvts
19 Mar 2010 00:40:39 GMT
19 Mar 2010 00:40:39 GMT

hi,

look for steps to build form builder in below link on zk documentation

http://docs.zkoss.org/wiki/Zeta_DB_Form_Builder_Step_by_Step