[EJB 3.0] - stateful session bean is not removed from memory
by alex0027
Hi,
we are using EJB 3 stateful session beans on JBoss 4.2.2.GA (jems-installer-1.2.1.CR4.jar).
Our application creates a lot of instances of one stateful bean. About 300 per minute. So we set the timeouts to:
... idleTimeoutSeconds=30, removalTimeoutSeconds=30 ...
At the proper time the "@PreDestroy" method of the bean is called correct.
If i've a look on the Mbean of this stateful bean all looks fine. Only a few instances of the bean are active, the most beans are removed.
But in the Java Heap all instances exist and no one was removed. In spite of the Mbean says only 200 instances exist and all othere was removed, after a few hours i see in the heapdump about 400000 instances of this bean (and the same number of instances of type "org.jboss.ejb3.stateful.StatefulBeanContext"). Garbage collection does not remove the bean.
Is this a problem of the JBoss or why is the bean not evicted from memory?
Thanks,
alex
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222998#4222998
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222998
15 years, 9 months
[JBoss AOP] - Problems with Maven2 and JBoss AOP 1.5.6.GA
by marvm
Hi,
I'm trying to move my projects from Ant to Maven2. The maven-jbossaop-plugin is only compatible with jbossaop 2.0.x so I was wondering how someone else solved this problem.
At the moment I try to test everything with a very simple project that only consists of a Servlet. The jboss-aop.xml is ok, I just need to know how to trigger the code-weaving from within maven.
That's what I have so far...
pom.xml:
| <build>
| <finalName>aop-test</finalName>
| <plugins>
| <plugin>
| <artifactId>maven-antrun-plugin</artifactId>
| <executions>
| <execution>
| <phase>package</phase>
| <configuration>
| <tasks>
|
| <ant antfile="build.xml">
| <target name="aopc" />
| </ant>
|
| </tasks>
| </configuration>
| <goals>
| <goal>run</goal>
| </goals>
| </execution>
| </executions>
| </plugin>
| </plugins>
| </build>
|
build.xml:
|
| <project name="aoptest" default="aopc" basedir=".">
|
| <path id="maven-ant-tasks.classpath" path="build-lib/maven-ant-tasks-2.0.9.jar" />
|
| <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
| uri="urn:maven-artifact-ant"
| classpathref="maven-ant-tasks.classpath" />
|
| <artifact:dependencies pathId="dependency.classpath" xmlns:artifact="urn:maven-artifact-ant">
| <dependency groupId="jboss.aop" artifactId="jboss-aop-jdk50" version="1.5.6.GA" scope="compile"/>
| </artifact:dependencies>
|
| <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="maven-ant-tasks.classpath" />
|
| <target name="aopc" >
| <aopc compilerclasspathref="dependency.classpath" verbose="false">
| <classpath path="target/classes" />
| <src path="target" />
| <aoppath path="src/main/resources/jboss-aop.xml" />
| <aopclasspath path="${jboss.home}/lib" />
| </aopc>
| </target>
|
| </project>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222985#4222985
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222985
15 years, 9 months
[JBoss AOP] - Introducing annotations only on classes which don't have it
by jaikiran
I have been trying the examples hosted in the aop project SVN https://svn.jboss.org/repos/jbossas/projects/aop/trunk/aop/docs/examples/. Specifically, the annotation-introduction example. The sample application that i am trying contains a couple of POJOs and my own custom annotation:
POJO 1 (which is not annotated):
public class SimplePOJO
| {
| private int someInt;
|
| public String someMethod()
| {
| ...
| }
|
| }
|
POJO 2 (which is already annotated) :
@MyOwnAnnotation
| public class AlreadyAnnotatedPOJO
| {
| private int something;
|
| public String hello()
| {
| ...
| }
| }
|
|
My custom annotation :
@Retention(RetentionPolicy.RUNTIME)
| @Target(value=ElementType.TYPE)
| public @interface MyOwnAnnotation
| {
| String value();
| }
|
In this example, i am trying to add/introduce the @MyOwnAnnotation *on a class* which does not have one. So in the above code, i want the @MyOwnAnnotation to be added to SimplePOJO but not to AlreadyAnnotatedPOJO.
I have this jboss-aop.xml which tries to accomplish this:
<aop>
| <!-- Add the annotation at *class level* on classes which do not have
| this annotation already -->
| <annotation-introduction expr="!class(@MyOwnAnnotation)">
| @MyOwnAnnotation (value="i am testing something")
| </annotation-introduction>
|
| </aop>
|
This does not give the desired results (but infact leads to interesting output - see #2 and #3 below):
Questions:
1) Am i using the correct expression? expr="!class(@MyOwnAnnotation)"
2) This annotation-introduction expression results, in the @MyOwnAnnotation being applied to SimplePOJO class at:
- class level
- method level (all methods)
- field level (all fields)
So effectively the annotation is applied to all the methods, all fields and the class itself. Is this expected?
3) From what i showed in the annotation definition:
@Target(value=ElementType.TYPE)
| public @interface MyOwnAnnotation
|
The "target" of MyOwnAnnotation is a ElementType.TYPE, but it got applied to methods and fields by AOP (as explained in #2). Doesn't AOP validate the target type before applying the annotations and throw an error if adding the annotation is incorrect?
Let me know, if you need the sample application which demonstrates this along with the logs - its just a simple modified version of what is available in the examples/annotation-introduction in SVN.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222982#4222982
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222982
15 years, 9 months