[JBoss Seam] - WebSessionContext.flush causing out of memory
by jarkko@jab.fi
Hello,
A change (from non impl to the current copy-all) in WebSessionContext.flush is causing out-of-memory experiance in my portlet environment (with the special naive PortletSessionImpl).
With the flush below, 1000 Mb of memory consumed in 20 clicks in seam app, with the flush commented out no problem.
This is likely caused by the PortletSessionImpl which simply sets everything both in APPLICATION and PORTLET scope.. Btw i used the Jhat (included with JDK6) too to track this one down, pretty neat tool, now that's included with the JDK6. http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html
The names of attributes were very very long:
javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3_konseptimittaus_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?javax.portlet.p.tc3Portlet_kohteen_valinta_WAR_TrueConcept_LAYOUT_PRI.1005.6?org.jboss.seam.CONVERSATION#3$tc3EntityManager
This might indicate that there're some pretty weird namespace related problems when running on Portlets.
| public void flush() {
| for ( String name: getNames() )
| {
| Object attribute = session.getAttribute(name);
| if ( attribute instanceof Mutable && ( (Mutable) attribute ).clearDirty() )
| {
| session.setAttribute(name, attribute);
| }
| }
|
| /*
| * JBoss, Home of Professional Open Source
| *
| * Distributable under LGPL license.
| * See terms of license at gnu.org.
| */
| package org.jboss.seam.portlet;
|
| import java.util.Collections;
| import java.util.Enumeration;
| import java.util.List;
|
| import javax.portlet.PortletSession;
|
| import org.apache.commons.collections.ListUtils;
| import org.jboss.seam.contexts.ContextAdaptor;
|
| /**
| * @author <a href="mailto:theute@jboss.org">Thomas Heute </a>
| * @version $Revision: 1.4 $
| */
| public class PortletSessionImpl extends ContextAdaptor {
|
| private PortletSession session;
|
| public PortletSessionImpl(PortletSession session) {
| this.session = session;
| }
|
| public Object getAttribute(String key) {
| // search for key first in PORTLET_SCOPE
| Object o = session.getAttribute(key);
| Object po = null;
| // if nothing is found there try APPLICATION_SCOPE
| if (o == null) {
| po = session.getAttribute(key, PortletSession.APPLICATION_SCOPE);
| return po;
| } else {
| // TODO: just do some cleaning up or maybe not
| // session.removeAttribute(key, PortletSession.APPLICATION_SCOPE);
| }
|
| return o;
| }
|
| public void removeAttribute(String key) {
| session.removeAttribute(key);
| session.removeAttribute(key, PortletSession.APPLICATION_SCOPE);
| }
|
| public Enumeration getAttributeNames() {
| Enumeration portletAttributeNamesEnum = session.getAttributeNames();
| Enumeration portalAttributeNamesEnum = session
| .getAttributeNames(PortletSession.APPLICATION_SCOPE);
|
| List portletAttributeNames = Collections
| .list(portletAttributeNamesEnum);
| List portalAttributeNames = Collections.list(portalAttributeNamesEnum);
|
| // TODO: Is this correct?
| List allNames = ListUtils.sum(portletAttributeNames,
| portalAttributeNames);
|
| return Collections.enumeration(allNames);
| }
|
| public void setAttribute(String key, Object value) {
| session.setAttribute(key, value);
| session.setAttribute(key, value, PortletSession.APPLICATION_SCOPE);
| }
|
| public void invalidate() {
| session.invalidate();
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978047#3978047
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978047
19 years, 8 months
[JBossWS] - WS and Transactions
by timdyck
Using Web Service and Transactions annotations at the same time in my class is causing the following problem:
| 2006-10-12 16:50:08,396 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@a0509915{ url=file:/C:/devapps/jboss-4.0.4.GA-frickinlame/server/default/deploy/LicenseServerEAR.ear, deployedLastModified=0 }
| org.jboss.deployment.DeploymentException: Could not create deployment: file:/C:/devapps/jboss-4.0.4.GA-frickinlame/server/default/tmp/deploy/tmp47425LicenseServerEAR.ear-contents/LicenseServer.war; - nested throwable: (org.jboss.ws.WSException: Could not generate wrapper type: com.discorp.licensing.server.__JBossWS_LicenseServerService_LicenseServerPort_GetClientId)
| at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:975)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy8.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
| 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:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:464)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.ws.WSException: Could not generate wrapper type: com.discorp.licensing.server.__JBossWS_LicenseServerService_LicenseServerPort_GetClientId
| at org.jboss.ws.jaxrpc.ParameterWrapping.generateWrapper(ParameterWrapping.java:471)
| at org.jboss.ws.deployment.JSR181MetaDataBuilder.processWebMethod(JSR181MetaDataBuilder.java:568)
| at org.jboss.ws.deployment.JSR181MetaDataBuilder.setupEndpointFromAnnotations(JSR181MetaDataBuilder.java:193)
| at org.jboss.ws.deployment.JSR181MetaDataBuilderJSE.buildMetaData(JSR181MetaDataBuilderJSE.java:72)
| at org.jboss.ws.deployment.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:92)
| at org.jboss.ws.integration.jboss.DeployerInterceptor.create(DeployerInterceptor.java:80)
| at org.jboss.ws.integration.jboss.DeployerInterceptorJSE.create(DeployerInterceptorJSE.java:74)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy35.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| ... 67 more
| Caused by: javassist.CannotCompileException: by java.lang.LinkageError: duplicate class definition: com/discorp/licensing/server/__JBossWS_LicenseServerService_LicenseServerPort_GetClientId
| at javassist.ClassPool.toClass(ClassPool.java:831)
| at org.jboss.ws.jaxrpc.ParameterWrapping.generateWrapper(ParameterWrapping.java:467)
| ... 81 more
| Caused by: java.lang.LinkageError: duplicate class definition: com/discorp/licensing/server/__JBossWS_LicenseServerService_LicenseServerPort_GetClientId
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
| at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
| 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:585)
| at javassist.ClassPool.toClass(ClassPool.java:823)
| ... 82 more
|
So if I remove the transaction annotations from my class, then everything works as expected. I am using JBoss AS 4.0.4GA, with AOP 1.5.1GA, WS 1.0.3GA, and JDK 1.5.0_05.
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978044#3978044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978044
19 years, 8 months