Issue Details (XML | Word | Printable)

Key: CACTUS-158
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Felipe Leme
Reporter: Matheus Piai Bianconi
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Cactus

OutOfMemory in application server

Created: 06/Dec/04 12:42 PM   Updated: 10/Dec/04 02:26 PM
Return to search
Component/s: Ant Integration
Affects Version/s: 1.6.1
Fix Version/s: 1.7

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works CACTUS_158.patch 2004-12-10 12:29 PM Matheus Piai Bianconi 2 kB

Resolution Date: 10/Dec/04 02:14 PM


 Description  « Hide
Cactus does not allow to define memory used by application server, then some tests fail and error "OutOfMemoryError" occur.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Matheus Piai Bianconi added a comment - 06/Dec/04 06:39 PM
PS: We are working on a solution and will send a patch later (even though this solution may not be generic).


Felipe Leme added a comment - 08/Dec/04 11:05 AM
Vincent,

I haven't seen the patch yet, but I have the feeling there are 2 places where we should consider a generic approach:

1.This issue might happens in any container, not only JBoss, so the fix should go into the super-class of all container tasks (I think it should be defined on AbstractContainerJava or somthing like that). Note also that this issue might be appliable to Cargo as well.

2.The Java Ant tasks has a method to set the max memory; using that method should fix that specific problem, but we could be generic here too, allowing arbitrary JVM args to be passed to the container.

Once we define a way to fix it, I could implement the changes. So, any thoughts?

-- Felipe

Vincent Massol added a comment - 09/Dec/04 10:10 AM
Fyi, just done that for Cargo. See http://jira.codehaus.org/browse/CARGO-89

Matheus Piai Bianconi added a comment - 10/Dec/04 12:29 PM
This is the patch - it hasn't been fully tested yet, but it should work.

Matheus Piai Bianconi made changes - 10/Dec/04 12:29 PM
Field Original Value New Value
Attachment CACTUS_158.patch [ 18352 ]
Vincent Massol added a comment - 10/Dec/04 12:51 PM
Hi Matheus,

Just a quick question: why don't you call java.setJvmargs() instead of calling java.createJvmarg().setValue(...)? Does your solution work when you have to pass several JVM arguments?

I'm curious because I've used setJvmargs() for Cargo and it is working fine.

Thanks

Felipe Leme added a comment - 10/Dec/04 01:14 PM
Vincent,

What about the maven plugin? Should we create a generic property for all containers (like cactus.containers.jvmArgs) or one per container (cactus.jboss3x.jvmArgs, cactus.tomcat5.jvmArgs, etc...)?
 

Felipe Leme made changes - 10/Dec/04 01:14 PM
Assignee Felipe Leme [ felipeal ]
Felipe Leme added a comment - 10/Dec/04 01:24 PM
Vincent,

I tried the setJvmArgs, but got the following message:

   [cactus] The jvmargs attribute is deprecated. Please use nested jvmarg elemets.

Did you get that with Cargo too?

I haven't found a @deprecated in the Ant's API, so I think this message is a bug - I think it was meant only to the Ant task, not the java call (i.e., it should be displayed only when jvmargs is passed as an attribute to the java task).

-- Felipe

Repository Revision Date User Message
ASF #239095 Fri Dec 10 13:26:34 UTC 2004 felipeal Fix for CACTUS-158: new jvmArgs attribute to be passed to the container's JVM
Files Changed
MODIFY /jakarta/cactus/trunk/documentation/docs/xdocs/changes.xml
MODIFY /jakarta/cactus/trunk/documentation/docs/xdocs/integration/ant/task_cactus.xml
MODIFY /jakarta/cactus/trunk/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractJavaContainer.java

Vincent Massol added a comment - 10/Dec/04 01:28 PM
Felipe,

1/ About the deprecation. This should only happen if you use <java jvmarsg="...">. You shouldn't get it at the Java API level (at least I did not notice it when I've done the change on Cargo - Maybe I've just missed it).

2/ About the maven plugin. I think having one per container is the most flexible and would be useful to run cactus tests on several containers at once. You could always have a generic one and then have each container-specific one default to the generic one.

thanks

Felipe Leme added a comment - 10/Dec/04 01:41 PM
Nevermind, I figured out the solution: calling createJvmarg().setLines() instead of createJvmarg().setValue().

In fact, that's exactly what the setJvmargs method does:

    public void setJvmargs(String s) {
        log("The jvmargs attribute is deprecated. "
            + "Please use nested jvmarg elements.", Project.MSG_WARN);
        cmdl.createVmArgument().setLine(s);
    }

    public Commandline.Argument createJvmarg() {
        return cmdl.createVmArgument();
    }

So, I fixed that - the only pending issue now is which properties to use on the maven plugin.

-- Felipe

Felipe Leme made changes - 10/Dec/04 01:41 PM
Type Bug [ 1 ] Improvement [ 4 ]
Affects Version/s 1.6.1 [ 10715 ]
Fix Version/s 1.7 [ 10693 ]
Vincent Massol added a comment - 10/Dec/04 01:57 PM
ok, I get it. I've fixed Cargo accordingly. Thanks.

Repository Revision Date User Message
ASF #239097 Fri Dec 10 14:11:04 UTC 2004 felipeal Fix for CACTUS-158: added jvmArgs to all container tasks
Files Changed
MODIFY /jakarta/cactus/trunk/integration/maven/xdocs/changes.xml
MODIFY /jakarta/cactus/trunk/integration/maven/plugin.jelly
MODIFY /jakarta/cactus/trunk/integration/maven/xdocs/properties.xml
MODIFY /jakarta/cactus/trunk/integration/maven/plugin.properties

Felipe Leme added a comment - 10/Dec/04 02:14 PM
I also applied the changes to the maven plugin - please let me know if they're fine...

Felipe Leme made changes - 10/Dec/04 02:14 PM
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Vincent Massol added a comment - 10/Dec/04 02:26 PM
I haven't tried them but sounds good to me!

Repository Revision Date User Message
ASF #239101 Mon Jan 10 19:08:16 UTC 2005 felipeal CACTUS-158: added jvmArgs to all container tasks
Files Changed
MODIFY /jakarta/cactus/trunk/integration/maven/plugin.jelly