-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all, i need help!!!!
ZKoss v. 3.6.2; Hibernate v. 3.3; Spring v. 2.5
At time i'm trying to make my sample application ready for clustering. I hope this is the last point
and than i do a check in to ZK Forge.
I have read many about clustering. I see that the Part I and Part II of the cluster smalltalks are for the Tomcat 5.5.2.
So i have read and play a few hours to adapt it for Tomcat 6.0.18 because there are many changes in the sources and packages.
Now, i have problems on how i can debug the application to find the ground for the attached error.
This error comes from a test.zul page with it's own controller and when the error happens than it goes over
the whole application.
And at time its only a problem with the FieldComparator. By a look in the source of FieldComparator (new in 3.6.x )
i can see that the Interface Serializable is right in there ????
Does anyone have experience with "made ready for clustering" or "on what we have to look for better clustering" :-)
regards
Stephan
Argh: one hour later. Question to zk-team. I see that there is an inner class in FieldComparator:
private static class FieldInfo {
private String fieldname;
private boolean asc;
private String func;
public FieldInfo(String fieldname, boolean asc, String func) {
this.fieldname = fieldname;
this.asc = asc;
this.func = func;
}
}
It's possible that here is the problem and the interface is forgotten.???????
Push !
I have tried now several things.
1. Only the use of attribut sort="auto(braNr)" in my listheaders zul code is enough code for thrown above exception
<listheader id="listheader_CustNo" sort="auto(braNr)" image="/images/icons/builder.gif" label="${c:l('listheader_CustNo.label')}" width="5%" />
2. I have comment it out in zul and do the same in the java controller class with the same error
listheader_Branch_No.setSortAscending(new FieldComparator("braNr", true)); listheader_Branch_No.setSortDescending(new FieldComparator("braNr", false)); listheader_Branch_Description.setSortAscending(new FieldComparator("braBezeichnung", true)); listheader_Branch_Description.setSortDescending(new FieldComparator("braBezeichnung", false));
... private transient FieldComparator fcBraNr_Asc = new FieldComparator("braNr", true); private transient FieldComparator fcBraNr_Desc = new FieldComparator("braNr", false); private transient FieldComparator fcBraBezeichnung_Asc = new FieldComparator("braBezeichnung", true); private transient FieldComparator fcBraBezeichnung_Desc = new FieldComparator("braBezeichnung", false); ... listheader_Branch_No.setSortAscending(fcBraNr_Asc); listheader_Branch_No.setSortDescending(fcBraNr_Desc); listheader_Branch_Description.setSortAscending(fcBraBezeichnung_Asc); listheader_Branch_Description.setSortDescending(fcBraBezeichnung_Desc);
It's interessting to see that these objects are holding in the Sessionobject if i go to other pages where no Listboxes exists. Is this ok?
regards
Stephan
It is strange that #3 you did above didn't solve the problem. Are you sure you don't have reference to FieldComparator anywhere else in your application?
The only things that I can think of that may help you out before ZK fix the serializable problem is to write your own comparator:
1. Since you have the source code of FieldComparator, just copy it and create your own one with Serializable implemented.
2. Another choice is to build the zk jars from modified source
Hi jj,
thanks for answering. Argh i have all my own written comparators deleted, because i'm use my
PagedListWrapper for extend the paging for sorting. You can read about it in the smalltalks under
category Performance.
Yes, i'm having more uses of FieldComparator in other listboxes.
But this error occurs if i go to my test page as the first call of the application.
It's misterious.
If i comment out in zul and make as transient member fields in jave but do not acces it to the listheaders, than i have no error.
Than i have no problems to go further to other pages with listboxes and FieldComparators. ?????????????????
Is this ok? uuid but no interface ??
Listheader.java
* </ol> * <p>Default {@link #getZclass}: z-list-header.(since 3.5.0) * @author tomyeh */ public class Listheader extends HeaderElement implements org.zkoss.zul.api.Listheader { private static final long serialVersionUID = 20080218L; private String _sortDir = "natural"; private transient Comparator _sortAsc, _sortDsc; private Object _value; private int _maxlength; public Listheader() { }
OK, done.
I have done a little methode for reproduce the problem:
public void onClick$BtnSerialize(Event event) throws InterruptedException { FieldComparator fcOld; FieldComparator fcNew; fcOld = new FieldComparator("TestColumn", false); // Serialize the original class object try { FileOutputStream fo = new FileOutputStream("cde.tmp"); ObjectOutputStream so = new ObjectOutputStream(fo); so.writeObject(fcOld); so.flush(); so.close(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } // Deserialize in to new class object try { FileInputStream fi = new FileInputStream("cde.tmp"); ObjectInputStream si = new ObjectInputStream(fi); fcNew = (FieldComparator) si.readObject(); si.close(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
Error:
java.io.NotSerializableException: org.zkoss.zul.FieldComparator$FieldInfo at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) at java.util.ArrayList.writeObject(ArrayList.java:570) at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) at org.myfirm.example.TestCtrl.onClick$BtnSerialize(TestCtrl.java:119) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:211) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:493) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.sendEvent(EventProcessingThreadImpl.java:123) at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:293) at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:303) at org.zkoss.zk.ui.AbstractComponent$ForwardListener.onEvent(AbstractComponent.java:2308) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:197) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:493) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:425) 27.07.2009 17:16:44 org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8081 2009-07-27 17:16:47,890 INFO XmlWebApplicationContext M - Closing org.springframework.web.context.support.XmlWebApplicationContext@e29820: display name [Root WebApplicationContext]; startup date [Mon Jul 27 17:15:47 CEST 2009]; root of context hierarchy 2009-07-27 17:16:47,890 INFO DefaultListableBeanFactory M - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@10d95cd: defining beans [useCaseTxAdvice,daoTxAdvice,org.springframework.aop.config.internalAutoProxyCreator,serviceMethods,daoMethods,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,transactionManager,propertyConfigurer,dataSource,sessionFactory,hibernateTemplate,basisDAO,basisfNextidview,kundeDAO,auftragDAO,auftragpositionDAO,artikelDAO,filialeDAO,brancheDAO,nextidviewDAO,userDAO,secGroupDAO,secGrouprightDAO,secRightDAO,secRoleDAO,secRolegroupDAO,secUserroleDAO,secTypDAO,secLoginlogDAO,languageDAO,testDAO,guestBookDAO,kundeService,auftragService,filialeService,brancheService,artikelService,userService,loginService,reportService,securityService,loginLoggingService,testService,guestBookService,_delegatingMethodDefinitionSource,_accessManager,_methodSecurityInterceptor,_methodSecurityInterceptorPostProcessor,_methodDefinitionSourceAdvisor,_authenticationManager,_filterChainProxy,_httpSessionContextIntegrationFilter,_filterChainProxyPostProcessor,_filterChainList,_securityContextHolderAwareRequestFilter,_portMapper,_exceptionTranslationFilter,_filterSecurityInterceptor,_sessionRegistry,_concurrentSessionController,_concurrentSessionFilter,_sessionFixationProtectionFilter,_anonymousAuthenticationProvider,_anonymousProcessingFilter,_rememberMeServices,_rememberMeAuthenticationProvider,_rememberMeFilter,_rememberMeServicesInjectionBeanPostProcessor,_logoutFilter,_basicAuthenticationEntryPoint,_basicAuthenticationFilter,_formLoginFilter,_formLoginEntryPoint,_entryPointInjectionBeanPostProcessor,_userServiceInjectionPostProcessor,myUserDetailsService,passwordEncoder,org.springframework.security.providers.dao.DaoAuthenticationProvider,org.springframework.security.config.AuthenticationProviderBeanDefinitionParser$AuthenticationProviderCacheResolver,zkListenerConfigFilter,zkDesktopReuseFilter,zkDisableSessionInvalidateFilter,zkEnableSessionInvalidateFilter,zkLoginOKFilter,zkError403Filter,zkExceptionTranslationFilter,zkEventProcessInterceptor,LoginLoggingPolicyService,org.springframework.aop.aspectj.AspectJPointcutAdvisor,authPointcut]; root of factory hierarchy 2009-07-27 17:16:47,890 INFO LocalSessionFactoryBean M - Closing Hibernate SessionFactory
regards
Stephan
PS: Next shown code works well for serializing/deserializing a Textbox.
public void onClick$BtnSerializeTB(Event event) throws InterruptedException { Textbox fcOld; Textbox fcNew; fcOld = new Textbox("Test Textbox"); // Serialize the original class object try { FileOutputStream fo = new FileOutputStream("cde.tmp"); ObjectOutputStream so = new ObjectOutputStream(fo); so.writeObject(fcOld); so.flush(); so.close(); } catch (Exception e) { e.printStackTrace(); // System.exit(1); } // Deserialize in to new class object try { FileInputStream fi = new FileInputStream("cde.tmp"); ObjectInputStream si = new ObjectInputStream(fi); fcNew = (Textbox) si.readObject(); System.out.println(fcNew.getValue()); si.close(); } catch (Exception e) { e.printStackTrace(); // System.exit(1); } }
I have implemented the bugfixed FieldComparator.class.
Now i became the next error:
31.07.2009 15:05:26 org.apache.catalina.ha.session.DeltaManager messageReceived SCHWERWIEGEND: Manager : Unable to receive message through TCP channel java.lang.ClassCastException: org.zkoss.zul.FieldComparator cannot be cast to org.zkoss.zul.ListitemComparator at org.zkoss.zul.Listheader.readObject(Listheader.java:554) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.zkoss.zk.ui.AbstractComponent.readObject(AbstractComponent.java:2182) at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.zkoss.zk.ui.AbstractComponent.readObject(AbstractComponent.java:2182) at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.zkoss.zk.ui.AbstractComponent.readObject(AbstractComponent.java:2182) at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.zkoss.zk.ui.AbstractComponent.readObject(AbstractComponent.java:2182) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.zkoss.zk.ui.AbstractComponent.readObject(AbstractComponent.java:2182) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ...
Stephan
Thanks Henri,
I have compiled the newest sources, so the error is away. I can go no further.
regards
Stephan
Asked: 2009-07-20 19:57:59 +0800
Seen: 639 times
Last updated: Aug 05 '09