[appengine-java] Re: GWT complains on deployment from Eclipse plugin that it needs compiled

2009-09-25 Thread Todd Nine

I've figured this out.  There was a javascript file at the root of my
webapp that didn't get deleted and I couldn't see in Finder.  Once I
deleted it my error is gone.

On Sep 26, 4:55 pm, Todd Nine  wrote:
> Hi all,
>   I've created a project using the Eclipse plugin and created a simple
> CRUD app with Spring MVC  and JDO to become familiar with the
> platform.  Everything runs fine on the dev server on my laptop,
> however when I deploy my eclipse project via the plugin, I receive
> this error every time I hit the site.
>
> GWT module 'inventory' needs to be (re)compiled, please run a compile
> or use the Compile/Browse button in hosted mode
>
> I haven't actually used the GWT, but I installed it when I started the
> project.  I've unchecked "Use  Google Web Toolkit" in my project
> settings.  What else do I need to do to remove this so I no longer
> receive the error?
>
> Thanks,
> Todd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: How to add directory outside of web archive directory to classpath when running in dev_appserver?

2009-09-25 Thread gburd

I suspect that http://code.google.com/p/googleappengine/issues/detail?id=1831
and http://code.google.com/p/googleappengine/issues/detail?id=1503 are
causing problems for the some of the approaches that I tried.

On Sep 25, 3:24 pm, gburd  wrote:
> I am trying to implement automatic code reloading for Clojure code
> running in dev_appserver.  My goal is to edit and save the source
> files in the source directory (sibling of the web archive directory)
> and hit refresh in the browser to run the new code.
>
> Clojure looks for source files on the Java class path using
> ClassLoader.getResource(s).  Here are some things that I have tried
> using the --jvm_flag=-D--enable_all_permissions=true command line flag
> to dev_appserver.
>
> 1) Create symbolic links in war/WEB-INF/classes to the source
> directories.  Fails with security exception.
>
> 2) Create my own class loader with findResource(s) implementation that
> searches ../src/*.  Fails with security exception.
>
> 3) Edit dev_appserver.sh to add my source directory to the class
> path.  The additional class path is ignored.
>
> Is there a way to add a directory outside of the web archive directory
> to the dev_appserver class path?
>
> Is the source for dev_appserver available so I see what it's doing
> with class loaders and security managers?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: appcfg can't find javac?

2009-09-25 Thread Toby Reyelts
Hey Mark,
Unfortunately it's more complicated than that. The very first entry in your
path points to C:\Windows\system32. There is undoubtedly a java.exe living
in that folder who's home is actually the JRE in C:\Program Files\Java\jre6.
(You can test this yourself by running a small Java program):

System.out.println(System.getProperty("java.home"));


AppCfg uses the system property, java.home, of the currently running JVM to
look for javac. Since you're running the java.exe which belongs to a JRE, it
goes looking for the compiler there. Unfortunately, there's no real
universally consistent or great way to automagically find the most
appropriate java compiler. For our SDK, the rule is that you need to be
running the JVM from your SDK, not from a JRE. As I mentioned in my previous
post, this is most easily accomplished by just setting your Java SDK at the
front of your path. For example,

set PATH=c:\Program Files\Java\jdk1.6.0\bin;%PATH%

We've certainly been mulling over ways to make this simpler and more
bulletproof.

On Sat, Sep 26, 2009 at 1:41 AM, Mark Space  wrote:
>
>
> Thanks for the reply.  However, I think this is already the case.  I
> do apologize for the java/javac typo above.  The JDK is the only thing
> on my PATH, there's no JRE.  (Note this is from the Windows shell, but
> the Cygwin utility "which" prepends /cygdrive/ anyway.)  This shows
> that the JDK is the first and only "javac" accessible on my path.
>
> Why would appcfg be looking for javac in the JRE6 folders?  Something
> is fishy here.
>
>
> C:\Users\Brenden>which javac
> /cygdrive/c/Program Files/Java/jdk1.6.0/bin/javac
>
> C:\Users\Brenden>path
> PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Users
> \Brenden\Do
> wnloads\Maven\apache-maven-2.0.9\bin;c:\usr\bin;C:\Program Files
> \Common Files\Ro
> xio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared
> \9.0\DLLShared\;
> C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\Java
> \jdk1.6.0\bin;c:\
> cygwin\bin;C:\usr\svn\bin;C:\Program Files\MySQL\MySQL Server
> 5.0\bin;C:\Program
>  Files\glassfish-v2\bin;C:\Program Files\PHP;C:\Program Files
> \Mercurial;C:\Progr
> am Files\QuickTime\QTSystem\
>
>
> My JAVA_HOME is set to the JDK too:
>
>
> C:\Users\Brenden>set | grep HOME
> COMPUTERNAME=HOMER
> HOMEDRIVE=C:
> HOMEPATH=\Users\Brenden
> JAVA_HOME=C:\Program Files\Java\jdk1.6.0
>
>
> On Sep 25, 9:53 pm, Toby Reyelts  wrote:
> > If you look closer at the message, you can see that it's looking for the
> > java compiler - *javac.exe* not java.exe. The JRE does not contain the
> Java
> > compiler. Instead, you'll need to put the JDK on your PATH ahead of your
> > JRE.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Data access with JPA fails with errors

2009-09-25 Thread grigory

I am trying to get JPA data access going with App Engine. I have
single entity class so far. After my application gets deployed and
runs fine (hosted mode) I come to the part where JPA persistence code
kicks in. Then I get following errors (end of stack trace shown):

Caused by: org.datanucleus.exceptions.NucleusUserException: Class
"transactions-optional" found to be part of persistence-unit "{1}" so
loading it in case it is persistable
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit
(MetaDataManager.java:787)
at org.datanucleus.jpa.EntityManagerFactoryImpl.initialisePMF
(EntityManagerFactoryImpl.java:488)
at org.datanucleus.jpa.EntityManagerFactoryImpl.
(EntityManagerFactoryImpl.java:355)
at
org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.
(DatastoreEntityManagerFactory.java:63)
at
org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory
(DatastorePersistenceProvider.java:35)
at javax.persistence.Persistence.createFactory(Persistence.java:172)
... 35 more
Caused by: org.datanucleus.exceptions.ClassNotResolvedException: Class
"com.myapp.client.gin.MyAppClientModule" was not found in the
CLASSPATH. Please check your specification and your CLASSPATH.
at org.datanucleus.JDOClassLoaderResolver.classForName
(JDOClassLoaderResolver.java:250)
at org.datanucleus.JDOClassLoaderResolver.classForName
(JDOClassLoaderResolver.java:415)
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit
(MetaDataManager.java:767)
... 40 more

Neither message makes sense for me. "transactions-optional" is not a
class but a name for persistence unit as it was copied from Google
docs. Last error references gin-related class
com.myapp.client.gin.MyAppClientModule in my GWT module that is not
even supposed to be on a server.

I tried to add entity class to persistence.xml - no difference. It
seems that my classpath is not correct but I am using Eclipse with
Google plugin that assembles launch file for hosted mode
automatically.

Any pointers would be greatly appreciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: appcfg can't find javac?

2009-09-25 Thread Mark Space

Thanks for the reply.  However, I think this is already the case.  I
do apologize for the java/javac typo above.  The JDK is the only thing
on my PATH, there's no JRE.  (Note this is from the Windows shell, but
the Cygwin utility "which" prepends /cygdrive/ anyway.)  This shows
that the JDK is the first and only "javac" accessible on my path.

Why would appcfg be looking for javac in the JRE6 folders?  Something
is fishy here.


C:\Users\Brenden>which javac
/cygdrive/c/Program Files/Java/jdk1.6.0/bin/javac

C:\Users\Brenden>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Users
\Brenden\Do
wnloads\Maven\apache-maven-2.0.9\bin;c:\usr\bin;C:\Program Files
\Common Files\Ro
xio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared
\9.0\DLLShared\;
C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\Java
\jdk1.6.0\bin;c:\
cygwin\bin;C:\usr\svn\bin;C:\Program Files\MySQL\MySQL Server
5.0\bin;C:\Program
 Files\glassfish-v2\bin;C:\Program Files\PHP;C:\Program Files
\Mercurial;C:\Progr
am Files\QuickTime\QTSystem\


My JAVA_HOME is set to the JDK too:


C:\Users\Brenden>set | grep HOME
COMPUTERNAME=HOMER
HOMEDRIVE=C:
HOMEPATH=\Users\Brenden
JAVA_HOME=C:\Program Files\Java\jdk1.6.0


On Sep 25, 9:53 pm, Toby Reyelts  wrote:
> If you look closer at the message, you can see that it's looking for the
> java compiler - *javac.exe* not java.exe. The JRE does not contain the Java
> compiler. Instead, you'll need to put the JDK on your PATH ahead of your
> JRE.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: little help with object child relationship...

2009-09-25 Thread Prashant
sorry guys, my bad. again !

On Sat, Sep 26, 2009 at 10:20 AM, Prashant  wrote:

> Hi,
>
>
> I tried to create an object child relationship, both (object and child) are
> getting saved properly but while retrieving them back I am getting
> nullPointerException for child. Please help, following is my code:
>
>
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Data{
>
> @PrimaryKey
> @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> Long id;
>
> @Persistent
> MyData mydata;
> }
>
>
>
>
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class MyData{
>
> @PrimaryKey
> @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> private Key key;
>
> @Persistent(defaultFetchGroup = "true")
> String myValue;
> }
>
>
>
>
> public class Main extends HttpServlet {
>
> public void doGet(HttpServletRequest req, HttpServletResponse resp)
> throws IOException{
> /*
> Data data = new Data();
> data.mydata = new MyData();
> data.mydata.myValue = "some value";
> PersistenceManager pm = PMF.get().getPersistenceManager();
> pm.makePersistent(data);
> resp.getWriter().print("Done");
> */
>
> PersistenceManager pm = PMF.get().getPersistenceManager();
> Data data = pm.getObjectById(Data.class, 3);
> resp.getWriter().print(data.mydata.myValue); //
> NullPointerException
> pm.close();
> }
> }
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] GWT complains on deployment from Eclipse plugin that it needs compiled

2009-09-25 Thread Todd Nine

Hi all,
  I've created a project using the Eclipse plugin and created a simple
CRUD app with Spring MVC  and JDO to become familiar with the
platform.  Everything runs fine on the dev server on my laptop,
however when I deploy my eclipse project via the plugin, I receive
this error every time I hit the site.

GWT module 'inventory' needs to be (re)compiled, please run a compile
or use the Compile/Browse button in hosted mode

I haven't actually used the GWT, but I installed it when I started the
project.  I've unchecked "Use  Google Web Toolkit" in my project
settings.  What else do I need to do to remove this so I no longer
receive the error?

Thanks,
Todd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: appcfg can't find javac?

