Isomorphic's SmartClient integrated into Railo on Tomcat: Umlauts not displayed correctly

44 views
Skip to first unread message

verlsnake

unread,
Sep 12, 2012, 4:00:57 PM9/12/12
to ra...@googlegroups.com
I use Isomorphic's SmartClient (ISC) integrated with Railo on Tomcat; in my newest installation, the following error occurs: Umlauts - or, more generally speaking, multi-byte UNICODE chars - fetched from a MySQL DB are no longer displayed correctly in SmartClient widgets ...

This is - of course - a showstopper issue for me !

Therefore, I have done a LONG investigation ! And fortunately I have found out the following rock solid reasons for this showstopper issue:

- On the SmartClient side:
  * Using newer versions - currently 'SmartClient_SNAPSHOT_v90d_2012-09-08' - of the two JARs 'isomorphic_core_rpc.jar' and 'isomorphic_sql.jar' causes this issue
  * When using older versions from 'SmartClient_SC_SNAPSHOT-2011-09-23', this issue does NOT occur
  * I cannot tell You, however, from which version onwards this issue occurs


- On the Railo side:
  * A call to
    '<cfset getPageContext().getSession().setAttribute("attrName", attrValue) />'
    causes this issue
  * Obviously, there's something going on which disturbs the J2EE session for newer ISC versions ...


- Setting a session variable in a pure JSP WITHOUT Railo:
  * I have done a short test for this like so:
    <%@ page language="java" import="java.util.*"%>
    <%
      request.getSession().setAttribute("attrName", attrValue);
    %>
  * The showstopper issue does NOT occur


So yes: Unfortunately I could NOT reproduce this showstopper issue with a pure ISC installation; the more grateful I would be if someone could shed at least some light on it: Why later versions of those two JARs can behave differently when ISC is integrated into Railo on Tomcat ...

Furthermore, I could make a testcase available which is accessible from a public website !

And: I have posted about this showstopper issue into the ISC Forums, too. Hopefully there will come rescue for this showstopper issue from at least one direction ... Perhaps other Railo on Tomcat users have had problems with 'getPageContext().getSession().setAttribute()', too ?

Denny

unread,
Sep 12, 2012, 4:29:12 PM9/12/12
to ra...@googlegroups.com
So there's not an actual error, only the umlauts are garbled?

Maybe they fixed broken char encoding stuff?

I assume the attrValue is a simple value (sometimes javacast("type",var)
is needed), and probably a string?

You may need to be sure that the string is encoded with the same charset
that ISC is expecting.

This may or may not be helpful:

http://stackoverflow.com/questions/887148/how-to-determine-if-a-string-contains-invalid-encoded-characters

:Denny

--
Railo Technologies: getrailo.com Professional Open Source
Skype: valliantster (505)510.1336 de...@getrailo.com
GnuPG-FP: DDEB 16E1 EF43 DCFD 0AEE 5CD0 964B B7B0 1C22 CB62

verlsnake

unread,
Sep 12, 2012, 5:03:52 PM9/12/12
to ra...@googlegroups.com
Hello Denny !

I'm really grateful for any help I can get wrt this showstopper issue !

The actual error IS that the Umlauts are garbled ! This is not at all acceptable !

The concrete Railo CFML code is like so:
    <cfset getPageContext().getSession().setAttribute("idUser",1) />

This CFML code is needed to transfer authentication information from CFML to Java; and is not at all related to any data that is used in the ISC widget ! The ISC widget functions correctly when NOT using the above CFML code !

It seems to me that the above CFML code does something to the J2EE session that disturbs the latest versions of the two ISC JARs ...

Unfortunately, I got no reply in the Isomorphic Forums until now ... Perhaps I am the only one in the Railo/ISC universe who has married ISC with Railo ?


Cheers and Tschüss

Kai

Denny

unread,
Sep 12, 2012, 5:36:40 PM9/12/12
to ra...@googlegroups.com
Hrm. There are a few troubleshooting things you could try.

1) Use javacast to cast to an int, if that's what's expected:

setAttribute("idUser",javaCast("int",1))

2) Cycle through all the attributes in the session, dumping them out
before, and after, the attribute is set. Compare.

3) Verify that the charset is the same across the board - railo, tomcat,
ISC (I usually pick utf8 for everything just to be safe, YMMV).

3a) Explicitly set the charset for the request, maybe?

If the only problem is that it's garbled, then it is surely a char
encoding issue, the only question is where.

:Denny
>> Skype: valliantster (505)510.1336 de...@getrailo.com <javascript:>

verlsnake

unread,
Sep 12, 2012, 7:44:22 PM9/12/12
to ra...@googlegroups.com
Hello Denny !

Many Thanks ! Because You made me playing around with these CFML-J2EE session attributes more intensively ! And this eventually led me to the ultimate reason for this showstopper issue: An own ISC Java Class which
- uses the session attribute "idUser"
- I had compiled with an older version of the ISC JARs

Now I have recompiled this Java Class with the current version of the ISC JARs; and all of a sudden, the showstopper issue vanishes !

Shame on me that I had not recompiled this Java Class routinely before ... But I didn't experience any obvious errors and wasn't aware of this potential problem; probably because I had not touched all this stuff for months now ...

Once again it becomes clear: In software more than in anything else, the devil is in the details ...


Cheers and Tschüss

Kai
Reply all
Reply to author
Forward
0 new messages