Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.4.3
-
Fix Version/s: None
-
Component/s: Converters
-
Labels:None
-
JDK version and platform:java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11) Oracle JRockit(R) (build R28.2.0-79-146777-1.6.0_29-20111005-1808-windows-ia32, compiled mode)
Description
If a complex object uses another object that extends HashMap<String, String> during the serialization a new field is inserted in the xml when running on Weblogic/JRockit what makes it impossible to deserialze it on another JVM/Application server.
typeSettingsProperties is an instance of UnicodeProperties which extends HashMap<String, String>
On Tomcat with other JVM it seems to be OK.
Here is an example snippet:
<__typeSettingsProperties serialization="custom"> <unserializable-parents/> <map> <default> <cache__bitmask>-1</cache__bitmask> <!-- This line cause trouble --> <loadFactor>0.75</loadFactor> <threshold>12</threshold> </default> <int>16</int> <int>2</int> <string>layout-template-id</string> <string>2_columns_ii</string> <string>column-1</string> <string>56_INSTANCE_e5cZUX98hCmA</string> </map> <com.liferay.portal.kernel.util.UnicodeProperties> <default> <__length>66</__length> <__safe>true</__safe> </default> </com.liferay.portal.kernel.util.UnicodeProperties> </__typeSettingsProperties>
If an XML is exported from Weblogic and tried to import into the same webapplication running on Tomcat this StackTrace is shown:
13:30:23,075 ERROR [http-bio-8080-exec-10][ImportLayoutsAction:92] com.liferay.portal.kernel.exception.SystemException: com.thoughtworks.xstream.converters.ConversionException: Could not call com.liferay.portal.kernel.util.UnicodeProperties.readObject() : No field 'cache_bitmask' found in class 'com.liferay.portal.kernel.util.UnicodeProperties' ---- Debugging information ---- message : Could not call com.liferay.portal.kernel.util.UnicodeProperties.readObject() cause-exception : com.thoughtworks.xstream.converters.reflection.MissingFieldException cause-message : No field 'cache_bitmask' found in class 'com.liferay.portal.kernel.util.UnicodeProperties' class : com.liferay.portal.kernel.util.UnicodeProperties required-type : com.liferay.portal.kernel.util.UnicodeProperties converter-type : com.thoughtworks.xstream.converters.reflection.SerializableConverter path : /com.liferay.portal.model.impl.LayoutImpl/_typeSettingsProperties/map/default/cache_bitmask line number : 276 class[1] : com.liferay.portal.model.impl.LayoutImpl converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter version : null ------------------------------- com.liferay.portal.kernel.exception.SystemException: com.thoughtworks.xstream.converters.ConversionException: Could not call com.liferay.portal.kernel.util.UnicodeProperties.readObject() : No field 'cache_bitmask' found in class 'com.liferay.portal.kernel.util.UnicodeProperties' ---- Debugging information ---- message : Could not call com.liferay.portal.kernel.util.UnicodeProperties.readObject() cause-exception : com.thoughtworks.xstream.converters.reflection.MissingFieldException cause-message : No field 'cache_bitmask' found in class 'com.liferay.portal.kernel.util.UnicodeProperties' class : com.liferay.portal.kernel.util.UnicodeProperties required-type : com.liferay.portal.kernel.util.UnicodeProperties converter-type : com.thoughtworks.xstream.converters.reflection.SerializableConverter path : /com.liferay.portal.model.impl.LayoutImpl/_typeSettingsProperties/map/default/cache_bitmask line number : 276 class[1] : com.liferay.portal.model.impl.LayoutImpl converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter version : null ------------------------------- at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1398) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:197) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy177.importLayouts(Unknown Source) 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 com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211) at $Proxy178.importLayouts(Unknown Source) at com.liferay.portal.service.impl.LayoutServiceImpl.importLayouts(LayoutServiceImpl.java:636) 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 com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211) at $Proxy179.importLayouts(Unknown Source) at com.liferay.portal.service.LayoutServiceUtil.importLayouts(LayoutServiceUtil.java:493) at com.liferay.portlet.layoutsadmin.action.ImportLayoutsAction.processAction(ImportLayoutsAction.java:71) at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:169) at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:212) at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70) at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48) at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:548) at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:579) at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:294) at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:944) at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:688) at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560) at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329) at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:56) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:253) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163) at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216) at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95) at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call com.liferay.portal.kernel.util.UnicodeProperties.readObject() : No field 'cache_bitmask' found in class 'com.liferay.portal.kernel.util.UnicodeProperties'
This is normal. XStream uses specialized converters for known types only, all other ones are handled by the reflection-based converters which will reflect any implementation specific detail in the XML structure. This includes differences between different JDK versions or JDKs from different vendors.
If you want to prevent this behavior for UnicodeProperties, you will have to register your own converter that can handle this type. You may simply derive from the MapConverter.