You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Da...@dadebehring.com on 2003/10/24 13:18:05 UTC

OracleDB & TDK2.3 (Torque 3.1) Login Failure - Debugging

Hi there,

since there were no responses for on my last post concerning this issue I 
tried to debug a bit by myself, hopefully this helps the Torque-Developers 
to come up with a solution or further tips.

Again, the issue is: When I try to login I always get "incorrect 
username/password" and in the server-log I see the follwing: 

---
[DEBUG] Turbine - -action = LoginUser
[DEBUG] ActionLoader - -Loading Action LoginUser from the Assembler Broker
[DEBUG] JavaActionFactory - -Class Fragment is LoginUser
[DEBUG] JavaActionFactory - -Trying 
com.dadebehring.ebusiness.modules.actions.LoginUser
[DEBUG] JavaActionFactory - 
-com.dadebehring.ebusiness.modules.actions.LoginUser: Not found
[DEBUG] JavaActionFactory - -Trying 
org.apache.turbine.flux.modules.actions.LoginUser
[DEBUG] JavaActionFactory - 
-org.apache.turbine.flux.modules.actions.LoginUser: Not found
[DEBUG] JavaActionFactory - -Trying 
org.apache.turbine.modules.actions.LoginUser
[DEBUG] JavaActionFactory - -Returning: 
org.apache.turbine.modules.actions.LoginUser@14653a3
[DEBUG] BasePeer - -SELECT TURBINE_USER.USER_ID, TURBINE_USER.LOGIN_NAME, 
TURBINE_USER.PASSWORD_VALUE, TURBINE_USER.FIRST_NAME, 
TURBINE_USER.LAST_NAME, TURBINE_USER.EMAIL, TURBINE_USER.CONFIRM_VALUE, 
TURBINE_USER.MODIFIED, TURBINE_USER.CREATED, TURBINE_USER.LAST_LOGIN, 
TURBINE_USER.OBJECTDATA FROM TURBINE_USER WHERE 
TURBINE_USER.LOGIN_NAME='turbine'
[DEBUG] BasePeer - -Elapsed time=110 ms
  !! [ERROR] LoginUser - 
-org.apache.turbine.util.security.DataBackendException: Failed to retrieve 
user 'turbine'
[DEBUG] DefaultTurbineRunData - -user set: 
[DEBUG] LayoutTemplateMapper - -doMapping(Login.vm)
---

The error only occurs with oracle (8i), with mysql everything works fine, 
but since mysql is no option for the company I'm working for, I have to 
solve this somehow.
What I found out so far is:

The original exception that causes the DataBackendException is a 
java.util.NoSuchElementException, which occurs in BasePeer in function 
CreateQuery(Criteria) line 1110.

