JDOFatalUserException: Illegal argument (on GAE J, but not on development system)

0 views
Skip to first unread message

user1846093 via StackOverflow

unread,
Nov 22, 2012, 5:54:47 PM11/22/12
to google-appengin...@googlegroups.com

I'm developing an application on Google App Engine/Java. On my development environment, the application works fine, with data stored and retrieved successfully. However, on upload to app engine, i keep getting the error "javax.jdo.JDOFatalUserException: Illegal argument". From the stack trace, this appears to occur when i call (List query.execute()).size(). The relevant stack trace is.

2012-11-22 23:34:08.512
[s~qalmadev1/1.363360558551053190].<stderr>: javax.jdo.JDOFatalUserException: Illegal argument

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:488)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at org.datanucleus.api.jdo.JDOAdapter.getApiExceptionForNucleusException(JDOAdapter.java:1107)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.QueryExceptionWrappers$2.get(QueryExceptionWrappers.java:72)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.RuntimeExceptionWrappingIterator.hasNext(RuntimeExceptionWrappingIterator.java:103)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.LazyResult.resolveAll(LazyResult.java:120)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.LazyResult.size(LazyResult.java:115)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.StreamingQueryResult.size(StreamingQueryResult.java:151)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.qalma.naijaevents.appengine.server.CreateEventServlet.doPost(CreateEventServlet.java:115)

Line 115 in my CreateEventServlet is the "if()" line in the code below

Query query = pm.newQuery("select from com.qalma.naijaevents.appengine.User "
        + "where key == :userid");
        List<User> result = (List<User>) query.execute(userid);
        if (result != null && result.size() > 0) { // Line 115
            user = result.get(0);
            USER_VALID = true;
        }


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/13521010/jdofataluserexception-illegal-argument-on-gae-j-but-not-on-development-system

unchosen via StackOverflow

unread,
Nov 22, 2012, 10:31:26 PM11/22/12
to google-appengin...@googlegroups.com

I'm developing an application on Google App Engine/Java. On my development environment, the application works fine, with data stored and retrieved successfully. However, on upload to app engine, i keep getting the error "javax.jdo.JDOFatalUserException: Illegal argument". From the stack trace, this appears to occur when i call (List query.execute()).size(). The relevant stack trace is.

2012-11-22 23:34:08.512
[s~qalmadev1/1.363360558551053190].<stderr>: javax.jdo.JDOFatalUserException: Illegal argument

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:488)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at org.datanucleus.api.jdo.JDOAdapter.getApiExceptionForNucleusException(JDOAdapter.java:1107)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.QueryExceptionWrappers$2.get(QueryExceptionWrappers.java:72)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.RuntimeExceptionWrappingIterator.hasNext(RuntimeExceptionWrappingIterator.java:103)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.LazyResult.resolveAll(LazyResult.java:120)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.LazyResult.size(LazyResult.java:115)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.google.appengine.datanucleus.query.StreamingQueryResult.size(StreamingQueryResult.java:151)

W 2012-11-22 23:34:08.516
[s~qalmadev1/1.363360558551053190].<stderr>:    at com.xxx.xxx.appengine.server.CreateEventServlet.doPost(CreateEventServlet.java:115)

Line 115 in my CreateEventServlet is the "if()" line in the code below

Query query = pm.newQuery("select from com.xxx.xxx.appengine.User "
        + "where key == :userid");
        List<User> result = (List<User>) query.execute(userid);
        if (result != null && result.size() > 0) { // Line 115
            user = result.get(0);
            USER_VALID = true;
        }

unchosen via StackOverflow

unread,
Nov 23, 2012, 5:56:38 AM11/23/12
to google-appengin...@googlegroups.com

Found the problem.

Query query = pm.newQuery("select from com.qalma.naijaevents.appengine.User "
    + "where key == :userid");

In the query, "userid" referred to a String realized through KeyFactory.keyToString(). Converting the String back to a key using KeyFactory.stringToKey() solved the issue.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/13521010/jdofataluserexception-illegal-argument-on-gae-j-but-not-on-development-system/13527576#13527576

unchosen via StackOverflow

unread,
Nov 23, 2012, 9:11:47 AM11/23/12
to google-appengin...@googlegroups.com

Found the problem.

Query query = pm.newQuery("select from com.xxx. xxx.appengine.User "
    + "where key == :userid");
Reply all
Reply to author
Forward
0 new messages