You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Phill <ph...@leadseeker.co.uk> on 2011/11/12 15:45:37 UTC

CryptoMapper - Error decoding text

Hi,
I'm migrating a Wicket 1.4 app that uses CryptedUrlWebRequestCodingStrategy to 1.5.2 and I'm having some issues:

In my Application init() before I mount any pages I've got:
getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));

Any non-wicket URLs in my markup, for example image tags <img src="/images/myimg.jpg" …./> and also any references added in WebPage.renderHead() produce the exception below. The page displays fine including correctly linked images and stylesheets, but the exception is thrown.

@Override
public void renderHead(IHeaderResponse response) {
    super.renderHead(response);
    response.renderCSSReference("css/style.css");
}


ERROR - AbstractCrypt              - Error decoding text: css
java.lang.RuntimeException: Unable to decrypt the text 'r?'
	at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
	at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
	at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
	at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
	at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
..snip
Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
	at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
	at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
	at com.sun.crypto.provider.SunJCE_ab.b(DashoA13*..)
	at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(DashoA13*..)
	at javax.crypto.Cipher.doFinal(DashoA13*..)
	at org.apache.wicket.util.crypt.SunJceCrypt.crypt(SunJceCrypt.java:94)
	at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:146)
	... 32 more
ERROR - CryptoMapper               - Error decrypting URL
java.lang.IllegalArgumentException: Argument 'url' may not be null.
	at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
	at org.apache.wicket.request.Url.parse(Url.java:127)
	at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:160)
	at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
	at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
..snip

How can I avoid these errors?

Thanks
Phill


---
Lead Seeker - Lead Generation Done Right
http://www.leadseeker.co.uk



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


Re: CryptoMapper - Error decoding text

Posted by fachhoch <fa...@gmail.com>.
I could not reproduce  with the  quick start , it works in quick start   I
also tried with 1.5.1 still I could not produce it , not sure why my app is
getting error.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-Error-decoding-text-tp4034573p4587229.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CryptoMapper - Error decoding text

Posted by Martin Grigorov <mg...@apache.org>.
It is fixed in 1.5.4 so you have a new problem.
Create a ticket with a quickstart app

On Wed, Apr 25, 2012 at 5:59 PM, fachhoch <fa...@gmail.com> wrote:
> I am getting the same error , I am trying to migrate to wicket 1.5.5, is
> there a fix  for this ?
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-Error-decoding-text-tp4034573p4586850.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: CryptoMapper - Error decoding text

Posted by fachhoch <fa...@gmail.com>.
I am getting the same error , I am trying to migrate to wicket 1.5.5, is
there a fix  for this ?


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-Error-decoding-text-tp4034573p4586850.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CryptoMapper - Error decoding text

Posted by Phill <ph...@leadseeker.co.uk>.
https://issues.apache.org/jira/browse/WICKET-4222

On 12/nov/2011, at 23:33, Igor Vaynberg wrote:

> go ahead and create a quickstart and stick it into a jira.
> 
> thanks,
> -igor
> 
> On Sat, Nov 12, 2011 at 11:30 AM, Phill <ph...@leadseeker.co.uk> wrote:
>> I have now, same problem:
>> 
>> INFO  - WebApplication             - [wicket.cryptest] Started Wicket version 1.5.3 in DEVELOPMENT mode
>> ********************************************************************
>> *** WARNING: Wicket is running in DEVELOPMENT mode.              ***
>> ***                               ^^^^^^^^^^^                    ***
>> *** Do NOT deploy to your live server(s) without changing this.  ***
>> *** See Application#getConfigurationType() for more information. ***
>> ********************************************************************
>> 2011-11-12 20:27:59.244:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 STARTING
>> 2011-11-12 20:27:59.435:INFO:oejs.AbstractConnector:Started SslSocketConnector@0.0.0.0:8443 STARTING
>> [INFO] Started Jetty Server
>> ERROR - AbstractCrypt              - Error decoding text: logo.png
>> java.lang.RuntimeException: Unable to decrypt the text '??(?x'
>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
>>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
>>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>> 
>> Phill

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


Re: CryptoMapper - Error decoding text

Posted by Igor Vaynberg <ig...@gmail.com>.
go ahead and create a quickstart and stick it into a jira.

thanks,
-igor

