[appengine-java] Re: Client Error (400)

2009-08-17 Thread Russell

Hi Jason

I was able to deploy since this post. I'm not sure if there were too
many files in the original or if the overall post size was too large,
but I omitted the icons directory and the app then uploaded.
The upload was done from the command line.

-Russell

On Aug 18, 12:19 am, "Jason (Google)"  wrote:
> Hi Russell. It looks like you were able to deploy your application since
> this post. What was the issue? If you're still having problems, please say
> whether you tried deploying from Eclipse and/or the command line and provide
> the contents of your appengine-web.xml file.
> - Jason
>
>
>
> On Sat, Aug 15, 2009 at 7:10 AM, Russell  wrote:
>
> > Hi,
> > I am trying to upload my application for the first time and get the
> > following response:
>
> > Unable to upload:
> > java.io.IOException: Error posting to URL:
>
> >http://appengine.google.com/api/appversion/deploy?app_id=roses-are-bl...
> > 400 Bad Request
>
> > Client Error (400)
> > The request is invalid for an unspecified reason.
>
> >        at com.google.appengine.tools.admin.ServerConnection.send
> > (ServerConnection.java:143)
> >        at com.google.appengine.tools.admin.ServerConnection.post
> > (ServerConnection.java:81)
> >        at com.google.appengine.tools.admin.AppVersionUpload.send
> > (AppVersionUpload.java:415)
> >        at com.google.appengine.tools.admin.AppVersionUpload.deploy
> > (AppVersionUpload.java:374)
> >        at com.google.appengine.tools.admin.AppVersionUpload.commit
> > (AppVersionUpload.java:337)
> >        at com.google.appengine.tools.admin.AppVersionUpload.doUpload
> > (AppVersionUpload.java:111)
> >        at com.google.appengine.tools.admin.AppAdminImpl.update
> > (AppAdminImpl.java:53)
> >        at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute
> > (AppCfg.java:504)
> >        at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:129)
> >        at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:57)
> >        at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:53)
> > com.google.appengine.tools.admin.AdminException: Unable to upload app:
> > Error posting to URL:
> >http://appengine.google.com/api/appversion/deploy?app_id=roses-are-bl...
> > 400 Bad Request
>
> > Client Error (400)
> > The request is invalid for an unspecified reason.
>
> >        at com.google.appengine.tools.admin.AppAdminImpl.update
> > (AppAdminImpl.java:59)
> >        at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute
> > (AppCfg.java:504)
> >        at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:129)
> >        at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:57)
> >        at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:53)
> > Caused by: java.io.IOException: Error posting to URL:
>
> >http://appengine.google.com/api/appversion/deploy?app_id=roses-are-bl...
> > 400 Bad Request
>
> > Client Error (400)
> > The request is invalid for an unspecified reason.
>
> >        at com.google.appengine.tools.admin.ServerConnection.send
> > (ServerConnection.java:143)
> >        at com.google.appengine.tools.admin.ServerConnection.post
> > (ServerConnection.java:81)
> >        at com.google.appengine.tools.admin.AppVersionUpload.send
> > (AppVersionUpload.java:415)
> >        at com.google.appengine.tools.admin.AppVersionUpload.deploy
> > (AppVersionUpload.java:374)
> >        at com.google.appengine.tools.admin.AppVersionUpload.commit
> > (AppVersionUpload.java:337)
> >        at com.google.appengine.tools.admin.AppVersionUpload.doUpload
> > (AppVersionUpload.java:111)
> >        at com.google.appengine.tools.admin.AppAdminImpl.update
> > (AppAdminImpl.java:53)
> >        ... 4 more
>
> > Any ideas as to how to fix this?
>
> > -Russell
--~--~-~--~~~---~--~~
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] Images API non-deterministic behavoir

2009-08-17 Thread Jeremy Corbett

I am having a very bizarre issue with images API.  I think it should
be seen first.  Visit

http://2.latest.pseudomap.appspot.com/fractalmap/tiles/yo.png

and refresh a few times.

Every time the exact same TIFF image is generated and then converted
to a png, using a rotation of 0 degrees.

So a few questions.  Is the TIFF support standards complaint?  My
guess is no, but lots of stuff isn't.  GIMP can read but not display
my TIFFs, but Brava! Reader has no problem.

Another easy one, why would I ever see data from other peoples
pictures?  That seems like a serious bug, but I can't imagine an
exploit so please nobody lose sleep over this...

Thanks in advance for any response, but if you can't help please do
enjoy the random images.
--~--~-~--~~~---~--~~
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 Import and Export

2009-08-17 Thread Zhi Le Zou
Would it be a good idea to export the data to google docs spreadsheets?

2009/8/18 Wladiston Paiva 

> nice question.
>
> 2009/8/17 Ryuzaki 
>
>>
>> yes good question!! this utility would be very helpful
>>
>>
>
>
> --
> Wladiston Maurício de Paiva
> desenvolvedo...@gmail.com
> e...@wladistonpaiva.com.br
> +55 (31) 8435 - 5380
>
>
> >
>


-- 

Kind Regards
Zhile

--~--~-~--~~~---~--~~
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: Please help - Strange exception thrown when do datastore query with GWT RPC call

2009-08-17 Thread Zhi Le Zou
Jason, many many thanks, the problem is solved.

And may I know why such an object is StreamingQueryResult returned together
with instances of T2?

And how is this instance returned? I googled on the web, someone mentioned
this instance is injected into instances of T2 as an additional field, is
this correct?

Thanks in advance :-)

2009/8/18 Jason (Google) 

> Hi Zhile. The execute method returns a StreamingQueryResult instance which
> you can't pass back directly or you'll see the error that you indicated
> above. What you can do is create a new Collection instance (e.g. an
> ArrayList or Vector), iterate through the query results copying each item
> (T2 instance) into the new Collection, and then return that instead.
> You may find the recently added gwtguestbook demo useful. The full source
> is available through Subversion:
>
>
> http://code.google.com/p/googleappengine/source/browse/#svn/trunk/java/demos/gwtguestbook
>
> - Jason
>
>
> On Fri, Aug 14, 2009 at 9:46 PM, Zhi Le Zou  wrote:
>
>> Hello everyone,
>> I encountered a strange exception when doing datastore query with GWT RPC
>> call. The stack trace is pasted at bottom.
>>
>> There are two data types involved in the query, both are annotated
>> properly. T1 has several simple properties, while T2 has several simple
>> properties and holds an instance of T1. The query code is below.  Does
>> anyone know why such exception is produced?  A million thanks in advance :-)
>>
>> public List getAllRecords(){
>> PersistenceManager pm = MyUtil.getPersistenceManager(); // The persistence
>> manager is returned correctly here.
>>  try {
>> Query query = pm.newQuery(T2.class);
>> List allRecords = (List) query.execute();
>>  return allRecords;
>> } finally {
>> pm.close();
>>  }
>> }
>>
>>
>> 2009-8-15 4:29:05 com.google.appengine.tools.development.ApiProxyLocalImpl
>> log
>> SEVERE: [1250310545707000] javax.servlet.ServletContext log: Exception
>> while dispatching incoming RPC call
>> com.google.gwt.user.client.rpc.SerializationException: Type
>> 'org.datanucleus.store.appengine.query.StreamingQueryResult' was not
>> included in the set of types which can be serialized by this
>> SerializationPolicy or its Class object could not be loaded. For security
>> purposes, this type will not be serialized.
>>  at
>> com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSerialize(
>> StandardSerializationPolicy.java:83)
>>  at
>> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(
>> ServerSerializationStreamWriter.java:591)
>>  at
>> com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129)
>> at
>> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
>>  at
>> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:530)
>> at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
>>  at
>> com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:441)
>> at
>> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:529)
>>  at
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
>> at
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>  at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>> at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>>  at
>> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>> at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>  at
>> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:124)
>> at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>> at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>  at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>>  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>> at
>> com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
>>  at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> at
>> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:313)
>>  at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> at org.mortbay.jetty.Server.handle(Server.java:313)
>>

[appengine-java] Re: Getting a child by ID

2009-08-17 Thread Rayala Udayakumar
I have few basic questions here:
1. How are you getting the Question Id as string when the id is defined as
Key ? If you are using KeyFactory.keyToString(), the stringToKey() should be
able to give you the Key back right ?

2. If you have had your question id as encoded string key, you can then
directly use the string key and retrieve the object without the parent id.
Is that correct ?

Please help me clarify.

Thanks,
Uday.

On Tue, Aug 18, 2009 at 2:43 AM, Jason (Google)  wrote:

> In short, yes. That said, in practice, I haven't seen very deep entity
> hierarchies since there are performance implications with deep entity
> groups, so hopefully that won't be a huge inconvenience for you.
> - Jason
>
>
> On Fri, Aug 14, 2009 at 3:36 AM, Smrky  wrote:
>
>>
>> Yes, that was what I was asking - so for getting a specific question I
>> need both - survey ID and question ID. But what if I had deeper level
>> child - I would have to keep IDs of all parents? i.e.:
>>
>> parent1 -> parent2 -> parent3 -> parent4 -> parent5 -> child
>>
>> public child getChildByID(parent1ID, parent2ID, parent3ID, parent4ID,
>> parent5ID, childID) {
>> PersistenceManager pm = PMFactory.get().getPersistenceManager
>> ();
>> Key kp = KeyFactory.createKey(parent1.class.getSimpleName(),
>> parent1ID);
>>Key k = kp.getChild(parent2.class.getSimpleName(),
>> parent2).getChild(parent3.class.getSimpleName(), parent3).getChild
>> (parent4.class.getSimpleName(), parent4).getChild
>> (parent5.class.getSimpleName(), parent5).getChild
>> (child.class.getSimpleName(), childID);
>>
>>child c = (child) pm.getObjectById(child.class, k);
>>pm.retrieve(c);
>>pm.close();
>>return c;
>> }
>>
>> Is it correct? Or there is another way? Thank you!
>>
>> On 13 srp, 18:01, objectuser  wrote:
>> > Right, the ID of the Question is not a Long, it's a Key.  So if you
>> > keep the question's key value somewhere (I'm assuming you can since
>> > you have the survey ID somewhere), you can do pm.getObjectById
>> > (Question.class, questionKey).
>> >
>> > For the relationship, just ignore me since I'm just wrong. :)
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: JDO fetch groups does not work with GAE

2009-08-17 Thread SammyBar

> Actually uses the Locale.getDefault() value at initialisation, so
> since the PC is in "es" then you get "es" :-)
> Y si no quieras español, ¿porque tener el PC así? jeje.
I can not get used to mm/dd/ date format, no way!

> Change your default JRE Locale to be "en" is the only way.
I though it was just some command line or configuration parameter...

Thanks Andy!
--~--~-~--~~~---~--~~
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] A Portable solution for Data Model Relationships?

2009-08-17 Thread Vineet

Hey Guys,
I am a big fan of App Engine, but seem to be stuck on a problem: Is
there any option for storing relationships such that entity keys are
not dependent on GAE?

The background:
We are building a web app that we believe our customers would like to
have a core component on their internal networks. Since we would like
to use Google App Engine on our side (for the rest of the users), I am
trying to find the best way for storing relationships that allows the
core data model to not be stuck to only run on the App Engine
platform. When doing this the challenge seems to be finding the best
way to model relationships.

I played with JDO, but since JPA implementations seem to be more
easily available - it seems to be the best option.

The big challenge is in supporting relationships.

The documentation seems to indicate that this is not possible, which
given that JPA exists for increased portability seems surprising to
me. From 
http://code.google.com/intl/pl/appengine/docs/java/datastore/relationships.html
:
"The child class must have a key field whose type can contain the
parent key information: either a Key, or a Key value encoded as a
string."

Will appreciate guidance.

Vineet
--~--~-~--~~~---~--~~
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] error app engine 1.22 demo sticky

2009-08-17 Thread asianCoolz

i imported the sticky into eclipse and tried on macox and windowsxp, i
get the same consistent error as below when run as webapp. i'm sure
already included gwt library. anyone know what is the reason of the
error?


