Thiery,

I had figured it was something to do with the Pattern class not being able to 
handle the regex that was generated.  I was hoping there was a workaround such 
as you provided.  I'll give it a try.  Thanks.

>Sam Bao | Software Engineer | Cerner Corporation | 816.201.8242 | [EMAIL 
>PROTECTED] | www.cerner.com

-----Original Message-----
From: Thierry Boileau [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 09, 2008 3:29 AM
To: discuss@restlet.tigris.org
Subject: Re: StackOverFlow warning

Hello all,

this problem has already been encoutered and seems to be related to this bug 
affecting the "java.util.regex.Pattern" class:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337993.

As a workaround, you can update your code like that:

Route route = router.attach("/result/{yourVar}", <Restlet instance or Resource 
class>); route.getTemplate().getVariables().put("yourVar", new 
Variable(Variable.TYPE_ALL));


best regards,
Thierry Boileau

> Hi,
>
> I've seen a couple of other discussion about this in the past, but 
> didn't know if there's been any progress.  Anyways, I've encountered a 
> java.lang.StackOverflowError when sending in a long attribute.  Here's 
> the warning I'm getting:
>
> Apr 8, 2008 10:59:58 AM org.restlet.util.Template match
> WARNING: StackOverflowError exception encountered while matching this 
> string :
> /result/c045d791-11b0-408e-8d60-b2f6ce6c117d,af3e28f4-2bdf-4b34-a74a-4
> 8f6c638a9b8,b242e13a-7083-45d6-a4db-5961883690db,a315b9cb-743c-422e-bb
> 1b-bedfa93957bd,ac399b7f-5a2a-4ddc-8a7b-d1106e1e28f4,ffe736ef-5dbf-420
> 4-a69c-b1599e012b75,1b876179-e897-4eb9-a5ae-b124fd69cbcb,b1c5abc4-b69c
> -4d5a-85fe-b320adab8f29,44efad37-ed0a-4bf0-80c8-55a82dfe89d3,bd43c7c4-
> 0949-40a3-998b-b6cf0d895cc9,45b046c1-a509-4835-a801-c5bca0855d49,8260a
> 9fd-9773-4803-8218-2de29082ef7a,2acd118a-5721-4aee-afcc-a28b3dd8bcbd,8
> 943d432-a147-4393-afbf-5de3bbfb3f28,3db028ad-4f8c-4355-a7ca-ac4af7a712
> be,d00faab9-0c2d-4b5b-84bf-810e375ec38f,c8780a2a-a7be-458e-a6ef-9f7392
> 2b0ca7,16525506-0df4-453e-b930-d9fd46e08b72,a50839f2-e3b2-4604-86bf-64
> 6af2ca048d,5383406a-c566-455b-8725-2c81aba82db0,ae3ceaa9-a495-4311-8e6
> 5-4e83aa02b2ad,0cfc54f9-9852-451e-9856-a63689cbb4e3,2faaa074-b21c-4c40
> -a632-b5e8e84aa09a,ec4f38de-e0de-437e-9e3f-19db4576f177,185b9d55-237f-
> 42b3-ba8a-bb005db09f2a,887ffc64-c190-439e-a9b2-261f55ea18e3,97683f00-1
> 51e-4508-8b77-5d34d1048843,1cfde617-ad79-4f81-bc30-bf017ecb5636,c4551d
> 09-b558-40a1-96ca-eea503d72815,2fa39dc8-d375-42a6-bc11-e8cf4a91ceb8,e2
> 198d2c-86c8-49e2-95c3-b6e88901cd68,f32600d5-1f27-4a4c-ae87-25caf0d91bd
> d,5156d109-aa69-4cf6-813c-7682b55d139e,b360f697-af9f-4e1e-8aff-e3d2fd5
> 10b0e,07f1db89-5b7f-4c9a-a177-003dffda8206,bc1103d2-7f0a-412e-9dc3-8c3
> 11c66c16b,2cefe92b-92ce-430f-89ee-8f2713afff2b,85cf0fb2-06d6-4d86-9146
> -4e8c951682b7,7acbaa77-d6bf-4271-a6b9-965ba5b83637,6ed9b90b-a533-4925-
> 9019-282f27c32f86,4447c1b8-7333-4be1-ad37-9a552aed8243,d1e0593e-c340-4
> 526-bc61-e98b74e2796b
>
> I'm trying to call a GET at the result resource using a list of comma 
> delimited uuids.  When it gets to the match(String formattedString) 
> method and it calls getRegexPattern().match(formattedString) on the 
> string above, it produces a Matcher with this regex:
> "/result/((?:[a-zA-Z0-9\\-\\.\\_\\~\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=\\
> :[EMAIL PROTECTED]|(?:\\%[0-9ABCDEFabcdef][0-9ABCDEFabcdef]))+)",
> and I get the stack overflow when matcher.lookingAt() is called.
>
> I've tried just matching on the above string with the regex 
> standalone, and it looks to be recursively calling pattern.match, and 
> causing the StackOverflowError.
>
> String s =
> "/result/c045d791-11b0-408e-8d60-b2f6ce6c117d,af3e28f4-2bdf-4b34-a74a-
> 48f6c638a9b8,b242e13a-7083-45d6-a4db-5961883690db,a315b9cb-743c-422e-b
> b1b-bedfa93957bd,ac399b7f-5a2a-4ddc-8a7b-d1106e1e28f4,ffe736ef-5dbf-42
> 04-a69c-b1599e012b75,1b876179-e897-4eb9-a5ae-b124fd69cbcb,b1c5abc4-b69
> c-4d5a-85fe-b320adab8f29,44efad37-ed0a-4bf0-80c8-55a82dfe89d3,bd43c7c4
> -0949-40a3-998b-b6cf0d895cc9,45b046c1-a509-4835-a801-c5bca0855d49,8260
> a9fd-9773-4803-8218-2de29082ef7a,2acd118a-5721-4aee-afcc-a28b3dd8bcbd,
> 8943d432-a147-4393-afbf-5de3bbfb3f28,3db028ad-4f8c-4355-a7ca-ac4af7a71
> 2be,d00faab9-0c2d-4b5b-84bf-810e375ec38f,c8780a2a-a7be-458e-a6ef-9f739
> 22b0ca7,16525506-0df4-453e-b930-d9fd46e08b72,a50839f2-e3b2-4604-86bf-6
> 46af2ca048d,5383406a-c566-455b-8725-2c81aba82db0,ae3ceaa9-a495-4311-8e
> 65-4e83aa02b2ad,0cfc54f9-9852-451e-9856-a63689cbb4e3,2faaa074-b21c-4c4
> 0-a632-b5e8e84aa09a,ec4f38de-e0de-437e-9e3f-19db4576f177,185b9d55-237f
> -42b3-ba8a-bb005db09f2a,887ffc64-c190-439e-a9b2-261f55ea18e3,97683f00-
> 151e-4508-8b77-5d34d1048843,1cfde617-ad79-4f81-bc30-bf017ecb5636,c4551
> d09-b558-40a1-96ca-eea503d72815,2fa39dc8-d375-42a6-bc11-e8cf4a91ceb8,e
> 2198d2c-86c8-49e2-95c3-b6e88901cd68,f32600d5-1f27-4a4c-ae87-25caf0d91b
> dd,5156d109-aa69-4cf6-813c-7682b55d139e,b360f697-af9f-4e1e-8aff-e3d2fd
> 510b0e,07f1db89-5b7f-4c9a-a177-003dffda8206,bc1103d2-7f0a-412e-9dc3-8c
> 311c66c16b,2cefe92b-92ce-430f-89ee-8f2713afff2b,85cf0fb2-06d6-4d86-914
> 6-4e8c951682b7,7acbaa77-d6bf-4271-a6b9-965ba5b83637,6ed9b90b-a533-4925
> -9019-282f27c32f86,4447c1b8-7333-4be1-ad37-9a552aed8243,d1e0593e-c340-
> 4526-bc61-e98b74e2796b";
>
> Pattern p =
> Pattern./compile/("/result/((?:[a-zA-Z0-9\\-\\.\\_\\~\\!\\$\\&\\'\\(\\
> )\\*\\+\\,\\;\\=\\:[EMAIL 
> PROTECTED]|(?:\\%[0-9ABCDEFabcdef][0-9ABCDEFabcdef]))+)")
> ;
>
> Matcher m = p.matcher(s);
> m.matches();
> m.lookingAt();
>
> Due to this problem, we're having to hack a solution of using the POST 
> method for doing gets (as well as deletes) when operating on a large 
> batch.  This works, but still a hack for what I presume to be a poorly 
> generated regex that's preventing us for truly using a GET to do a get 
> and a DELETE to do deletes.  I just wanted to bring this to people's 
> attention, and to probe for any answers.  Has there been any fix for 
> this, or will there be a fix for this in the future?  Thanks.
>
> Sam
>
> ----------------------------------------------------------------------
> -- CONFIDENTIALITY NOTICE This message and any included attachments 
> are from Cerner Corporation and are intended only for the addressee. 
> The information contained in this message is confidential and may 
> constitute inside or non-public information under international, 
> federal, or state securities laws. Unauthorized forwarding, printing, 
> copying, distribution, or use of such information is strictly 
> prohibited and may be unlawful. If you are not the addressee, please 
> promptly delete this message and notify the sender of the delivery 
> error by e-mail or you may call Cerner's corporate offices in Kansas 
> City, Missouri, U.S.A at (+1) (816)221-1024.


----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

Reply via email to