Hi again,
Some new information regarding the problem I have described in my previous mail.
It doesn't seem to be related to any particular JBoss version (tested with the same result on 3.2.1, 3.2.2 and 3.2.3).
It doesn't seem to depend on the JVM version (tested with J2SDK 1.4.1_02 and 1.4.2_03).
It is not OS specific (tested on Linux 2.4.22 {system encoding set to ISO-8859-2} and Windows2000/XP {system encoding set to WIN-1250})


We have tried to replace the DynamicSQL query with a EJBQL query and JBossQL query but it didn't help.
Queries still returning no results if special characters are used. We can't see how they are transformed though
because JBoss only logs the prepared statement and all we see is '?'.


Situation currently looks like this:
Creating and updating CMP entities works just fine! Special characters are stored to and read from database without problem.
EJBQL, JBossQL and DynamicQL queries work ONLY if query does not contain special characters!
Non of them works if query contains special characters!


I downloaded JBoss source code and tried to trace the calls.
It seems to me that special characters gets changed somewhere in "JBossQLParser.jjt" and/or "EJBQLParser.jjt".
Don't have any idea of JJTree so unfortunately there my investigation was interrupted.


Our application is JBoss -> Tomcat -> Struts web application.
All our JSPs are in utf-8 encoding: <%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="utf-8"%>
In both "doGet" and doPost() in Struts ActionServlet we have: httpRequest.setCharacterEncoding("utf8");
Our struts configuration file includes: <controller contentType="text/html;charset=UTF-8" ... />
Database and JDBC driver are set to use UTF8 as well.


I have tried to run JBoss with -Dfile.encoding=utf8 but it didn't made any difference.


Any ideas of what is going on are highly appreciated. I have ran out of them!
Please!


Milen Dyankov



Few days ago I wrote:

Hi,
I'm running JBoss 3.2.3(200311301445) on Debian Woody with J2SDK 1.4.1_02-b06
I have strange problem with DynamicQL. It looks like non-English characters in queries get somehow changed.


This is my ejbHome method calling the dynamic "ejbSelectGeneric" :

public Collection ejbHomeSearchCompanies (CompanyCriteriasGroup companyCriteriasGroup) throws FinderException {
NDC.push("ejbHomeFindCompanies");
log.debug ("called");
Collection result = null;
if (companyCriteriasGroup != null) {
StringBuffer jbossQl = new StringBuffer();
jbossQl.append("SELECT OBJECT(c) ");
jbossQl.append("FROM Company c ");
jbossQl.append("WHERE ");
jbossQl.append(companyCriteriasGroup.toSQL());
Object[] args = {}; // no arguments
log.debug("**************************************************");
log.debug(jbossQl.toString());
log.debug("**************************************************");
result = ejbSelectGeneric(jbossQl.toString(), args); // call dynamic-ql query
log.debug("**************************************************");
log.debug(result);
log.debug("**************************************************");
}
log.debug ("end");
NDC.pop();
return result;
}



Now this is what I have in my log file:


. . .
2004-01-20 09:21:44,507 DEBUG [CompanyBean] (ejbHomeFindCompanies) called
2004-01-20 09:21:44,507 DEBUG [CompanyBean] (ejbHomeFindCompanies) **************************************************
2004-01-20 09:21:44,507 DEBUG [CompanyBean] (ejbHomeFindCompanies) SELECT OBJECT(c) FROM Company c WHERE ((c.name LIKE '%ąężźćśłóń%'))
2004-01-20 09:21:44,507 DEBUG [CompanyBean] (ejbHomeFindCompanies) **************************************************
2004-01-20 09:21:44,507 DEBUG [plugins.cmp.jdbc.JDBCDynamicQLQuery.Company#ejbSelectGeneric] (ejbHomeFindCompanies) DYNAMIC-QL: SELECT OBJECT(c) FROM Company c WHERE ((c.name LIKE '%ąężźćśłóń%'))
2004-01-20 09:21:44,510 DEBUG [plugins.cmp.jdbc.JDBCDynamicQLQuery.Company#ejbSelectGeneric] (ejbHomeFindCompanies) SQL: SELECT t0_c.symbol_ FROM COMPANY_ t0_c WHERE (((t0_c.name_ LIKE '%|z[BóD%')))
2004-01-20 09:21:44,510 DEBUG [plugins.cmp.jdbc.JDBCDynamicQLQuery.Company#ejbSelectGeneric] (ejbHomeFindCompanies) Executing SQL: SELECT t0_c.symbol_ FROM COMPANY_ t0_c WHERE (((t0_c.name_ LIKE '%|z[BóD%')))
2004-01-20 09:21:44,530 DEBUG [CompanyBean] (TP-Processor2:findCompanies findCompanies ejbHomeFindCompanies) **************************************************
2004-01-20 09:21:44,530 DEBUG [CompanyBean] (TP-Processor2:findCompanies findCompanies ejbHomeFindCompanies) []
2004-01-20 09:21:44,530 DEBUG [CompanyBean] (TP-Processor2:findCompanies findCompanies ejbHomeFindCompanies) **************************************************
2004-01-20 09:21:44,532 DEBUG [CompanyBean] (TP-Processor2:findCompanies findCompanies ejbHomeFindCompanies) end
. . .


Here I'm using polish characters for test, and as you can see "ąężźćśłóń" changes to "|z[BóD"!
The same thing happens with Cyrillic characters.


Can someone help me fix that?

Thanks
Milen Dyankov


------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user





------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to