---
Iterator it = aliases.keySet().iterator();
          while (it.hasNext())
        {
1110        String key = (String) it.next();
            selectClause.add((String) aliases.get(key) + " AS " + key);
        }

        Iterator critKeys = criteria.keySet().iterator();
        while (critKeys.hasNext())
        {
            String key = (String) critKeys.next();
            Criteria.Criterion criterion = criteria.getCriterion(key);
            Criteria.Criterion[] someCriteria =
                criterion.getAttachedCriterion();
            String table = null;
            for (int i = 0; i < someCriteria.length; i++)
            {
---

This occurs at the first invokation of CreateQuery during the login 
Process. it.hasNext is true, then it enters the while, now it.hasNext is 
false and critKeys.next() throws the NoSuchElementException.
What I keep asking me, is: why this only happens with the oracleDB? the 
only difference between Oracle and Mysql flow was concerning some limits 
settings as far as I could see it.

I only traced this two times so far, there might be other errors.

I also attach the contents of critKeys before and after the while 
condition was performed (hasNext()). Interesting to see is, that the 
lastReturned value changes, but hasNext() is described as follows:

---
hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns 
true if next would return an element rather than throwing an exception.) 

Returns:
true if the iterator has more elements.
---

So hasNext() isn't supposed to return an object, but it seems, it does! or 
it at least it changes the next-value, because before hasNext() is called, 
next() returns the correct element.
I really hope this helps to solve the issue. If you need further 
information, please feel free to contact me via email, if you prefer, we 
also can speak via Telephone.

Best Regards,
David


critKeys BEFORE invokation of hasNext() in while condition
---
"critKeys" = Hashtable$Enumerator  (id=2474)
        entry= null
        expectedModCount= 1
        index= 0
        iterator= true
        lastReturned= Hashtable$Entry  (id=2477)
        table= Hashtable$Entry[10]  (id=2475)
                [0]= null
                [1]= null
                [2]= null
                [3]= null
                [4]= Hashtable$Entry  (id=2477)
                        hash= 149549364
                        key= "TURBINE_USER.LOGIN_NAME"
                        next= null
                        value= Criteria$Criterion  (id=2484)
                [5]= null
                [6]= null
                [7]= null
                [8]= null
                [9]= null
        this$0= Criteria  (id=2473)
                aliases= null
                asColumns= Hashtable  (id=2478)
                cascade= false
                count= 1
                dbName= "fca"
                entrySet= null
                groupByColumns= UniqueList  (id=2479)
                having= null
                ignoreCase= false
                joinL= null
                joinR= null
                keySet= Collections$SynchronizedSet  (id=2480)
                        c= Hashtable$KeySet  (id=2494)
                        mutex= Criteria  (id=2473)
                limit= -1
                loadFactor= 0.75
                modCount= 1
                offset= 0
                orderByColumns= UniqueList  (id=2481)
                originalDbName= "fca"
                selectColumns= UniqueList  (id=2482)
                selectModifiers= UniqueList  (id=2483)
                singleRecord= false
                table= Hashtable$Entry[10]  (id=2475)
                threshold= 7
                useTransaction= false
                values= null
        type= 0
---

critKeys AFTER hasNext() call in while condition:
---
"critKeys" = Hashtable$Enumerator  (id=2424)
        entry= null
        expectedModCount= 1
        index= 0
        iterator= true
        lastReturned= Hashtable$Entry  (id=2429)
                hash= 149549364
                key= "TURBINE_USER.LOGIN_NAME"
                        count= 23
                        hash= 149549364
                        offset= 0
                        value= char[34]  (id=185)
                next= null
                value= Criteria$Criterion  (id=2431)
                        clauses= ArrayList  (id=2434)
                        column= "LOGIN_NAME"
                        comparison= SqlEnum  (id=2407)
                        conjunctions= ArrayList  (id=2436)
                        db= DBOracle  (id=2314)
                        ignoreStringCase= false
                        table= "TURBINE_USER"
                        this$0= Criteria  (id=2426)
                        value= "turbine"
        table= Hashtable$Entry[10]  (id=2430)
        this$0= Criteria  (id=2426)
                aliases= null
                asColumns= Hashtable  (id=2442)
                cascade= false
                count= 1
                dbName= "fca"
                entrySet= null
                groupByColumns= UniqueList  (id=2443)
                having= null
                ignoreCase= false
                joinL= null
                joinR= null
                keySet= Collections$SynchronizedSet  (id=2444)
                limit= -1
                loadFactor= 0.75
                modCount= 1
                offset= 0
                orderByColumns= UniqueList  (id=2445)
                originalDbName= "fca"
                selectColumns= UniqueList  (id=2446)
                selectModifiers= UniqueList  (id=2447)
                singleRecord= false
                table= Hashtable$Entry[10]  (id=2430)
                threshold= 7
                useTransaction= false
                values= null
        type= 0
---

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: OracleDB & TDK2.3 (Torque 3.1) Login Failure - Debugging

Posted by Scott Eade <se...@backstagetech.com.au>.
David_Solbach/MR/de/DadeInt@dadebehring.com wrote:

>[DEBUG] BasePeer - -SELECT TURBINE_USER.USER_ID, TURBINE_USER.LOGIN_NAME, 
>TURBINE_USER.PASSWORD_VALUE, TURBINE_USER.FIRST_NAME, 
>TURBINE_USER.LAST_NAME, TURBINE_USER.EMAIL, TURBINE_USER.CONFIRM_VALUE, 
>TURBINE_USER.MODIFIED, TURBINE_USER.CREATED, TURBINE_USER.LAST_LOGIN, 
>TURBINE_USER.OBJECTDATA FROM TURBINE_USER WHERE 
>TURBINE_USER.LOGIN_NAME='turbine'
>[DEBUG] BasePeer - -Elapsed time=110 ms
>  !! [ERROR] LoginUser - 
>-org.apache.turbine.util.security.DataBackendException: Failed to retrieve 
>user 'turbine'
>
The exception you are getting says this:
    Thrown to indicate that there was an error accessing the data 
backend of the SecurityService.

So I would suggest that your connection to Oracle may not configured 
correctly.  Try adding the following to your log4j.properties to see if 
some useful info is produced (assuming you have a default appender 
configured):
    log4j.category.org.apache.torque.dsfactory = DEBUG, default

If you run the above query in the Oracle command interpreter does it 
produce the desired result?

BTW: Please don't cross-post questions - choose the correct mailing list 
and post to it alone.


Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au





---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org