Aug 18, 2009 1:19:33 AM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: failed service
java.lang.NoClassDefFoundError: com/google/gwt/user/client/rpc/
RemoteService
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at
com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass
(IsolatedAppClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at
com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass
(IsolatedAppClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:
233)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:40)
at org.mortbay.jetty.servlet.ServletHandler.initialize
(ServletHandler.java:612)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
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 org.mortbay.jetty.handler.HandlerWrapper.doStart
(HandlerWrapper.java:117)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart
(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:217)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:40)
at
com.google.appengine.tools.development.JettyContainerService.startContainer
(JettyContainerService.java:147)
at
com.google.appengine.tools.development.AbstractContainerService.startup
(AbstractContainerService.java:116)
at com.google.appengine.tools.development.DevAppServerImpl.start
(DevAppServerImpl.java:211)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start
(AppEngineLauncher.java:86)
at com.google.gwt.dev.HostedMode.doStartUpServer(HostedMode.java:365)
at com.google.gwt.dev.HostedModeBase.startUp(HostedModeBase.java:590)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:397)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
Caused by: java.lang.ClassNotFoundException:
com.google.gwt.user.client.rpc.RemoteService
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at
com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass
(IsolatedAppClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 47 more
Aug 18, 2009 1:19:34 AM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: failed
com.google.apphosting.utils.jetty.devappenginewebappcont...@127ca47
{/,D:\work\projects\appengine-java-sdk-1.2.2\appengine-java-
sdk-1.2.2\demos\sticky\war}
java.lang.NoClassDefF

[appengine-java] Query by using inheritance?

2009-08-17 Thread Dominik Steiner

Hi there,

I saw that Google App Engine for Python is using the PolyModel class
in order to query for objects using inheritance. Is there something
similar available for Java?

So to say, I have a class AbstractModel and two classes FirstModel and
SecondModel that extend/implement the AbstractModel and would like to
be able to query

Select * from AbstractModel

Is that possible?

Thanks

Dominik

P.S. if that wouldn't be possible in Java is it possible to use Python
for the Google App Engine in Java?
--~--~-~--~~~---~--~~
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: testing portable of jdo

2009-08-17 Thread Jason (Google)
There are no current plans to enable direct connections to other database
systems via JDBC or the like. You can always set up a web service in front
of your RDBMS and use App Engine's URL Fetch service to interact with it if
you need to access your legacy data in App Engine. Another option is using
the bulk import tool to move your data from your old database to App
Engine's datastore.
- Jason

On Sun, Aug 16, 2009 at 8:19 AM, CoolDude  wrote:

>
> Hi,
>  Thank you for referring me to the relevant articles. Is there any
> plan for GAE to allow user able to direct connect to any other
> database in the future?  From the article, if i have an appengine
> application and want to run db2. i would need to modify the project to
> use datanucleus api directly rather than GAE api.
> >
>

--~--~-~--~~~---~--~~
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: JDOQL - query syntax documentation

2009-08-17 Thread Jason (Google)
That's a similar approach to the SearchableModel class included with the
Python SDK. There are other ways of making your datastore searchable in
Java. One example:
http://www.kimchy.org/searchable-google-appengine-with-compass/

- Jason

On Sun, Aug 16, 2009 at 11:18 AM, Kris  wrote:

>
> Hi Jeff,
>
> Thanks for the reply.  I did what you suggested and the lowercase
> solution works nicely so the I can do case insensitive searches. With
> regard to the wild-card search I did not find a perfect solution. What
> I have done is to split up the String, that I wish to search in, into
> words and stored them in an ArrayList all in lowercase. Now I can use
> the contains method on the ArrayList. This way I can get a word match
> search which is good enough for my needs.
>
> The best regards
> Kris
>
>
>
> On 16 Aug., 16:05, Sean Lynch  wrote:
> > Hey Anton - I've seen a few people run into this before.
> >
> > .contains(...) in this case only works on List fields in your model.
> > So the query you're trying to run is actually checking to see if any
> > of the items in that list is exactly "A".  This is why it's treated
> > the same as ==.  contains(...) does _not_ work on a single string
> > object to do substring matching like you're trying to do.
> >
> > Out of curiosity, what are you trying to match a substring for?
> >
> > On Aug 15, 7:20 am, Anton Ananich  wrote:
> >
> > > Hi.
> >
> > > I have just found an answer in the source code myself. It seems that
> > > contains(...) works like operator ==. Is this a bug?
> http://code.google.com/p/datanucleus-appengine/source/browse/trunk/sr...
> >
> > > Best regards,
> > > Anton Ananich
> >
> > > On Aug 15, 4:58 pm, Anton Ananich  wrote:
> >
> > > > Dear Jeff,
> >
> > > > I have just spend several hours trying to make [field].contains(...)
> > > > working, however I was not able to do that.
> > > > Here is piece of code:
> >
> > > >   Query q = PMF.getInstance().newQuery(my.package.Customer.class);
> > > >   q.setFilter("address.contains(\"A\")");
> > > >   q.setResult("count(this)");
> > > >   o = q.execute().toString();
> >
> > > > I tried out different combinations, but always got zero. Than I tried
> > > > to use startsWith instead of contains and it works as needed.
> > > > Could you please give me a hint what is the best way to find all the
> > > > customers from "Roma" using google apps engine?
> >
> > > > Best Regards,
> > > > Anton Ananich
> >
> > > > On Aug 7, 3:42 am, "Jeff S (Google)"  wrote:
> >
> > > > > Hi Kris,
> >
> > > > > You can currently use startsWith, contains, and regular expressions
> as long
> > > > > as the pattens is a startsWith type of query (ex: blah.* but not
> .*blah). I
> > > > > don't think endsWith will work. If you want to create case
> insensitive
> > > > > search, it might be helpful to store a lowercased form of the text
> in your
> > > > > entity along with the original text content.
> >
> > > > > Thank you,
> >
> > > > > Jeff
> >
> > > > > On Wed, Aug 5, 2009 at 5:50 AM, Kris  wrote:
> >
> > > > > > Hi all,
> >
> > > > > > I just started to work with the Google App Engine and I have run
> into
> > > > > > some troubles on finding query syntax documentation. What I am
> trying
> > > > > > to figure out is how I can build up my where conditions.
> >
> > > > > > Ex.
> > > > > > I can write: "select from " + [myClass].class.getName() + " where
> > > > > > [myField].startsWith(\"Hello\")"; and this works fine. I can use
> > > > > > endsWith as well but I can not use substring, toLowerCase or
> indexOf.
> >
> > > > > > What else can I put into my where clause?
> >
> > > > > > What I am trying to achieve is some kind of wildcard or case
> > > > > > insensitive query search.
> >
> > > > > > The best regards
> > > > > > Kris
> >
>

--~--~-~--~~~---~--~~
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: Minimal/example code for a cron job

2009-08-17 Thread Jason (Google)
Hi Jaap. Have you seen this?
http://code.google.com/appengine/docs/java/config/cron.html

The actual handlers are servlets, the the same as you would define for any
on-demand endpoints.

- Jason

On Sun, Aug 16, 2009 at 3:41 PM, Jaap  wrote:

>
> Hi,
>
> I want to run a cron job in java. Can somebody sent me the code for a
> minimal cron job.
>
> 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: class evolution -- Problem Solved

2009-08-17 Thread victor

I have resolved this issue. The field that I was initially trying to
add was of "int" type. I changed this to "Integer" type and all is
well. Thank you all for your responses.



On Aug 17, 7:27 pm, victor  wrote:
> It looks like "@Persistent(nullValue=NullValue.DEFAULT)" is not
> supported:
>
> java.lang.UnsupportedOperationException: Default values not supported
>         at org.datanucleus.store.appengine.DatastoreProperty.setDefaultable
> (DatastoreProperty.java:128)
>
> On Aug 17, 3:35 pm, datanucleus  wrote:
>
> > > It looks like I have some missing parameters in the
> > > @Persistentannotation? I was thinking it would be the "nullValue"
> > > parameter but it does not seem to be the case.
>
> > nullValue as "default" perhaps. Doesn't mean that GAE/J supports it
> > (yet)
--~--~-~--~~~---~--~~
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 get started with Granite Data Service

2009-08-17 Thread Jason (Google)
Have you tried posting in the graniteds discussion group?
http://tech.groups.yahoo.com/group/graniteds/

- Jason

On Sun, Aug 16, 2009 at 11:19 PM, Capsicum annuum wrote:

>
> I want to build a flex project with GAE,
> and i want to use JDO Detach.
> My English is poor.
> It's Doc is poor too...
>
> >
>

--~--~-~--~~~---~--~~
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: class evolution

2009-08-17 Thread victor

It looks like "@Persistent(nullValue=NullValue.DEFAULT)" is not
supported:

java.lang.UnsupportedOperationException: Default values not supported
at org.datanucleus.store.appengine.DatastoreProperty.setDefaultable
(DatastoreProperty.java:128)




On Aug 17, 3:35 pm, datanucleus  wrote:
> > It looks like I have some missing parameters in the
> > @Persistentannotation? I was thinking it would be the "nullValue"
> > parameter but it does not seem to be the case.
>
> nullValue as "default" perhaps. Doesn't mean that GAE/J supports it
> (yet)
--~--~-~--~~~---~--~~
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: Client Error (400)

2009-08-17 Thread Jason (Google)
Hi Russell. It looks like you were able to deploy your application since
this post. What was the issue? If you're still having problems, please say
whether you tried deploying from Eclipse and/or the command line and provide
the contents of your appengine-web.xml file.
- Jason

On Sat, Aug 15, 2009 at 7:10 AM, Russell  wrote:

>
> Hi,
> I am trying to upload my application for the first time and get the
> following response:
>
> Unable to upload:
> java.io.IOException: Error posting to URL:
>
> http://appengine.google.com/api/appversion/deploy?app_id=roses-are-blue&version=1&;
> 400 Bad Request
>
> Client Error (400)
> The request is invalid for an unspecified reason.
>
>at com.google.appengine.tools.admin.ServerConnection.send
> (ServerConnection.java:143)
>at com.google.appengine.tools.admin.ServerConnection.post
> (ServerConnection.java:81)
>at com.google.appengine.tools.admin.AppVersionUpload.send
> (AppVersionUpload.java:415)
>at com.google.appengine.tools.admin.AppVersionUpload.deploy
> (AppVersionUpload.java:374)
>at com.google.appengine.tools.admin.AppVersionUpload.commit
> (AppVersionUpload.java:337)
>at com.google.appengine.tools.admin.AppVersionUpload.doUpload
> (AppVersionUpload.java:111)
>at com.google.appengine.tools.admin.AppAdminImpl.update
> (AppAdminImpl.java:53)
>at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute
> (AppCfg.java:504)
>at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:129)
>at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:57)
>at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:53)
> com.google.appengine.tools.admin.AdminException: Unable to upload app:
> Error posting to URL:
> http://appengine.google.com/api/appversion/deploy?app_id=roses-are-blue&version=1&;
> 400 Bad Request
>
> Client Error (400)
> The request is invalid for an unspecified reason.
>
>at com.google.appengine.tools.admin.AppAdminImpl.update
> (AppAdminImpl.java:59)
>at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute
> (AppCfg.java:504)
>at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:129)
>at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:57)
>at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:53)
> Caused by: java.io.IOException: Error posting to URL:
>
> http://appengine.google.com/api/appversion/deploy?app_id=roses-are-blue&version=1&;
> 400 Bad Request
>
> Client Error (400)
> The request is invalid for an unspecified reason.
>
>at com.google.appengine.tools.admin.ServerConnection.send
> (ServerConnection.java:143)
>at com.google.appengine.tools.admin.ServerConnection.post
> (ServerConnection.java:81)
>at com.google.appengine.tools.admin.AppVersionUpload.send
> (AppVersionUpload.java:415)
>at com.google.appengine.tools.admin.AppVersionUpload.deploy
> (AppVersionUpload.java:374)
>at com.google.appengine.tools.admin.AppVersionUpload.commit
> (AppVersionUpload.java:337)
>at com.google.appengine.tools.admin.AppVersionUpload.doUpload
> (AppVersionUpload.java:111)
>at com.google.appengine.tools.admin.AppAdminImpl.update
> (AppAdminImpl.java:53)
>... 4 more
>
> Any ideas as to how to fix this?
>
> -Russell
> >
>

--~--~-~--~~~---~--~~
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: Incoming Mail

2009-08-17 Thread Jason (Google)
Incoming email support is still on the roadmap:
http://code.google.com/appengine/docs/roadmap.html

- Jason

On Sat, Aug 15, 2009 at 8:15 AM, Tim  wrote:

>
> Is it still impossible to implement pop or imap using?
> If not, what could you recommend instead of(especially for java).
> thx
> >
>

--~--~-~--~~~---~--~~
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: Problem with JSF deployed on GAE

2009-08-17 Thread Jason (Google)
It should be. Please file a new bug report:
http://code.google.com/p/googleappengine/issues/list

- Jason

On Sat, Aug 15, 2009 at 1:07 PM, barak  wrote:

>
> Well, HtmlDataTable is not serializable, but how come this error is
> not seen on the development server?
>
>
> On Aug 13, 8:30 pm, "Jason (Google)"  wrote:
> > Can you verify whether HtmlDataTable extends Serializable?
> > The discussion athttp://
> groups.google.com/group/google-appengine-java/browse_thread/th...
> > how to build a session cleanup servlet to verify whether old
> > session data is the source of the problem.
> >
> > - Jason
> >
> >
> >
> > On Wed, Aug 12, 2009 at 4:54 AM, barak  wrote:
> >
> > > Hello all,
> >
> > > I'm using myfaces-1.1.7 and tomahawk-1.1.9.
> >
> > > The application has a jsp displays t:dataTable, backed by session
> > > scope bean. Everything is working as expected when deployed on the
> > > development server.
> >
> > > But, when uploading to GAE, the following errors appear:
> >
> > > java.lang.RuntimeException: java.io.NotSerializableException:
> > > org.apache.myfaces.component.html.ext.HtmlDataTable
> > >at com.google.apphosting.runtime.jetty.SessionManager.serialize
> > > (SessionManager.java:334)
> > >at
> > >
> com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession
> > > (SessionManager.java:314)
> > >at com.google.apphosting.runtime.jetty.SessionManager
> > > $AppEngineSession.save(SessionManager.java:153)
> > >at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter
> > > (SaveSessionFilter.java:41)
> > >at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> > > (ServletHandler.java:1084)
> > >at
> > > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
> > > (TransactionCleanupFilter.java:43)
> > >at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> > > (ServletHandler.java:1084)
> > >at org.mortbay.jetty.servlet.ServletHandler.handle
> > > (ServletHandler.java:360)
> > >at org.mortbay.jetty.security.SecurityHandler.handle
> > > (SecurityHandler.java:216)
> > >at org.mortbay.jetty.servlet.SessionHandler.handle
> > > (SessionHandler.java:181)
> > >at org.mortbay.jetty.handler.ContextHandler.handle
> > > (ContextHandler.java:712)
> > >at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> > > 405)
> > >at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
> > > (AppVersionHandlerMap.java:237)
> > >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.serviceReques­t
> > > (JettyServletEngineAdapter.java:139)
> > >at com.google.apphosting.runtime.JavaRuntime.handleRequest
> > > (JavaRuntime.java:235)
> > >at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > > $6.handleBlockingRequest(RuntimePb.java:4823)
> > >at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > > $6.handleBlockingRequest(RuntimePb.java:4821)
> > >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:820)
> > >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:775)
> > >at
> com.google.net.rpc.impl.Server.processRequest(Server.java:348)
> > >at com.google.net.rpc.impl.ServerConnection.messageReceived
> > > (ServerConnection.java:436)
> > >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 

[appengine-java] Re: Bulk update throws exception

2009-08-17 Thread Jason (Google)
Have you read the documentation on entity groups?
http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths
http://code.google.com/appengine/docs/java/datastore/relationships.html

In JDO/JPA, entity groups are expressed using owned relationships between
entities -- in JPA, this would be annotated using @OneToOne, @OneToMany, and
so forth. If you have any specific questions after reading through the docs
on entity groups and relationships, let me know.

- Jason

On Sat, Aug 15, 2009 at 1:09 PM, Foreigner  wrote:

> While trying to do a bulk update on my entities using JPA I get the
> exception bellow.
> I understand that you can't do a bulk update on different entity groups in
> the same transaction but I guess I don't quite understand what an entity
> group is and how I go about making all entities part of the same group I
> want.
>
> Thanks for the help.
>
> fbr
>
> Illegal argument
> org.datanucleus.exceptions.NucleusUserException: Illegal argument
>   at 
> org.datanucleus.store.appengine.DatastoreExceptionTranslator.wrapIllegalArgumentException(DatastoreExceptionTranslator.java:42)
>
>   at 
> org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.put(RuntimeExceptionWrappingDatastoreService.java:106)
>   at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:125)
>
>   at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:94)
>   at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(DatastorePersistenceHandler.java:398)
>
>   at 
> org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4458)
>   at 
> org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2807)
>   at 
> org.datanucleus.ObjectManagerImpl.markDirty(ObjectManagerImpl.java:2617)
>
>   at 
> org.datanucleus.state.JDOStateManagerImpl.postWriteField(JDOStateManagerImpl.java:4241)
>   at 
> org.datanucleus.state.JDOStateManagerImpl.setObjectField(JDOStateManagerImpl.java:2287)
>   at 
> com.yicook.entities.TwitterDailyTip.jdoSetlastSet(TwitterDailyTip.java)
>
>   at 
> com.yicook.entities.TwitterDailyTip.setLastSet(TwitterDailyTip.java:36)
>   at 
> com.yicook.control.bco.TwitterStatusSetterBCO.resetTDT(TwitterStatusSetterBCO.java:60)
>   at 
> com.yicook.control.bco.TwitterStatusSetterBCO.execute(TwitterStatusSetterBCO.java:40)
>
>   at 
> com.yicook.control.ApplicationController.executeControllers(ApplicationController.java:61)
>   at 
> com.yicook.control.ApplicationController.dispatch(ApplicationController.java:41)
>   at com.yicook.servlets.FrontController.doPost(FrontController.java:31)
>
>   at com.yicook.servlets.FrontController.doGet(FrontController.java:25)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>   at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>   at 
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>
>   at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>   at 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>   at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>
>   at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>   at 
> com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
>
>   at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>   at 
> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
>   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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
>   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
>   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>   at 
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
>
>   at 
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
> Caused by: java.lang.IllegalArgumentExcepti

[appengine-java] Re: Datastore Import and Export

2009-08-17 Thread Wladiston Paiva
nice question.

2009/8/17 Ryuzaki 

>
> yes good question!! this utility would be very helpful
> >
>


-- 
Wladiston Maurício de Paiva
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380

--~--~-~--~~~---~--~~
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 Import and Export

2009-08-17 Thread Ryuzaki

yes good question!! this utility would be very helpful
--~--~-~--~~~---~--~~
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: Please help - Strange exception thrown when do datastore query with GWT RPC call

2009-08-17 Thread Jason (Google)
Hi Zhile. The execute method returns a StreamingQueryResult instance which
you can't pass back directly or you'll see the error that you indicated
above. What you can do is create a new Collection instance (e.g. an
ArrayList or Vector), iterate through the query results copying each item
(T2 instance) into the new Collection, and then return that instead.
You may find the recently added gwtguestbook demo useful. The full source is
available through Subversion:

http://code.google.com/p/googleappengine/source/browse/#svn/trunk/java/demos/gwtguestbook

- Jason

On Fri, Aug 14, 2009 at 9:46 PM, Zhi Le Zou  wrote:

> Hello everyone,
> I encountered a strange exception when doing datastore query with GWT RPC
> call. The stack trace is pasted at bottom.
>
> There are two data types involved in the query, both are annotated
> properly. T1 has several simple properties, while T2 has several simple
> properties and holds an instance of T1. The query code is below.  Does
> anyone know why such exception is produced?  A million thanks in advance :-)
>
> public List getAllRecords(){
> PersistenceManager pm = MyUtil.getPersistenceManager(); // The persistence
> manager is returned correctly here.
>  try {
> Query query = pm.newQuery(T2.class);
> List allRecords = (List) query.execute();
>  return allRecords;
> } finally {
> pm.close();
>  }
> }
>
>
> 2009-8-15 4:29:05 com.google.appengine.tools.development.ApiProxyLocalImpl
> log
> SEVERE: [1250310545707000] javax.servlet.ServletContext log: Exception
> while dispatching incoming RPC call
> com.google.gwt.user.client.rpc.SerializationException: Type
> 'org.datanucleus.store.appengine.query.StreamingQueryResult' was not
> included in the set of types which can be serialized by this
> SerializationPolicy or its Class object could not be loaded. For security
> purposes, this type will not be serialized.
>  at
> com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSerialize(
> StandardSerializationPolicy.java:83)
>  at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(
> ServerSerializationStreamWriter.java:591)
>  at
> com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
>  at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:530)
> at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
>  at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:441)
> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:529)
>  at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>  at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:124)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>  at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> at
> com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
>  at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> at
> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:313)
>  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.content(HttpConnection.java:844)
>  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
>  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
>  at
> org.mortbay.thr

[appengine-java] Re: Getting a child by ID

2009-08-17 Thread Jason (Google)
In short, yes. That said, in practice, I haven't seen very deep entity
hierarchies since there are performance implications with deep entity
groups, so hopefully that won't be a huge inconvenience for you.
- Jason

On Fri, Aug 14, 2009 at 3:36 AM, Smrky  wrote:

>
> Yes, that was what I was asking - so for getting a specific question I
> need both - survey ID and question ID. But what if I had deeper level
> child - I would have to keep IDs of all parents? i.e.:
>
> parent1 -> parent2 -> parent3 -> parent4 -> parent5 -> child
>
> public child getChildByID(parent1ID, parent2ID, parent3ID, parent4ID,
> parent5ID, childID) {
> PersistenceManager pm = PMFactory.get().getPersistenceManager
> ();
> Key kp = KeyFactory.createKey(parent1.class.getSimpleName(),
> parent1ID);
>Key k = kp.getChild(parent2.class.getSimpleName(),
> parent2).getChild(parent3.class.getSimpleName(), parent3).getChild
> (parent4.class.getSimpleName(), parent4).getChild
> (parent5.class.getSimpleName(), parent5).getChild
> (child.class.getSimpleName(), childID);
>
>child c = (child) pm.getObjectById(child.class, k);
>pm.retrieve(c);
>pm.close();
>return c;
> }
>
> Is it correct? Or there is another way? Thank you!
>
> On 13 srp, 18:01, objectuser  wrote:
> > Right, the ID of the Question is not a Long, it's a Key.  So if you
> > keep the question's key value somewhere (I'm assuming you can since
> > you have the survey ID somewhere), you can do pm.getObjectById
> > (Question.class, questionKey).
> >
> > For the relationship, just ignore me since I'm just wrong. :)
> >
>

--~--~-~--~~~---~--~~
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: Suggestion on whitelite/blacklist java classes on local test machine

2009-08-17 Thread Jason (Google)
Thanks for the note. We do try to throw an exception or log a warning in the
development environment when a class not on the white list is used, but
evidently there are some holes. Can you please file a new bug with the
classes in question in our public tracker? If you do some searching, you may
be able to find an open bug already.
http://code.google.com/p/googleappengine/issues/list

Thanks,
- Jason

On Fri, Aug 14, 2009 at 8:22 PM, asianCoolz  wrote:

>
> I noticed that some of our test app able to run well on local test
> machine but unable to run on app engine because of some of the classes
> are blacklisted. example. java.naming.*   . I wanna propose if app
> engine in eclipse will have a feature to blacklist those classes on
> development environment as well and thus ease programmer to know that
> certain class will not work on appengine.  what u folks thinks?
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Error creating JDO PersistanceManagerFactory with "transactions-optional"

2009-08-17 Thread David Fuelling

I think we have the same symptoms, and certainly the same error --
we're both getting an ExceptionInInitializerError that only occurs on
the server (Hosted-Mode browser and appengine).  His doesn't reference
JUnit, but I imagine he's just missing a .jar library that's on his
eclipse build path, but missing from his WAR -- Java is throwing a
class-not-found error with a message related to the
PersistenceManager.  I think this is just happening because the JDO
code eats the actual exception and re-packages it (compounding the
problem is that this is actually a JRE initialization error -- it's
not really a normal code flow error, so try/catches may not be
designed for this use-case).

david

On Aug 14, 3:35 pm, Rajeev Dayal  wrote:
> Hi David,
> One more thing - it also seems that your problem was different than Geoff's.
> Is that correct?
>
> Thanks,
> Rajeev
>