On Sat, Nov 12, 2011 at 11:30 AM, Phill <ph...@leadseeker.co.uk> wrote:
> I have now, same problem:
>
> INFO  - WebApplication             - [wicket.cryptest] Started Wicket version 1.5.3 in DEVELOPMENT mode
> ********************************************************************
> *** WARNING: Wicket is running in DEVELOPMENT mode.              ***
> ***                               ^^^^^^^^^^^                    ***
> *** Do NOT deploy to your live server(s) without changing this.  ***
> *** See Application#getConfigurationType() for more information. ***
> ********************************************************************
> 2011-11-12 20:27:59.244:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 STARTING
> 2011-11-12 20:27:59.435:INFO:oejs.AbstractConnector:Started SslSocketConnector@0.0.0.0:8443 STARTING
> [INFO] Started Jetty Server
> ERROR - AbstractCrypt              - Error decoding text: logo.png
> java.lang.RuntimeException: Unable to decrypt the text '??(?x'
>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>
> Phill
>
> On 12/nov/2011, at 19:33, Igor Vaynberg wrote:
>
>> have you tried with 1.5.3?
>>
>> -gior
>>
>> On Sat, Nov 12, 2011 at 10:27 AM, Phill <ph...@leadseeker.co.uk> wrote:
>>> Thanks, I had put setRootRequestMapper(..) first after reading https://issues.apache.org/jira/browse/WICKET-4139
>>> However putting it last does not seem to solve the problem, I can replicate the error with a pristine 1.5.2 quickstart and just changing the init() to:
>>>
>>> public void init() {
>>>    super.init();
>>>    getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
>>>    setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
>>> }
>>>
>>> The links in the standard quickstart HomePage.html markup cause the exceptions.
>>> Phill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: CryptoMapper - Error decoding text

Posted by Phill <ph...@leadseeker.co.uk>.
I have now, same problem:

INFO  - WebApplication             - [wicket.cryptest] Started Wicket version 1.5.3 in DEVELOPMENT mode
********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
***                               ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************
2011-11-12 20:27:59.244:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 STARTING
2011-11-12 20:27:59.435:INFO:oejs.AbstractConnector:Started SslSocketConnector@0.0.0.0:8443 STARTING
[INFO] Started Jetty Server
ERROR - AbstractCrypt              - Error decoding text: logo.png
java.lang.RuntimeException: Unable to decrypt the text '??(?x'
	at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
	at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
	at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
	at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)

Phill

On 12/nov/2011, at 19:33, Igor Vaynberg wrote:

> have you tried with 1.5.3?
> 
> -gior
> 
> On Sat, Nov 12, 2011 at 10:27 AM, Phill <ph...@leadseeker.co.uk> wrote:
>> Thanks, I had put setRootRequestMapper(..) first after reading https://issues.apache.org/jira/browse/WICKET-4139
>> However putting it last does not seem to solve the problem, I can replicate the error with a pristine 1.5.2 quickstart and just changing the init() to:
>> 
>> public void init() {
>>    super.init();
>>    getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
>>    setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
>> }
>> 
>> The links in the standard quickstart HomePage.html markup cause the exceptions.
>> Phill

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


Re: CryptoMapper - Error decoding text

Posted by Igor Vaynberg <ig...@gmail.com>.
have you tried with 1.5.3?

-gior

On Sat, Nov 12, 2011 at 10:27 AM, Phill <ph...@leadseeker.co.uk> wrote:
> Thanks, I had put setRootRequestMapper(..) first after reading https://issues.apache.org/jira/browse/WICKET-4139
> However putting it last does not seem to solve the problem, I can replicate the error with a pristine 1.5.2 quickstart and just changing the init() to:
>
> public void init() {
>    super.init();
>    getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
>    setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
> }
>
> The links in the standard quickstart HomePage.html markup cause the exceptions.
> Phill
>
> On 12/nov/2011, at 18:39, Igor Vaynberg wrote:
>
>> this:
>>
>> setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
>>
>> should be the last thing you do in your application#init()
>>
>> -igor
>>
>> On Sat, Nov 12, 2011 at 6:45 AM, Phill <ph...@leadseeker.co.uk> wrote:
>>> Hi,
>>> I'm migrating a Wicket 1.4 app that uses CryptedUrlWebRequestCodingStrategy to 1.5.2 and I'm having some issues:
>>>
>>> In my Application init() before I mount any pages I've got:
>>> getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
>>> setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
>>>
>>> Any non-wicket URLs in my markup, for example image tags <img src="/images/myimg.jpg" …./> and also any references added in WebPage.renderHead() produce the exception below. The page displays fine including correctly linked images and stylesheets, but the exception is thrown.
>>>
>>> @Override
>>> public void renderHead(IHeaderResponse response) {
>>>    super.renderHead(response);
>>>    response.renderCSSReference("css/style.css");
>>> }
>>>
>>>
>>> ERROR - AbstractCrypt              - Error decoding text: css
>>> java.lang.RuntimeException: Unable to decrypt the text 'r?'
>>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
>>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
>>>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
>>>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>>>        at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
>>>        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
>>>        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>>>        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>>>        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>>>        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
>>> ..snip
>>> Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
>>>        at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
>>>        at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
>>>        at com.sun.crypto.provider.SunJCE_ab.b(DashoA13*..)
>>>        at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(DashoA13*..)
>>>        at javax.crypto.Cipher.doFinal(DashoA13*..)
>>>        at org.apache.wicket.util.crypt.SunJceCrypt.crypt(SunJceCrypt.java:94)
>>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:146)
>>>        ... 32 more
>>> ERROR - CryptoMapper               - Error decrypting URL
>>> java.lang.IllegalArgumentException: Argument 'url' may not be null.
>>>        at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
>>>        at org.apache.wicket.request.Url.parse(Url.java:127)
>>>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:160)
>>>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>>>        at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
>>>        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
>>>        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>>>        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>>>        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>>> ..snip
>>>
>>> How can I avoid these errors?
>>>
>>> Thanks
>>> Phill
>>>
>>>
>>> ---
>>> Lead Seeker - Lead Generation Done Right
>>> http://www.leadseeker.co.uk
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: CryptoMapper - Error decoding text

