Gilead: PersistentRemoteService

Gilead does merge operations when you made a service call using PersistentRemoteService, before with hibernate4gwt it didn't do it on all service calls. So we had this nice error

[WARN] StandardContext[]Exception while dispatching incoming RPC call
java.lang.NullPointerException: null
at net.sf.gilead.core.PersistentBeanManager.mergePojo(PersistentBeanManager.java:423)
at net.sf.gilead.core.PersistentBeanManager.merge(PersistentBeanManager.java:289)
at net.sf.gilead.gwt.GileadRPCHelper.parseInputParameters(GileadRPCHelper.java:89)
at net.sf.gilead.gwt.PersistentRemoteService.processCall(PersistentRemoteService.java:147)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)

So if you don't use spring to create your PersistentRemoteServices, then you have to include these 2 lines in the constructor of all your services.

XmlBeanFactory application = ApplicationContextFactory.getXmlBeanFactoryInstance();
setBeanManager((PersistentBeanManager) application.getBean("hibernateBeanManager"));


As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles