[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3873) Memory leak using EJB transactions and jBpm contexts
by Torsten Fink (JIRA)
Memory leak using EJB transactions and jBpm contexts
----------------------------------------------------
Key: JBSEAM-3873
URL: https://jira.jboss.org/jira/browse/JBSEAM-3873
Project: Seam
Issue Type: Bug
Components: BPM, Core, EJB3
Affects Versions: 2.1.1.GA
Environment: JBoss 4.2.x, Mac OSX and Linux environments, Java 1.5
Reporter: Torsten Fink
Attachments: MemoryLeakEventKontext.tgz
Our application had to survive a night with full load. On the next morning the heap was full of JbpmContext's.
After looking at the source code of Seam and at the debug messages we came up with this hypothesis:
* The SFSB EjbSynchronizations is placed in the event context, the Seam-JbpmContext-Component also lives in the event context.
* Using EJB transactions, EjbSynchronizations is responsible for cleaning up the JbpmContext after the end of the transaction.
* Unfortunately the event context ends BEFORE EjbSynchronizations has the chance to clean up the JbpmContext.
Using BMT the transaction ends before the event context ends. Thus, the JbpmContext is cleaned up.
We switch all our MDBs, EJB-timers, and Web-services from CMT to BMT and (after fixing some other leaks, e.g. a class loader issue in jBpm), we survived the night.
I wrote a small test application that shows the memory leak and I will try to attach it to this issue.
It is a Maven application that consists of
- a Web-GUI to start the test and displays the results (http://localhost:8080/leak/)
- a SFSB that sends 10 messages each to two queues (the standard queues A and B), waits a little bit, and does a gc
- two MDBs, one with CMT, one with BMT, which uses Seam injection to access a jBpm-Context
- an application scoped POJO that saves the contexts in a Set using a weak reference
After executing the tests and the GC, the surviving references are displayed. You can see that the CMT references are not gs'ed whereas the BMT references are cleaned up. You can execute the test several times.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] Commented: (JBSEAM-4543) seam-gen should not use resources:// for things that are in web/view content
by Max Rydahl Andersen (JIRA)
[ https://jira.jboss.org/jira/browse/JBSEAM-4543?page=com.atlassian.jira.pl... ]
Max Rydahl Andersen commented on JBSEAM-4543:
---------------------------------------------
Ok, so is this now a pure RF fix ?
I just want to be sure that always processing is the semantics of resource:// ?
Since if it is then this is a pure RF fix, but if it is not then we need to change both
seam-gen and JBDS to put the .xcss files into the classpath and not in webcontent (at all - even on AS 4)
> seam-gen should not use resources:// for things that are in web/view content
> ----------------------------------------------------------------------------
>
> Key: JBSEAM-4543
> URL: https://jira.jboss.org/jira/browse/JBSEAM-4543
> Project: Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.1.2.GA, 2.2.0.GA
> Environment: winxp x86, jdk6, jboss5
> Reporter: Jacques Lemire
> Assignee: Dan Allen
> Priority: Blocker
> Fix For: 2.2.1.CR1
>
>
> seam-gen templates are using resource:// for things that are not on the classpath (currently build.xml hacks around this by duplicating the .xcss files in the war)
> Original description:
> In projects generated through "File" -> "New" -> "Seam web project", the facelets template "layout/template.xhtml" contains the following component in the "head" section:
> layout/template.xhtml:
> <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
> This component, from a4j should transform the "richfaces templatable css" (xcss) file into a real CSS file and render as a <link> tag containing an a4j resource url. In projects created from the command-line seam-gen script, the output is as expected:
> <link class='user' rel='stylesheet' type='text/css' href='/testxcss/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAFrvajdHLp8hjQAEgwDtA__' />
> However, using jboss tools, I get:
> <link class='user' rel='stylesheet' type='text/css' href='/SeamThemeTest/stylesheet/theme.xcss' />
> This version does not work, however, as the xcss file is returned to the browser as is.
> By looking at the differences between the seam-gen project and the jbosstools project, i noticed the following section of the build.xml ant file generated by seam-gen:
> <copy todir="${war.dir}/WEB-INF/classes">
> <fileset dir="${basedir}/resources">
> <include name="**/*.xcss"/>
> </fileset>
> <!-- move XCSS into classpath for now
> loading from web context only works in JBoss AS 4 -->
> <fileset dir="${basedir}/view">
> <include name="**/*.xcss"/>
> </fileset>
> </copy>
> This step is not done by jbosstools (3.1.0), and indeed, by doing a quick web search, I fell on the following jira: https://jira.jboss.org/jira/browse/JBAS-6034, which states that:
> > [...] that would work in 4.2.x but not in jboss5 where the root of the war is no longer a part of the war's classpath (and never should have been!)
> Please fix it as soon as possible, as this problem affects any generated site and is pretty difficult to debug. On the other hand, it should be very easy to fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] Commented: (JBSEAM-4543) seam-gen should not use resources:// for things that are in web/view content
by Alexander Smirnov (JIRA)
[ https://jira.jboss.org/jira/browse/JBSEAM-4543?page=com.atlassian.jira.pl... ]
Alexander Smirnov commented on JBSEAM-4543:
-------------------------------------------
Finally, I got JBDS Seam project running under debugger and trace stylesheet processing step by step. I'm sorry, but my initial conclusion was initiated by my own neglecting.
All ServletContext methods are working properly, but Jboss AS 4.x has an unexpected behavior: all web application content is available by classloader, so I caught null return value from classloader's #getResourceAsStream method! Therefore, RichFaces resource framework processes the same resource from classloader in the AS 4.2 but as static web application content in the 5.x environment.
Finally, we can make the two possible solutions :
1) Change seam-gen/JBDS template to move .xcss file into java source folder.
2) Change RichFaces framework to process static resources in the same way as Jar content.
I'm going to implement option 2.
> seam-gen should not use resources:// for things that are in web/view content
> ----------------------------------------------------------------------------
>
> Key: JBSEAM-4543
> URL: https://jira.jboss.org/jira/browse/JBSEAM-4543
> Project: Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.1.2.GA, 2.2.0.GA
> Environment: winxp x86, jdk6, jboss5
> Reporter: Jacques Lemire
> Assignee: Dan Allen
> Priority: Blocker
> Fix For: 2.2.1.CR1
>
>
> seam-gen templates are using resource:// for things that are not on the classpath (currently build.xml hacks around this by duplicating the .xcss files in the war)
> Original description:
> In projects generated through "File" -> "New" -> "Seam web project", the facelets template "layout/template.xhtml" contains the following component in the "head" section:
> layout/template.xhtml:
> <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
> This component, from a4j should transform the "richfaces templatable css" (xcss) file into a real CSS file and render as a <link> tag containing an a4j resource url. In projects created from the command-line seam-gen script, the output is as expected:
> <link class='user' rel='stylesheet' type='text/css' href='/testxcss/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAFrvajdHLp8hjQAEgwDtA__' />
> However, using jboss tools, I get:
> <link class='user' rel='stylesheet' type='text/css' href='/SeamThemeTest/stylesheet/theme.xcss' />
> This version does not work, however, as the xcss file is returned to the browser as is.
> By looking at the differences between the seam-gen project and the jbosstools project, i noticed the following section of the build.xml ant file generated by seam-gen:
> <copy todir="${war.dir}/WEB-INF/classes">
> <fileset dir="${basedir}/resources">
> <include name="**/*.xcss"/>
> </fileset>
> <!-- move XCSS into classpath for now
> loading from web context only works in JBoss AS 4 -->
> <fileset dir="${basedir}/view">
> <include name="**/*.xcss"/>
> </fileset>
> </copy>
> This step is not done by jbosstools (3.1.0), and indeed, by doing a quick web search, I fell on the following jira: https://jira.jboss.org/jira/browse/JBAS-6034, which states that:
> > [...] that would work in 4.2.x but not in jboss5 where the root of the war is no longer a part of the war's classpath (and never should have been!)
> Please fix it as soon as possible, as this problem affects any generated site and is pretty difficult to debug. On the other hand, it should be very easy to fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] Updated: (JBSEAM-4543) seam-gen should not use resources:// for things that are in web/view content
by Pete Muir (JIRA)
[ https://jira.jboss.org/jira/browse/JBSEAM-4543?page=com.atlassian.jira.pl... ]
Pete Muir updated JBSEAM-4543:
------------------------------
Fix Version/s: 2.2.1.CR1
Dan, please advise if this is correct :-)
> seam-gen should not use resources:// for things that are in web/view content
> ----------------------------------------------------------------------------
>
> Key: JBSEAM-4543
> URL: https://jira.jboss.org/jira/browse/JBSEAM-4543
> Project: Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.1.2.GA, 2.2.0.GA
> Environment: winxp x86, jdk6, jboss5
> Reporter: Jacques Lemire
> Assignee: Dan Allen
> Priority: Blocker
> Fix For: 2.2.1.CR1
>
>
> seam-gen templates are using resource:// for things that are not on the classpath (currently build.xml hacks around this by duplicating the .xcss files in the war)
> Original description:
> In projects generated through "File" -> "New" -> "Seam web project", the facelets template "layout/template.xhtml" contains the following component in the "head" section:
> layout/template.xhtml:
> <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
> This component, from a4j should transform the "richfaces templatable css" (xcss) file into a real CSS file and render as a <link> tag containing an a4j resource url. In projects created from the command-line seam-gen script, the output is as expected:
> <link class='user' rel='stylesheet' type='text/css' href='/testxcss/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAFrvajdHLp8hjQAEgwDtA__' />
> However, using jboss tools, I get:
> <link class='user' rel='stylesheet' type='text/css' href='/SeamThemeTest/stylesheet/theme.xcss' />
> This version does not work, however, as the xcss file is returned to the browser as is.
> By looking at the differences between the seam-gen project and the jbosstools project, i noticed the following section of the build.xml ant file generated by seam-gen:
> <copy todir="${war.dir}/WEB-INF/classes">
> <fileset dir="${basedir}/resources">
> <include name="**/*.xcss"/>
> </fileset>
> <!-- move XCSS into classpath for now
> loading from web context only works in JBoss AS 4 -->
> <fileset dir="${basedir}/view">
> <include name="**/*.xcss"/>
> </fileset>
> </copy>
> This step is not done by jbosstools (3.1.0), and indeed, by doing a quick web search, I fell on the following jira: https://jira.jboss.org/jira/browse/JBAS-6034, which states that:
> > [...] that would work in 4.2.x but not in jboss5 where the root of the war is no longer a part of the war's classpath (and never should have been!)
> Please fix it as soon as possible, as this problem affects any generated site and is pretty difficult to debug. On the other hand, it should be very easy to fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] Updated: (JBSEAM-4543) seam-gen should not use resources:// for things that are in web/view content
by Max Rydahl Andersen (JIRA)
[ https://jira.jboss.org/jira/browse/JBSEAM-4543?page=com.atlassian.jira.pl... ]
Max Rydahl Andersen updated JBSEAM-4543:
----------------------------------------
Summary: seam-gen should not use resources:// for things that are in web/view content (was: xcss templates should be copied to the classpath on deploy)
Description:
seam-gen templates are using resource:// for things that are not on the classpath (currently build.xml hacks around this by duplicating the .xcss files in the war)
Original description:
In projects generated through "File" -> "New" -> "Seam web project", the facelets template "layout/template.xhtml" contains the following component in the "head" section:
layout/template.xhtml:
<a:loadStyle src="resource:///stylesheet/theme.xcss"/>
This component, from a4j should transform the "richfaces templatable css" (xcss) file into a real CSS file and render as a <link> tag containing an a4j resource url. In projects created from the command-line seam-gen script, the output is as expected:
<link class='user' rel='stylesheet' type='text/css' href='/testxcss/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAFrvajdHLp8hjQAEgwDtA__' />
However, using jboss tools, I get:
<link class='user' rel='stylesheet' type='text/css' href='/SeamThemeTest/stylesheet/theme.xcss' />
This version does not work, however, as the xcss file is returned to the browser as is.
By looking at the differences between the seam-gen project and the jbosstools project, i noticed the following section of the build.xml ant file generated by seam-gen:
<copy todir="${war.dir}/WEB-INF/classes">
<fileset dir="${basedir}/resources">
<include name="**/*.xcss"/>
</fileset>
<!-- move XCSS into classpath for now
loading from web context only works in JBoss AS 4 -->
<fileset dir="${basedir}/view">
<include name="**/*.xcss"/>
</fileset>
</copy>
This step is not done by jbosstools (3.1.0), and indeed, by doing a quick web search, I fell on the following jira: https://jira.jboss.org/jira/browse/JBAS-6034, which states that:
> [...] that would work in 4.2.x but not in jboss5 where the root of the war is no longer a part of the war's classpath (and never should have been!)
Please fix it as soon as possible, as this problem affects any generated site and is pretty difficult to debug. On the other hand, it should be very easy to fix.
was:
In projects generated through "File" -> "New" -> "Seam web project", the facelets template "layout/template.xhtml" contains the following component in the "head" section:
layout/template.xhtml:
<a:loadStyle src="resource:///stylesheet/theme.xcss"/>
This component, from a4j should transform the "richfaces templatable css" (xcss) file into a real CSS file and render as a <link> tag containing an a4j resource url. In projects created from the command-line seam-gen script, the output is as expected:
<link class='user' rel='stylesheet' type='text/css' href='/testxcss/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAFrvajdHLp8hjQAEgwDtA__' />
However, using jboss tools, I get:
<link class='user' rel='stylesheet' type='text/css' href='/SeamThemeTest/stylesheet/theme.xcss' />
This version does not work, however, as the xcss file is returned to the browser as is.
By looking at the differences between the seam-gen project and the jbosstools project, i noticed the following section of the build.xml ant file generated by seam-gen:
<copy todir="${war.dir}/WEB-INF/classes">
<fileset dir="${basedir}/resources">
<include name="**/*.xcss"/>
</fileset>
<!-- move XCSS into classpath for now
loading from web context only works in JBoss AS 4 -->
<fileset dir="${basedir}/view">
<include name="**/*.xcss"/>
</fileset>
</copy>
This step is not done by jbosstools (3.1.0), and indeed, by doing a quick web search, I fell on the following jira: https://jira.jboss.org/jira/browse/JBAS-6034, which states that:
> [...] that would work in 4.2.x but not in jboss5 where the root of the war is no longer a part of the war's classpath (and never should have been!)
Please fix it as soon as possible, as this problem affects any generated site and is pretty difficult to debug. On the other hand, it should be very easy to fix.
Moved from JBIDE to Seam on the request of Pete and Jay.
> seam-gen should not use resources:// for things that are in web/view content
> ----------------------------------------------------------------------------
>
> Key: JBSEAM-4543
> URL: https://jira.jboss.org/jira/browse/JBSEAM-4543
> Project: Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.1.2.GA, 2.2.0.GA
> Environment: winxp x86, jdk6, jboss5
> Reporter: Jacques Lemire
> Assignee: Dan Allen
> Priority: Blocker
>
> seam-gen templates are using resource:// for things that are not on the classpath (currently build.xml hacks around this by duplicating the .xcss files in the war)
> Original description:
> In projects generated through "File" -> "New" -> "Seam web project", the facelets template "layout/template.xhtml" contains the following component in the "head" section:
> layout/template.xhtml:
> <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
> This component, from a4j should transform the "richfaces templatable css" (xcss) file into a real CSS file and render as a <link> tag containing an a4j resource url. In projects created from the command-line seam-gen script, the output is as expected:
> <link class='user' rel='stylesheet' type='text/css' href='/testxcss/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAFrvajdHLp8hjQAEgwDtA__' />
> However, using jboss tools, I get:
> <link class='user' rel='stylesheet' type='text/css' href='/SeamThemeTest/stylesheet/theme.xcss' />
> This version does not work, however, as the xcss file is returned to the browser as is.
> By looking at the differences between the seam-gen project and the jbosstools project, i noticed the following section of the build.xml ant file generated by seam-gen:
> <copy todir="${war.dir}/WEB-INF/classes">
> <fileset dir="${basedir}/resources">
> <include name="**/*.xcss"/>
> </fileset>
> <!-- move XCSS into classpath for now
> loading from web context only works in JBoss AS 4 -->
> <fileset dir="${basedir}/view">
> <include name="**/*.xcss"/>
> </fileset>
> </copy>
> This step is not done by jbosstools (3.1.0), and indeed, by doing a quick web search, I fell on the following jira: https://jira.jboss.org/jira/browse/JBAS-6034, which states that:
> > [...] that would work in 4.2.x but not in jboss5 where the root of the war is no longer a part of the war's classpath (and never should have been!)
> Please fix it as soon as possible, as this problem affects any generated site and is pretty difficult to debug. On the other hand, it should be very easy to fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months