• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception when modifying profile [DONE]

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My friend found a bug. He edited profile to fill the occupation and signature using cyrillics; upon submit, he got an exception and the profile was not modified.

See http://dan.solutions.lv/photoz/screenshots/JForum/bugs/ for screenshot (his) and stackstace (from mine logs).
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any clues on this one, Rafael? :-\
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't checked this out yet.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem is more complicated to solve than I thought.. :roll:

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafael Steil wrote:This problem is more complicated to solve than I thought.. :roll:

Rafael



In which sence?

As far as I understand, it has something to do with avatars?
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I serialize user data into xml files, using XMLEncoder. This is throwing exceptions when the encoder tries to write the xml data. One quick solution is to encode the strings using base64, but this would break existing sessions and cookies.

The fact is that jforum doesn't handle well cyrillic chars.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafael Steil wrote:One quick solution is to encode the strings using base64, but this would break existing sessions and cookies.

The fact is that jforum doesn't handle well cyrillic chars.


Have you tried to specify "Utf-8" charset for the XML file?
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafael Steil wrote:

Daniil wrote:
But the problem I was originally pointing to is not in the XML encoder as the stack stace shows, but rather with avatar resizing code (I wish I make myself to make some fixes to it someday...).



I haven't gone so far.



Just look at the stack trace I've listed to you before: http://dan.solutions.lv/photoz/screenshots/JForum/bugs/

Rafael Steil wrote:The data in XML is like



and so on.


Very very strange it confuses the XML classes...

Rafael Steil wrote:I didn't take a closer look, anyway. There is so many things do to that is harder to develop the new ones and fix the existing ones quickly :?


But the priority should be fixing bugs anyway ;)
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
aaaaaaaaaaaaaahhhhhhhhhhh

I want my mom..

well.. .hhehe.. I saw the stack trace. I'll try to send some set of changes this night ( here is now exactly 11:10 AM ;) )

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I've looked into the trace and into the source once again. The only reason for NullPointerException here is that ImageIO.read(new File(imgName)) if failed because file format was not understood by ImageIO or the file was not exist (nearly impossible, right?) or the permission was denied (I run Tomcat under root. So impossible).

So the problem was user sending windoze's swap file as avatar I guess ;]

If all this is correct, forum should handle such situations in a more pollute way (like "Hey, dude, don't try to use your favorite PowerPoint presentation as avatar next time! For now, you're banned" ;])

Or can anything else be the source of it?
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the xml uses utf-8.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't quite understand then how cyrillics can be a problem - but it seems to be, indeed...
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created a user using cyrillics chars, but then the xml parser crashed when I tried to serialize the UserSession object to XML. The username property was with those cyrillics chars translated to some form of html, and it was causing the bug, at least in my machine.

Maybe it is because my default machine language ( pt_BR ).. I really don't know..

But if in your machine it works, so there is a light in the end of the tunel ;)

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's translated into entities like amp-hash-number-semicolon, this could possibly be disliked by the XML stuff, at least by the reader which could try to resolve the entities by fail (I don't understand why the encoder fails, hovewer). Try to replace all & symbols with & entity before serializing. Strange stuff, I think serialization should work out-of-box with any data.

But the problem I was originally pointing to is not in the XML encoder as the stack stace shows, but rather with avatar resizing code (I wish I make myself to make some fixes to it someday...).
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafael Steil wrote:But if in your machine it works, so there is a light in the end of the tunel ;)


If you haven't applied my patches the i18n stuff may be still broken.
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Daniil wrote:
But the problem I was originally pointing to is not in the XML encoder as the stack stace shows, but rather with avatar resizing code (I wish I make myself to make some fixes to it someday...).



I haven't gone so far.

The data in XML is like



and so on.

I didn't take a closer look, anyway. There is so many things do to that is harder to develop the new ones and fix the existing ones quickly :?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I fixed this little one..

The changes are in the CVS.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
reply
    Bookmark Topic Watch Topic
  • New Topic