--~--~-~--~~~---~--~~
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: Error creating JDO PersistanceManagerFactory with "transactions-optional"

2009-08-17 Thread David Fuelling

Hi Rajeev,

Great questions...

First, I'm using JPA (my understanding is that JPA actually uses JDO
under the covers -- hence the JDO references in my errors).  Per the
documentation, I'm loading an EntityManager like it's done on this
page (http://code.google.com/appengine/docs/java/datastore/
usingjpa.html).  You'll notice that the EMF class is static, which
means it is statically initialized when the JRE virtual machine is
started up (before any code gets run).  This is where the error was
occurring (the static initializer was unable to link-in my JUnit test
classes when the JRE loaded up -- hence, my obfuscated error).  I
think this is happening because my JUnit test classes "import" a DAO
class that "imports" the EMF class.  So, this is probably why the
error was happening in conjuntino with the statically initialized
EntityManagerFactory (EMF) class.

In reality, it would be nice to *not* have my JUnit test classes and
junit.jar deployed to the HostedMode browser or AppEngine -- after
all, I don't actually run JUnit tests on the server.  However, I
haven't taken the time to filter out my junit tests when the appengine
WAR gets assembled (I'm not actually certain how I would do that -- is
there an easy way to say what goes into the WAR and what doesn't?).

With regard to your second question, I'm not sure what changed between
pre and post-upgrade.  All I know is that I didn't have this error
before I upgraded, and it showed up post-upgrade, and it only involved
jar files in "web-inf/lib" (the error only shows up on the server).
My guess is that I probably put the JUnit.jar file into the "web-inf/
lib" directory long ago, and the upgrade must have deleted all jars
and only added back the appengine jars (I recognize that's
contradictory to expected appgengine upgrade behavior, so possibly
there's another explanation -- though it seems like lots of people
have had similar errors to mine, especially with this latest eclipse
upgrade).

Hope that helps!

David

On Aug 14, 3:25 pm, Rajeev Dayal  wrote:
> Hi David,
> I'm sorry that you had to go through all of this trouble to get everything
> working. I'm trying to understand the problem here, so that we can guide
> other users away from it. Did the test code that you had make use of JDO at
> all? I can understand why a classloading error might occur (since junit.jar
> was not part of your war/WEB-INF/lib directory), but I do not understand why
> any of your test classes would need to be loaded during the course of
> running your application.
>
> Also, you mentioned that the junit.jar file went missing from your
> war/WEB-INF/lib folder when you upgraded to App Engine? Do you recall if it
> was just the SDK switch that caused this problem, or could it have been
> removed by some other means? I ask because an SDK switch should not remove
> any non-SDK jars.
>
> Thanks,
> Rajeev
>
> On Thu, Aug 13, 2009 at 1:39 PM, David Fuelling  wrote:
>
> > Ok -- I solved my problem.
>
> > In a nutshell, I have some JUnit tests that are part of my project in
> > Eclipse (I'm not using Maven).  These JUnit tests are included in the
> > generated WAR file that is deployed to appengine since they're a
> > regular part of my project structure.  For whatever reason, when I
> > upgraded to the appengine eclipse 1.2.2 plugin, the JUnit.jar file was
> > still in my *eclipse build path*, but was no longer in the "war/WEB-
> > INF/lib" folder.  So, in eclipse everything appeared to be working
> > fine (no errors).  However, once I ran the app in appengine (Hosted
> > and real) and the app tried to initialize the EntityManagerFactory
> > (via: EntityManagerFactory emfInstance =
> > Persistence.createEntityManagerFactory("transactions-
> > optional");).I would get this error:
>
> > java.lang.ExceptionInInitializerError
> > CAUSED BY: javax.persistence.PersistenceException: Provider error.
> > Provider:
> > org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
> > 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
>
> > This led me to think something was amiss with my PersistenceProvider
> > config.  However, after digging deeper through my debug output, I was
> > able to stick a breakpoint on line 250 of the class
> > "org.datanucleusJDOClassLoaderResolver".  On line 249, the "msg"
> > variable does some translation to get an actual error message.  My
> > error message was saying that certain classes (that I created) were
> > not found on the classpath.  Digging even deeper, I was able to
> > isolate that each of the "not found" classes extended the the
> > "TestCase" JUnit class.
>
> > Anyway, since that jar (junit.jar) had been removed from my "war/WEB-
> > INF/lib" folder, it was causing my EMF utility class to barf during
> > instantiation, which then caused the PersistenceManager to not be able
> > to load.
>
> > All in all, some interes

[appengine-java] Re: How to understand "a query will never return more than 1000 enties"

2009-08-17 Thread Mike

Hi,

>From my understanding queries return a maximum of 1000 entities, and
the largest starting index you can use is either 999 or 1000.  This
means you'll never be able to access more than the first 2000 entities
from the datastore for a particular query, regardless of the code in
place after the fetch.

Mike


On Aug 17, 5:17 am, hzqtc  wrote:
> Hi,
>
> I'm new to app engine and I have a question when I come to this
> sentence:"a query will never return more than 1000 enties". If I
> execute a query and store the return result in a List, but I don't
> detach them, i.e., keep them in the persitent manager. And the entries
> in that List is beyond 1000, would it be possible?
>
> For example:
>
>         public void updateIndex(int from, int value)
>         {
>                 PersistenceManager pm = PMF.get().getPersistenceManager();
>                 Query query = pm.newQuery(Article.class);
>                 query.setFilter(String.format("index >= %d", from));
>                 try
>                 {
>                         List articles = 
> (List)query.execute();
>                         for(Article article: articles)
>                         {
>                                 article.setIndex(article.getIndex() + value);
>                                 pm.makePersistent(article);
>                         }
>                 }
>                 finally
>                 {
>                         query.closeAll();
>                         pm.close();
>                 }
>         }
>
> If the query returns 2000 entries, will it work or not? If not, would
> you please recommend me a alternative way?
> Thank you very much.
--~--~-~--~~~---~--~~
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: class evolution

2009-08-17 Thread datanucleus

> It looks like I have some missing parameters in the
> @Persistentannotation? I was thinking it would be the "nullValue"
> parameter but it does not seem to be the case.

nullValue as "default" perhaps. Doesn't mean that GAE/J supports it
(yet)
--~--~-~--~~~---~--~~
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: class evolution

2009-08-17 Thread victor

I tried what you suggested and I get the following exception:

Datastore entity with kind ...has a null property named
voteDownCount.  This property is mapped to ..., which cannot accept
null values.

It looks like I have some missing parameters in the
@Persistentannotation? I was thinking it would be the "nullValue"
parameter but it does not seem to be the case.
Does anyone know what would this be?

Thanks!


On Aug 16, 11:48 pm, Mujtaba Hassan  wrote:
> This issue has been discussed on the forum.
>
> Just add your the new field in the ClassA and start your development, the
> old records will store null associated with the new field.
>
> On Mon, Aug 17, 2009 at 8:30 AM, victor  wrote:
>
> > This seems to be a common use case but I cannot seem to find the
> > answer to this in the forum. Let us say I have defined a persistent
> > class:
> > class A {
> >  private String field;
> >  //get set methods removed for clarity
> > }
>
> > Supposed that this class worked out fine and I have already deployed
> > my app and populated my tables with it. But then it just occurred to
> > me that I have to add a new field:
> > class A {
> >  private String field;
> >  private String newField;
> >  //get set methods removed for clarity
> > }
>
> > What would be the best way to tackle this scenario? Can I just extend
> > "A" instead? -- but class extension seems to be poorly supported in
> > this JDO implementation. How do I migrate my old class versions?
>
> > I was thinking of putting class version on my classes and everytime I
> > update it I would do the following steps:
> > 1) Change the version ID of the class
> > 2) Migrate all the tables in the table by retrieving it, changing the
> > version ID, resave it with the new class.
>
> > Any pointers would be helpful.
>
> > 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: XStream and Google App Engine

2009-08-17 Thread Abe Parvand

Anyone figure out a solution to this? I really need xstream

On Aug 8, 4:37 am, dflorey  wrote:
> I guess that due to reflection restrictions it is not possible to 
> useXStreamor other tools relying on relection.
> I ended up with creating serializable dto classes.
>
> On 8 Aug., 08:33, Iqbal Yusuf Dipu  wrote:
>
>
>
> > Tried the patch... I'm probably doing something wrong.. getting
> > reflection error.. I really needed a XML serializer/de-serializer
> > badly... :( Jaxb doesn't work. I can't makeXStreamwork... I've tried
> > Bitwext and couldn't make it work Can someone guide me to a easy
> > simple xml to java serializer that works in GAEj?
>
> > Thanks.
>
> > Iqbal Yusuf Dipu
>
> > On Aug 4, 8:44 am, Sheel  wrote:
>
> > > Hi,
> > > I have a patched version ofxstreamjar which I used with my
> > > application.
> > > You can download it from 
> > > herehttp://cloudcms.sheelapps.com/vfs/download/xstream-gae.jar
> > > Give it a try.
> > > But I think your error is related to Google data api.
>
> > > Sheelhttp://cloudcms.sheelapps.com
> > > CMS for Google App Engine
>
> > > On Aug 3, 8:34 am, dflorey  wrote:
>
> > > > I've updated to latestXStreamtrunk and applied your patch. Now I get
> > > > a different excpetion:
>
> > > > com.thoughtworks.xstream.converters.ConversionException: Cannot
> > > > construct com.google.gdata.util.common.xml.XmlNamespace as it does not
> > > > have a no-args constructor : Cannot construct
> > > > com.google.gdata.util.common.xml.XmlNamespace as it does not have a no-
> > > > args constructor
> > > >  Debugging information 
> > > > message             : Cannot construct
> > > > com.google.gdata.util.common.xml.XmlNamespace as it does not have a no-
> > > > args constructor
> > > > cause-exception     :
> > > > com.thoughtworks.xstream.converters.reflection.ObjectAccessException
> > > > cause-message       : Cannot construct
> > > > com.google.gdata.util.common.xml.XmlNamespace as it does not have a no-
> > > > args constructor
> > > > class               : java.util.ArrayList
> > > > required-type       : com.google.gdata.util.common.xml.XmlNamespace
> > > > path                : /list/
> > > > com.google.gdata.data.contacts.ContactEntry/nonRepeatingExtensionMap/
> > > > entry/com.google.gdata.data.extensions.Name/namespace
> > > > ---
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert
> > > > (TreeUnmarshaller.java:78)
> > > >         at 
> > > > com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert
> > > > (AbstractReferenceUnmarshaller.java:63)
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother
> > > > (TreeUnmarshaller.java:65)
> > > >         at
> > > > com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.
> > > >  unmarshallField
> > > > (AbstractReflectionConverter.java:256)
> > > >         at
> > > > com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.
> > > >  doUnmarshal
> > > > (AbstractReflectionConverter.java:228)
> > > >         at
> > > > com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.
> > > >  unmarshal
> > > > (AbstractReflectionConverter.java:168)
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert
> > > > (TreeUnmarshaller.java:71)
> > > >         at 
> > > > com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert
> > > > (AbstractReferenceUnmarshaller.java:63)
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother
> > > > (TreeUnmarshaller.java:65)
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother
> > > > (TreeUnmarshaller.java:49)
> > > >         at
> > > > com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
> > > >  .readItem
> > > > (AbstractCollectionConverter.java:71)
> > > >         at
> > > > com.thoughtworks.xstream.converters.collections.MapConverter.populateMap
> > > > (MapConverter.java:79)
> > > >         at
> > > > com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal
> > > > (MapConverter.java:66)
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert
> > > > (TreeUnmarshaller.java:71)
> > > >         at 
> > > > com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert
> > > > (AbstractReferenceUnmarshaller.java:63)
> > > >         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother
> > > > (TreeUnmarshaller.java:65)
> > > >         at
> > > > com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.
> > > >  unmarshallField
> > > > (AbstractReflectionConverter.java:256)
> > > >         at
> > > > com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.
> > > >  doUnmarshal
> > > > (AbstractReflectionConverter.java:228)
> > > >         at
> > > > com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.
> > > >  unmarshal
> > > > (Abstr

[appengine-java] Re: Java heap space on batch insert

2009-08-17 Thread Jason (Google)
Naturally, there will be some distinctions between the services/components
used in the production environment and those included with the local SDK.
We're working hard to keep this distinction as transparent as possible, but
we do not currently have a document listing the implementation differences
between the local and production components. That said, if you have any
specific questions on how the local SDK works in relation to the production
environment, please ask.
- Jason

On Fri, Aug 14, 2009 at 5:09 PM, PLX  wrote:

>
> I appreciate
>
> This is very useful information. Can you provide me with a link to
> dev.server documentation, please? I want to review all differences
> between production and development servers.
>
> Thank you
>
> On Aug 12, 3:26 pm, PLX  wrote:
> > Hi,
> >
> > I'm trying to understand, how is it possible to insert a large amount
> > of data to datastore with JDO. But I have a memory leak problem.
> >
> > PersistenceManager pm = null;
> > for (int i = 0; i < 100; i++) {
> >   try {
> > pm = PMF.get().getPersistenceManager();
> > List products = new Vector();
> > for (int j = 0; j < 1000; j++) {
> >   Product p = new Product();
> >   products.add(p);
> > }
> > pm.makePersistentAll(products);
> > products.clear();
> > System.out.println("committed " + i);
> >   } catch (Exception e) {
> > e.printStackTrace();
> >   }
> >   finally {
> > pm.close();
> >   }
> >
> > }
> >
> > I've tried:
> > - to use the same PM instance all the time without recreating it after
> > every 1000 inserts.
> > - pm.flush();
> > - pm.evictAll();
> > - pm.makePersistent(p); instead of creating the list and calling
> > pm.makePersistentAll() for it
> >
> > Nothing helps. After approximately 55000 inserts I get the same:
> >
> > java.lang.OutOfMemoryError: Java heap space
> > at java.lang.reflect.Method.copy(Method.java:143)
> > at java.lang.reflect.ReflectAccess.copyMethod
> > (ReflectAccess.java:118)
> > at sun.reflect.ReflectionFactory.copyMethod
> > (ReflectionFactory.java:282)
> > at java.lang.Class.copyMethods(Class.java:2748)
> > at java.lang.Class.getMethods(Class.java:1410)
> > at
> >
> com.google.appengine.tools.development.ApiProxyLocalImpl.getDispatchMethod
> > (ApiProxyLocalImpl.java:149)
> > at
> > com.google.appengine.tools.development.ApiProxyLocalImpl.makeSyncCall
> > (ApiProxyLocalImpl.java:88)
> > at com.google.apphosting.api.ApiProxy.makeSyncCall
> > (ApiProxy.java:79)
> > at
> > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
> > (DatastoreApiHelper.java:48)
> > at com.google.appengine.api.datastore.DatastoreServiceImpl
> > $2.run(DatastoreServiceImpl.java:169)
> > at
> > com.google.appengine.api.datastore.TransactionRunner.runInTransaction
> > (TransactionRunner.java:30)
> > at com.google.appengine.api.datastore.DatastoreServiceImpl.put
> > (DatastoreServiceImpl.java:157)
> > at com.google.appengine.api.datastore.DatastoreServiceImpl.put
> > (DatastoreServiceImpl.java:137)
> > at com.google.appengine.api.datastore.DatastoreServiceImpl.put
> > (DatastoreServiceImpl.java:129)
> > at
> >
> org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.put
> > (RuntimeExceptionWrappingDatastoreService.java:92)
> > at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.put
> > (DatastorePersistenceHandler.java:108)
> > at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.put
> > (DatastorePersistenceHandler.java:94)
> > at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
> > (DatastorePersistenceHandler.java:195)
> > at
> > org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent
> > (JDOStateManagerImpl.java:3185)
> > at org.datanucleus.state.JDOStateManagerImpl.makePersistent
> > (JDOStateManagerImpl.java:3161)
> > at org.datanucleus.ObjectManagerImpl.persistObjectInternal
> > (ObjectManagerImpl.java:1298)
> > at org.datanucleus.ObjectManagerImpl.persistObject
> > (ObjectManagerImpl.java:1175)
> > at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent
> > (JDOPersistenceManager.java:669)
> > at org.datanucleus.jdo.JDOPersistenceManager.makePersistentAll
> > (JDOPersistenceManager.java:723)
> > at test.servlet.RunServlet.doGet(RunServlet.java:46)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:
> > 693)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:
> > 806)
> > at org.mortbay.jetty.servlet.ServletHolder.handle
> > (ServletHolder.java:487)
> > at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1093)
> > at
> > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
> > (TransactionCleanupFilter.java:43)
> > at org.mortbay.jett

[appengine-java] Re: Connect to google docs on behalf of user john....@domain.com

2009-08-17 Thread Jason (Google)
Hi Cornel. Have you raised this in the Documents List Data API discussion
forum? One of the contributors on that list might be able to better explain
why your authentication is failing and the CaptchaRequiredException is being
thrown.

- Jason

On Fri, Aug 14, 2009 at 2:51 AM, Cornel  wrote:

>
> Hello!
>
> I want to be able to read and modify some google docs belonging a
> user, from a servlet running in app-engine.
>
> I was able to connect and fetch a document list from the
> john@gmail.com both from hosted-mode and from app-engine.
>
>service.setUserCredentials("john@gmail.com",
> "password");
>URL documentListFeedUrl = new URL("
> http://docs.google.com/feeds/
> documents/private/full");
>DocumentListFeed feed =
> service.getFeed(documentListFeedUrl,
> DocumentListFeed.class);
>
>for (DocumentListEntry entry : feed.getEntries()) {
>spreadSheets +=
> entry.getTitle().getPlainText() + " ";
>}
>
> But when i try to do the same thing for john@mydomain.com, it only
> works in hosted mode.
> When i try on appengine i get a CaptchaRequiredException in the logs.
> >
>

--~--~-~--~~~---~--~~
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: Read Gmail from app engine

2009-08-17 Thread Rayala Udayakumar
I dont think you can. Connecting to a mail server requires you to establish
a socket connection which you cannt do in GAE.

On Mon, Aug 17, 2009 at 12:11 AM, Puneet  wrote:

>
> Can i retrieve mails using Java Mail api or G4J from a servlet?.
>
> On Aug 14, 2:30 pm, Mahesh Patil  wrote:
> > Hi Puneet,
> > You could just forward your emails to another email address or to your
> > workplace email..thats what I did when I couldn't access Gmail from
> one
> > of my client side.
> >
> > Of course it would be nice to access your own emailsand may be to
> > extract some information or create alerts of it.
> >
> > Cheers,
> > Mahesh
> >
> >
> >
> > On Thu, Aug 13, 2009 at 9:33 PM, Puneet  wrote:
> >
> > > Hi,
> >
> > > Is there a way to read google mails from app engine. As far as i have
> > > searched, it only allows sending email-messages.
> >
> > > Actually Gmail is blocked in my workplace, so I was thinking if I can
> > > host an application on appspot, enter my userid/password, and fetch my
> > > google-mails. It would be great fun.
> >
> > > Can any-one help.
> >
> > > 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: How implements query with inequality filters on multiple properties ?

2009-08-17 Thread benwit

Thanks for your response.

But in my case, i can't use this tips.

--~--~-~--~~~---~--~~
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: Own Domain setup for GAE

2009-08-17 Thread Vik
hie
so i added a alias in my google apps account.
now it says domain verification in progress... so how much time will it
take?

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Fri, Aug 14, 2009 at 10:57 PM, Jason (Google) wrote:

> It looks like the www mapping is already in use -- 
> http://www.sakshum.com/takes me to your home page. So you will have to remove 
> this mapping before
> you can add your App Engine app. For now, you can try using another
> subdomain that's not already in use to see if this works.
> - Jason
>
>
> On Wed, Aug 12, 2009 at 9:42 PM, Vik  wrote:
>
>> Hie
>> Nope i was trying to create alias for www.sakshum.com only.
>> As i told currently this points to my friend's server ip.
>>
>> Now i want it to point to my gae app.
>>
>> Thankx and Regards
>>
>> Vik
>> Founder
>> www.sakshum.com
>> www.sakshum.blogspot.com
>>
>>
>> On Thu, Aug 13, 2009 at 12:08 AM, Jason (Google) wrote:
>>
>>> What mapping are you trying to create? Naked domains aren't currently
>>> supported, so you wouldn't be able to use sakshum.com to point to your
>>> App Engine app. You could use www.sakshum.com, etc., as long as the
>>> subdomain (e.g. www) isn't already mapped to something else like a Google
>>> Site.
>>>
>>> - Jason
>>>
>>> On Tue, Aug 11, 2009 at 5:46 AM, Vik  wrote:
>>>
 Hie
 I went to https://www.google.com/a/cpanel/sakshum.com  which my google
 app panel .
 And when i tried to add a new alias  giving value sakshum.com

 it says: This domain name has already been used as an alias or domain.

 So where it is used? How do i know that and how do i finally solve my
 issue? please help..


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Tue, Aug 11, 2009 at 5:52 PM, Nick Johnson (Google) <
 nick.john...@google.com> wrote:

>
> Hi Vik,
>
> You need to either create a new Apps installation for your custom
> domain, or add the domain to an existing Apps installation as an
> alias. Then, follow the instructions Martin linked to.
>
> -Nick Johnson
>
> On Tue, Aug 11, 2009 at 12:35 PM, Vik wrote:
> > Hie Martin
> > Thankx but here is the trouble:
> > I bought the domain www.sakshum.com from a provider called
> net4domains.com
> > I signed up google app standard edition using this domain and now
> using mail
> > services.
> > I changed the NS record and pointed to my friends server ips. So, in
> a way
> > when i type www.sakshum.com it points to his server and gets the
> content.
> > Now, I want to point it to GAE to use my GAE version app.
> > When i tried to add to the version "add domain" it gave me following
> error:
> > Sorry, you've reached a login page for a domain that isn't using
> Google
> > Apps. Please check the web address and try again
> > And when i tried to check for any alias in my google app account then
> i dont
> > see anything there.
> > So what should i do now?
> > Thankx and Regards
> >
> > Vik
> > Founder
> > www.sakshum.com
> > www.sakshum.blogspot.com
> >
> >
> > On Tue, Aug 11, 2009 at 2:33 PM, Martin Caslavsky <
> mcaslav...@gmail.com>
> > wrote:
> >>
> >> http://code.google.com/intl/cs/appengine/articles/domains.html
> >>
> >> Martin
> >>
> >> On 11 srp, 09:58, Vik  wrote:
> >> > Hie
> >> > We own a domainhttp://www.sakshum.comwhich is hosted somewhere
> else as
> >> > of
> >> > now.
> >> >
> >> > Now we are ready with our new app which runs using GAE
> >> > athttp://sakshumweb-test.appspot.com/ui/page/index.html
> >> >
> >> > So, the
> question
> >> > is
> >> > how should use my domainhttp://www.sakshum.comto host the GAE app?
> >> >
> >> > Thankx and Regards
> >> >
> >> > Vik
> >> > Founderwww.sakshum.comwww.sakshum.blogspot.com
> >>
> >
> >
> > >
> >
>
>
>
> --
> Nick Johnson, Developer Programs Engineer, App Engine
>
>
>



>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: grandson not deleted in cascading 1-M update

2009-08-17 Thread Jason (Google)
Feel free to file a feature request in the public tracker:
http://code.google.com/p/googleappengine/issues/list

- Jason

On Fri, Aug 14, 2009 at 12:36 AM, ray  wrote:

>
> Thanks Jason for the reply. I wish the descendants can be deleted
> automatically in a single transaction by setting the children property
> along the path and saving the root. Note that, in this way, the child
> that is excluded from children property of the root is deleted, while
> deeper level descendants are not.
> Sorry for my ignorance, but is this by design?
>
> Thanks,
> Ray
> On Aug 14, 2:47 am, "Jason (Google)"  wrote:
> > App Engine entity hierarchies ("entity groups") are implemented by
> including
> > the key of the parent (and its parent's parent, and so on) in its own
> key,
> > and once an entity is created, its key cannot be changed. Further,
> deleting
> > an entity does not recursively delete any child entities under it. If
> this
> > is what you're after, you'll have to implement it. Otherwise, the
> grandchild
> > entity will continue to exist and its relationship to its grandparent
> will
> > remain, even after its parent is gone.
> > For more on entity groups, seehttp://
> code.google.com/appengine/docs/python/datastore/keysandentityg...
> > .
> >
> > - Jason
> >
> >
> >
> > On Wed, Aug 12, 2009 at 9:09 PM, ray  wrote:
> >
> > > Hi,
> >
> > > I have an entity that has a 1-M relationship using JPA:
> > > @Entity
> > > public class Person {
> > >@Id
> > >@GeneratedValue(strategy = GenerationType.IDENTITY)
> > >@Extension(vendorName = "datanucleus", key = "gae.encoded-pk",
> value
> > > = "true")
> > >private String encodedKey;
> >
> > >private String parent;
> >
> > >@OneToMany(cascade = CascadeType.ALL)
> > >private List children = new ArrayList();
> > > }
> > > Children and grandchildren can be created excellently when saving a
> > > parent Person. However, when I update its children property, its
> > > grandchildren cann't be deleted, while its son can be deleted.
> >
> > > For example, at first the relationship is Parent - Son - Grandson.
> > > Then I set set the children of Son to empty, and call dao.save
> > > (Parent). Grandson remains there, while it should have been deleted.
> >
> > > A limitation or something wrong with my code?
> >
> > > Thanks,
> > > Ray
> >
>

--~--~-~--~~~---~--~~
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: Struts 2 on App Engine

2009-08-17 Thread dolsen

It looks like with this exception I can still move forward with my
app. I hate seeing it when I start the SDK but it is something I could
live with. As long as it doesn't cause a problem on App Engine.

On Aug 14, 6:37 pm, dolsen  wrote:
> I am trying to setup Struts with App Engine. However ,when I start up
> the SDK server I get the error shown below. Any ideas on how to get
> past this would be greatly appreciated.
>
> java.lang.Exception: Could not load javax/servlet/http/
> HttpServlet.class
>         at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef
> (ClassFinder.java:745)
>         at com.opensymphony.xwork2.util.finder.ClassFinder.access$400
> (ClassFinder.java:57)
>         at com.opensymphony.xwork2.util.finder.ClassFinder
> $InfoBuildingVisitor.extractSuperInterfaces(ClassFinder.java:790)
>         at com.opensymphony.xwork2.util.finder.ClassFinder
> $InfoBuildingVisitor.visit(ClassFinder.java:777)
>         at org.objectweb.asm.xwork.ClassReader.accept(Unknown Source)
>         at org.objectweb.asm.xwork.ClassReader.accept(Unknown Source)
>         at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef
> (ClassFinder.java:740)
>         at com.opensymphony.xwork2.util.finder.ClassFinder.
> (ClassFinder.java:148)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions
> (PackageBasedActionConfigBuilder.java:295)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs
> (PackageBasedActionConfigBuilder.java:277)
>         at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages
> (ClasspathPackageProvider.java:52)
>         at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer
> (DefaultConfiguration.java:200)
>         at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
> (ConfigurationManager.java:55)
>         at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration
> (Dispatcher.java:360)
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
>         at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher
> (InitOperations.java:69)
>         at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init
> (StrutsPrepareAndExecuteFilter.java:48)
>         at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
> 99)
>         at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
>         at org.mortbay.jetty.servlet.ServletHandler.initialize
> (ServletHandler.java:589)
>         at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
>         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 org.mortbay.jetty.handler.HandlerWrapper.doStart
> (HandlerWrapper.java:117)
>         at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
>         at org.mortbay.jetty.handler.HandlerWrapper.doStart
> (HandlerWrapper.java:117)
>         at org.mortbay.jetty.Server.doStart(Server.java:217)
>         at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
>         at
> com.google.appengine.tools.development.JettyContainerService.startContainer
> (JettyContainerService.java:152)
>         at
> com.google.appengine.tools.development.AbstractContainerService.startup
> (AbstractContainerService.java:116)
>         at com.google.appengine.tools.development.DevAppServerImpl.start
> (DevAppServerImpl.java:218)
>         at com.google.appengine.tools.development.DevAppServerMain
> $StartAction.apply(DevAppServerMain.java:162)
>         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
> (Parser.java:48)
>         at com.google.appengine.tools.development.DevAppServerMain.
> (DevAppServerMain.java:113)
>         at com.google.appengine.tools.development.DevAppServerMain.main
> (DevAppServerMain.java:89)
--~--~-~--~~~---~--~~
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: Problem with unowned relationships.

2009-08-17 Thread Rayala Udayakumar
I had faced a simillar issue. So i introduced add() method
and initialize the list if it is null.
In your example,

   Make temp = pm.getObjectById(Make.class, makeKey);
   temp.getModels().add(model);
   temp.addOption(optionKey);
   pm.makePersistent(temp);

class Make {
  ...
  public void addOption(String key) {
   if(options == null){
  options = new ArrayList();
   }
   options.add(key);
  }
}


Does any one know better way doing this ?


On Mon, Aug 17, 2009 at 4:04 PM, zhiqiang huang  wrote:

> Good idea...but where is the log? I'm using development server running on
> localhost.
>
> On Mon, Aug 17, 2009 at 6:31 PM, datanucleus wrote:
>
>>
>> Why not just look at the log (DEBUG level) since it tells you what
>> fields are loaded in what object and what the object states are.
>>
>>
>
>
> --
> Huang Zhiqiang
> Computer Science College
> Zhejiang University
>
> >
>

--~--~-~--~~~---~--~~
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: Granite Data Services Blog

2009-08-17 Thread objectuser

The last line made me laugh!

I think some of the GraniteDS team has published an app on GAE and
actually made the source available.  Have you search for that?

On Aug 17, 1:17 am, Capsicum annuum  wrote:
> I want to build a flex project with GAE,
> and i want to use JDO Detach.
>
> My English is poor.
>
> It's Doc is poor too...
--~--~-~--~~~---~--~~
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: Unit Test Data Persistence: Is there two Datastore instances in the test enviroment?

2009-08-17 Thread objectuser

You followed all the steps in this thread?

http://groups.google.com/group/google-appengine-java/browse_thread/thread/9a5ca03a216cd0a9

There are a few.  The google docs are out of date and you need to use
the code in the other link.

Have you done all of that?

On Aug 17, 9:16 am, - Ray  wrote:
> Is there two Datastore instances in the test enviroment?
>
> i am using GWT 1.7, Google Plugin 1.2.2 und Eclipse Galileo. the same Issue
> exists in GWT 1.6, Google Plugin 1.2.1 und Eclipse 3.4.
>
> recently i have got a problem like below:
>
> My example is simple:
> 1.  Create an object and save it,  then use Service to update its value.
> 2. load it using pm with id direct from Datastore. the Changes doesn't take
> effect.
> 3.  but when i load it using service to retrieve it from datastore, the
> Changes take effect.
>
> WorkitemService uses JDO to save the Object of Workitem and update the
> Object of Workitem.
> Workitem is a class simply saves data.
>
> source code below demonstrate the Problem i got:
>
> private WorkitemServiceImpl wsi = new WorkitemServiceImpl();
> PersistenceManager pm = PMF.get().getPersistenceManager();
>
> public void testUpdate() {
>
> try {
>
> Date date = new Date();
>                 Date date1 = new Date();
>                 Long user_id = 1L;
>      Workitem wi1 = new Workitem("test", 1, "tag", date, user_id);
>      pm.makePersistent(wi1);
>      Workitem wi2 = pm.detachCopy(wi1);
> wi2.setDescription("test1");
>  wi2.setTagString("tag1 tag2");
> wi2.setDuration(2);
> wi2.setDate(date1);
>  wsi.update(wi2);
> ArrayList workitems = wsi.loadWorkitems(user_id);
>  Workitem wi3 = workitems.get(0);
>  assertEquals(wi2.getId(), wi3.getId());
> assertEquals("test1", wi3.getDescription());
>  assertEquals(2, wi3.getDuration());
> assertEquals("tag1 tag2", wi3.getTagString());
>  assertEquals(date1, wi3.getDate());
>     } catch (Exception e) {
>      System.out.println(e.toString());
>      assertTrue(false);
>     } finally {
>       pm.close();
>     }
>
> }
>
> the test passes. wenn i change the way of fetching the updated Object in the
> test case like below, the test can not pass any more.
>
> public void testUpdate() {
>
> try {
>
> Date date = new Date();
>                 Date date1 = new Date();
>                 Long user_id = 1L;
>       Workitem wi1 = new Workitem("test", 1, "tag", date, user_id);
>       pm.makePersistent(wi1);
>      Workitem wi2 = pm.detachCopy(wi1);
>  wi2.setDescription("test1");
> wi2.setTagString("tag1 tag2");
>  wi2.setDuration(2);
> wi2.setDate(date1);
> wsi.update(wi2);
>  Workitem wi3 = pm.getObjectById(Workitem.class, wi2.getId());
> assertEquals(wi2.getId(), wi3.getId());
>  assertEquals("test1", wi3.getDescription());
> assertEquals(2, wi3.getDuration());
>  assertEquals("tag1 tag2", wi3.getTagString());
> assertEquals(date1, wi3.getDate());
>      } catch (Exception e) {
>      System.out.println(e.toString());
>       assertTrue(false);
>     } finally {
>        pm.close();
>     }
>
> }
>
> i did have do what Jason has said:
>
> change
>
> public String getRequestNamespace() {  return "gmail.com";
>
> }
>
> topublic String getRequestNamespace() {
>   return "";
>
> }
>
> it doesn't work for me.
>
> so my question is: is there two different Datastore instances in the test
> enviroment for GAE? or have i done something wrong?
>
> thanks in advance.
>
> ray
--~--~-~--~~~---~--~~
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] Install has encountered a problem in Eclipse.

2009-08-17 Thread tiger

I have get the following error when I was trying to install the Google
App Engine 1.2.2 Plungins for Eclipse 3.5



GoogleAppEngine http://dl.google.com/eclipse/plugin/3.5

===
An error occurred during the
org.eclipse.equinox.internal.provisional.p2.engine.phases.CheckTrust
phase.
  session context was:(profile=epp.package.jee,
phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.CheckTrust,
operand=, action=).
  Cannot connect to keystore.
  Uninitialized keystore
===

does anyone know about it ? or any resolved issue ?

Thanks
tiger
--~--~-~--~~~---~--~~
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: Null MemCache

2009-08-17 Thread Don Schwarz
Can you provide the code for your MemcacheFilter?

On Sat, Aug 15, 2009 at 2:54 AM, Martyn wrote:

>
> Hi Jason,
>
> Only seen in production environment.
>
> Since I use the wrapper class MemcacheFilter, if this is not
> initialised then I would get a null exception from the wrapper method
> call, but I get the null exception from the call to the wrapped
> memcacheService which is only assigned in the MemcacheFilter field
> initilizer.
>
> - Martyn
>
> On Aug 14, 6:00 pm, "Jason (Google)"  wrote:
> > Hi Martyn. Are you seeing this in the local environment, production, or
> > both? If you're seeing this in the local environment only, signs point to
> a
> > race condition in your code.
> > - Jason
> >
> > On Thu, Aug 13, 2009 at 6:31 AM, Martyn  >wrote:
> >
> >
> >
> >
> >
> > > I have written a wrapper for MemCache to facillitate batch operations.
> >
> > > Specifically I have added a queue method that add to a Map object and
> > > then a flush method does a batch put.
> >
> > > This works very well.
> >
> > > However, I have just found a couple of errors in my log indicating the
> > > wrapped memcacheService is null.
> >
> > > The wrapper has a field initializer defiend as:
> > >MemcacheService m_cache =
> MemcacheServiceFactory.getMemcacheService
> > > ();
> >
> > > ..and then later methods call through to the m_cache field.
> >
> > > Nowhere in my code do I set m_cache to null and am at a loss to
> > > explain unless the getMemcacheService is returning null.  Should I
> > > really need to be checking this? The only response to the user would
> > > be "The Application Is Not Available".
> >
> > > - Martyn
> >
>

--~--~-~--~~~---~--~~
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: Struts 2 on App Engine

2009-08-17 Thread dolsen

I am still trying to figure this out. I have setup my project like on
Struts 2 on App Engine app found on Github but that doesn't work. Has
anyone else seen this error?

On Aug 14, 6:37 pm, dolsen  wrote:
> I am trying to setup Struts with App Engine. However ,when I start up
> the SDK server I get the error shown below. Any ideas on how to get
> past this would be greatly appreciated.
>
> java.lang.Exception: Could not load javax/servlet/http/
> HttpServlet.class
>         at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef
> (ClassFinder.java:745)
>         at com.opensymphony.xwork2.util.finder.ClassFinder.access$400
> (ClassFinder.java:57)
>         at com.opensymphony.xwork2.util.finder.ClassFinder
> $InfoBuildingVisitor.extractSuperInterfaces(ClassFinder.java:790)
>         at com.opensymphony.xwork2.util.finder.ClassFinder
> $InfoBuildingVisitor.visit(ClassFinder.java:777)
>         at org.objectweb.asm.xwork.ClassReader.accept(Unknown Source)
>         at org.objectweb.asm.xwork.ClassReader.accept(Unknown Source)
>         at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef
> (ClassFinder.java:740)
>         at com.opensymphony.xwork2.util.finder.ClassFinder.
> (ClassFinder.java:148)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions
> (PackageBasedActionConfigBuilder.java:295)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs
> (PackageBasedActionConfigBuilder.java:277)
>         at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages
> (ClasspathPackageProvider.java:52)
>         at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer
> (DefaultConfiguration.java:200)
>         at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
> (ConfigurationManager.java:55)
>         at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration
> (Dispatcher.java:360)
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
>         at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher
> (InitOperations.java:69)
>         at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init
> (StrutsPrepareAndExecuteFilter.java:48)
>         at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
> 99)
>         at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
>         at org.mortbay.jetty.servlet.ServletHandler.initialize
> (ServletHandler.java:589)
>         at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
>         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 org.mortbay.jetty.handler.HandlerWrapper.doStart
> (HandlerWrapper.java:117)
>         at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
>         at org.mortbay.jetty.handler.HandlerWrapper.doStart
> (HandlerWrapper.java:117)
>         at org.mortbay.jetty.Server.doStart(Server.java:217)
>         at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
>         at
> com.google.appengine.tools.development.JettyContainerService.startContainer
> (JettyContainerService.java:152)
>         at
> com.google.appengine.tools.development.AbstractContainerService.startup
> (AbstractContainerService.java:116)
>         at com.google.appengine.tools.development.DevAppServerImpl.start
> (DevAppServerImpl.java:218)
>         at com.google.appengine.tools.development.DevAppServerMain
> $StartAction.apply(DevAppServerMain.java:162)
>         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
> (Parser.java:48)
>         at com.google.appengine.tools.development.DevAppServerMain.
> (DevAppServerMain.java:113)
>         at com.google.appengine.tools.development.DevAppServerMain.main
> (DevAppServerMain.java:89)
--~--~-~--~~~---~--~~
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: The import com.google.appengine cannot be resolved

