admin@glassfish.java.net

Re: multibyte characters in instance names

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Fri, 28 Jan 2011 09:37:16 -0600

I updated the bug with a comment. The problem is likely that the LANG
environment variable is not set to support UTF-8 when starting the
server. Try setting LANG=en_US.utf-8. Then the characters will be
written correctly to the domain.xml file.

BTW, I've assigned the original bug that bought up this issue (15706) to
Carla for investigation. I suspect that what is happening is that when
create-instance invokes the asadmin command to run various hidden
commands, such as _create-instance-filesystem, an instance name that has
a multibyte character is not being passed correctly on the command line
for some operating systems. I was able to create an instance with a
multibyte character on Linux, just as you were able to on MacOS, but
this fails on Windows. While you were able to delete an instance on
MacOS, this definitely fails on both Windows and Linux. So there is
some OS variation here.

Tom


On 1/27/2011 9:09 PM, Jason Lee wrote:
> I see the same behavior from the CLI, but not from REST. Perhaps
> asadmin is lousing up the MB chars...
>
> On 1/27/11 7:03 PM, Anissa Lam wrote:
>>
>>
>> On 1/27/11 4:38 PM, Jason Lee wrote:
>>> I'm not seeing a problem in REST. I created a test that creates an
>>> instance named i1듈2. I then get a list of all the servers, request
>>> that particular server, then delete. All operations succeed, and
>>> the value is stored correctly in domain.xml.
>>>
>>> We discussed MB chars some time ago, and Tom and I were working on
>>> making all of the XML parsing UTF-8-friendly, but it was decided
>>> that people who need MB char support were likely to have their
>>> systems configured correctly so that making all of the changes in
>>> the admin layer to explicitly support it weren't necessary. It
>>> would seem, then, that Anissa is, for some reason, running into
>>> that, though I can't explain why. We're both on Macs, and I know I
>>> didn't do anything special WRT encodings, locales, etc.
>> I didn't do anything special in my system either. And i have no
>> problem with v2.
>> Maybe someone else can try this. Try using CLI to create 2 instances
>> and see what happen.
>>
>> Anissa.
>>>
>>> At any rate, I think REST is fine unless my shot in the dark above
>>> is off the mark. I can commit the test as soon as the trunk is open.
>>>
>>> On 1/27/11 6:33 PM, Anissa Lam wrote:
>>>>
>>>> I believe there is problem in 'admin' besides the REST layer. Here
>>>> is what i see.
>>>> In GUI, I can create and list out standalone instances with multi
>>>> byte char. See attached image.
>>>> However, if you look at domain.xml, the name is incorrect. It has
>>>> "??" instead. In v2, I can see that the multi-byte char is
>>>> written out correctly.
>>>> v2: <server config-ref="玻璃鱼-config" lb-weight="100" name="玻璃
>>>> 鱼" node-agent-ref="AAA">
>>>>
>>>> v3: <server name="??" node-ref="localhost-domain1"
>>>> config-ref="??-config"></server>
>>>>
>>>> The name is fine as long as you don't stop the server after
>>>> creating this instance. I guess it is still in memory ok.
>>>>
>>>> But once you stop the server, I cannot even bring up console.
>>>> Caused by: java.util.regex.PatternSyntaxException: Dangling meta
>>>> character '?' near index 0
>>>> ??-config
>>>> ^
>>>> at java.util.regex.Pattern.error(Pattern.java:1713)
>>>> at java.util.regex.Pattern.sequence(Pattern.java:1878)
>>>> at java.util.regex.Pattern.expr(Pattern.java:1752)
>>>> at java.util.regex.Pattern.compile(Pattern.java:1460)
>>>> at java.util.regex.Pattern.<init>(Pattern.java:1133)
>>>> at java.util.regex.Pattern.compile(Pattern.java:823)
>>>> at java.util.regex.Pattern.matches(Pattern.java:928)
>>>> at java.lang.String.matches(String.java:2090)
>>>> at
>>>> com.sun.jsftemplating.el.PermissionChecker.hasPermission(PermissionChecker.java:553)
>>>>
>>>> at
>>>> com.sun.jsftemplating.layout.descriptors.handler.Handler.hasPermission(Handler.java:506)
>>>>
>>>> at
>>>> com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:430)
>>>>
>>>> at
>>>> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
>>>>
>>>>
>>>> So, I think the first step is able to persist this mb char in
>>>> domain.xml.
>>>> I am afraid I will have to touch a lot of pages in GUI, since name
>>>> usually is in the endpoint, and needs to be encoded.
>>>>
>>>> Should i file a separate bug against admin for domain.xml
>>>> persistence ? This sounds like a blocker issue to me.
>>>>
>>>> ps. I have trouble sending email to admin_at_glassfish.java.net
>>>> alias. Every email i sent to the alias is bounced back. Thats why
>>>> i specifically 'cc' each of you. Sorry for the duplicate.
>>>>
>>>> thanks
>>>> Anissa.
>>>>
>>>>
>>>> On 1/27/11 2:18 PM, Tom Mueller wrote:
>>>>> Created issue 15719.
>>>>> http://java.net/jira/browse/GLASSFISH-15719
>>>>>
>>>>> On 1/27/2011 3:03 PM, Ludovic Champenois wrote:
>>>>>> On 1/27/11 12:52 PM, Tom Mueller wrote:
>>>>>>> Thanks Anissa for checking on this. So these are bugs then.
>>>>>>> Does the REST team want yet another bug filed for the
>>>>>>> IllegalArgumentException or should I just tack this on to issue
>>>>>>> 15705?
>>>>>>>
>>>>>> yep, and the log file if any
>>>>>> Ludo
>>>>>>> Thanks.
>>>>>>> Tom
>>>>>>>
>>>>>>> On 1/27/2011 2:14 PM, Anissa Lam wrote:
>>>>>>>>
>>>>>>>> I just checked, we do support multibyte char in v2. See
>>>>>>>> attached.
>>>>>>>>
>>>>>>>> Anissa.
>>>>>>>>
>>>>>>>> On 1/27/11 12:01 PM, Tom Mueller wrote:
>>>>>>>>> Today, issue 15706 was filed because of an English error message
>>>>>>>>> being generated when multibyte character is used in an
>>>>>>>>> instance name.
>>>>>>>>> http://java.net/jira/browse/GLASSFISH-15706
>>>>>>>>>
>>>>>>>>> While looking into this, I was wondering why such an instance
>>>>>>>>> name
>>>>>>>>> was even allowed since instance names are only supposed to
>>>>>>>>> contain
>>>>>>>>> letters, numbers and some special characters. As it turns
>>>>>>>>> out, the
>>>>>>>>> regular expression that is used for validating the name uses
>>>>>>>>> "\p{L}"
>>>>>>>>> for letters, which means any Unicode character that is a
>>>>>>>>> letter, not
>>>>>>>>> just ASCII letters. In my test, I was able to create an
>>>>>>>>> instance with
>>>>>>>>> a multibyte character, but then I couldn't start it or delete
>>>>>>>>> it from
>>>>>>>>> the console because I get an IllegalArgumentException from the
>>>>>>>>> REST
>>>>>>>>> interface (see the bug report for details).
>>>>>>>>>
>>>>>>>>> So my question is this - do we really support creation of
>>>>>>>>> instances
>>>>>>>>> with multibyte characters in their names?
>>>>>>>>>
>>>>>>>>> If no, then we need to change the regex that is used to
>>>>>>>>> validate the
>>>>>>>>> name.
>>>>>>>>> If yes, then we might have lots of bug fixing to do to get
>>>>>>>>> this to
>>>>>>>>> work end-to-end.
>>>>>>>>>
>>>>>>>>> Does anybody know what 2.1 supports here?
>>>>>>>>>
>>>>>>>>> Tom
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>
>>>
>
>