Setting openfire VM arguments on centOS

Hi,

I have a problem with double-bytes encoding(openfire 3.4.1) that I can solve on my localhost XP by adding the following to the VM arguments in the “Open Run Dialog” in eclipse:

-Dfile.encoding=“UTF-8”

What is the equivalent to the eclipes`s VM arguments on a VPS that running on centOS?

Is it the same as changing the java heap memory?

I`ve tried modifying /opt/openfire/bin/openfire or /etc/init.d/openfire and added the line: INSTALL4J_ADD_VM_PARAMS="-Dfile.encoding=UTF-8" to the top of the openfire.sh file.

I didn`t have INSTALL4J_ADD_VM_PARAMS in this file.

Does that makes any sense?

Thanks

Are you using the RPM install or .tar.gz? If you are using the RPM, look in /etc/sysconfig/openfire and there’s a line for editing the jvm options. (it has changing the memory as a specific example)

I`m using the rpm version and it works. Thanks.

You might want to consider this addition. Openfire BOSH works well with utf-8 encoding for AJAX calls but doesn`t handle double-byte characters in the url. This is needed when working with script tags and setting httbind scripttag property to true.

I realy cant tell why its working and what it does and you guys can probably fix it better but adding:

“-Dfile.encoding=UTF-8”

to the /etc/sysconfig/openfire fix this issue.

Please let me know if you are going to include this or other workaround in the next release of openfire.

Hi dror,

I would say that one should modify the code so that the right encoding is used when writing to a socket (or file) instead of relying on the file.encoding property. So this should be a nice job to do.

LG

It felt like a hack but I was desperate so I did it anyway

The client CAN`T set the encoding because this is a GET request with no headers. The server has to define the utf-8 as a default for URL.

Im sure there are better ways to do it but Im new to java. Maybe an addition to setCharacterEncodinFilter?

Ive searched in jetty forums which is the http server openfire is based on if I understand correctly. The following are possible fixes for utf-8 in GET that I dont know how to implement but you might do:

org.mortbay.jetty.Request.queryEncoding = UTF-8

org.mortbay.util.URI.charset = UTF-8 under the section: International characters in URLs

-Dorg.mortbay.util.URI.charset = UTF-8

-Dfile.encoding=UTF-8

Hi,

it’s of course the server which must use the right Content-Encoding. A quick “fix” is to specify the needed encoding as the default-encoding during startup of the JVM but the right solution is to modify the java code and open an UTF-8 stream instead of one using the default encoding.

LG

Hi,

Which openfire component is makeing the stream?

Do you think the team can take care of that in the next release?

Are you one of the team?

Thanks

Hi,

Daniel with the “Jiver” icon is in the team, and I guess that this can be done in the code unless it is a Jetty problem. I’ll create an issue for this, so one can track it.

JM-1190

LG

Thanks