2009-08-17 Thread Rajeev Dayal
Hi Geeth,
You cannot use App Engine classes on the client-side (GWT) of your code. You
can only use them on the server side. Also, you cannot use the App Engine
data types over RPC. You'll have to convert them to a GWT-compatible DTO,
and then send them over the wire.


Rajeev

On Fri, Aug 14, 2009 at 8:54 AM, Geeth  wrote:

>
> Hrishi,
>
> Thanks for you reply. That was a typo in my post. I am using the
> google plugin for Eclipse Galileo.
>
> Please let me know if you have any other thoughts.
>
> Thanks.
> Geeth
>
> On Aug 13, 9:16 am, Hrishi  wrote:
> > http://dl.google.com/eclipse/plugin/3.5
> >
> > You haven't installed the Google app engine plug-in for eclipse.
> >
> > GWT is a different plug-in. You don't need that for App engine.
> >
> > On Aug 13, 9:12 am, Geeth  wrote:
> >
> > > I am using GWT Eclipse Plugin and trying to create a war for Google
> > > App Engine. I am importingcom.google.appengine.api.users.User to
> > > store the user information. I am using JDO persistance.
> >
> > > I am getting the following error during GWT compilation:
> >
> > > Theimportcom.google.appenginecannot be resolved
> > > User cannot be resolved to a type
> >
> > > I did some searching and couldn't find anyone else facing this issue.
> > > Please help as I have hit a wall on this.
> >
> > > Here is my class
> >
> > >importjava.io.Serializable;
> > >importjava.util.Date;
> >
> > >importjavax.jdo.annotations.IdGeneratorStrategy;
> > >importjavax.jdo.annotations.IdentityType;
> > >importjavax.jdo.annotations.PersistenceCapable;
> > >importjavax.jdo.annotations.Persistent;
> > >importjavax.jdo.annotations.PrimaryKey;
> >
> > >importcom.google.appengine.api.users.User;
> >
> > > /**
> > >  * @author Geeth.Narayanan
> > >  *
> > >  */
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > public class Comment implements Serializable {
> >
> > >@PrimaryKey
> > >@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >Long id;
> > >@Persistent
> > >private User user;
> > >@Persistent
> > >private String title;
> > >@Persistent
> > >private String description;
> > >@Persistent
> > >private Date createDate;
> >
> > >public Comment() {
> > >}
> >
> > >public Comment(User user, String title, String description) {
> > >this.createDate = new Date();
> > >this.user = user;
> > >this.title = title;
> > >this.description = description;
> > >}
> >
> > >public Long getId() {
> > >return this.id;
> > >}
> >
> > > public User getUser() {
> > > return this.user;
> > > }
> >
> > >public Date getCreateDate() {
> > >return this.createDate;
> > >}
> >
> > > public void setUser(User user) {
> > > this.user = user;
> > > }
> >
> > >/**
> > > * @return the title
> > > */
> > >public String getTitle() {
> > >return title;
> > >}
> >
> > >/**
> > > * @param title
> > > *the title to set
> > > */
> > >public void setTitle(String title) {
> > >this.title = title;
> > >}
> >
> > >/**
> > > * @return the description
> > > */
> > >public String getDescription() {
> > >return description;
> > >}
> >
> > >/**
> > > * @param description
> > > *the description to set
> > > */
> > >public void setDescription(String description) {
> > >this.description = description;
> > >}
> >
> > > }
> >
>

