Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Hi,

It would be quite hard to reproduce the problem in quickstart application.
Here is the code of DynamicImageResource:

@Override
protected byte[] getImageData(IResource.Attributes attributes) {
try {
return IOUtils.toByteArray(stream);
} catch (IOException ex) {
LOG.error(Could not return byte[] from  + stream, ex);

return null;
} finally {
if(stream != null){
try {  
stream.close();
} catch (IOException ex) {
LOG.error(Could not close stream, ex);
}
}
}
}

And then I use the NonCachingImage in conjunction with my
DynamicImageResource implementation class.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856p4668863.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Yeah, sure. Here is the code:

public class LocalFileResource extends DynamicImageResource {
private final Logger LOG = Logger.getLogger(LocalFileResource.class);

private String filePath;
private InputStream stream;

public LocalFileResource(String filePath) throws FileNotFoundException {
this.filePath = filePath;

File file = new File(filePath);
if(!file.exists()){
throw new FileNotFoundException(Could not load file  +
filePath);
}

try {
stream = new FileInputStream(file);
} catch (FileNotFoundException ex) {
throw new FileNotFoundException(Could not obtain stream from 
+ filePath);
}
}

public LocalFileResource(InputStream stream) {
if(stream == null){
throw new IllegalArgumentException(Stream cannot be null);
}

this.stream = stream;
}

@Override
protected byte[] getImageData(IResource.Attributes attributes) {
try {
return IOUtils.toByteArray(stream);
} catch (IOException ex) {
LOG.error(Could not return byte[] from  + stream);

return null;
} finally {
if(stream != null){
try {  
stream.close();
} catch (IOException ex) {
LOG.error(Could not close stream:  + ex.getMessage());
}
}
}
}
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856p4668865.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Hi,

It's used very rarely so it should not be a problem. However I've moved the
stream creation from the constructor to getImageData method. 

The important point here - it only happens when the crawler visits my
website. When normal users visit my website the file descriptors are closed
successfully.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856p4668868.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Actually I've checked the code in the second constructor and the stream is
the ByteArrayInputStream instance. But I've moved the stream creation from
the first constructor to the getImageData because that's the constructor I
use to create the 99% of the images in my website.

And yes I've changed it today.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856p4668870.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Looks like it's working now :)

Thank you Francois for your help :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856p4668874.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Possible memory leak in Wicket 1.5.12

2014-12-19 Thread Satrix
Hello,

I've developed an Wicket website in Wicket 1.5.12. It's hosted on Glassfish
server 3.1.2.2 and lately I've run into the following problem:

The problem only occurs when a crawler (for example googlebot) visits my
website and then when it's crawling, Glassfish opens a lot of file
descriptors (for images) and doesn't close it. This leads to Too many open
files exception and right after that my server crashes. Those file
descriptors are open all the time - I've to restart the server to delete the
file descriptors.

So I wanted to ask if it's possible that it's a wicket related problem or
it's just Glassfish problem ?

Thank you for any help.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Load Image in IE fails

2013-01-26 Thread Satrix
Hello,

Im struggling with a very strange problem. Im loading the images from the
file system using NonCachingImage or Image classes and everything work fine
in FF but in IE it fails to load the images randomly and for example:

1. First request it loads all images.
2. Second request it fails to load some of the images.
3. Third request it loads all images.
4. etc etc.

I've tried everything and I would really appreciate if someone could point
me in the right direction.

Regards



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Load-Image-in-IE-fails-tp4655776.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket Form + multiple fields

2012-12-01 Thread Satrix
Hello,

Im struggling with a strange behaviour.

Introduction:

1. I want to show user his products in a cart. So each row contains product
name + textfield with quantity.
2. He can set the quantity to other value. Some products have maximum number
per transaction. So I've added validators the textfields.
3. Im using PropertyModel(myObject, quantityProperty) for each Textfield.
4. Now when user clicks on checkout button and lets say I have two products
- one product passes the validation, the second doesn't the values of both
fields are restored to default. I don't get this behaviour because when
product passes the validation his model should be updated with new value but
it doesn't.

Any idea how could I change this ?

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Form-multiple-fields-tp4654407.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-24 Thread Satrix
Cause Im eager to learn new things :)

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4654128.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Satrix
Hello Martin,