2009-09-25 Thread Toby Reyelts
If you look closer at the message, you can see that it's looking for the
java compiler - *javac.exe* not java.exe. The JRE does not contain the Java
compiler. Instead, you'll need to put the JDK on your PATH ahead of your
JRE.
On Fri, Sep 25, 2009 at 10:50 PM, Mark Space  wrote:

>
> Hi all, I just tried appcfg for the first time and I got some odd
> errors.  The error is odd because my javac is exactly where the error
> says it is looking.
>
> 
>
> C:\Users\Brenden\Downloads\GoogleAppEngine\appengine-java-
> sdk-1.2.5\appengine-ja
> va-sdk-1.2.5\bin>appcfg.cmd update c:\Users\Brenden\Dev\GAE1\web
> Reading application configuration data...
> Beginning server interaction for paixweb...
> 0% Creating staging directory
> 5% Scanning for jsp files.
> 8% Compiling jsp files.
> 11% Compiling java files.
>
> Error Details:
> Sep 25, 2009 7:34:34 PM org.apache.jasper.JspC processFile
> INFO: Built File: \index.jsp
>
>
> java.lang.IllegalStateException: cannot find javac executable based on
> java.home
> , tried "C:\Program Files\Java\jre6\bin\javac.exe" and "C:\Program
> Files\Java\bi
> n\javac.exe"
> Unable to upload app: cannot find javac executable based on java.home,
> tried "C:
> \Program Files\Java\jre6\bin\javac.exe" and "C:\Program Files\Java\bin
> \javac.exe
> "
> Please see the logs [C:\Users\Brenden\AppData\Local\Temp
> \appcfg80867784232196126
> 55.log] for further information.
>
>
> C:\Users\Brenden>dir "C:\Program Files\Java\jre6\bin\java.exe"
>  Volume in drive C is OS
>  Volume Serial Number is 2225-A6A0
>
>  Directory of C:\Program Files\Java\jre6\bin
>
> 07/25/2009  05:23 AM   145,184 java.exe
>   1 File(s)145,184 bytes
>   0 Dir(s)  23,832,948,736 bytes free
>
> C:\Users\Brenden>
>
> **
>
>
> Does anyone have an idea what might be going on?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] little help with object child relationship...

2009-09-25 Thread Prashant
Hi,


I tried to create an object child relationship, both (object and child) are
getting saved properly but while retrieving them back I am getting
nullPointerException for child. Please help, following is my code:



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Data{

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Long id;

@Persistent
MyData mydata;
}





@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class MyData{

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent(defaultFetchGroup = "true")
String myValue;
}




public class Main extends HttpServlet {

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException{
/*
Data data = new Data();
data.mydata = new MyData();
data.mydata.myValue = "some value";
PersistenceManager pm = PMF.get().getPersistenceManager();
pm.makePersistent(data);
resp.getWriter().print("Done");
*/

PersistenceManager pm = PMF.get().getPersistenceManager();
Data data = pm.getObjectById(Data.class, 3);
resp.getWriter().print(data.mydata.myValue); //
NullPointerException
pm.close();
}
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] little help with object child relationship...

2009-09-25 Thread Prashant
Hi,


I tried to create an object child relationship, both (object and child) are
getting saved properly but while retrieving them back I am getting
nullPointerException for child. Please help, following is my code:



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Data{

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Long id;

@Persistent
MyData mydata;
}





@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class MyData{

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent(defaultFetchGroup = "true")
String myValue;
}




public class Main extends HttpServlet {

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException{
/*
Data data = new Data();
data.mydata = new MyData();
data.mydata.myValue = "some value";
PersistenceManager pm = PMF.get().getPersistenceManager();
pm.makePersistent(data);
resp.getWriter().print("Done");
*/

PersistenceManager pm = PMF.get().getPersistenceManager();
Data data = pm.getObjectById(Data.class, 3);
resp.getWriter().print(data.mydata.myValue); //
NullPointerException
pm.close();
}
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] appcfg can't find javac?

2009-09-25 Thread Mark Space

Hi all, I just tried appcfg for the first time and I got some odd
errors.  The error is odd because my javac is exactly where the error
says it is looking.



C:\Users\Brenden\Downloads\GoogleAppEngine\appengine-java-
sdk-1.2.5\appengine-ja
va-sdk-1.2.5\bin>appcfg.cmd update c:\Users\Brenden\Dev\GAE1\web
Reading application configuration data...
Beginning server interaction for paixweb...
0% Creating staging directory
5% Scanning for jsp files.
8% Compiling jsp files.
11% Compiling java files.

Error Details:
Sep 25, 2009 7:34:34 PM org.apache.jasper.JspC processFile
INFO: Built File: \index.jsp


java.lang.IllegalStateException: cannot find javac executable based on
java.home
, tried "C:\Program Files\Java\jre6\bin\javac.exe" and "C:\Program
Files\Java\bi
n\javac.exe"
Unable to upload app: cannot find javac executable based on java.home,
tried "C:
\Program Files\Java\jre6\bin\javac.exe" and "C:\Program Files\Java\bin
\javac.exe
"
Please see the logs [C:\Users\Brenden\AppData\Local\Temp
\appcfg80867784232196126
55.log] for further information.


C:\Users\Brenden>dir "C:\Program Files\Java\jre6\bin\java.exe"
 Volume in drive C is OS
 Volume Serial Number is 2225-A6A0

 Directory of C:\Program Files\Java\jre6\bin

07/25/2009  05:23 AM   145,184 java.exe
   1 File(s)145,184 bytes
   0 Dir(s)  23,832,948,736 bytes free

C:\Users\Brenden>

**


Does anyone have an idea what might be going on?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: AppEngine down?

2009-09-25 Thread Don Schwarz
Hi Sven,

You had a request back at 09-25 06:27AM 29.110 that exceeded the 30 second
deadline during class initialization and therefore this class was never
loaded properly.  We have some code to detect failures of this kind, but a
large enough percentage of your requests apparently did not need this class
and succeeded, so you never triggered our thresholds.  I've reloaded your
application into this particular JVM, which shouldn't generally be necessary
but you can do by redeploying your application in a pinch.

We will have a fix for this specific issue coming up in the next release,
and we're currently working on some longer term changes that will
dramatically speed up class loading for all applications and hopefully make
this kind of issue much less common.

Sorry for the inconvenience,
Don

On Fri, Sep 25, 2009 at 7:11 PM, hansamann wrote:

>
> Hi all,
>
> without changing the app, I see these errors in the logs:
>
> [groovytweets/75.336368063049426232].: StackTrace Sanitizing
> stacktrace:
> java.lang.NoClassDefFoundError: Could not initialize class
> com.google.appengine.api.memcache.MemcacheServicePb
> $MemcacheStatsRequest
>at
> com.google.appengine.api.memcache.MemcacheServiceImpl.getStatistics
> (MemcacheServiceImpl.java:616)
>at
> com.google.appengine.api.memcache.stdimpl.GCache.getCacheStatistics
> (GCache.java:110)
>at
> com.google.appengine.api.memcache.stdimpl.GCache.size(GCache.java:
> 138)
>at com.google.appengine.api.memcache.stdimpl.GCache.isEmpty
> (GCache.java:142)
>at
>
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToBoolean
> (DefaultTypeTransformation.java:157)
>at
>
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.booleanUnbox
> (DefaultTypeTransformation.java:61)
>at MemcacheService.getCache(MemcacheService.groovy:69)
>
>
> The app-id is 'groovytweets'
>
> Can anyone from Google confirm issues right now? I'd say
> NoClassDefFoundError should not occur without changing / redeploying,
> right?
>
> Mhh.
>
> Anyone else?
>
> Cheers
> Sven
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: AppEngine down?

2009-09-25 Thread Terry

I had the similar error when my app runs a period of time, I have to
redeploy the app using eclipse.

On Sep 26, 8:11 am, hansamann  wrote:
> Hi all,
>
> without changing the app, I see these errors in the logs:
>
> [groovytweets/75.336368063049426232].: StackTrace Sanitizing
> stacktrace:
> java.lang.NoClassDefFoundError: Could not initialize class
> com.google.appengine.api.memcache.MemcacheServicePb
> $MemcacheStatsRequest
>         at com.google.appengine.api.memcache.MemcacheServiceImpl.getStatistics
> (MemcacheServiceImpl.java:616)
>         at com.google.appengine.api.memcache.stdimpl.GCache.getCacheStatistics
> (GCache.java:110)
>         at com.google.appengine.api.memcache.stdimpl.GCache.size(GCache.java:
> 138)
>         at com.google.appengine.api.memcache.stdimpl.GCache.isEmpty
> (GCache.java:142)
>         at
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToBo 
> olean
> (DefaultTypeTransformation.java:157)
>         at
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.booleanU 
> nbox
> (DefaultTypeTransformation.java:61)
>         at MemcacheService.getCache(MemcacheService.groovy:69)
>
> The app-id is 'groovytweets'
>
> Can anyone from Google confirm issues right now? I'd say
> NoClassDefFoundError should not occur without changing / redeploying,
> right?
>
> Mhh.
>
> Anyone else?
>
> Cheers
> Sven
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] AppEngine down?

2009-09-25 Thread hansamann

Hi all,

without changing the app, I see these errors in the logs:

[groovytweets/75.336368063049426232].: StackTrace Sanitizing
stacktrace:
java.lang.NoClassDefFoundError: Could not initialize class
com.google.appengine.api.memcache.MemcacheServicePb
$MemcacheStatsRequest
at com.google.appengine.api.memcache.MemcacheServiceImpl.getStatistics
(MemcacheServiceImpl.java:616)
at com.google.appengine.api.memcache.stdimpl.GCache.getCacheStatistics
(GCache.java:110)
at com.google.appengine.api.memcache.stdimpl.GCache.size(GCache.java:
138)
at com.google.appengine.api.memcache.stdimpl.GCache.isEmpty
(GCache.java:142)
at
org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToBoolean
(DefaultTypeTransformation.java:157)
at
org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.booleanUnbox
(DefaultTypeTransformation.java:61)
at MemcacheService.getCache(MemcacheService.groovy:69)


The app-id is 'groovytweets'

Can anyone from Google confirm issues right now? I'd say
NoClassDefFoundError should not occur without changing / redeploying,
right?

Mhh.

Anyone else?

Cheers
Sven
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Persisting embeddable classes working?

2009-09-25 Thread Dominik Steiner

Hi,

I'm having troubles persisting embeddable classes, when calling
pm.makePersist(object); I get the following ClassCastException