--~--~-~--~~~---~--~~
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: Updating to Eclipse Galileo issues/problems

2009-08-17 Thread Rajeev Dayal
Hi Pion,
I'm glad that everything seems to be working now. Just to be clear, your
Java build path should have a Classpath Container called "App Engine SDK".
None of the entries within that container should point to the libraries in
your war/WEB-INF/lib folder.

Whenever the SDK jars are not in sync with the jars in your war/WEB-INF/lib
folder, you should see a warning message. If you select that message and hit
CTRL-1, that will give you the option to "fix" the problem by syncing up the
jars - i.e. copying them to your war/WEB-INF/lib folder.


Thanks,
Rajeev

On Wed, Aug 12, 2009 at 7:49 PM, Pion  wrote:

>
> I am using Eclipse. My "Java Build Path" points the external jars to a
> folder (not war/WEB-INF/lib. Per your question below, I did the
> following:
>
> 1. Copy the external jar files manually to the war\WEB-INF\lib
> 2. Set my "Java Build Path Libraries" to point to the jar files
> located in war\WEB-INF\lib.
>
> The above steps have solved the problem. The errors go away now!
>
> Thanks all for your help!
>
> On Aug 12, 6:50 am, Miguel Méndez  wrote:
> > Now that the file is in war/WEB-INF/lib, does the classpath entry point
> to
> > the one in war/WEB-INF/lib or does it point to the original location?
> > Also, is there not warning on project with a quick fix?
> >
> >
> >
> > On Tue, Aug 11, 2009 at 5:25 PM, Pion  wrote:
> >
> > > I have just copied (manually) the file to war/WEB-INF/lib. But the
> > > error message is still there.
> >
> > > On Aug 10, 7:02 am, Jason Parekh  wrote:
> > > > Oh, that could be your problem.  If you don't copy the JAR into
> > > > war/WEB-INF/lib, it may not get bundled in your war file and hence
> will
> > > be
> > > > unavailable to the app server.
> > > > jason
> >
> > > > On Sat, Aug 8, 2009 at 12:38 PM, Pion  wrote:
> >
> > > > > No, I did not manually copy commons-fileupload-1.2.1-javadoc.jar to
> > > > > the war/WEB-INF/lib directory . I just added the commons-
> > > > > fileupload-1.2.1-javadoc.jar using "Project Properties -> Java
> Build
> > > > > Path -> Libraries -> Add External JARS".
> > > > > Then, I got the classpath entry error.
> >
> > > > > On Aug 8, 9:16 am, Jason Parekh  wrote:
> > > > > > Hmm, are you placing that JAR in war/WEB-INF/lib?
> > > > > > jason
> >
> > > > > > On Sat, Aug 8, 2009 at 11:48 AM, Pion 
> wrote:
> >
> > > > > > > > > Per your suggestion below, I created a default new project
> > > > > > > > > (GreetingService sample) using Galileo. It ran fine without
> any
> > > > > error
> > > > > > > > > and the Galileo "Markers" tab does not show any error.
> >
> > > > > > > I just added external jar commons-fileupload-1.2.1-javadoc.jar
> to
> > > this
> > > > > > > GreetingService sample. It does produce the error "2. Google
> Web
> > > App
> > > > > > > Problem -- The following classpath entry 'D:\download\commons-
> > > > > > > fileupload-1.2.1\lib\commons-fileupload-1.2.1-javadoc.jar' will
> not
> > > be
> > > > > > > available on the server's classpath ".
> >
> > > > > > > On Aug 8, 8:20 am, Pion  wrote:
> > > > > > > > One more thing ... I did clean the project. The errors still
> show
> > > up.
> >
> > > > > > > > On Aug 8, 8:17 am, Pion  wrote:
> >
> > > > > > > > > Thanks for looking into this problem.
> >
> > > > > > > > > Yes, the Galileo " Project Properties -> Java Build Path ->
> > > > > Libraries"
> > > > > > > > > shows the JRE, App Engine SDK 1.2.2, GWT SDK 1.7.0 and some
> my
> > > > > > > > > external jars (for example,
> > > commons-fileupload-1.2.1-javadoc.jar).
> >
> > > > > > > > > I did the following this morning:
> >
> > > > > > > > > 1. Installed Galileo (
> > > > >http://www.eclipse.org/downloads/download.php?
> >
> > > > >
> file=/technology/epp/downloads/release/galileo/R/eclipse-jee-galileo-
> > > > > > > > > win32.zip) from scratch.
> > > > > > > > > 2. Followed "Google Plugin for Eclipse 3.5 (Galileo)
> > > Installation
> > > > > > > > > Instructions"
> > > > > > >http://code.google.com/eclipse/docs/install-eclipse-3.5.html
> > > > > > > > > 3. Imported my previous project/app created by Eclipse 3.4
> > > > > (Ganymede)
> > > > > > > > > -http://dl.google.com/eclipse/plugin/3.4.
> >
> > > > > > > > > Per your suggestion below, I created a default new project
> > > > > > > > > (GreetingService sample) using Galileo. It ran fine without
> any
> > > > > error
> > > > > > > > > and the Galileo "Markers" tab does not show any error.
> >
> > > > > > > > > I notice a few differences between Eclipse Galileo and
> > > Ganymede:
> > > > > > > > > 1. Galileo seems to be more strict. It gave more
> > > warnings/problems.
> > > > > > > > > 2. Galileo calls both "warnings and problems" as "problems.
> > > > > Ganymede
> > > > > > > > > differentiates them.
> > > > > > > > > 3. Galileo puts the "External Jars" files under the project
> > > > > directory
> > > > > > > > > directly. Ganymede does create "External Jars" folder and
> store
> > > the
> > > > > > > > > external jars in that folder.
> >
> > > > > > > > > Plea

[appengine-java] Re: JDO fetch groups does not work with GAE

2009-08-17 Thread datanucleus

> It worked also. Just one point. I get the DataNucleus logs in a
> foreign language. My PC is Windows Vista, language Spanish-Mexico. I
> suspect DataNucleus is guessing the language from JRE.

Actually uses the Locale.getDefault() value at initialisation, so
since the PC is in "es" then you get "es" :-)
Y si no quieras español, ¿porque tener el PC así? jeje.