I'll check this out today and let you know if it helps.

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653990.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Satrix
Unfortunately even after changing the version of the
wicketstuff-javaee-inject to newer version the problem still exists. 

What's more interesing is that when I navigate over the page (everything
except back button) the @Stateful bean works. Only back button click
recreates the @Stateful bean (but... after the bean has been recreated, when
I click on a links etc, container returns me correct bean instance (previous
bean - before recreation)).

I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
they could provide me a workaround or smth ?

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Satrix
Nope. Look at the example:

1. User has chose to add a product to the Cart (so now the cart number is 1
and he can see that number in a proper place on the page).

2. Now when he clicks back button - bean is recreated - so the cart number
is 0 (list is recreated).

3. BUT now when I click on any other link on my page container returns
previous EJB bean so the cart number is 1.

Btw Im using LoadableDetachableModel so there is no way that the user is
seeing stale data.

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653995.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-18 Thread Satrix
Hello,

Im using Wicket 1.5.8 + EJB 3.1. To configure Wicket with EJB Im using:
dependency
   groupIdorg.wicketstuff/groupId
   artifactIdjavaee-inject/artifactId
   version1.5-RC5.1/version
/dependency

Everything seemed to work when I was using only @Stateless beans. But now,
it's the time that I need to introduce @Stateful bean into the application.
And because of that I'm struggling with a very strange problem. Everything
works as expected except... back button. When I click back button -
@Stateful EJB is being recreated each time I press back button. So it's
ruining my logic. 

Any idea what's happening ?

Thank you in advance, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Access Denied Page

2012-04-16 Thread Satrix
Hi,

Yeah, the INFO logging is ON so that's not the case. I've resolved the
problem... but I don't know what was causing it. Two reasons:

1. Multipart set to true on form
2. Nested form

But the problem is that it was only occuring on external hosting. Locally it
was working like a charm.

Regards, Satrix


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Access-Denied-Page-tp4555096p4560780.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Access Denied Page

2012-04-13 Thread Satrix
Hello,

I'm facing really strange behaviour and I can't find out what's causing
this. Let me describe this scenario:

1. We have an external hosting and the wicket app is running out there.
2. There is a form to upload a file to FTP.
3. When I try to upload a file I get Access Denied Page. However I dont use
any authorize strategies etc. My logs are clear and there are no exceptions
in the logs.

The interesting thing is that on my local machine it's working like a charm
but on the external hosting sometimes it's working and sometimes it's not.

So any idea what can cause such a problem ?

Regards, Satrix

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Access-Denied-Page-tp4555096p4555096.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket Application on GoDaddy

2012-04-04 Thread Satrix
Yeah, You are right about that it's GoDaddy's problem. Their support couldn't
help me with it... But my collegue who's managing this hosting finally did
it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Application-on-GoDaddy-tp4529071p4534008.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket Application on GoDaddy

2012-04-03 Thread Satrix
Hello,

I'm trying to deploy my application on GoDaddy and it works but... let's say
that I've domain that is available under www.domain.com
WAR file name is: warfilename

When the installation is done my application is available under
www.domain.com/warfilename/home
And the question is how to deploy it there to run at www.domain.com/home

When I run my application on my local machine it starts at
www.localhost:8080/home so it looks like the configuration is ok.

My web.xml configuration is:

filter  
filter-namewicket.website/filter-name  
   
filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class  
init-param  
param-nameapplicationFactoryClassName/param-name
   
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
init-param
param-nameconfiguration/param-name
param-valuedeployment/param-value
/init-param
init-param  
param-nameapplicationClassName/param-name
param-valuesec.website.WicketApplication/param-value
/init-param
/filter  