java.lang.ClassCastException: com.myprojecyt.MyEmbeddableClass
at org.datanucleus.state.JDOStateManagerImpl.initialiseForEmbedded
(JDOStateManagerImpl.java:357)
at org.datanucleus.state.StateManagerFactory.newStateManagerForEmbedded
(StateManagerFactory.java:132)
at
org.datanucleus.store.appengine.DatastoreFieldManager.getEmbeddedStateManager
(DatastoreFieldManager.java:356)
at
org.datanucleus.store.appengine.DatastoreFieldManager.storeEmbeddedField
(DatastoreFieldManager.java:811)
at
org.datanucleus.store.appengine.DatastoreFieldManager.storeObjectField
(DatastoreFieldManager.java:769)
at org.datanucleus.state.AbstractStateManager.providedObjectField
(AbstractStateManager.java:1037)

The class that I'm trying to persist looks roughly like this

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Entity {
@Persistent
@Embedded
private MyEmbeddableClass myEmbeddableClass;
..
}


And in an extra file I declare the class that has to be embedded

@PersistenceCapable
@EmbeddedOnly
public class MyEmbeddableClass{
@Persistent
private String text;
...
}

Anybody has some experience with embeddable classes?

Thanks in advance

Dominik
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Strange errors with my java-app

2009-09-25 Thread Toby Reyelts
Hi Sasha,

It appears that Groovy's compiler is generating invalid class files in some
cases with respect to generics. In this case, it looks like you only have
one class suffering from this problem - CrazymenuExporter. You should be
able to workaround this issue by removing the generic types from your
process method. I.E. change

byte[]
com.stanfy.grab.export.CrazymenuExporter.process(java.util.List)

to

byte[] com.stanfy.grab.export.CrazymenuExporter.process(java.util.List)

Please let me know if that works for you. Meanwhile, we'll be contacting the
Groovy team directly to fill them in on the full details. Please feel free
to file a bug with them too.

On Fri, Sep 25, 2009 at 11:43 AM, Sasha Timofeev
wrote:

>
> Hi, i have really strange problems with my java application. I'm
> already have 2 apps that working nice now but this (third app) one
> don't want even start...
> Mb anybody has the same problem ?
> This is my log:
>
>
> #
>
>   1.
>  09-25 08:36AM 37.413 / 500 1113ms 1671cpu_ms 0kb Mozilla/5.0
> (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009090216 Linux Mint/7
> (Gloria) Firefox/3.0.14,gzip(gfe)
>  See details
>
>  66.186.34.211 - - [25/Sep/2009:08:36:38 -0700] "GET / HTTP/1.1"
> 500 0 - "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/
> 2009090216 Linux Mint/7 (Gloria) Firefox/3.0.14,gzip(gfe)" "rest-
> searchbot-dev-1.appspot.com"
>
>   2.
>  I 09-25 08:36AM 37.708
>
>  javax.servlet.ServletContext log: Initializing Spring root
> WebApplicationContext
>
>   3.
>  I 09-25 08:36AM 38.502
>
>  [rest-searchbot-dev-1/5.336589323742918607].: 25 Sep
> 2009 15:36:38,498 [Runtime Network Thread] ERROR StackTrace -
> Sanitizing stacktrace:
>  java.lang.StringIndexOutOfBoundsException: String index out of
> range: 60
>at com.google.appengine.runtime.Request.process-b8797a9fde24aa95
> (Request.java)
>at java.lang.String.charAt(Unknown Source)
>at java.lang.Class.getDeclaredField(Class.java:158)
>at
> org.codehaus.groovy.grails.commons.DomainClassArtefactHandler.isDomainClass
> (DomainClassArtefactHandler.java:69)
>at
> org.codehaus.groovy.grails.commons.ServiceArtefactHandler.isArtefactClass
> (ServiceArtefactHandler.java:37)
>at
> org.codehaus.groovy.grails.commons.ArtefactHandlerAdapter.isArtefact
> (ArtefactHandlerAdapter.java:64)
>at
>
> org.codehaus.groovy.grails.commons.DefaultGrailsApplication.configureLoadedClasses
> (DefaultGrailsApplication.java:315)
>at
> org.codehaus.groovy.grails.commons.DefaultGrailsApplication.initialise
> (DefaultGrailsApplication.java:810)
>at
>
> org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean.afterPropertiesSet
> (GrailsPluginManagerFactoryBean.java:112)
>at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
> (AbstractAutowireCapableBeanFactory.java:1369)
>at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
> (AbstractAutowireCapableBeanFactory.java:1335)
>at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
> (AbstractAutowireCapableBeanFactory.java:473)
>at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
> $1.run(AbstractAutowireCapableBeanFactory.java:409)
>at java.security.AccessController.doPrivileged(Native Method)
>at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
> (AbstractAutowireCapableBeanFactory.java:380)
>at org.springframework.beans.factory.support.AbstractBeanFactory
> $1.getObject(AbstractBeanFactory.java:264)
>at
>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
> (DefaultSingletonBeanRegistry.java:222)
>at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
> (AbstractBeanFactory.java:261)
>at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> (AbstractBeanFactory.java:185)
>at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> (AbstractBeanFactory.java:164)
>at
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
> (DefaultListableBeanFactory.java:423)
>at
>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization
> (AbstractApplicationContext.java:728)
>at
> org.springframework.context.support.AbstractApplicationContext.refresh
> (AbstractApplicationContext.java:380)
>at
> org.springframework.web.context.ContextLoader.createWebApplicationContext
> (ContextLoader.java:255)
>at
>
> org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext
> (GrailsContextLoader.java:65)
>at
> org.springframework.web.context.ContextLoader.initWebApplicationContext
> (

[appengine-java] How to add directory outside of web archive directory to classpath when running in dev_appserver?

2009-09-25 Thread gburd

I am trying to implement automatic code reloading for Clojure code
running in dev_appserver.  My goal is to edit and save the source
files in the source directory (sibling of the web archive directory)
and hit refresh in the browser to run the new code.

Clojure looks for source files on the Java class path using
ClassLoader.getResource(s).  Here are some things that I have tried
using the --jvm_flag=-D--enable_all_permissions=true command line flag
to dev_appserver.

1) Create symbolic links in war/WEB-INF/classes to the source
directories.  Fails with security exception.

2) Create my own class loader with findResource(s) implementation that
searches ../src/*.  Fails with security exception.

3) Edit dev_appserver.sh to add my source directory to the class
path.  The additional class path is ignored.

Is there a way to add a directory outside of the web archive directory
to the dev_appserver class path?

Is the source for dev_appserver available so I see what it's doing
with class loaders and security managers?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Child Objects and Relationships (JDO)

2009-09-25 Thread Prashant
still not working... :(

following are my classes...



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Block implements Serializable {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long block_id;

@Persistent
private String block_description;

@Persistent(defaultFetchGroup = "true")
private BlockModule block_module;






@PersistenceCapable(identityType = IdentityType.APPLICATION)
public abstract class BlockModule implements Serializable{

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
protected Key key;

protected abstract String getTitle(HttpServletRequest req);

protected abstract String getContent(HttpServletRequest req);
}



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class MyBlock extends BlockModule{

@Persistent
private String block_title;

@Persistent
private String block_content;

...



i am putting *MyBlock*'s instance in *Block*'s instance ...



On Sat, Sep 26, 2009 at 2:05 AM, objectuser  wrote:

>
> Put the myContactInfo property in the default fetch group (search for
> defaultFetchGroup in this group).
>
> On Sep 25, 2:32 pm, Prashant  wrote:
> > Hi,
> >
> > I created a relationship similar to the one given
> > here<
> http://code.google.com/appengine/docs/java/datastore/dataclasses.html...>.
> > Suppose fetched an *Employee*** entity from datastore, now, how to get *
> > Employee*'s *ContactInfo* entity?
> >
> > I tries using *employee.myContactInfo* but it gives nullPointerException.
> >
> > Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] How to use the Python bulkloader for Java apps

2009-09-25 Thread Nick Johnson (Google)
I've written up a blog post describing how to use the Python bulkloader to
load data into Java apps:
http://blog.notdot.net/2009/9/Advanced-Bulk-Loading-Part-5-Bulk-Loading-for-Java

-- 
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Child Objects and Relationships (JDO)

2009-09-25 Thread objectuser

Put the myContactInfo property in the default fetch group (search for
defaultFetchGroup in this group).

On Sep 25, 2:32 pm, Prashant  wrote:
> Hi,
>
> I created a relationship similar to the one given
> here.
> Suppose fetched an *Employee*** entity from datastore, now, how to get *
> Employee*'s *ContactInfo* entity?
>
> I tries using *employee.myContactInfo* but it gives nullPointerException.
>
> Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Question on transactions

2009-09-25 Thread Max Ross
Fixed in trunk.

On Fri, Sep 25, 2009 at 11:35 AM, Max Ross

> wrote:

> http://code.google.com/p/datanucleus-appengine/issues/detail?id=134
>
>
> On Fri, Sep 25, 2009 at 11:33 AM, Max Ross 
> 
> > wrote:
>
>> Short answer:
>> Yes, the pattern is incorrect.
>>
>> Longer answer:
>> This is a bug - we throw JDOCanRetryException when this failure occurs
>> without a txn, but we throw the wrong exception when this failure happens
>> during txn commit.
>>
>> Great catch!  I'll file a bug and update this thread with the link.
>>
>> Thanks,
>> Max
>>
>>
>> On Fri, Sep 25, 2009 at 1:09 AM, Patrizio Munzi > > wrote:
>>
>>>  Hi all,
>>>
>>> I'm trying to verify transactions behavior, and what I see is that
>>> commit() method never throws a JDOCanRetryException as explained in doc when
>>> the same entity group has being modified concurrently.
>>> I always get a JDOException caused by ConcurrentModificationException.
>>>
>>> My question is:
>>> Is this pattern incorrect??
>>> -
>>>
>>> for (int i = 0; i < NUM_RETRIES; i++) {
>>> pm.currentTransaction().begin();
>>>
>>> ClubMembers members = pm.getObjectById(ClubMembers.class,
>>> "k12345");
>>> members.incrementCounterBy(1);
>>>
>>> try {
>>> pm.currentTransaction().commit();
>>> break;
>>>
>>> } catch (JDOCanRetryException ex) {
>>> if (i == (NUM_RETRIES - 1)) {
>>> throw ex;
>>> }
>>> }
>>> }
>>> -
>>>
>>> should it be modified this way??
>>>
>>> -
>>>
>>> for (int i = 0; i < NUM_RETRIES; i++) {
>>> pm.currentTransaction().begin();
>>>
>>> ClubMembers members = pm.getObjectById(ClubMembers.class,
>>> "k12345");
>>> members.incrementCounterBy(1);
>>>
>>> try {
>>> pm.currentTransaction().commit();
>>> break;
>>>
>>> } catch (JDOException ex) {
>>> if (!(ex.getCause() instanceof
>>> ConcurrentModificationException ) || i == (NUM_RETRIES - 1) {
>>>
>>> throw ex;
>>> }
>>> }
>>> }
>>> -
>>>
>>> Please let me know
>>>
>>> Thanks
>>>
>>> >>>
>>>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Viewing Data in Production

2009-09-25 Thread Praneeth Patlola

Is there a way to view data in production environment for AppEngine?
Similar to http://localhost:8080/_ah/admin in Development environment?


Thanks,
Praneeth
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Opening/closing projects in Eclipse

2009-09-25 Thread Keith Platfoot
Hi Jay,
I've never seen this particular error, but if you can send me your Eclipse
log I can try to track it down.  The log file should be at:

*/.metadata/.log*