> How tweak my environment to get english logs from DataNucleus?

Change your default JRE Locale to be "en" is the only way.
Not possible dynamically in DataNucleus 1.x; only in 2.0

--Andy (DataNucleus)
--~--~-~--~~~---~--~~
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] Unit Test Data Persistence: Is there two Datastore instances in the test enviroment?

2009-08-17 Thread - Ray
Is there two Datastore instances in the test enviroment?

i am using GWT 1.7, Google Plugin 1.2.2 und Eclipse Galileo. the same Issue
exists in GWT 1.6, Google Plugin 1.2.1 und Eclipse 3.4.

recently i have got a problem like below:

My example is simple:
1.  Create an object and save it,  then use Service to update its value.
2. load it using pm with id direct from Datastore. the Changes doesn't take
effect.
3.  but when i load it using service to retrieve it from datastore, the
Changes take effect.

WorkitemService uses JDO to save the Object of Workitem and update the
Object of Workitem.
Workitem is a class simply saves data.

source code below demonstrate the Problem i got:

private WorkitemServiceImpl wsi = new WorkitemServiceImpl();
PersistenceManager pm = PMF.get().getPersistenceManager();

public void testUpdate() {

try {

Date date = new Date();
Date date1 = new Date();
Long user_id = 1L;
 Workitem wi1 = new Workitem("test", 1, "tag", date, user_id);
 pm.makePersistent(wi1);
 Workitem wi2 = pm.detachCopy(wi1);
wi2.setDescription("test1");
 wi2.setTagString("tag1 tag2");
wi2.setDuration(2);
wi2.setDate(date1);
 wsi.update(wi2);
ArrayList workitems = wsi.loadWorkitems(user_id);
 Workitem wi3 = workitems.get(0);
 assertEquals(wi2.getId(), wi3.getId());
assertEquals("test1", wi3.getDescription());
 assertEquals(2, wi3.getDuration());
assertEquals("tag1 tag2", wi3.getTagString());
 assertEquals(date1, wi3.getDate());
} catch (Exception e) {
 System.out.println(e.toString());
 assertTrue(false);
} finally {
  pm.close();
}
}