Posted by Phill <ph...@leadseeker.co.uk>.
Thanks, I had put setRootRequestMapper(..) first after reading https://issues.apache.org/jira/browse/WICKET-4139
However putting it last does not seem to solve the problem, I can replicate the error with a pristine 1.5.2 quickstart and just changing the init() to:

public void init() {
    super.init();
    getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
    setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
}

The links in the standard quickstart HomePage.html markup cause the exceptions.
Phill

On 12/nov/2011, at 18:39, Igor Vaynberg wrote:

> this:
> 
> setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
> 
> should be the last thing you do in your application#init()
> 
> -igor
> 
> On Sat, Nov 12, 2011 at 6:45 AM, Phill <ph...@leadseeker.co.uk> wrote:
>> Hi,
>> I'm migrating a Wicket 1.4 app that uses CryptedUrlWebRequestCodingStrategy to 1.5.2 and I'm having some issues:
>> 
>> In my Application init() before I mount any pages I've got:
>> getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
>> setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
>> 
>> Any non-wicket URLs in my markup, for example image tags <img src="/images/myimg.jpg" …./> and also any references added in WebPage.renderHead() produce the exception below. The page displays fine including correctly linked images and stylesheets, but the exception is thrown.
>> 
>> @Override
>> public void renderHead(IHeaderResponse response) {
>>    super.renderHead(response);
>>    response.renderCSSReference("css/style.css");
>> }
>> 
>> 
>> ERROR - AbstractCrypt              - Error decoding text: css
>> java.lang.RuntimeException: Unable to decrypt the text 'r?'
>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
>>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
>>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>>        at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
>>        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
>>        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>>        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>>        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>>        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
>> ..snip
>> Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
>>        at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
>>        at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
>>        at com.sun.crypto.provider.SunJCE_ab.b(DashoA13*..)
>>        at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(DashoA13*..)
>>        at javax.crypto.Cipher.doFinal(DashoA13*..)
>>        at org.apache.wicket.util.crypt.SunJceCrypt.crypt(SunJceCrypt.java:94)
>>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:146)
>>        ... 32 more
>> ERROR - CryptoMapper               - Error decrypting URL
>> java.lang.IllegalArgumentException: Argument 'url' may not be null.
>>        at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
>>        at org.apache.wicket.request.Url.parse(Url.java:127)
>>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:160)
>>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>>        at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
>>        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
>>        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>>        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>>        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>> ..snip
>> 
>> How can I avoid these errors?
>> 
>> Thanks
>> Phill
>> 
>> 
>> ---
>> Lead Seeker - Lead Generation Done Right
>> http://www.leadseeker.co.uk
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: CryptoMapper - Error decoding text

Posted by Igor Vaynberg <ig...@gmail.com>.
this:

setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));

should be the last thing you do in your application#init()

-igor

On Sat, Nov 12, 2011 at 6:45 AM, Phill <ph...@leadseeker.co.uk> wrote:
> Hi,
> I'm migrating a Wicket 1.4 app that uses CryptedUrlWebRequestCodingStrategy to 1.5.2 and I'm having some issues:
>
> In my Application init() before I mount any pages I've got:
> getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
> setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
>
> Any non-wicket URLs in my markup, for example image tags <img src="/images/myimg.jpg" …./> and also any references added in WebPage.renderHead() produce the exception below. The page displays fine including correctly linked images and stylesheets, but the exception is thrown.
>
> @Override
> public void renderHead(IHeaderResponse response) {
>    super.renderHead(response);
>    response.renderCSSReference("css/style.css");
> }
>
>
> ERROR - AbstractCrypt              - Error decoding text: css
> java.lang.RuntimeException: Unable to decrypt the text 'r?'
>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>        at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
>        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
>        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
> ..snip
> Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
>        at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
>        at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
>        at com.sun.crypto.provider.SunJCE_ab.b(DashoA13*..)
>        at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(DashoA13*..)
>        at javax.crypto.Cipher.doFinal(DashoA13*..)
>        at org.apache.wicket.util.crypt.SunJceCrypt.crypt(SunJceCrypt.java:94)
>        at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:146)
>        ... 32 more
> ERROR - CryptoMapper               - Error decrypting URL
> java.lang.IllegalArgumentException: Argument 'url' may not be null.
>        at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
>        at org.apache.wicket.request.Url.parse(Url.java:127)
>        at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:160)
>        at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
>        at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
>        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
>        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
> ..snip
>
> How can I avoid these errors?
>
> Thanks
> Phill
>
>
> ---
> Lead Seeker - Lead Generation Done Right
> http://www.leadseeker.co.uk
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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