-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Here is the list of my tutorial on ZK + Spring 3 + Hibernate
1. ZK 7 and Hibernate Configuration for MySQL Database
2. ZK 7 MVVM List Box–Retrieve records from MYSQL with Hibernate and Spring integration
4. ZK MVVM CRUD Example using mysql database with Spring 3 + Hibernate 4 API (No Spring template)
5. Spring 3 secuirty Custom Login form using ZK with mysql database.
6. ZK MVC CRUD Example using mysql database with ZK + Spring + JPA + Hibernate Entity Manager
Thanks for your sharing !
All these should work with ZK 7 also. If you have any problem, please let me know
example 3. ZK MVVM листинге записей из базы данных MySQL, используя ZK + Весна + JPA + Hibernate Entity Менеджер
1466 [Scanner-2] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: No Persistence provider for EntityManager named ZKSpringJPA
What should I do please help
Hi Senthilchettyin,
your examples really help me a lots. Base on your example in your code likes below your used:
@AfterCompose public void initSetup(@ContextParam(ContextType.VIEW) Component view) { Selectors.wireComponents(view, this, false); CRUDService = (CRUDService) SpringUtil.getBean("CRUDService"); allReordsInDB = CRUDService.getAll(AddressBook.class); }
I reference CRUDService.getAll to my CRUD operation,however I always get the null value in my viewmodel returned then message likes: you are using a composer [PersonInforViewModel [selectedPerson=null, personalList=null]] as a view model 2020-05-20 14:03:21.409 ERROR 13092 --- [nio-8080-exec-2] org.zkoss.bind.impl.ParamCall :
java.lang.NullPointerException: null at com.lia.data.viewmodel.PersonInforViewModel.initSetup(PersonInforViewModel.java:53) ~[Clientofthe_earsample-0.0.1-SNAPSHOT.jar:na]
I really have no idea how to fix it . Technologies Used: <java.version>1.8</java.version> <zk.version>9.0.1</zk.version> <zkspringboot.version>1.0.4</zkspringboot.version> <springboot.version>2.2.6.RELEASE</springboot.version> <springframe.version>5.2.6.RELEASE</springframe.version> <org.hibernate-version>5.4.15.Final</org.hibernate-version> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source>
Once I put back "apply="org.zkoss.bind.BindComposer" to my ZUL file,got additional error message likes below:
<window id="personinforList" title="Person Information" border="normal" apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm') @init('XXXXXX.PersonInforViewModel')">
2020-05-20 14:49:01.253 WARN 18616 --- [nio-8080-exec-3] org.zkoss.zk.ui.metainfo.Parser : file:/C:/Users...20New/view/PersonInfor.zul:5:81: If the attribute of viewModel is being used, then "org.zkoss.bind.BindComposer" will be applied automatically. Notice that if you want to use another Composer, you will need to apply the "org.zkoss.bind.BindComposer" yourself. 2020-05-20 14:49:01.377 WARN 18616 --- [nio-8080-exec-3] org.zkoss.bind.impl.BinderImpl : you are using a composer [PersonInforViewModel [selectedPerson=null, personalList=null]] as a view model 2020-05-20 14:49:01.409 ERROR 18616 --- [nio-8080-exec-3] org.zkoss.bind.impl.ParamCall :
java.lang.NullPointerException: null at XXXXXXX.PersonInforViewModel.initSetup(PersonInforViewModel.java:53)
Asked: 2013-04-19 07:35:43 +0800
Seen: 870 times
Last updated: May 20 '20