Re: memory leak with large POST

2003-08-14 Thread Reinhard Nägele
I've seen OutOfMemoryErrors, too. They especially happen if your request 
has a content type of "multipart/form-data" and your form is very large. 
I had a page whose number of input fields was dynamic. If there were to 
many fields, I'd get an OutOfMemoryError. As far as I remember, it 
happened on parsing the request somewhere in 
CommonsMultipartRequestHandler or FileUploadBase. As a workaround, I 
created a separate form for the file upload only. This makes sense 
anyway, since FileUpload involves a lot of overhead.

Reinhard

Leone, James wrote:

We're a few days from pushing a Struts based application to production.
One of our clever QA created a simple Perl script which assembles a POST
with one very large parameter (80k) and calls the front page of our
application.  The front page action does not use an actionform nor does
it examine the large parameter in any way; however, after so many
serialized calls from this script, we experienced out of memory errors.
We did a lot of customizing on Struts, so to narrow down where the code
was I deploy the struts-example.war.  I pointed the same script to
/struts-example/tour.do Again the parameter is not used by this action,
but in the same number of requests this caused an out of memory error.
All of this was done running Weblogic 7.0 SP 1.  To further determine
the problem, I ran the struts-example application in Tomcat.  In a
similar amount of time, down she went.
Has anybody run tests of this nature?  Any ideas why the gc is not
collecting it's due memory.  No...this is not a session thing.  I've run
other apps that do not use Struts, but do use sessions, and they stood
strong.  

Smaller sized POSTs have revealed a similar memory problem, it just
takes longer to surface. Right now I'm using hprof to investigate
further.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: commons-fileupload.jar

2003-08-14 Thread Reinhard Nägele
Download Struts 1.1 again. I think they packaged a wrong jar when Struts 
1.1 was released, which was fixed later. DiskFileUpload is definitely 
included in my Struts 1.1 distribution.

Reinhard

Filip Polsakiewicz wrote:

Hi everybody,

i found that the commons-fileupload.jar shipped with struts is not complete
compared to the original commans-fileupload.jar
In our project we need e.g. the class DiskFileUpload which is not included
in the struts version. On the other hand i cannot take the "original"
version since then struts fileupload doesn't work. Is there any full
featured version of fileupload.jar for struts? ... or how can i get struts
to work with the original jar?
Thank Filip



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidator Form is Null

2003-06-17 Thread Reinhard Nägele
Not true. Struts always creates the form for you if it is configured 
correctly. It doesn't matter if the request is submitted from a JSP or 
results from clicking a link. IMHO you should never create forms 
yourself. I presume this is a configuration problem.

Reinhard

Ben Anderson wrote:

I had trouble with this as well.  Hopefully, the answer you're looking 
for was as simple as the one I was.  The action is looking for a form 
and can't find it.  Make sure you are submitting the form from the jsp 
page its coming from?  If not, you'll need to add the form somewhere 
in the action.
-Ben Anderson


From: Natalie D Rassmann <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: DynaValidator Form is Null
Date: Tue, 17 Jun 2003 07:24:10 -0400
Sorry, that line isn't throwing the null pointer exception.  It is
returning a null as the form.  The line throwing the null pointer
exception is
reviewRecordForm.set( "dispatchAction", "createPeerRec" );
Gemes Tibor wrote:

> Natalie D Rassmann írta:
>
> >I am getting a null pointer exception on the following line:
> >
> > DynaActionForm reviewRecordForm = (DynaActionForm)form;
> >
> >
> This line could not throw NPE.
> The proper way of retrieving the values stored in dyna form
> is via beanutils package eg PropertyUtils.getProperty(form, "prop");
>
> Tib
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Communication applet-servlet, how to do a forward.

2003-06-17 Thread Reinhard Nägele
This is not a bug. The applet creates a request and receives the 
response. The browser doesn't know anything about this. You need to call 
getAppletContext().showDocument(URL) in your applet. Of course, you 
could create an URL from an ActionForward, serialize it to your applet, 
and then call showDocument(URL) with that URL. This way, you'd always 
create a new request, a forward is not possible.

Reinhard

[EMAIL PROTECTED] wrote:

Hello!

I'm developing an application with communication between applet and 
front-controller (that calls the corresponding Actions). No problem 
here, I do that with response.getOutputStream... , works!

The problem comes here: I want to do a forward, with the corresponding 
action. For do that I open a connection in the applet that calls the 
corresponding action. In this action nothing is recieved or sent 
because if the connection becomes commited no forward is posible. In 
this way I do de findForward and it seems to work, in fact in the log 
file it is register as successful, but my navigator don't do anything, 
even if the action is forward or sendRedirect, I've tried both.

I'm not sure if it is a bug or not.

Thanks for all.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: RC2 requiredif validation rule syntax change

2003-06-16 Thread Reinhard Nägele
Thanks for pointing this out. I wonder nobody else has responded to your 
message.

What's the point of that kind of change? I read the release notes and 
couldn't find anything about this. That's the place where such kinds of 
changes ought to be listed!

Reinhard

Kevin Robair wrote:

FYI:

While testing my app with RC2, I noticed this:

In RC1, the requiredif validator rule used these tags:

field-test[n]
field-value[n]
field-join[n]
In RC2, it uses:

fieldValue[n]
fieldTest[n]
fieldJoin[n]
If you are getting a reflection error / null pointer
exception, this is why. 

-Kevin



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Class-Path entry in struts.jar (Struts 1.1 RC 2)

2003-06-16 Thread Reinhard Nägele
The manifest file of the struts.jar of Struts 1.1 RC 2 contains the 
following class-path entry:

Class-Path:  commons-beanutils.jar commons-collections.jar commons-dig
ester.jar commons-logging.jar commons-pool.jar commons-validator.jar
jakarta-oro.jar struts-legacy.jar
This does not correspond to the jars bundled with Struts. The reference 
to commons-pool.jar is obsolete, commons-fileupload.jar and 
commons-lang.jar are missing. Actually, I don't see the need for a 
class-path entry at all. The webapp's classloader will make the classes 
available anyway. Maybe someone can enlighten me here.

Thanks,
Reinhard


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts 1.1 RC1 - Validator problems on Linux only

2003-03-21 Thread Reinhard Nägele
Thanks for the info. I guess, the Internet connection was the problem 
then. I searched the bug database but couldn't find this. I'll check again.

Reinhard

COMPAGNON GUILLAUME wrote:
ensure you ve got the very last version of commons-validator

in fact, with the commons validator bundled with 1.1RC1, there is a bug when
the machine has no connection to the Internet
for more information, have a look to the bug database.

regards
Guillaume Compagnon



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Struts 1.1 RC1 - Validator problems on Linux only

2003-03-21 Thread Reinhard Nägele
Hi,

we've been developing an application with Struts 1.1 RC1 which runs fine 
on Win 2000 machines. Today we deployed it to a Linux machine (Red Hat, 
JDK 1.4.1_01, Tomcat 4.1.12) and found out that the validator didn't 
work as expected, i. e. validation simply never failed. So I decided to 
attach to the VM and debug into the code. To do so, I needed the 
validator sources which, unfortunately, are not part of the Struts 
source distribution. So, I used the latest nightly build of the 
validator, attached to the process in order to debug into it, and, guess 
what, now it worked.

So, I really wonder what this was. Has anybody else experienced such 
behavior? Are there any Linux-specific issues?

Thanks,
Reinhard


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Best way to forward to login, then re-forward to originallyrequestedresource?

2002-05-29 Thread Reinhard Nägele

Save mapping in session and go to login page:

session.setAttribute(REDIRECT_KEY, mapping);
return mapping.findForward("login");


In your login action, check if a mapping is in the session and go there:

ActionMapping redirectMapping =
(ActionMapping) session.getAttribute(REDIRECT_KEY);
if (redirectMapping != null) {
session.removeAttribute(REDIRECT_KEY);
return new ActionForward(redirectMapping.getInput());
}


Reinhard


Rick Mann wrote:

>on 5/28/02 11:59 PM, Adam Hardy at [EMAIL PROTECTED] wrote:
>
>  
>
>>I wouild save the form bean and a mapping or action forward in the
>>session, and collect them when the in-between task is finished.
>>
>>
>
>Yeah, I was thinking of that, too.
>
>Okay, so here's the struts-specific problem: how do I get the name of the
>action in a way that I can use later to generate an ActionForward? If I call
>mapping.getPath(), I get the path used in the mapping, but it will be
>"outside" of the pattern set up in the deployment descriptor. Typically, it
>will not end in ".do".
>
>Right now, I do this:
>
>forward = new ActionForward();
>forward.setContextRelative(true);
>forward.setPath(originalResource + ".do");
>
>This works, but won't work if the original resource was a .jsp. (I'd like to
>put a tag at the top of a JSP to check for a valid login). In fact, it
>doesn't work in the general case (say the deployment action servlet mapping
>is "/action/*" instead of "*.do").
>
>Perhaps I just don't understand container-managed security well enough. How
>can I cause one of my User objects to be created in the session when the
>user gets authenticated? As far as what's provided by the server, it just
>sets a user name (and principal) available to servlets. I suppose I could
>look for the user, and if it's not found, create one based on the result of
>isUserInRole() et al., but it just seems less than elegant. I'll post a more
>general question to the Tomcat list.
>
>
>  
>

-- 
Reinhard Nägele
MGM EDV-Beratung GmbH
Frankfurter Ring 105 a
80807 München
Tel.: +49 89 358680-817
Fax: +49 89 358680-88
E-Mail: [EMAIL PROTECTED]
Web: www.mgm-edv.de




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>