Thanks!

On Thu, Sep 24, 2009 at 3:11 PM, Jay Damon  wrote:

>
> I seems I may have found a bug with the GAE eclipse plugin.  When I
> select Open Project on a GAE project that was previously closed, e.g.
> My First Web Application, it opens and may be run successfully.
> However, it appears that if I shut down eclipse and restart it, the
> data nucleus enhancer fails:
>
> java.lang.NoClassDefFoundError: com/google/appengine/tools/enhancer/
> Enhance
> Exception in thread "main"
>
> If I select Close Project, then Open Project, it appears to solve the
> problem.  Has anyone else seen this?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] How to view changes immediately in browser when session is enable ?

2009-09-25 Thread tomekc

Hello

I work on eclipse with gae plugin and when I set true in appengine-web.xml file then, if
session starts I can't see changes on modified class. Reload page has
no effect, but if I set off session then changes are visible
immediately.  I have turned off browser cache.

Is there any way to turn off cache, or any other solution to view
changes immediately when session is enable ?
Of course I can delete cookie, close browser or any other workaround
but I want to find really solution.

Best..., tomek.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Child Objects and Relationships (JDO)

2009-09-25 Thread Prashant
Hi,

I created a relationship similar to the one given
here.
Suppose fetched an *Employee*** entity from datastore, now, how to get *
Employee*'s *ContactInfo* entity?

I tries using *employee.myContactInfo* but it gives nullPointerException.

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: javax.jdo.JDOFatalUserException

2009-09-25 Thread Jason (Google)
Make sure you're using a PMF singleton as described here:

http://code.google.com/appengine/docs/java/datastore/usingjdo.html#Getting_a_PersistenceManager_Instance

Then you can call PMF.get().getPersistenceManager in all of your classes
instead of continually instantiating new PersistenceManagerFactory objects,
which is an expensive operation.

- Jason

On Wed, Sep 23, 2009 at 5:27 PM, Vatsa  wrote:

>
> Hi,
>  I am a newbie to "Google App Engine".  We are trying to prototype a
> simple application to persist DTO which are read from a .csv file to
> the virtual data store.
>
>  I get the following error (very descriptive) at the time of
> instantiating the Access Manager
>
> Caused by: javax.jdo.JDOFatalUserException: Application code attempted
> to create a PersistenceManagerFactory named transactions-optional, but
> one with this name already exists!  Instances of
> PersistenceManagerFactory are extremely slow to create and it is
> usually not necessary to create one with a given name more than once.
> Instead, create a singleton and share it throughout your code.  If you
> really do need to create a duplicate PersistenceManagerFactory (such
> as for a unittest suite), set the
> appengine.orm.disable.duplicate.pmf.exception system property to avoid
> this error.
>
>
> Thanks
> Vatsa
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: @Persistent(defaultFetchGroup="false")

2009-09-25 Thread Jason (Google)
You can use a custom fetch group as objectuser says or you can "touch" the
field (e.g. call the getter) before detaching the queried object, which will
force it to be lazily loaded even if it's not part of the default fetch
group. The former is a more elegant option, though.

- Jason

On Wed, Sep 23, 2009 at 1:47 PM, Max  wrote:

>
> How do I fetch field that is not declared like:-
>
>@Persistent(defaultFetchGroup="true")
>
> I am using JDO
>
> Thanks, Max
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Exception while getting data from HttpSession

2009-09-25 Thread Jason (Google)
In particular, does the Twitter class that you're trying to store implement
Serializable? This is required since App Engine sessions are backed by
Memcache and the datastore.

- Jason

On Wed, Sep 23, 2009 at 6:21 AM, Simon  wrote:

>
> Can you show the code for your Twitter class?
>
> On Sep 22, 9:48 pm, Tahir Akram  wrote:
> > I am getting following exception while getting data from session. I
> > have following 2 servlets. One set session and other retrieve
> > attribute from it. I have also sett session enable tag in appengine
> > web xml file. (note: Using twitter4j)
> >
> > [FIRST SERVLET]
> >
> >  Twitter twitter = new Twitter();
> >twitter.setOAuthConsumer("", "");
> >RequestToken requestToken = null;
> > try {
> > requestToken = twitter.getOAuthRequestToken();
> > log.info("OAuth token has been taken");
> > } catch (TwitterException e) {
> > log.warning(e.toString());
> > }
> >
> > HttpSession session = request.getSession();
> > if (session.getAttribute("twitter")==null){
> > session.setAttribute("twitter", twitter);
> > out.println("->
> session is set");
> > }
> >
> > if (session.getAttribute("token")==null){
> > session.setAttribute("token", requestToken);
> > out.println("->
> session is set");
> > }
> > String authUrl = requestToken.getAuthorizationURL();
> >
> > [SECOND SERVLET]
> >
> > HttpSession session = request.getSession();
> >
> > twitter =
> (Twitter)session.getAttribute("twitter");
> > r  = (RequestToken)session.getAttribute("token");
> >
> > twitter.setOAuthAccessToken(r.getAccessToken());
> >
> > twitter.updateStatus("Hello World!");
> >
> > #
> > 09-22 01:34PM 12.913
> >
> > EXCEPTION
> > javax.servlet.ServletException: java.lang.ArrayStoreException:
> > [Ljava.lang.String;
> > at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
> > (AppVersionHandlerMap.java:239)
> > at org.mortbay.jetty.handler.HandlerWrapper.handle
> > (HandlerWrapper.java:139)
> > at org.mortbay.jetty.Server.handle(Server.java:313)
> > at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> > 506)
> > at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
> > (HttpConnection.java:830)
> > at
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable
> > (RpcRequestParser.java:76)
> > at
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
> > at
> >
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest
> > (JettyServletEngineAdapter.java:139)
> > at com.google.apphosting.runtime.JavaRuntime.handleRequest
> > (JavaRuntime.java:235)
> > at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:4950)
> > at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:4948)
> > at
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
> > (BlockingApplicationHandler.java:24)
> > at
> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> > 359)
> > at com.google.net.rpc.impl.Server$2.run(Server.java:823)
> > at com.google.tracing.LocalTraceSpanRunnable.run
> > (LocalTraceSpanRunnable.java:56)
> > at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
> > (LocalTraceSpanBuilder.java:516)
> > at com.google.net.rpc.impl.Server.startRpc(Server.java:778)
> > at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
> > at com.google.net.rpc.impl.ServerConnection.messageReceived
> > (ServerConnection.java:437)
> > at com.google.net.rpc.impl.RpcConnection.parseMessages
> > (RpcConnection.java:319)
> > at com.google.net.rpc.impl.RpcConnection.dataReceived
> > (RpcConnection.java:290)
> > at
> com.google.net.async.Connection.handleReadEvent(Connection.java:
> > 428)
> > at com.google.net.async.EventDispatcher.processNetworkEvents
> > (EventDispatcher.java:762)
> > at com.google.net.async.EventDispatcher.internalLoop
> > (EventDispatcher.java:207)
> > at
> com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
> > 101)
> > at com.google.net.rpc.RpcService.runUntilServerShutdown
> > (RpcService.java:251)
> > at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run
> > (JavaRuntime.java:392)
> > at java.lang.Thread.run(Unknown Source)
> > Caused by: java.la

[appengine-java] Re: not able to send emails using google apps engine

2009-09-25 Thread Jason (Google)
The "from" address must be set to either the current signed-in user or an
application administrator account. You can add new administrators by
clicking on the "Developers" link in your application's Admin Console. Also,
this email address is case sensitive -- if I registered my gmail address as
ja...@gmail.com and try to send email with ja...@gmail.com, I would see the
error above.

If you still need help, please ping me privately with your application ID
and the admin email address you are trying to use and I'll look into it
more.

- Jason

On Wed, Sep 23, 2009 at 5:36 AM, vikceo  wrote:

>
> Hie
>
> thanks for replying but that does not work.
>
> I tried it from scratch as well. I assigned one of my user in my
> google apps account as administrator.
> Using the same id in from still throws unauthorized user exception.
>
> The only id i can use is the id i use to log in to the dashboard of my
> google app engine account.
> So, how to add more ids and provide admin right?
>
> Vik
>
>
> On Sep 22, 7:25 pm, GregGG  wrote:
> > I think you have to add that "from" user as an administrative user on
> > your app engine application.
> >
> > On Sep 22, 2:02 am, Vik  wrote:
> >
> >
> >
> > > Hie
> > > Getting following exception:
> >
> > > javax.mail.MessagingException: Illegal Arguments
> > > (java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized
> > > sender
> >
> > > The from address is on of the user i have created in my google apps
> > > account associated with my domainwww.sakshum.com
> >
> > > the from id i m using is subscr...@sakshum.com
> >
> > > So, how to fix this? I may like to use different from ids depending
> > > upon the context in which a request is raised in my app.
> >
> > > Thankx and Regards
> >
> > > Vik
> > > Founderwww.sakshum.comwww.sakshum.blogspot.com
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Lists not being saved with JDO

2009-09-25 Thread Jason (Google)
Are you closing the PersistenceManager before issuing the query? If not,
that could be your problem.

- Jason

On Wed, Sep 23, 2009 at 4:56 AM, T_even  wrote:

>
> Hey,
>
> I am executing a query after i have saved the object to check if all
> the data is saved/restored.
> Right now i am using a work around, instead of letting the engine take
> care of the list i am serializing the list myself and saving them in a
> byte array. It isn't pretty but it is working. Also i have just
> checked the http://localhost:8080/_ah/admin (hadn't used it before
> today)and from what i saw the data is there so i guess the data is
> being saved but not converted back ? There query is the same for both
> versions (the work around and the normal one).
>
> I don't know if this info will be relevant but i am using eclipse
> 64bits with windows 7 64bits, eclipse is running on the 64bits jdk but
> the project is running on a 32bits jdk. I am using the 32bit jdk for
> the project because otherwise i will get an error with the google app
> engine emulator.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: gql query error on data viewer.. help

2009-09-25 Thread Jason (Google)
The index necessary to execute that particular query isn't available -- if
you create the index, this query should work. The Admin Console should say
something to this effect at the bottom of the stack trace.

- Jason

On Wed, Sep 23, 2009 at 1:24 AM, mar_novice  wrote:

>
> When i use a filter in query like
> SELECT * FROM Fruits where item = 'apple'
>
> It runs well and if i use an ordering like
> SELECT * FROM Subscriber order by date
>
> it runs well also
>
> but when i combine the two,
>
> SELECT * FROM Fruits where item = 'apple' order by date
>
> i got Server Error..
>
> What do you think is the problem??
>
> thanks..
>
> mar_novice
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Question on transactions

