A client ran into this exception when performing a fetch with this qualifier: "((deleted=0) or (deleted=nil)) and (accountId=1) and (username caseInsensitiveLike %@)":
Unknown operator:<class com.webobjects.foundation.NSSelector (methodName=caseInsensitiveLike)>
(Strack trace and code snippet below.) They are running the application as a Tomcat SSDD deployment using WO 5.3 on Windows XP SP3, using Turkish as the Windows locale. I've tested the same configuration (as near as I can tell, anyway) on several different machines, including an identical Windows XP setup with Turkish as the system locale, and haven't been able to replicate the problem. I've also decompiled the relevant classes and haven't been able to find anywhere that would explain why the EOSQLExpression.sqlStringForSelector() method would fail to recognize the caseInsensitiveLike operator.
Any ideas? Has anyone seen this before?
Thanks very much in advance, Nathan
STACK TRACE:
java.lang.IllegalStateException: sqlStringForSelector: Unknown operator:<class com.webobjects.foundation.NSSelector (methodName=caseInsensitiveLike)> at com.webobjects.eoaccess.EOSQLExpression.sqlStringForSelector (EOSQLExpression.java:2001) at com.webobjects.jdbcadaptor.FrontbasePlugIn $FrontbaseExpression.sqlStringForSelector(FrontbasePlugIn. java:862) at com.webobjects.jdbcadaptor.FrontbasePlugIn $FrontbaseExpression.sqlStringForKeyValueQualifier (FrontbasePlugIn.java:1043) at com.webobjects.eoaccess.EOQualifierSQLGeneration$ _KeyValueQualifierSupport.sqlStringForSQLExpression (EOQualifierSQLGeneration.java:441) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support. _sqlStringForSQLExpression(EOQualifierSQLGeneration.java:151) at com.webobjects.eoaccess.EOSQLExpression. sqlStringForArrayOfQualifiers(EOSQLExpression.java:1562) at com.webobjects.eoaccess.EOSQLExpression. sqlStringForConjoinedQualifiers(EOSQLExpression.java:1597) at com.webobjects.eoaccess.EOQualifierSQLGeneration$ _AndQualifierSupport.sqlStringForSQLExpression (EOQualifierSQLGeneration.java:512) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support. _sqlStringForSQLExpression(EOQualifierSQLGeneration.java:151) at com.webobjects.eoaccess.EOSQLExpression. prepareSelectExpressionWithAttributes(EOSQLExpression.java: 1024) at com.webobjects.jdbcadaptor.JDBCExpression. prepareSelectExpressionWithAttributes(JDBCExpression.java:273 ) at com.webobjects.eoaccess.EOSQLExpressionFactory. selectStatementForAttributes(EOSQLExpressionFactory.java:226) at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes (JDBCChannel.java:178) at com.webobjects.eoaccess.EODatabaseChannel. _selectWithFetchSpecificationEditingContext (EODatabaseChannel.java:878) at com.webobjects.eoaccess.EODatabaseChannel. selectObjectsWithFetchSpecification(EODatabaseChannel.java: 215) at com.webobjects.eoaccess.EODatabaseContext. _objectsWithFetchSpecificationEditingContext (EODatabaseContext.java:3205) at com.webobjects.eoaccess.EODatabaseContext. objectsWithFetchSpecification(EODatabaseContext.java:3346) at com.webobjects.eocontrol.EOObjectStoreCoordinator. objectsWithFetchSpecification(EOObjectStoreCoordinator.java: 539) at com.webobjects.eocontrol.EOEditingContext. objectsWithFetchSpecification(EOEditingContext.java:4114) at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC. java:1096) at com.webobjects.eocontrol.EOEditingContext. objectsWithFetchSpecification(EOEditingContext.java:4500) at com.macsdesign.whd.util.UserAuthenticator.getUserforLoginId(UserAuthenticator.java:258 )
CODE:
public User getUserForLoginId( String loginId, int loginType, Preference aPreference ) {
. . .
NSMutableArray andQuals = new NSMutableArray(); andQuals.addObject( EOQualifier.qualifierWithQualifierFormat( "(deleted = 0) or (deleted = nil)", null ) ); if( aPreference != null ) andQuals.addObject( EOQualifier.qualifierWithQualifierFormat( "accountId = " + aPreference.account().id(), null ) ); if( loginType == USERNAME_LOGIN ) andQuals.addObject( EOQualifier.qualifierWithQualifierFormat( "username caseInsensitiveLike %@", new NSArray( loginId ) ) ); . . .
EOQualifier qual = new EOAndQualifier( andQuals ); EOFetchSpecification fetchSpec = new EOFetchSpecification( "User", qual, null ); fetchSpec.setRefreshesRefetchedObjects( true ); NSArray matchingUsers = ec.objectsWithFetchSpecification( fetchSpec );
. . .
}
|