filter-mapping
filter-namewicket.website/filter-name
url-pattern/*/url-pattern
/filter-mapping

So do you have any idea how can I solve this problem or maybe it a problem
on their side ?

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Application-on-GoDaddy-tp4529071p4529071.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket Application on GoDaddy

2012-04-03 Thread Satrix
I changed the name of WAR file to ROOT.war but no luck now it's
www.domain.com/ROOT/home :/
From what I know there is tomcat 5 running

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Application-on-GoDaddy-tp4529071p4529402.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket Application on GoDaddy

2012-04-03 Thread Satrix
Yes. I know that I can redirect all requests but the question is how to
deploy Java Web App on their hosting because there is something like
Parallels Panel and you have to upload your WAR file and the files are
generated (cant edit them by hand).

That's why my application is available under www.domain.com/warfilename/home
My context.xml file in the application has path= so it should start on
default path

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Application-on-GoDaddy-tp4529071p4531015.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



POST parameters lost during InterceptException

2012-03-30 Thread Satrix
Hello,

Let me describe my problem. Easy scenario, I have two pages. Login Page and
Order Page. In order to access Order Page you need to be logged in. If you
are not then my SimplePageAuthorizationStrategy will intercept that and
redirect user to Login Page and here is my problem because I send post
parameters to Order Page and after the redirection they are lost. 

I use Apache Wicket 1.5.5 and SimplePageAuthorizationStrategy.

Any idea how can I resolve such a problem ?

Regards, Satrix

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-lost-during-InterceptException-tp4518350p4518350.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: POST parameters lost during InterceptException

2012-03-30 Thread Satrix
Hmm, one question where shall I setup a breakpoint ? Cause I've no idea how
to debug only the
org.apache.wicket.RestartResponseAtInterceptPageException.InterceptData#set().

Regards, Satrix

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-lost-during-InterceptException-tp4518350p4518458.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: POST parameters lost during InterceptException

2012-03-30 Thread Satrix
Moreover, I've debugged continueToOriginalDestination (InterceptData data =
InterceptData.get();)
and the parameters are in the data but at
(RequestCycle.get().replaceAllRequestHandlers(new
RedirectRequestHandler(url));) it goes into the replaceAllRequestHandlers
method and then from this method it goes to (private void
internalInvoke(final Component component, final Object target)) and it ends
up in catch section of this method.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-lost-during-InterceptException-tp4518350p4518639.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: POST parameters lost during InterceptException

2012-03-30 Thread Satrix
The point is that I cannot catch the exception. The code enters first if in
the catch section:
if (e.getTargetException() instanceof ReplaceHandlerException ||
e.getTargetException() instanceof AuthorizationException ||
e.getTargetException() instanceof WicketRuntimeException)
{
throw (RuntimeException)e.getTargetException();
}

It's ReplaceHandlerException and during the debugg session there is no
message, cause or stacktrace in the exception object. But the exception's
target status is 302. So it's some kind of error code or something but it
doesnt say anything about the exception.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-lost-during-InterceptException-tp4518350p4518736.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



POST parameters in URL Problem

2012-03-28 Thread Satrix
Hello,

I'm facing really strange behaviour in my wicket web application. I have two
websites:

1. The first website at some point must send post data to another wicket
website. The form code that's gonna transport post data:
String form = form id='redirectForm' method='post' action=' + redirectTo
+ ';
form += input type='hidden' name='transactionId' value=' + transactionId
+ '/;
form += /form;
form += ;

2.The second website lets say is working under
http://localhost:8080/app/home

Nothing fancy. Just a Post method and a hidden field with value. Everything
works like a charm except that after the redirect is done I can see the
parameter that was send by post method. The result looks like:
http://localhost:8080/app/home?transactionId=1231231231

I use Apache Wicket 1.5 and to map requests to url's I use:
new AnnotatedMountScanner().scanPackage(package.website).mount(this);

Then on every web page I use annotations like:
@MountPath(value = home)

The HomePage has constructor with PageParameters. I can see those parameters
in the PageParameters but my question is why is this parameter visible in
the url? How can I change it ?
Please point me in the right direction.

Thank you in advance, Satrix

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-in-URL-Problem-tp4512104p4512104.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: POST parameters in URL Problem

2012-03-28 Thread Satrix
Hey Martin, I've tried and changed the wicket version to 1.5.5 but the
problem still occurs :/
Any idea what can be wrong ?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-in-URL-Problem-tp4512104p4512167.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: POST parameters in URL Problem

2012-03-28 Thread Satrix
Ahhh! It works :). I had some WAR related issues. I confirm that by uprading
wicket version to 1.5.5 the problem with POST parameters in URL is fixed.

Martin THANK YOU VERY MUCH, you made my day :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/POST-parameters-in-URL-Problem-tp4512104p4512185.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org