the test passes. wenn i change the way of fetching the updated Object in the
test case like below, the test can not pass any more.

public void testUpdate() {

try {

Date date = new Date();
Date date1 = new Date();
Long user_id = 1L;
  Workitem wi1 = new Workitem("test", 1, "tag", date, user_id);
  pm.makePersistent(wi1);
 Workitem wi2 = pm.detachCopy(wi1);
 wi2.setDescription("test1");
wi2.setTagString("tag1 tag2");
 wi2.setDuration(2);
wi2.setDate(date1);
wsi.update(wi2);
 Workitem wi3 = pm.getObjectById(Workitem.class, wi2.getId());
assertEquals(wi2.getId(), wi3.getId());
 assertEquals("test1", wi3.getDescription());
assertEquals(2, wi3.getDuration());
 assertEquals("tag1 tag2", wi3.getTagString());
assertEquals(date1, wi3.getDate());
 } catch (Exception e) {
 System.out.println(e.toString());
  assertTrue(false);
} finally {
   pm.close();
}
}

i did have do what Jason has said:

change

public String getRequestNamespace() {  return "gmail.com";
}

topublic String getRequestNamespace() {
  return "";
}



it doesn't work for me.

so my question is: is there two different Datastore instances in the test
enviroment for GAE? or have i done something wrong?

thanks in advance.

ray

--~--~-~--~~~---~--~~
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] JPA question - Parent Child relationship

2009-08-17 Thread Partha

What is the meaning of this message? I get this error while updating
Parent

Attempt was made to manually set the id component of a Key primary
key.  If you want to control the value of the primary key, set the
name component instead.

@Entity
public class Tenant {

@Version()
private Long version;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long tenantId;

@OneToOne(cascade=CascadeType.ALL)
private Contact contact;
...
}


@Entity
public class Contact {

@Version
private Long version;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key contactId;
.
}
--~--~-~--~~~---~--~~
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: JDO fetch groups does not work with GAE

2009-08-17 Thread SammyBar

> @FetchGroup(name="myGroup", member...@persistent(name="points")})
Yes, it works! Thanks a lot. I can live with this solution.

> In your  logging.properties file, change the level from WARNING ( to
> FINEST to see everything).
It worked also. Just one point. I get the DataNucleus logs in a
foreign language. My PC is Windows Vista, language Spanish-Mexico. I
suspect DataNucleus is guessing the language from JRE. Then I changed
the language of non-unicode apps to English-USA, as suggested
somewhere, but nothing changed. How tweak my environment to get
english logs from DataNucleus?

--~--~-~--~~~---~--~~
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: Dataviewer not show an entity

2009-08-17 Thread Heru Martinus Salim
Hi Jason,

it contained several fields before (name, address, etc).
At first, the list was not inside the entity A. Dataviewer showed the entity
A.
After that, I add that list of another Entity (say it entity B). The
dataviewer still showed entity A. While entity A contains a single instance
of entity B, adding list of B caused error on saving (as I understood, an
entity cannot contains more than one field of another entity). Therefore I
removed the list of entity B (I'm going to separate it in a new entity using
'foreign key' in entity A).
After I removed the list of entity B, entity A is not shown in data viewer
anymore.

Yes I meant seeing that in Admin Console.

My application id is rumah-makan, and the entity name is Restaurant.
Below I posted the snippet of the entity.

Best regards,
Heru


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

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

@Persistent
private String name;

@Persistent
private String address;

@Persistent
private String telephone;

   // Image is the entity B
@Persistent
private Image picture;

   // This is the field I removed
   //@Persistent
   //private List imageList
}


2009/8/14 Jason (Google) 

> The ID is not an indexed property, per se. So if the list was the only
> other property and you subsequently removed it, that would explain your
> issue. If not, then there's another issue. Can you reply with your updated
> model definition and your application ID? I assume that you're seeing this
> in the Admin Console and not your local data viewer?
> - Jason
>
> On Thu, Aug 13, 2009 at 4:28 AM, Heru Martinus Salim <
> heru.sa...@googlemail.com> wrote:
>
>> Hi Nick,
>>
>> thanks for your reply.
>> It was there before. So from my understanding. There are indexed fields.
>> And the field I removed was a list another entity.
>> So i think, it would not removed the indexed fields (at list the Id should
>> be indexed I guess).
>>
>> Regards,
>> Heru
>>
>> 2009/8/13 Nick Johnson (Google) 
>>
>>>
>>> Hi Heru,
>>>
>>> It's a known bug that if an entity has no indexed fields, it will not
>>> show up in the Admin Console data viewer.
>>>
>>> -Nick Johnson
>>>
>>> On Thu, Aug 13, 2009 at 11:51 AM, Heru Martinus
>>> Salim wrote:
>>> > Hi all,
>>> >
>>> > I have a problem, that after updating the structure of my entity
>>> (removing a
>>> > field), I cannot see my entity anymore in the DataViewer of the apps
>>> > Dashboard.
>>> > Though as I tried to add a new data via my app, the data is there, and
>>> can
>>> > be retrieved.
>>> > Still the entity cannot be found in the dataviewer. Even when I use the
>>> GQL
>>> > to retrieve it using "select * from" syntax, it showed only "No
>>> Results"
>>> >
>>> > Has anyone experienced the same case?
>>> >
>>> > Regards,
>>> > Heru
>>> >
>>> > >
>>> >
>>>
>>>
>>>
>>> --
>>> Nick Johnson, Developer Programs Engineer, App Engine
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Problem with unowned relationships.

2009-08-17 Thread zhiqiang huang
Good idea...but where is the log? I'm using development server running on
localhost.

On Mon, Aug 17, 2009 at 6:31 PM, datanucleus wrote:

>
> Why not just look at the log (DEBUG level) since it tells you what
> fields are loaded in what object and what the object states are.
> >
>


-- 
Huang Zhiqiang
Computer Science College
Zhejiang University

--~--~-~--~~~---~--~~
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: Problem with unowned relationships.

2009-08-17 Thread datanucleus

Why not just look at the log (DEBUG level) since it tells you what
fields are loaded in what object and what the object states are.
--~--~-~--~~~---~--~~
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: Problem with unowned relationships.

2009-08-17 Thread zhiqiang huang
Thank you. But I can't understand the meaning of the sample program.  I do
know about "lazy" load problem and maybe I need to construct more than 1000
entries to do a test.

On Mon, Aug 17, 2009 at 5:14 PM, leszek  wrote:

>
> May be you are experiencing some "lazy" load problem.
>
> Try simply something like:
>
> List  tempList = temp.getModels();
> tempList.add(model).
>
> It worked for me, but I'm guessing only,
>
>
> >
>


-- 
Huang Zhiqiang
Computer Science College
Zhejiang University

--~--~-~--~~~---~--~~
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 understand "a query will never return more than 1000 enties"

2009-08-17 Thread hzqtc

Hi,

I'm new to app engine and I have a question when I come to this
sentence:"a query will never return more than 1000 enties". If I
execute a query and store the return result in a List, but I don't
detach them, i.e., keep them in the persitent manager. And the entries
in that List is beyond 1000, would it be possible?

For example:

public void updateIndex(int from, int value)
{
PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Article.class);
query.setFilter(String.format("index >= %d", from));
try
{
List articles = (List)query.execute();
for(Article article: articles)
{
article.setIndex(article.getIndex() + value);
pm.makePersistent(article);
}
}
finally
{
query.closeAll();
pm.close();
}
}

If the query returns 2000 entries, will it work or not? If not, would
you please recommend me a alternative way?
Thank you very much.
--~--~-~--~~~---~--~~
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: Problem with unowned relationships.

2009-08-17 Thread leszek

May be you are experiencing some "lazy" load problem.

Try simply something like:

List  tempList = temp.getModels();
tempList.add(model).

It worked for me, but I'm guessing only,


--~--~-~--~~~---~--~~
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: Problem with unowned relationships.

2009-08-17 Thread Cioccas

Hi Jason,

many thanks for the response. Yes, I'm querying for an object and then
trying to add an option to it. I should have been clearer about that.
The code is basically:

Make temp = pm.getObjectById(Make.class, makeKey);
temp.getModels().add(model);
temp.getOptions().add(optionKey);
pm.makePersistent(temp);

In the above, optionKey is an Encoded String version of the option's
key.

Even with defaultFetchGroup = "true" as you suggested, the
"temp.getOptions().add(optionKey)" line will return a null pointer
exception as getOptions is returning null.

Many thanks in advance,
Dominic.

On Aug 14, 7:59 pm, "Jason (Google)"  wrote:
> Hi Dominic. I assume that you're querying for an object and then trying to
> add an option to it, but the datastore returns a null options field, even
> when there are options persisted.
> Can you try adding the List to the defaultFetchGroup using the following and
> see if that helps:
>
> @Persistent(defaultFetchGroup = "true")
> private List options;
>
> - Jason
>
> On Thu, Aug 13, 2009 at 3:08 PM, Cioccas wrote:
>
>
>
> > Hi all,
>
> > I'm having a problem with unowned collection. In my fictitious example
> > I have a Make, Model and Option.
>
> > A Make can have many Models (owned relationship) but an Option can
> > belong to either a Make or a Model (hence unowned). I'm using an
> > encoded String as a key (as I need to serialise these objects). I alve
> > also tried Long keys without success.
>
> > So, the class definitions look similar to below:
>
> > Make
> > 
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Make implements Serializable
> > {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   �...@extension(vendorName="datanucleus", key="gae.encoded-pk",
> > value="true")
> >    private String              key;
>
> >   �...@persistent
> >    private String              name;
> >   �...@persistent
> >    private String              description;
> >   �...@persistent
> >    private List         models;
> >   �...@persistent
> >    private List        options;
>
> > Option
> > =
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Option implements Serializable, KeyedObject
> > {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   �...@extension(vendorName="datanucleus", key="gae.encoded-pk",
> > value="true")
> >    private String                              key;
>
> >   �...@persistent
> >    private String      name;
> >   �...@persistent
> >    private String      description;
>
> > Now, the problem is that when I want to add a Make to a Model (owned
> > relationship) I can do the following:
>
> > make.getModels().add(model);
>
> > But I the issue is that I _can't_ to the following:
>
> > make.getOptions.add(option.getKey());
>
> > ... as getOptions() will always return null.
>
> > According to the documentation at:
>
> >http://code.google.com/appengine/docs/java/datastore/relationships.ht...
>
> > this is exactly how I should set up an unowned relationship: i.e. one
> > object should contain a set of "keys" for the relationships with the
> > unowned objects ("options" here). The problem is really, how to add
> > keys to these key collections as they are always null?
>
> > Regards,
> > Dominic.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---