2009-09-25 Thread Max Ross
http://code.google.com/p/datanucleus-appengine/issues/detail?id=134

On Fri, Sep 25, 2009 at 11:33 AM, Max Ross

> wrote:

> Short answer:
> Yes, the pattern is incorrect.
>
> Longer answer:
> This is a bug - we throw JDOCanRetryException when this failure occurs
> without a txn, but we throw the wrong exception when this failure happens
> during txn commit.
>
> Great catch!  I'll file a bug and update this thread with the link.
>
> Thanks,
> Max
>
>
> On Fri, Sep 25, 2009 at 1:09 AM, Patrizio Munzi 
> wrote:
>
>>  Hi all,
>>
>> I'm trying to verify transactions behavior, and what I see is that
>> commit() method never throws a JDOCanRetryException as explained in doc when
>> the same entity group has being modified concurrently.
>> I always get a JDOException caused by ConcurrentModificationException.
>>
>> My question is:
>> Is this pattern incorrect??
>> -
>>
>> for (int i = 0; i < NUM_RETRIES; i++) {
>> pm.currentTransaction().begin();
>>
>> ClubMembers members = pm.getObjectById(ClubMembers.class,
>> "k12345");
>> members.incrementCounterBy(1);
>>
>> try {
>> pm.currentTransaction().commit();
>> break;
>>
>> } catch (JDOCanRetryException ex) {
>> if (i == (NUM_RETRIES - 1)) {
>> throw ex;
>> }
>> }
>> }
>> -
>>
>> should it be modified this way??
>>
>> -
>>
>> for (int i = 0; i < NUM_RETRIES; i++) {
>> pm.currentTransaction().begin();
>>
>> ClubMembers members = pm.getObjectById(ClubMembers.class,
>> "k12345");
>> members.incrementCounterBy(1);
>>
>> try {
>> pm.currentTransaction().commit();
>> break;
>>
>> } catch (JDOException ex) {
>> if (!(ex.getCause() instanceof
>> ConcurrentModificationException ) || i == (NUM_RETRIES - 1) {
>>
>> throw ex;
>> }
>> }
>> }
>> -
>>
>> Please let me know
>>
>> Thanks
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Question on transactions

2009-09-25 Thread Max Ross
Short answer:
Yes, the pattern is incorrect.

Longer answer:
This is a bug - we throw JDOCanRetryException when this failure occurs
without a txn, but we throw the wrong exception when this failure happens
during txn commit.

Great catch!  I'll file a bug and update this thread with the link.

Thanks,
Max

On Fri, Sep 25, 2009 at 1:09 AM, Patrizio Munzi wrote:

>  Hi all,
>
> I'm trying to verify transactions behavior, and what I see is that commit()
> method never throws a JDOCanRetryException as explained in doc when the same
> entity group has being modified concurrently.
> I always get a JDOException caused by ConcurrentModificationException.
>
> My question is:
> Is this pattern incorrect??
> -
>
> for (int i = 0; i < NUM_RETRIES; i++) {
> pm.currentTransaction().begin();
>
> ClubMembers members = pm.getObjectById(ClubMembers.class,
> "k12345");
> members.incrementCounterBy(1);
>
> try {
> pm.currentTransaction().commit();
> break;
>
> } catch (JDOCanRetryException ex) {
> if (i == (NUM_RETRIES - 1)) {
> throw ex;
> }
> }
> }
> -
>
> should it be modified this way??
>
> -
>
> for (int i = 0; i < NUM_RETRIES; i++) {
> pm.currentTransaction().begin();
>
> ClubMembers members = pm.getObjectById(ClubMembers.class,
> "k12345");
> members.incrementCounterBy(1);
>
> try {
> pm.currentTransaction().commit();
> break;
>
> } catch (JDOException ex) {
> if (!(ex.getCause() instanceof
> ConcurrentModificationException ) || i == (NUM_RETRIES - 1) {
>
> throw ex;
> }
> }
> }
> -
>
> Please let me know
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Java example on how to upload csv data to the data store

2009-09-25 Thread Jason (Google)
You should look into this also, especially if you have a small- to
medium-sized data set:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/786585a57e25355a

Let me know if it works and I'll add it to the "Will it Play in App Engine"
wiki page.

- Jason

On Fri, Sep 25, 2009 at 10:50 AM, Jason (Google) wrote:

> The bulk loader is not currently available for the Java SDK, although you
> can use the Python-based bulk loader utility to upload data to your
> Java-based apps.
>
> - Jason
>
>
> On Tue, Sep 22, 2009 at 10:11 PM, Jaap  wrote:
>
>>
>> Does anybody have an example on how to easily upload csv data to the
>> data store with java?
>>
>> Thanks
>>
>> Jaap
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: log page gets unformatted when looking at older logs

2009-09-25 Thread Jason (Google)
Please file a new issue and include a screenshot:

http://code.google.com/p/googleappengine/issues/list

- Jason

On Wed, Sep 23, 2009 at 1:10 AM, mar_novice  wrote:

>
> When looking at olders logs by clicking Next 20> the page gets
> unformatted and not good to look at.. i am using firefox 3.0 in
> ubuntu
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: App Engine 1.2.5 Doesn't Support String, Exception, SAXParser in Java?

2009-09-25 Thread Jason (Google)
I think he was joking, Eric. :) String, Exception, et al. work just fine in
App Engine.

- Jason

On Tue, Sep 22, 2009 at 7:38 PM, Eric Atkinson  wrote:

>
> Thank you, the pointer to 1.2.5 was incorrect in Eclipse as you
> suggested, and now all my massive number of compiler errors are gone
> (thank god, and thank you again).
>
> What's curious is that I'm still using String and Exception and other
> java.lang classes, and they work fine on the engine too, yet I've not
> read anything in the documentation (yet) that indicates java.lang.* is
> unsupported. How is this possible? How can it be Java without
> supporting java.lang.*, which certainly seems to be doing?
>
> On Sep 22, 5:46 pm, Toby Reyelts  wrote:
> > App Engine no longer supports classes from java.lang.*. You can work
> around
> > this by bundling your own versions of java.lang.String and
> > java.lang.Exception with your webapp.
> >
> > Seriously though, please check that your Eclipse project is pointing to a
> > valid 1.2.5 App Engine SDK installation. There is a known issue with the
> > Eclipse IDE where it can sometimes too aggressively remove plugins which
> it
> > believes are no longer in use.
> >
> >
> >
> > On Tue, Sep 22, 2009 at 5:20 PM, Eric Atkinson 
> wrote:
> >
> > > I justed updated to App Engine 1.2.5 and now all my software is full
> > > of compiler errors because it says app engine no longer support
> > > classes like String, Exception, SAXParser in Java.  Should I revert
> > > back to an earlier app engine that did support them or is this really
> > > the "new" app engine support?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Model to Optimize Queries

2009-09-25 Thread Jason (Google)
As far as I can tell, your plan should work -- I don't think you're missing
anything. Now that your design is set, I'm looking forward to hearing how
the actual implementation goes. Let me know if you have any other questions.

- Jason

On Tue, Sep 22, 2009 at 10:10 PM, Sam Walker wrote:

> Thanks Jason, I realize that I wont be able to do transactions per say
> across the entity groups, and that the tasks can be run multiple times. With
> those two constraints in mind, I designed both of the tasks described above
> (running any of the two multiple times wont have any affect due to the stage
> variable/pendingSet, and they rely on transactions within the same entity
> group). Can you please take a deeper look on what the tasks actually do and
> will they achieve what I am trying to do here. Just want to make sure I am
> not missing anything basic with this.
>
> Thanks for bringing out Option 3 as the easy winner with 30s rule I wasn't
> considering. Thanks for all your help in general as well!
>
>
> On Tue, Sep 22, 2009 at 10:39 AM, Jason (Google) wrote:
>
>> Hi Sam. Based on your design above, I believe you're modeling an unowned
>> relationship between articles and reviewers, which makes sense.
>> Unfortunately, this means that you cannot use transactions, so you'll have
>> to work around this. Also keep in mind that tasks may be executed multiple
>> times so you will need to include logic to ensure that, should a task be
>> executed a second time, it won't throw off your application's state.
>> Regarding the task queue scenarios you laid out, I prefer the third
>> option, although the first and second should work. With the first and second
>> options, you need to be aware of how many articles and reviewers you're
>> processing since tasks are subject to the same 30-second request limits that
>> normal requests are. Option 3 neatly avoids this problem, which is one
>> reason why I consider it preferable.
>>
>> - Jason
>>
>>
>> On Sun, Sep 20, 2009 at 8:46 PM, Sam Walker wrote:
>>
>>> Yea, I dont need to query on it, that's why I thought maybe storing in a
>>> HashMap would save me an extra query. Lets not go that way for now and
>>> assume I make a new relationship:
>>>
>>> I have another question, I was wondering if I can use TaskQueue to
>>> achieve some sort of transactions across entities and give my reviewers
>>> points (to rank them later on) based on their reviews.
>>>
>>> So, once an Article is finalized, I want to give each reviewer some
>>> points (based on some logic like first reviewer who approved gets the
>>> maximum points and so on and so forth), I am thinking of having another
>>> persistent variable in Article named stage, initialized to 0 and a
>>> pendingSet in Reviewer
>>>
>>> Once everyone approves, I can set stage to 1.
>>>
>>> Task 1:
>>> For all articles in stage 1:
>>>   For all reviewers in this article
>>> in a transaction add the given article to pendingSet of the reviewer
>>> Set article stage to 2
>>>
>>> Task 2:
>>> For all articles in stage 2:
>>>   For all reviewers in this article:
>>>  in a transaction, remove the article from the pendingSet and add
>>> points to the reviewer
>>> Set article stage to 3
>>>
>>> First and foremost, you think this will work, right?
>>>
>>> Secondly, which approach is the best:
>>> 1. Make one  big task which executes both task1 followed by task 2, and
>>> run it every five minutes or so.
>>> 2. Run both task 1 and task 2 every 5 minutes
>>> 3. Change the tasks so that they take the key of the article as input,
>>> and kick off Task 1 with key = articleKey after setting the stage to 1, and
>>> Task 1 kicks off Task2 with key = articleKey after setting the stage to 2.
>>>
>>> Please feel free to add more and advise which should be used when.
>>>
>>> Thanks a bunch!
>>>
>>>
>>> On Tue, Sep 8, 2009 at 12:03 PM, Jason (Google) wrote:
>>>
 How do you plan to use the HashMap? You won't be able to query on it, so
 if that's a requirement, you'll want to look into adding another
 relationship.

 - Jason

 On Fri, Sep 4, 2009 at 7:14 PM, Sam Walker wrote:

> Thanks!
>
> I am thinking of doing something like this:
>
> class Article {
>   HashSet reviewers;
>   HashSet tags;
>   int status; // pending, approved, declined - derived from reviewers'
> statuses
>
>   HashMap mapping; // Reviewer key to Review mapping to
> prevent storing making another 1:n relationship
>
>   class Review {
> int status; // pending, approved, declined
> String notes;
> ... // anything else
>   }
> }
>
> Do you think this will work? It doesn't get me all the things I want,
> but is still good enough I think (its kind of sad that we can't model this
> common scenario effectively/efficiently).
>
> Do you recommend doing this HashMap kind of a hacky thing or just make
> a new Entity and a new relationship? Is it worth the 

[appengine-java] Re: Co-related Queries

2009-09-25 Thread Jason (Google)
See
http://groups.google.com/group/google-appengine-java/browse_thread/thread/cef51dde1d7cafaf
.

- Jason

On Tue, Sep 22, 2009 at 10:10 PM, rams  wrote:

>
> is there any support in google app engine to execute Co-related
> subquery like below:
>
>
> SELECT FROM Employee WHERE salary >
>(SELECT avg(salary) FROM  Employee e)
>
> i need the way to handle this in java app engine, jdo
>
> Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Referring to the outer query in the subquery

2009-09-25 Thread Jason (Google)
App Engine's datastore does not allow for subqueries -- you will either have
to structure your data model to return the results in a single query or
issue multiple queries and resolve them using your own logic. Obviously, the
former is preferred.

Also, keep in mind that aggregate functions aren't supported by App Engine's
datastore. The best way to handle aggregate functions is computing values at
write time -- i.e. for average, you can store the total count and total
salary in separate entities and update them when new employees are added.
Then when the average is requested, just fetch these two entities and return
the result. This approach does require that you know in advance which
aggregate data you'll need.

- Jason

On Tue, Sep 22, 2009 at 10:17 PM, rams  wrote:

>
> hi i need help to solve the query as stated below
>
> SELECT FROM  Employee WHERE salary >
>(SELECT avg(salary) FROM  Employee e WHERE e.lastName ==
> this.lastName)
>
> is there any possibility to implement this query in java app engine
> and jdo.
>
>
> please help me in this issue;
>
>
> thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Java example on how to upload csv data to the data store

2009-09-25 Thread Jason (Google)
The bulk loader is not currently available for the Java SDK, although you
can use the Python-based bulk loader utility to upload data to your
Java-based apps.

- Jason

On Tue, Sep 22, 2009 at 10:11 PM, Jaap  wrote:

>
> Does anybody have an example on how to easily upload csv data to the
> data store with java?
>
> Thanks
>
> Jaap
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: OpenID Consumer

2009-09-25 Thread David Yu

There's a demo running on appengine. http://dyuproject.appspot.com
The relevant source is at http://code.google.com/p/dyuproject/wiki/Hybrid

On Sep 3, 8:10 am, anjolight  wrote:
> Hi, I'm trying to create anOpenIDconsumer in my appengine project.
> My intention to use Google forOpenIDprovider withOpenID+OAuth. If
> someone has an example code to share, I'd greatly appreciate it.
>
> thank you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Saving a GregorianCalendar object causes a java.lang.UnsupportedOperationException

2009-09-25 Thread Max Ross
That's odd.  Perhaps your class didn't get reenhanced when you made the
change?  One way to do a sanity check is to change the name of the class and
then run again.

2009/9/24 antichrist 

>
> I have same problem and I'm already using java.util.date. but in
> eclipse, debug as web application works,
>
> but run as web application makes same problem. my object looks like
> this
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Bidder {
>@PrimaryKey
>  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>  private Long id;
>@Persistent
>  private String some;
>
>@Persistent
>  private Integer some;
>
>@Persistent
>  private Integer some;
>
>@Persistent
>  private Long some;
>
>@Persistent
>  private Date some;
>
> On 7월28일, 오전4시19분, Max Ross 
> >
> wrote:
> > Thanks for the report.  There are two things going on here.  First,
> > DataNucleus is doing something I don't understand with the meta-data that
> is
> > being created for your GregorianCalendar field.  I'll look into this.
> > However, even if this problem didn't exist, the datastore doesn't support
> > Calendar or any of its subtypes.  This isn't a whitelisting issue - it's
> a
> > data issue.  A Calendar contains a TimeZone attribute, but the datastore
> > represents a point in time as an int 64, so we can't just store the
> > millisecond representation of the Calendar without potentially losing
> > important data.  The workaround is to use java.util.Date.
> >
> > Max
> >
> >
> >
> > On Sun, Jul 26, 2009 at 10:18 PM, alosii  wrote:
> >
> > > The problem apparently happens at line 60 of your EntityUtils.class
> >
> > > if (ammd.getColumnMetaData() != null && ammd.getColumnMetaData
> > > ().length > 0) {
> > >  if (ammd.getColumnMetaData().length != 1) {  //<-
> > > BOOM!!!
> > >// TODO(maxr) throw something more appropriate
> > >throw new UnsupportedOperationException();
> > > }
> >
> > > My object looks like this:
> >
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > public class Object{
> > >@PrimaryKey
> > >private String someattribute;
> >
> > >@Persistent
> > >private String someattribute;
> >
> > >@Persistent
> > >private String someattribute;
> >
> > >...
> >
> > >@Persistent
> > >private STATUS status;
> >
> > >@Persistent
> > >private GregorianCalendar lastActiveTime;
> >
> > > ...
> > > }
> >
> > > I'm I doing something wrong? Last time i checked the GregorianCalendar
> > > was available:
> > >http://code.google.com/appengine/docs/java/jrewhitelist.html
> >
> > > Any ideas would be great!
> >
> > > Thanks!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Strange errors with my java-app

2009-09-25 Thread Sasha Timofeev

Hi, i have really strange problems with my java application. I'm
already have 2 apps that working nice now but this (third app) one
don't want even start...
Mb anybody has the same problem ?
This is my log:


#

   1.
  09-25 08:36AM 37.413 / 500 1113ms 1671cpu_ms 0kb Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009090216 Linux Mint/7
(Gloria) Firefox/3.0.14,gzip(gfe)
  See details

  66.186.34.211 - - [25/Sep/2009:08:36:38 -0700] "GET / HTTP/1.1"
500 0 - "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/
2009090216 Linux Mint/7 (Gloria) Firefox/3.0.14,gzip(gfe)" "rest-
searchbot-dev-1.appspot.com"

   2.
  I 09-25 08:36AM 37.708

  javax.servlet.ServletContext log: Initializing Spring root
WebApplicationContext

   3.
  I 09-25 08:36AM 38.502

  [rest-searchbot-dev-1/5.336589323742918607].: 25 Sep
2009 15:36:38,498 [Runtime Network Thread] ERROR StackTrace -
Sanitizing stacktrace:
  java.lang.StringIndexOutOfBoundsException: String index out of
range: 60
at com.google.appengine.runtime.Request.process-b8797a9fde24aa95
(Request.java)
at java.lang.String.charAt(Unknown Source)
at java.lang.Class.getDeclaredField(Class.java:158)
at
org.codehaus.groovy.grails.commons.DomainClassArtefactHandler.isDomainClass
(DomainClassArtefactHandler.java:69)
at
org.codehaus.groovy.grails.commons.ServiceArtefactHandler.isArtefactClass
(ServiceArtefactHandler.java:37)
at
org.codehaus.groovy.grails.commons.ArtefactHandlerAdapter.isArtefact
(ArtefactHandlerAdapter.java:64)
at
org.codehaus.groovy.grails.commons.DefaultGrailsApplication.configureLoadedClasses
(DefaultGrailsApplication.java:315)
at
org.codehaus.groovy.grails.commons.DefaultGrailsApplication.initialise
(DefaultGrailsApplication.java:810)
at
org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean.afterPropertiesSet
(GrailsPluginManagerFactoryBean.java:112)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
(AbstractAutowireCapableBeanFactory.java:1335)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
(DefaultListableBeanFactory.java:423)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization
(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh
(AbstractApplicationContext.java:380)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext
(ContextLoader.java:255)
at
org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext
(GrailsContextLoader.java:65)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext
(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized
(ContextLoaderListener.java:45)
at org.mortbay.jetty.handler.ContextHandler.startContext
(ContextHandler.java:530)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:
135)
at org.mortbay.jetty.webapp.WebAppContext.startContext
(WebAppContext.java:1218)
at org.mortbay.jetty.handler.ContextHandler.doStart
(ContextHandler.java:500)
at org.mortbay.jetty.webapp.WebAppContext.doStart
(WebAppContext.java:448)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:40)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler
(AppVersionHandlerMap.java:190)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler
(AppVersionHandlerMap.java:167)
at
com.google.apphosting

[appengine-java] Re: Need GAE logs explanation

2009-09-25 Thread Vince Bonfanti

RE: "One way to tell is by registering a load-on-startup servlet and
logging from its init method."

Is there any sort of unique identifier for the application instance
that we can include in the log message? I'd like to be able to monitor
how many instances of my application are running. I don't care what
the identifier is and wouldn't try to use it for any other purpose.
The only thing I can find that might work is the "user.dir" system
property, which seems to vary based on application instance.


On Fri, Sep 25, 2009 at 11:26 AM, Toby Reyelts  wrote:
> Yes, it's very possible for two requests (serial or concurrent) to land on
> two different applications instances, one being newly initialized, the other
> already warm. (Does not technically have to be physically separate
> machines).
>
> On Fri, Sep 25, 2009 at 11:01 AM, mably  wrote:
>>
>> Thanx for your answer, the response times seems to be back to normal.
>> I'll keep an eye on it.
>>
>> May be the two pages where served from different machines ?
>>
>> On 25 sep, 16:48, Toby Reyelts  wrote:
>> > Is your application being initialized when you hit that URL? (One way to
>> > tell is by registering a load-on-startup servlet and logging from its
>> > init
>> > method). If so, what's likely happening is that you're not including
>> > your
>> > app initialization when you only time the service method of your
>> > servlet.
>> >
>> >
>> >
>> > On Thu, Sep 24, 2009 at 11:41 AM, mably  wrote:
>> >
>> > > Hello everybody,
>> >
>> > > I dont really understand the logs GAE shows me in the admin console :
>> >
>> > > I have a first URI showing a simple search form that gives me :
>> >
>> > > 09-24 08:24AM 30.341 /default/ftsearch.do?_contenttype_=content 200
>> > > 117ms 103cpu_ms 73api_cpu_ms
>> >
>> > > But my servlet service method lasts only :
>> >
>> > > INFO : com.mably.cms.web.DispatcherServlet service: 6ms
>> >
>> > > And I have a second URI listing data from the datastore that gives
>> > > me :
>> >
>> > > 09-24 08:24AM 28.575 /default/notifications.do 200 38ms 27cpu_ms
>> > > 13api_cpu_ms
>> >
>> > > INFO : com.mably.cms.web.DispatcherServlet service: 10ms
>> >
>> > > What's annoying me is that the fastest (6ms versus 10ms) servlet seems
>> > > to last longer for GAE (117ms vs 38ms) and to take more CPU.
>> >
>> > > Can somebody explain these numbers to me ?
>> >
>> > > Thanx in advance.
>> >
>> > > Francois
>> > > Bordeaux, FRANCE
>>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Need GAE logs explanation

2009-09-25 Thread Toby Reyelts
Yes, it's very possible for two requests (serial or concurrent) to land on
two different applications instances, one being newly initialized, the other
already warm. (Does not technically have to be physically separate
machines).

On Fri, Sep 25, 2009 at 11:01 AM, mably  wrote:

>
> Thanx for your answer, the response times seems to be back to normal.
> I'll keep an eye on it.
>
> May be the two pages where served from different machines ?
>
> On 25 sep, 16:48, Toby Reyelts  wrote:
> > Is your application being initialized when you hit that URL? (One way to
> > tell is by registering a load-on-startup servlet and logging from its
> init
> > method). If so, what's likely happening is that you're not including your
> > app initialization when you only time the service method of your servlet.
> >
> >
> >
> > On Thu, Sep 24, 2009 at 11:41 AM, mably  wrote:
> >
> > > Hello everybody,
> >
> > > I dont really understand the logs GAE shows me in the admin console :
> >
> > > I have a first URI showing a simple search form that gives me :
> >
> > > 09-24 08:24AM 30.341 /default/ftsearch.do?_contenttype_=content 200
> > > 117ms 103cpu_ms 73api_cpu_ms
> >
> > > But my servlet service method lasts only :
> >
> > > INFO : com.mably.cms.web.DispatcherServlet service: 6ms
> >
> > > And I have a second URI listing data from the datastore that gives
> > > me :
> >
> > > 09-24 08:24AM 28.575 /default/notifications.do 200 38ms 27cpu_ms
> > > 13api_cpu_ms
> >
> > > INFO : com.mably.cms.web.DispatcherServlet service: 10ms
> >
> > > What's annoying me is that the fastest (6ms versus 10ms) servlet seems
> > > to last longer for GAE (117ms vs 38ms) and to take more CPU.
> >
> > > Can somebody explain these numbers to me ?
> >
> > > Thanx in advance.
> >
> > > Francois
> > > Bordeaux, FRANCE
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Need GAE logs explanation

2009-09-25 Thread mably

Thanx for your answer, the response times seems to be back to normal.
I'll keep an eye on it.

May be the two pages where served from different machines ?

On 25 sep, 16:48, Toby Reyelts  wrote:
> Is your application being initialized when you hit that URL? (One way to
> tell is by registering a load-on-startup servlet and logging from its init
> method). If so, what's likely happening is that you're not including your
> app initialization when you only time the service method of your servlet.
>
>
>
> On Thu, Sep 24, 2009 at 11:41 AM, mably  wrote:
>
> > Hello everybody,
>
> > I dont really understand the logs GAE shows me in the admin console :
>
> > I have a first URI showing a simple search form that gives me :
>
> > 09-24 08:24AM 30.341 /default/ftsearch.do?_contenttype_=content 200
> > 117ms 103cpu_ms 73api_cpu_ms
>
> > But my servlet service method lasts only :
>
> > INFO : com.mably.cms.web.DispatcherServlet service: 6ms
>
> > And I have a second URI listing data from the datastore that gives
> > me :
>
> > 09-24 08:24AM 28.575 /default/notifications.do 200 38ms 27cpu_ms
> > 13api_cpu_ms
>
> > INFO : com.mably.cms.web.DispatcherServlet service: 10ms
>
> > What's annoying me is that the fastest (6ms versus 10ms) servlet seems
> > to last longer for GAE (117ms vs 38ms) and to take more CPU.
>
> > Can somebody explain these numbers to me ?
>
> > Thanx in advance.
>
> > Francois
> > Bordeaux, FRANCE
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Need GAE logs explanation

2009-09-25 Thread Toby Reyelts
Is your application being initialized when you hit that URL? (One way to
tell is by registering a load-on-startup servlet and logging from its init
method). If so, what's likely happening is that you're not including your
app initialization when you only time the service method of your servlet.

On Thu, Sep 24, 2009 at 11:41 AM, mably  wrote:

>
> Hello everybody,
>
> I dont really understand the logs GAE shows me in the admin console :
>
> I have a first URI showing a simple search form that gives me :
>
> 09-24 08:24AM 30.341 /default/ftsearch.do?_contenttype_=content 200
> 117ms 103cpu_ms 73api_cpu_ms
>
> But my servlet service method lasts only :
>
> INFO : com.mably.cms.web.DispatcherServlet service: 6ms
>
> And I have a second URI listing data from the datastore that gives
> me :
>
> 09-24 08:24AM 28.575 /default/notifications.do 200 38ms 27cpu_ms
> 13api_cpu_ms
>
> INFO : com.mably.cms.web.DispatcherServlet service: 10ms
>
> What's annoying me is that the fastest (6ms versus 10ms) servlet seems
> to last longer for GAE (117ms vs 38ms) and to take more CPU.
>
> Can somebody explain these numbers to me ?
>
> Thanx in advance.
>
> Francois
> Bordeaux, FRANCE
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Discussion on will-it-play-in-app-engine

2009-09-25 Thread Stuart Moffatt

Under the Java Topology Suite (JTS) section of this page, please add:

"A JTS + GWT + Google Maps demo is available at http://giscloud.appspot.com";
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Storing GIS spatial indexes with modified Java Topology Suite

2009-09-25 Thread Stuart Moffatt

All,

For App Engine to be considered a platform for custom GIS (outside of
what is current possible with Google Maps) we need to have a robust
mechanism for spatial queries. This is provided by the Java Topology
Suite (JTS). My initial reference application for JTS on App Engine
can be found at http://giscloud.appspot.com (follow the links to the
source code).

The reference application, however, does not employ a spatial index.
This is problematic if our application needs to make repeated spatial
queries on large sets of geometries. Spatial indexes are typically
stored in the file system of the application in question, but under
App Engine we have limited use of the file system. Offline building of
the index also presents some problems.

The only realistic option I have discovered so far is to persist the
spatial index in the App Engine datastore, but the datastore expects
all objects to be serializable and the current JTS indexes are not.
Thus, JTS needs to be modified to permit serializing indexes.

Here is my initial foray into making the STRtree spatial index
serializable:
http://code.google.com/p/giscloud/wiki/SerializedSpatialIndexes

Best regards,
Stuart Moffatt

Ph.D. student ~ http://home.gwu.edu/~sfm
Crisis, Emergency and Risk Management
http://www.gwu.edu/~icdrm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] how to get over 1 mb respose size url fetch api limit?

2009-09-25 Thread Prashant
Hi,

I want to fetch urls having more than 1mb response size. is there any way to
get around 1 mb response size limit?

thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Indexes not auto-generated without filter properties

2009-09-25 Thread Patrizio Munzi

Hi all,

just a clarification.
Is it normal that indexes are auto-generated only for query with filter 
properties??
I mean, this first query will generate an index:

Query query = pm.newQuery(Stat_1.class);
query.setFilter("timestamp >= " + now);   
query.setOrdering("timestamp desc, value desc");


while the following will not:

Query query = pm.newQuery(Stat_2.class);
query.setOrdering("value desc");

Is this normal??
Should I configure an index myself for optimize Stat_2 queries 
executions..??

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Multimap in JDO

2009-09-25 Thread Dhamu

If I use

@Persistent(serialized = "true")
Multimap map;

I get javax.jdo.JDOUserException: Field "...jdo.MyModel.map" is
declared as a reference type (interface/Object) but no implementation
classes of "com.google.common.collect.Multimap" have been found!

but if I use
@Persistent(serialized = "true")
HashMultimap map;
its working fine.

On Sep 25, 1:20 pm, Dhamu  wrote:
> Thanks Jason...
>
> @Persistent(serialized = "true")  -- this works fine..
>
> - Dhamu.
>
> On Sep 24, 8:02 pm, mcrady  wrote:
>
> > I don't see serializable as an 
> > option:http://db.apache.org/jdo/api23/apidocs/javax/jdo/annotations/Persiste...
>
> > On Sep 23, 11:01 am, "Jason (Google)"  wrote:
>
> > > If you use a non-native datastore type that isn't declared to be
> > > PersistenceCapable, you need to explicitly indicate that it is 
> > > serializable:
> > > @Persistent(serializable = "true")
> > > Multimap map;
>
> > > ...
>
> > > This should work if the class of the object implements Serializable. For
> > > instance, I've been able to store HashMap objects this way.
>
> > > - Jason
>
> > > On Mon, Sep 21, 2009 at 2:26 PM, Dhamu  wrote:
>
> > > > How to use multimap (http://google-collections.googlecode.com/svn/
> > > > trunk/javadoc/com/google/common/collect/Multimap.html) in jdo?
>
> > > > I get the following exception.
> > > > org.datanucleus.exceptions.NucleusUserException: Field
> > > > "...model.jdo.MyModel.content" is declared as a reference type
> > > > (interface/Object) but no implementation classes of
> > > > "com.google.common.collect.Multimap" have been found!
>
> > > > please help!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Multimap in JDO

2009-09-25 Thread Dhamu

Thanks Jason...

@Persistent(serialized = "true")  -- this works fine..

- Dhamu.

On Sep 24, 8:02 pm, mcrady  wrote:
> I don't see serializable as an 
> option:http://db.apache.org/jdo/api23/apidocs/javax/jdo/annotations/Persiste...
>
> On Sep 23, 11:01 am, "Jason (Google)"  wrote:
>
> > If you use a non-native datastore type that isn't declared to be
> > PersistenceCapable, you need to explicitly indicate that it is serializable:
> > @Persistent(serializable = "true")
> > Multimap map;
>
> > ...
>
> > This should work if the class of the object implements Serializable. For
> > instance, I've been able to store HashMap objects this way.
>
> > - Jason
>
> > On Mon, Sep 21, 2009 at 2:26 PM, Dhamu  wrote:
>
> > > How to use multimap (http://google-collections.googlecode.com/svn/
> > > trunk/javadoc/com/google/common/collect/Multimap.html) in jdo?
>
> > > I get the following exception.
> > > org.datanucleus.exceptions.NucleusUserException: Field
> > > "...model.jdo.MyModel.content" is declared as a reference type
> > > (interface/Object) but no implementation classes of
> > > "com.google.common.collect.Multimap" have been found!
>
> > > please help!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Regarding JDOQL

2009-09-25 Thread leszek


username1==username


try with

username1.equals(username)

username1 == username compares references, not string pointed a by
reference.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Regarding JDOQL

2009-09-25 Thread anu

hi i have developed an application using google appengine with
java.and my code is as follows 

entry.java

package com.google;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class entry {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
public String email;
@Persistent
private String pwd;
@Persistent
private String username;
@Persistent
public String first_name;
@Persistent
public String last_name;


public entry(String email,String pwd,String username,String
first_name,String last_name)
{

this.email= email;
this.pwd= pwd;
this.username=username;
this.first_name=first_name;
this.last_name=last_name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id=id;
}

public String getEmail() {
return email;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public void setEmail(String email) {
this.email = email;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;

}
public String getFirst_name() {
return first_name;
}
public void setFirstName(String first_name) {
this.first_name = first_name;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String last_name) {
this.last_name = last_name;
}
}


Entry1.java

package com.google;

public class Entry1 {
private String username1;
private String password1;
private String username,pwd,first_name,last_name,email;


public Entry1(String username1,String password1)
{
this.password1= password1;
this.username1=username1;

}



public String getUsername1() {
return username1;
}
public void setUsername1(String username1) {
this.username1 = username1;
}
public String getPassword1() {
return password1;
}
public void setPassword1(String password1) {
this.password1 = password1;
}


}

LoginServlet.java

package com.google;
import java.io.PrintWriter;
import java.io.IOException;
import javax.servlet.http.*;
import javax.servlet.*;
import javax.jdo.PersistenceManager;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.Query;
public class LoginServlet extends HttpServlet{
HttpSession session;
String
username1,password1,clickButton1,username,pwd,first_name,last_name,email;
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException
{
   resp.setContentType("text/plain");
   PrintWriter pw=resp.getWriter();
   session=req.getSession(true);
   clickButton1=req.getParameter("submit");
username1=req.getParameter("username1");
password1=req.getParameter("password1");
username=req.getParameter("username");
pwd=req.getParameter("pwd");
PersistenceManager pm=PMF.get().getPersistenceManager();

Entry1 ex1=new Entry1(username1,password1);

if(clickButton1.equals("Login"))
{
if(!(username1.equals("")||password1.equals("")))
{
Query query = pm.newQuery(entry.class);
query.setFilter(("username1 == username"));

if(username1==username)
{
  resp.sendRedirect("./welcome.html");
}
else
System.out.println("you are not 
registred with us");

pw.close();
}

}
 }
}

NullServlet.java


package com.google;
import java.io.PrintWriter;
import java.io.IOException;
import javax.servlet.http.*;
import javax.servlet.*;
import javax.jdo.PersistenceManager;
import javax.jdo

[appengine-java] Re: Delete all from datastore

2009-09-25 Thread jd

No this is not for local unit tests but for clearing all datastore
entities.

If there is a way to list current Kinds or select all entities of any
kind I could manage this.

On Sep 24, 5:42 pm, leszek  wrote:
> If you want to clean your local datastore with respect to junit tests
> - look at this link:
>
> http://code.google.com/appengine/docs/java/howto/unittesting.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: can't update the same entity twice in a transaction or operation RAISED ONLY in JUnit tests

2009-09-25 Thread Marton Papp

Hi Patrizio,


It is hard to say anything without seeing your code. For me even this
runs without a problem in JUnit test:

PersistenceManager pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();

ParentOfList p = new ParentOfList();
pm.makePersistent(p);
pm.flush();

Child c = new Child();
p.getChildren().add(c);
pm.makePersistent(p);
pm.makePersistent(c);

pm.currentTransaction().commit();
pm.close();

I am calling makePersistent() multiple times, in theory it should be
failing, still it does not.


Marton


On Sep 25, 9:23 am, Patrizio Munzi  wrote:
> Any opinion...??
> Google?
> Patrizio Munzi wrote:Hi Marton,
> I think I've worked out what was the problem with my JUnit tests.
> I was persisting a parent entity before its children.
> The strange thing however is that I didn't have any problem running the same 
> code in GAE local server.
> Now the question is what's the correct behavior??
> I thing this could be an issue.
> Patrizio Munzi wrote:Hi,
> yep the same code runs correctly in the GAE development server.
> I'll send you the code ASAP.
> Thanks
> Marton Papp wrote:Hi Patrizio, I am not sure what you mean by having the 
> error only in JUnit tests. The same code runs correctly in some other 
> environment? Anyway, the documentation says that it is not allowed to update 
> the same entity more than once in a single transaction. However I was not 
> able to reproduce the problem. Could you send me some code example that 
> fails? Thx. The 
> docs:http://code.google.com/appengine/docs/java/datastore/transactions.html
>  An attempt to update the same entity multiple times in a single transaction 
> (such as with repeated makePersistent() calls) will throw a 
> JDOFatalUserException. Instead, just modify the persistent objects within the 
> transaction, and allow the call to commit() to apply the changes.  Marton 
> On Sep 24, 1:53 pm, Patrizio Munziwrote:Hi all, I'm 
> having this exception/error only in JUnit tests. Where's the problem? In the 
> SDK or UNIT tests?? Thanks--
>
> Patrizio Munzi
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail:patrizio.mu...@eris4.com
> web:http://www.eris4.com
> skype:eris4_munzi--
>
> Patrizio Munzi
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail:patrizio.mu...@eris4.com
> web:http://www.eris4.com
> skype:eris4_munzi--
>
> Patrizio Munzi
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail:patrizio.mu...@eris4.com
> web:http://www.eris4.com
> skype:eris4_munzi
>
>
>
>  image_gif_part
> 1KViewDownload
>
>  image_gif_part
> 1KViewDownload
>
>  logo.gif
> 1KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Question on transactions

2009-09-25 Thread Patrizio Munzi





Hi all,

I'm trying to verify transactions behavior, and what I see is that
commit() method never throws a JDOCanRetryException as explained in doc
when the same entity group has being modified concurrently.
I always get a JDOException caused by ConcurrentModificationException.

My question is:
Is this pattern incorrect??
-

 
      for (int i = 0; i < NUM_RETRIES; i++) {
            pm.currentTransaction().begin();

            ClubMembers members = pm.getObjectById(ClubMembers.class, "k12345");
            members.incrementCounterBy(1);

            try {
                pm.currentTransaction().commit();
                break;

            } catch (JDOCanRetryException ex) {
                if (i == (NUM_RETRIES
- 1)) { 
                    throw ex;
                }
            }
        }
-

should it be modified this way??

-

 
      for (int i = 0; i < NUM_RETRIES; i++) {
            pm.currentTransaction().begin();

            ClubMembers members = pm.getObjectById(ClubMembers.class, "k12345");
            members.incrementCounterBy(1);

            try {
                pm.currentTransaction().commit();
                break;

            } catch (JDOException ex) {
                if (!(ex.getCause() instanceof
ConcurrentModificationException ) || i == (NUM_RETRIES - 1) { 

                    throw ex;
                }
            }
        }
-

Please let me know

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.  To post to this group, send email to google-appengine-java@googlegroups.com  To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com  For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---





[appengine-java] Re: Child key is always null

2009-09-25 Thread Ravi

No Reply :(
I am eagerly waiting for response, as if it doesnt work then i may
need to redesign all m y entities for unowned relations... :(

On Sep 24, 11:29 pm, Ravi Sharma  wrote:
> Hi,
> I have following classes. I am creating a country object first and it get
> persisted, then i read its key field and i get some value.
> Basically i start a transaction and persist it close/commit the transaction.
>
> then i create a State and set Country for state object as the country(reload
> the country in this transaction) i just created.
> After i save State object using
>         pm.makePersistent(state);
> I try to read id field(Key) from state object, but its coming as null and
> data(state object) is not persisting.
> Can you please advise me if i am doing anything wrong.
>
> Following are the classes
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Country implements BaseObject{
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key id;
>     @Persistent
>     private String name;
>     @Persistent
>     private long stateCount;
>     @Persistent(mappedBy = "country")
>     private List states;
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class State implements BaseObject{
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key id;
>     @Persistent
>     private String name;
>     @Persistent
>     private Country country;
>     @Persistent(mappedBy = "state")
>     private List districts;
>
> }
>
> public interface BaseObject {
>     public Key getId();
>     public void setId(Key id);
>
> }
>
> Thanks,
> Ravi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: can't update the same entity twice in a transaction or operation RAISED ONLY in JUnit tests

2009-09-25 Thread Patrizio Munzi




Any opinion...??

Google?

Patrizio Munzi wrote:

  
Hi Marton,
  
I think I've worked out what was the problem with my JUnit tests.
I was persisting a parent entity before its children.
  
The strange thing however is that I didn't have any problem running the
same code in GAE local server.
  
Now the question is what's the correct behavior??
  
I thing this could be an issue.
  
  
Patrizio Munzi wrote:
  

Hi,

yep the same code runs correctly in the GAE development server.

I'll send you the code ASAP.

Thanks

Marton Papp wrote:

  Hi Patrizio,


I am not sure what you mean by having the error only in JUnit tests.
The same code runs correctly in some other environment?

Anyway, the documentation says that it is not allowed to update the
same entity more than once in a single transaction. However I was not
able to reproduce the problem. Could you send me some code example
that fails? Thx.

The docs:
http://code.google.com/appengine/docs/java/datastore/transactions.html


An attempt to update the same entity multiple times in a single
transaction (such as with repeated makePersistent() calls) will throw
a JDOFatalUserException. Instead, just modify the persistent objects
within the transaction, and allow the call to commit() to apply the
changes.



Marton

On Sep 24, 1:53 pm, Patrizio Munzi  wrote:
  
  
Hi all,

I'm having this exception/error only in JUnit tests.
Where's the problem?
In the SDK or UNIT tests??

Thanks

  
  

  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi




  
  
  -- 
  
  Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi
  
  
  
  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.  To post to this group, send email to google-appengine-java@googlegroups.com  To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com  For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---





[appengine-java] Lets flirt or...

2009-09-25 Thread Camellia

Hi to community, Im new here.
Life is boring and uninteresting, entertain me :)

Lets flirt or maybe something more?
Im here:
http://camelliaelfr.150m.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Datastore index deletion

2009-09-25 Thread mably

Thanx for your help.  I just starred the corresponding issue :
http://code.google.com/p/googleappengine/issues/detail?id=1893

On 25 sep, 05:47, klong86  wrote:
> The vacuum action is only available on the Python version.  You have
> to download the Python SDK to delete the indexes.  The instructions in
> the post below worked for me.
>
> http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> Kevin
>
> On Sep 24, 11:44 am, mably  wrote:
>
>
>
> > I tried to use appcfg command line with action "update_indexes" but it
> > doesn't delete my unnecessary indexes.
>
> > It seems there is no "vacuum" action like in the python version, am I
> > right ?
>
> > So, does anybody have another solution to delete a datastore index
> > with the java SDK ?
>
> > Francois
> > Bordeaux, FRANCE
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---