[appengine-java] Re: Persistence problem of an entity with two List of the same type

2009-09-21 Thread elDoudou

Thank you Maciej for your answer.

But I think that my problem is not related to any empty field. The
problem of storage arises as soon as you define twice a persistent
field which is a list of the same type, as I explained earlier. The
only work-around I found is to duplicate the listed persistent class
(B), and have a "List list1" and a "List list2" (B' and B''
being copy-classes of B): but since, you cannot properly persist
derived classes from persistent ones, I need to duplicate the code,
which is a shame! If someone by Google can explain this restriction,
this would help us a lot, and prevent from duplicating persistent
classes...

Thank you for your help. Regards,
Édouard
--~--~-~--~~~---~--~~
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: when will BigDecimal be supported in datastore?

2009-09-21 Thread Philippe Marschall



On 20 Sep., 18:56, ted stockwell  wrote:
> On Sep 20, 7:16 am, Philippe Marschall 
> wrote:
>
>
>
> > BigDecimal is the only sane choice for anything that includes monetary
> > calculations.
>
> True, but just because a number is saved as a long doesn't mean you
> can't do calculations using BigDecimal.
> I think the CPU cycles it takes to convert a long to a BigDecimal is
> trivial.

But long is crappy abstraction. Sometimes you need two decimal places,
sometimes three, sometimes six, sometimes "as many as there are".
That's all quite cumbersome to do with a long alone. String seems like
the easier way to go.

Cheers
Philippe
--~--~-~--~~~---~--~~
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: Storing GWT-RPC objects to BigTable

2009-09-21 Thread Max

When I declare fields as @Persistent it stops to work in GWT.

On Sep 21, 1:40 am, Romain  wrote:
> As long as your Entities are in the client.* folder they can be seen
> as JDO objects as well as in GWT as POJOs
>
> On Sep 20, 5:07 pm, Max  wrote:
>
> > It is possible to use same class with GWT-RPC and and in app engine
> > (JDO bigtable)?
>
> > or I have to define 2 similar classes. One for GWT and other for JDO
> > and write code to that will copy data from one object to another?
>
> > Is there some way to automate it?
>
> > Thanks, Max
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Restricted classes

2009-09-21 Thread gooru

Hi -

I was using iText PDF generation library and found out that when I
deploy it to the AppEngine I am getting exceptions because the
classes:

java.awt.Color and java.awt.color.ICC_Profile are restricted.

Would it be possible to add those to the white list?
It does not seem like those represent any danger.

Thanks,
Alex
--~--~-~--~~~---~--~~
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: Restricted classes

2009-09-21 Thread 小乐

iText
Version(s): ?
Status: INCOMPATIBLE

iText relies on several classes not in the JRE class whitelist
including java.awt.Color and java.nio.MappedByteBuffer. A bug has been
filed at 
http://sourceforge.net/tracker/?func=detail&atid=365255&aid=2810312&group_id=15255.

See:http://groups.google.com/group/google-appengine-java/web/will-it-
play-in-app-engine?hl=en

--~--~-~--~~~---~--~~
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: Restricted classes

2009-09-21 Thread leszek

It is known issue :

http://code.google.com/p/googleappengine/issues/list?can=2&q=awt&colspec=ID+Type+Status+Priority+Stars+Owner+Summary+Log+Component&cells=tiles
--~--~-~--~~~---~--~~
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] DatastoreTimeoutException on all the accesses

2009-09-21 Thread kaz

Hi,

My app is seeing DatastoreTimeoutException on all of its queries for
last 1 hour. Redeployment did not work. And it seems it is an app-wide
phenomenon since my other apps are working properly. Can you please
check? I'll let you know my app id directly.

Caused by:
com.google.appengine.api.datastore.DatastoreTimeoutException: Unknown
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError
(DatastoreApiHelper.java:38)
at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
(DatastoreApiHelper.java:56)

Thanks,

Kaz
--~--~-~--~~~---~--~~
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: Storing GWT-RPC objects to BigTable

2009-09-21 Thread leszek

Yes, the second solution (TO - transient objects) means code
duplicating but seems more realistic. You can share the same code
between GWT (client) and server (Google App Engine). If you have few
classes no problem to call set and get several times. Of course, if
you have more classes and more attribs than you can automate it by
using reflection.
--~--~-~--~~~---~--~~
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: DatastoreTimeoutException on all the accesses

2009-09-21 Thread Max Ross
Your app is most likely impacted by the elevated datastore latency and error
rate we're currently experiencing:

http://code.google.com/status/appengine

We'll update the status site when we have more information.

Thanks, and sorry for the trouble.

Max

On Mon, Sep 21, 2009 at 2:43 AM, kaz  wrote:

>
> Hi,
>
> My app is seeing DatastoreTimeoutException on all of its queries for
> last 1 hour. Redeployment did not work. And it seems it is an app-wide
> phenomenon since my other apps are working properly. Can you please
> check? I'll let you know my app id directly.
>
> Caused by:
> com.google.appengine.api.datastore.DatastoreTimeoutException: Unknown
>at
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError
> (DatastoreApiHelper.java:38)
>at
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
> (DatastoreApiHelper.java:56)
>
> Thanks,
>
> Kaz
> >
>

--~--~-~--~~~---~--~~
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: DatastoreTimeoutException on all the accesses

2009-09-21 Thread kaz

Hi Max,

OK, thanks so much for the quick response.

Kaz

On 9月21日, 午後6:58, Max Ross  wrote:
> Your app is most likely impacted by the elevated datastore latency and error
> rate we're currently experiencing:
>
> http://code.google.com/status/appengine
>
> We'll update the status site when we have more information.
>
> Thanks, and sorry for the trouble.
>
> Max
>
> On Mon, Sep 21, 2009 at 2:43 AM, kaz  wrote:
>
> > Hi,
>
> > My app is seeing DatastoreTimeoutException on all of its queries for
> > last 1 hour. Redeployment did not work. And it seems it is an app-wide
> > phenomenon since my other apps are working properly. Can you please
> > check? I'll let you know my app id directly.
>
> > Caused by:
> > com.google.appengine.api.datastore.DatastoreTimeoutException: Unknown
> >        at
> > com.google.appengine.api.datastore.DatastoreApiHelper.translateError
> > (DatastoreApiHelper.java:38)
> >        at
> > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
> > (DatastoreApiHelper.java:56)
>
> > Thanks,
>
> > Kaz
--~--~-~--~~~---~--~~
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: DatastoreTimeoutException on all the accesses

2009-09-21 Thread kaz

Now it seems the Datastore service is running properly. Thanks for the
quick response!

Thanks,

Kaz

On 9月21日, 午後6:58, Max Ross  wrote:
> Your app is most likely impacted by the elevated datastore latency and error
> rate we're currently experiencing:
>
> http://code.google.com/status/appengine
>
> We'll update the status site when we have more information.
>
> Thanks, and sorry for the trouble.
>
> Max
>
> On Mon, Sep 21, 2009 at 2:43 AM, kaz  wrote:
>
> > Hi,
>
> > My app is seeing DatastoreTimeoutException on all of its queries for
> > last 1 hour. Redeployment did not work. And it seems it is an app-wide
> > phenomenon since my other apps are working properly. Can you please
> > check? I'll let you know my app id directly.
>
> > Caused by:
> > com.google.appengine.api.datastore.DatastoreTimeoutException: Unknown
> >        at
> > com.google.appengine.api.datastore.DatastoreApiHelper.translateError
> > (DatastoreApiHelper.java:38)
> >        at
> > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
> > (DatastoreApiHelper.java:56)
>
> > Thanks,
>
> > Kaz
--~--~-~--~~~---~--~~
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 - User Defined Types

2009-09-21 Thread sud...@jsptube.com

Is it possible to create custom user defined types as explained in
this article
http://www.datanucleus.org/extensions/rdbms_java_types.html

I need to create custom types like Gender, Height Income etc...

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



[appengine-java] How to upload data into the app engine?

2009-09-21 Thread Pasin

If I have some static data that I would like to populate into the data
storage (for query), what is the best way to do this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Storing GWT-RPC objects to BigTable

2009-09-21 Thread Max

Thank You!

I thought I missed something and there is some framework from google
that has to be used here.

On Sep 21, 12:49 pm, leszek  wrote:
> Yes, the second solution (TO - transient objects) means code
> duplicating but seems more realistic. You can share the same code
> between GWT (client) and server (Google App Engine). If you have few
> classes no problem to call set and get several times. Of course, if
> you have more classes and more attribs than you can automate it by
> using reflection.
--~--~-~--~~~---~--~~
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] DataStoreTimeOutException when using session at production mode

2009-09-21 Thread doc123

Hi
I got DatastoreTimeoutException when I using HttpSession at production
mode.  This code does not create error at local development
environment.

Purpose to use session is cashing userID(google e-mail string ) when
user  login at first time. So I created Session_User class which have
SeesionID, UserID, and UserNickName propaty and store this instance to
memcashe(Key:SessionID. Value Session Instance) and use memcash to
identify user when they access server 2nd time.

I am not using HttpSession.setAttribute method because I can use
Google userService.getCurrentUser() method when cashed data is
expired.

It is written that when we add true to appengine-web.xml  then GoogleSDK automatically creates
datastore entities of the kind _ah_SESSION but I could not find
_ah_SESSION class in my source code.

So Is this the reason for this DatastoreTimeoutException?
And if so what  should I do to make GoogleSDK creates datastore
entities _ah_SESSION?


<<>
A server error has occurred.
Uncaught exception from servlet
com.google.appengine.api.datastore.DatastoreTimeoutException: Unknown
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError
(DatastoreApiHelper.java:38)
at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
(DatastoreApiHelper.java:56)
at com.google.appengine.api.datastore.DatastoreServiceImpl$2.run
(DatastoreServiceImpl.java:170)
at
com.google.appengine.api.datastore.TransactionRunner.runInTransaction
(TransactionRunner.java:30)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:158)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:138)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:130)
at com.google.apphosting.runtime.jetty.SessionManager.createSession
(SessionManager.java:333)
at com.google.apphosting.runtime.jetty.SessionManager
$AppEngineSession.(SessionManager.java:135)
at com.google.apphosting.runtime.jetty.SessionManager.newSession
(SessionManager.java:265)
at com.google.apphosting.runtime.jetty.SessionManager.newSession
(SessionManager.java:50)
at org.mortbay.jetty.servlet.AbstractSessionManager.newHttpSession
(AbstractSessionManager.java:413)
at org.mortbay.jetty.Request.getSession(Request.java:1005)
at askerDB.S_GoogleLogin.doPost(S_GoogleLogin.java:57)
at askerDB.S_GoogleLogin.doGet(S_GoogleLogin.java:102)
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.runtime.jetty.SaveSessionFilter.doFilter
(SaveSessionFilter.java:35)
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.serviceRequest
(JettyServletEngineAdapter.java:139)
at com.google.apphosting.runtime.JavaRuntime.handleRequest
(JavaRuntime.java:235)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:4950)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:4948)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
359)
at com.google.net.rpc.im

[appengine-java] How to get eclipse with google app engine plugin to copy jars to /war/WEB-INF/lib

2009-09-21 Thread brendan

I've just spent a couple hours tracking down an issue.  It turns out
that i was missing gin.jar and junit.jar from my /war/WEB-INF/lib
directory.

Using eclipse I have specified a number of "User Libraries", and have
added those to the Libraries section of the Java Build path in my
project properties.

It would be handy if the jars specified in the User Libraries section
were copied over to /war/WEB-INF/lib automatically.  Otherwise I worry
what happens when I update the central location where the jars are
stored, but forget to copy some of them over to /war/WEB-INF/lib.

Thanks,
Brendan
--~--~-~--~~~---~--~~
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: DataStoreTimeOutException when using session at production mode

2009-09-21 Thread doc

PS appengine-web.wxl


http://appengine.google.com/ns/1.0";>


chainofasker
1

true



























--~--~-~--~~~---~--~~
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: Query a collection of entities with their IDs

2009-09-21 Thread Zou Zhi Le

Max, thanks, this works pretty well for me :-)

On Sep 9, 3:14 am, Max Ross  wrote:
> You can do the equivalent of a low level batch get with jdoql:
>
> Query q = pm.newQuery("select from " + Flight.class.getName() + " where
> id == :ids");
> @SuppressWarnings("unchecked")
> List flights = (List) q.execute(listOfKeys);
>
> Hope this helps,
> Max
>
> 2009/9/6 Zhi Le Zou 
>
>
>
> > Hi,
> > I have a class Foo defined as below:
>
> >   public class Foo{
>
> >   @PrimaryKey
> >   @Persistent(valueStrategy=
> > IdGeneratorStrategy.IDENTITY)
> >   private String fooID;
>
> >...
>
> >   }
>
> > Now, I have a list of IDs of the Foo entities, is it possible to retrieve
> > the corresponding collection of Foo entities in a single query? I found the
> > in the documentation, it says logic "or" and "IN" are not supported in the
> > java version app engine sdk, although it is supported in the python version.
>
> > Thanks in advance :-)
>
> > --
> > Best Regards
> > Robin (邹志乐)
--~--~-~--~~~---~--~~
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 eclipse with google app engine plugin to copy jars to /war/WEB-INF/lib

2009-09-21 Thread Nicolas Melendez
hi, what i do,  is to copy all jars i use to /war/WEB-INF/lib (except those
for Junit testing) and then my user libraries reference them.
NM

On Mon, Sep 21, 2009 at 2:12 PM, brendan  wrote:

>
> I've just spent a couple hours tracking down an issue.  It turns out
> that i was missing gin.jar and junit.jar from my /war/WEB-INF/lib
> directory.
>
> Using eclipse I have specified a number of "User Libraries", and have
> added those to the Libraries section of the Java Build path in my
> project properties.
>
> It would be handy if the jars specified in the User Libraries section
> were copied over to /war/WEB-INF/lib automatically.  Otherwise I worry
> what happens when I update the central location where the jars are
> stored, but forget to copy some of them over to /war/WEB-INF/lib.
>
> Thanks,
> Brendan
> >
>

--~--~-~--~~~---~--~~
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: Persistence problem of an entity with two List of the same type

2009-09-21 Thread Nicolas Melendez
Hi, i think your problem is here:
@Persistent
 private List list1 =  new ArrayList();


you use a List, but you assing an ArrayList. That because the datastore
makes different structures for different types of collection.
To fix that,  your code should be:

@Persistent
 private ArrayList  list1 =  new ArrayList();

Tell me if that solves your problem, bye!
NM





On Mon, Sep 21, 2009 at 9:41 AM, elDoudou wrote:

>
> Thank you Maciej for your answer.
>
> But I think that my problem is not related to any empty field. The
> problem of storage arises as soon as you define twice a persistent
> field which is a list of the same type, as I explained earlier. The
> only work-around I found is to duplicate the listed persistent class
> (B), and have a "List list1" and a "List list2" (B' and B''
> being copy-classes of B): but since, you cannot properly persist
> derived classes from persistent ones, I need to duplicate the code,
> which is a shame! If someone by Google can explain this restriction,
> this would help us a lot, and prevent from duplicating persistent
> classes...
>
> Thank you for your help. Regards,
> Édouard
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [gae] [appengine-java] How to get eclipse with google app engine plugin to copy jars to /war/WEB-INF/lib

2009-09-21 Thread Allen Firstenberg
This issue was first raised back on April 16th:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/67cb7cdaefc8429f#

At the time, the Google team gave a couple of suggestions, admitted that
some work needed to be done in this area, and said that they were tracking
this internally.  If there has been an update to the issue since - I've
missed it.

On Mon, Sep 21, 2009 at 8:12 AM, brendan  wrote:

>
> I've just spent a couple hours tracking down an issue.  It turns out
> that i was missing gin.jar and junit.jar from my /war/WEB-INF/lib
> directory.
>
> Using eclipse I have specified a number of "User Libraries", and have
> added those to the Libraries section of the Java Build path in my
> project properties.
>
> It would be handy if the jars specified in the User Libraries section
> were copied over to /war/WEB-INF/lib automatically.  Otherwise I worry
> what happens when I update the central location where the jars are
> stored, but forget to copy some of them over to /war/WEB-INF/lib.
>
> Thanks,
> Brendan
> >
>

--~--~-~--~~~---~--~~
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] Type Owned by Two Different Types?

2009-09-21 Thread objectuser

I have a class that's in an owned relationship with two different
classes.  Is this supported?  I get the dreaded
"java.lang.ClassCastException: oid is not instanceof
javax.jdo.identity.ObjectIdentity" when I try to save an instance of
the second relationship.

I have classes setup like this:

class A {
  Long id;
  C c;
}

class B {
  Long id;
  C c;
}

class C {
  Key id;
}

I can save an A that has a C, but when I save a B that has a C I get
that exception.  If I don't save the A, then the B is persisted.
Maybe my transactions are interfering with each other somehow?  I
looked for defects there, but my code seems correct.  If this is not a
known limitation, I'll keep looking.

Thanks for any insight.
--~--~-~--~~~---~--~~
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: JPA - User Defined Types

2009-09-21 Thread || Sudhir Nimavat ||


 Does any one has any idea ? 

  

Sudhir NimavatSenior software engineer. 
Quick start global PVT LTD.
Baroda - 390007
Gujarat, India

Personally I'm always ready to learn, although I do not always like being taught
  





From: "sud...@jsptube.com" 
To: Google App Engine for Java 
Sent: Monday, 21 September, 2009 4:10:18 PM
Subject: [appengine-java] JPA - User Defined Types


Is it possible to create custom user defined types as explained in
this article
http://www.datanucleus.org/extensions/rdbms_java_types.html

I need to create custom types like Gender, Height Income etc...

Thanks


  Keep up with people you care about with Yahoo! India Mail. Learn how. 
http://in.overview.mail.yahoo.com/connectmore
--~--~-~--~~~---~--~~
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] Retrieve of Collection model not working

2009-09-21 Thread Dhamu

// MyModel
String id
List values
List scores;

// get(id)
PersistenceManager pm = ...getPersistenceManager();
try {
return pm.getObjectById(MyModel.class, id);
} finally {
pm.close();
}

// store(obj);
PersistenceManager pm = ...getPersistenceManager();
try {
pm.makePersistent(obj);
} finally {
pm.close();
}


MyModel m = new MyModel();
m.setId("key1");
m.addValue("value1");
m.addScore(100);
store(m);

Datastore (snapshot): I can see the following values in datastore
(thats ok).
key1, [value1], [100]

if I call get("key1") and print the properties, it prints only the id
but values and scores are always null

// I am trying to update like this
MyModel m = get("key1"); // values and scores property are null, only
id has the value.
m.addValue("value2");
m.addScore(200);
store(m); // this always replaces the old row in database.
i.e. now the database has only
key1, [value2], [200]

Why? Please help. I might be doing something 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] JDO vs low level API

2009-09-21 Thread Cornel

Hello!

I would like to bring in discussion a comparison between JDO and the
low level API. Google recommends using the low-level API only to
framework developers, but JDO seems to inflexible to me.

I've been using JDO for a month now and i've come across some nasty
limitations. I will mention a few here:

The datastore itself is very flexible: you can have an entity called
"SimpleObject" with "property1name" and "propery2name" and another
"SimpleObject" with "property1name" and "propery3name"! A low level
API query for entities of kind "SimpleObject" will fetch both. In JDO,
i simply cannot define two objects with the same name "SimpleObject"
and different properties, so i cannot take advantage of this feature
that the datastore offers!

JDO offers "Owned One-to-Many Relationships" by defining a List of
objects that will be persisted as the children of the current object;
also one can manipulate these objects by calls to List methods. But
what if i want to say "list.get(50.000)" ? How is this implemented?
Will it try to bring all 50.000 entities in memory (and fail?!), or
will it bring only the 50.000th one? In the latter case, how does it
"count" to 50.000, because the low level API doesn't offer support for
"limit 1 offset 49.999" (it's above the 1000 limit)

Or let's say i need to get the child from that list, that satisfies a
certain condition: "get the 5th child that has propertyX='y' "; in
pseudo-code something like this: list.get('propertyx', OP_EQUALS, 'y',
5). There is no such thing obviously; i should use a query instead:
"select * from SimpleObjectChild where propertyX = 'y' and ancestor is
_simpleobjectkey_" which is fine. My question is: since i need to use
queries for more complicated issues, why bother with the list
declaration :), if i will never use the plain old list.get(i).

You might suggest iterating through the list:
for (SimpleObjectChild soc: List) {
if (soc.properyX.equals(y) {
do_something();
}
}
But isn't this prohibitively inefficient?? If i have a list of 100.000
elements, of which only about 100 have propertyX='y', i could fetch
them (very fast) via the query: "select * from SimpleObjectChild where
propertyX = 'y' and ancestor is _simpleobjectkey_", then operate on
them.

Regarding JDO Extent, it's also very inefficient (in my opinion)! See
following example:

doit() {
for (DbContact db : extent) {
if (db.getVersion().equals("0.0")) {
do_stuff();
db.setVersion("0.2");
}
}
}

If i have a list of 100.000 elements, and have already handled 75.000
of them on previous calls (there is the 30 second limit to a call, not
enough time to handle all entities in a call); then, on a successive
call, the extent will also "pass" through "version 2.0" entities,
wasting time, and maybe even never reaching a "version 1.0" entity
within the 30 seconds allowed.

Instead i took the following approach:
(AdvancedQuery is a simple wrapper made by me, over JDO Query)

I am using a query, that always fetches the first 50 (could be any
number) unhandled objects so far. It is written in JDO, but can just
as easily be written in the low level API.

doit() {
AdvancedQuery aq = new AdvancedQuery(pm.newQuery
(DbRawContact.class));
aq.addFilter("version", "==", "0.1");
if (!firstRun) {
aq.addFilter("encodedKey", ">", lastKey);
}
aq.appendOrdering("encodedKey ascending");
aq.setLimit(50);
List  results = (List) aq.execute();
for (DbRawContact db : results) {
do_stuff();
db.setVersion("0.2");
lastkey = db.key;
}
return lastkey;
}



I am seriously thinking of developing my own framework based on the
low-level API to take advantage of it's full power and flexibility. I
know what the pros are (power and flexibility), i'm asking are there
any cons? :) (besides, perhaps, longer developing time and effort on
my behalf)

Corneliu
--~--~-~--~~~---~--~~
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] JDO vs low level API

2009-09-21 Thread Cornel

Hello!

I would like to bring in discussion a comparison between JDO and the
low level API. Google recommends using the low-level API only to
framework developers, but JDO seems to inflexible to me.

I've been using JDO for a month now and i've come across some nasty
limitations. I will mention a few here:

The datastore itself is very flexible: you can have an entity called
"SimpleObject" with "property1name" and "propery2name" and another
"SimpleObject" with "property1name" and "propery3name"! A low level
API query for entities of kind "SimpleObject" will fetch both. In JDO,
i simply cannot define two objects with the same name "SimpleObject"
and different properties, so i cannot take advantage of this feature
that the datastore offers!

JDO offers "Owned One-to-Many Relationships" by defining a List of
objects that will be persisted as the children of the current object;
also one can manipulate these objects by calls to List methods. But
what if i want to say "list.get(50.000)" ? How is this implemented?
Will it try to bring all 50.000 entities in memory (and fail?!), or
will it bring only the 50.000th one? In the latter case, how does it
"count" to 50.000, because the low level API doesn't offer support for
"limit 1 offset 49.999" (it's above the 1000 limit)

Or let's say i need to get the child from that list, that satisfies a
certain condition: "get the 5th child that has propertyX='y' "; in
pseudo-code something like this: list.get('propertyx', OP_EQUALS, 'y',
5). There is no such thing obviously; i should use a query instead:
"select * from SimpleObjectChild where propertyX = 'y' and ancestor is
_simpleobjectkey_" which is fine. My question is: since i need to use
queries for more complicated issues, why bother with the list
declaration :), if i will never use the plain old list.get(i).

You might suggest iterating through the list:
for (SimpleObjectChild soc: List) {
   if (soc.properyX.equals(y) {
   do_something();
   }
}
But isn't this prohibitively inefficient?? If i have a list of 100.000
elements, of which only about 100 have propertyX='y', i could fetch
them (very fast) via the query: "select * from SimpleObjectChild where
propertyX = 'y' and ancestor is _simpleobjectkey_", then operate on
them.

Regarding JDO Extent, it's also very inefficient (in my opinion)! See
following example:

doit() {
   for (DbContact db : extent) {
   if (db.getVersion().equals("0.0")) {
   do_stuff();
   db.setVersion("0.2");
   }
   }
}

If i have a list of 100.000 elements, and have already handled 75.000
of them on previous calls (there is the 30 second limit to a call, not
enough time to handle all entities in a call); then, on a successive
call, the extent will also "pass" through "version 2.0" entities,
wasting time, and maybe even never reaching a "version 1.0" entity
within the 30 seconds allowed.

Instead i took the following approach:
(AdvancedQuery is a simple wrapper made by me, over JDO Query)

I am using a query, that always fetches the first 50 (could be any
number) unhandled objects so far. It is written in JDO, but can just
as easily be written in the low level API.

doit() {
   AdvancedQuery aq = new AdvancedQuery(pm.newQuery
(DbRawContact.class));
   aq.addFilter("version", "==", "0.1");
   if (!firstRun) {
   aq.addFilter("encodedKey", ">", lastKey);
   }
   aq.appendOrdering("encodedKey ascending");
   aq.setLimit(50);
   List  results = (List) aq.execute
();
   for (DbRawContact db : results) {
   do_stuff();
   db.setVersion("0.2");
   lastkey = db.key;
   }
   return lastkey;
}



I am seriously thinking of developing my own framework based on the
low-level API to take advantage of it's full power and flexibility. I
know what the pros are (power and flexibility), i'm asking are there
any cons? :) (besides, perhaps, longer developing time and effort on
my behalf)

Corneliu
--~--~-~--~~~---~--~~
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: Persistence problem of an entity with two List of the same type

2009-09-21 Thread Marton Papp

Hi Édouard,

Although I am not from Google, I have had the a similar problem once.
I guess it has to do something with the fact that the datastore
identifies the object by their path from the roor of the entity group
that they belong to. If you make two collection of the same type,
there will be no information stored in the datastore whether a given
child entity (of class B in your case) belongs to one collection or
the other. If you still want to use a similar structure, but avoid
duplication of code, you can create the B' and B" classes, by both of
them having a one-to-one relationship to your B class. Or you can try
to embed the B class into your B' and B" classes.

Marton
--~--~-~--~~~---~--~~
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: URLFetching is failinging

2009-09-21 Thread Jay Wallingford

I believe this warning is from the underlying Apache HTTPClient
they're using. It's just warning you that the entire response is going
to be read into memory as opposed to reading it from an input stream a
chunk at a time, which could be more efficient. I get this with the
HTTPClient API outside of GAE as well.

On Sep 11, 3:12 pm, "Jason (Google)"  wrote:
> Which URL are you using? The above code is working for me. You can go ahead
> and disregard the getResponseBody warning -- it shouldn't affect the
> response from being returned to your app.
>
> - Jason
>
> On Wed, Sep 9, 2009 at 1:22 PM, Raghu  wrote:
>
> > Hi ALL,
>
> > I'm just trying to fetch url using following code:
> > ==
> >  PrintWriter out=response.getWriter();
> >  URLFetchService f=URLFetchServiceFactory.getURLFetchService();
> >                         HTTPResponse r=f.fetch(new URL("
> >http://dummyurl.ccom/rss.xml";));
> >                         byte[] b=r.getContent();
> >                      for (byte c : b) {
> >                                 out.write((char)c);
> >                        }
> > =
> > And I'm getting following message with blank servlet response
>
> > Sep 9, 2009 8:17:07 PM org.apache.commons.httpclient.HttpMethodBase
> > getResponseBody
> > WARNING: Going to buffer response body of large or unknown size. Using
> > getResponseBodyAsStream instead is recommended.
>
> > Please recommend me the solution for this.
>
> > thanks
> > rag
--~--~-~--~~~---~--~~
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: Type Owned by Two Different Types?

2009-09-21 Thread leszek

That's very interesting because it works for me:

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

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

private String firstName;

private String lastName;

}

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

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Employee getE() {
return e;
}

public void setE(Employee e) {
this.e = e;
}

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


(regardless if transaction is used or not - simply makePersistent
without transaction)

PersistenceManager em = EMF.get().getPersistenceManager();
Employee e = null;
try {
em.currentTransaction().begin();
A a = new A();
e = new Employee();
a.setE(e);
em.makePersistent(a);
em.currentTransaction().commit();
} catch (Exception ee) {
em.currentTransaction().rollback();
}


try {
em.currentTransaction().begin();
B b = new B();
//  e = new Employee();
b.setE(e);
em.makePersistent(b);
em.currentTransaction().commit();
} catch (Exception ee) {
em.currentTransaction().rollback();
}

--~--~-~--~~~---~--~~
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: when will BigDecimal be supported in datastore?

2009-09-21 Thread ted stockwell



On Sep 21, 3:05 am, Philippe Marschall 
wrote:
>
> But long is crappy abstraction. Sometimes you need two decimal places,
> sometimes three, sometimes six, sometimes "as many as there are".
> That's all quite cumbersome to do with a long alone. String seems like
> the easier way to go.
>

Well, in case anyone is interested, below I have included the code for
a class that can lexicographically encode BigDecimals as strings (and
I have included JUnit test class).
This class encodes numbers as strings in such a way that the
lexicographic order of the encoded strings is the same as the natural
order of the original numbers.
The length of an encoded number is only slightly larger than the
length of its original number.
Unlike other schemes, there is no limit to the size of numbers which
may be encoded.
This encoding lets you store BigDecimals as Strings and still be able
to do proper range searches in queries.

This code was based on ideas in this paper: www.zanopha.com/docs/elen.ps
, but there are some minor differences.
Feel free to use this code as you wish.




package net.sf.contrail.core.impl;

import java.math.BigDecimal;
import java.text.ParseException;

import net.sf.contrail.core.ContrailException;


/**
 * Encodes numbers as strings in such a way that the lexicographic
order of the
 * encoded strings is the same as the natural order of the original
numbers.
 * The length of an encoded number is only slightly larger than the
length
 * of its original number.
 * Unlike other schemes, there is no limit to the size of numbers
which may be encoded.
 *
 * @author ted stockwell
 *
 */
public class StorageNumberCodec {

public static final String decode(String input) {
try
{
if (input == null)
return null;
if (input.length() <= 0)
return "";
return new Decoder(input)._output;
}
catch (ParseException e) {
throw new ContrailException("Failed to decode 
number:"+input, e);
}
}
public static final BigDecimal decodeAsBigDecimal(String input) {
try
{
if (input == null)
return null;
if (input.length() <= 0)
throw new ContrailException("Internal Error: 
Cannot decode an
empty String");
return new BigDecimal(new Decoder(input)._output);
}
catch (ParseException e) {
throw new ContrailException("Failed to decode 
number:"+input, e);
}
}


public static final String encode(String input) {
try
{
if (input == null)
return null;
if (input.length() <= 0)
return "";
return new Encoder(input)._output;
}
catch (ParseException e)
{
throw new ContrailException("Failed to parse 
number:"+input, e);
}
}
public static final String encode(BigDecimal decimal) {
if (decimal == null)
return null;
return encode(decimal.toPlainString());
}



static public class Encoder {

private String _input;
private int _position= 0;
private int _end;
private String _output= "";
private boolean _isNegative= false;

private Encoder(String input) throws ParseException {
_input= input;
_end= _input.length();

char c= _input.charAt(_position);
if (c == '-') {
_input.charAt(_position++);
_isNegative= true;
}

readNumberBeforeDecimal();
if (readDecimalPoint()) {
readNumber(_end - _position);
}
_output+= _isNegative ? '?' : '*';
}

private boolean readDecimalPoint() throws ParseException {
if (_end <= _position)
return false;
char c= _input.charAt(_position++);
if (c != '.')
throwParseException("Expected decimal point");
if (_end <= _position)
return false;
_output+= _isNegative ? ':' : '.

[appengine-java] Re: Type Owned by Two Different Types?

2009-09-21 Thread objectuser

Thanks!  I'd certainly rather it be something I'm doing wrong.  I
think you have represented my exact scenario there.

I'll continue looking at my code.

On Sep 21, 9:49 am, leszek  wrote:
> That's very interesting because it works for me:
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Employee {
>
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key id;
>
>     private String firstName;
>
>     private String lastName;
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class A (B) {
>
>     public Long getId() {
>                 return id;
>         }
>
>         public void setId(Long id) {
>                 this.id = id;
>         }
>
>         public Employee getE() {
>                 return e;
>         }
>
>         public void setE(Employee e) {
>                 this.e = e;
>         }
>
>         @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Long id;
>
> }
>
> 
> (regardless if transaction is used or not - simply makePersistent
> without transaction)
>
>                 PersistenceManager em = EMF.get().getPersistenceManager();
>                 Employee e = null;
>                 try {
>                         em.currentTransaction().begin();
>                 A a = new A();
>                 e = new Employee();
>                 a.setE(e);
>                 em.makePersistent(a);
>                 em.currentTransaction().commit();
>                 } catch (Exception ee) {
>                         em.currentTransaction().rollback();
>                 }
>
>                 try {
>                         em.currentTransaction().begin();
>                 B b = new B();
> //              e = new Employee();
>                 b.setE(e);
>                 em.makePersistent(b);
>                 em.currentTransaction().commit();
>                 } catch (Exception ee) {
>                         em.currentTransaction().rollback();
>                 }
--~--~-~--~~~---~--~~
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 vs low level API

2009-09-21 Thread Marton Papp

Hi Corneliu!


I also had doubts about using JDO in GAE when I started to work with
it. Especially because I met several bugs and it was annoying and time
wasting to figure out what was going wrong. But then the bugs were
fixed in the next release, so I think the guys are generally doing a
good job.

About the limitation with the non-existing property, you are right. It
seems to me that JDO will create a property with a null value once you
declare and map it. Do you have a real-life scenario where this
limitation is an issue that you cannot overcome with the features
provided by JDO? I think if you really need to have some entities
having some properties, and others not, and still use JDO, then you
could try to map different classes to the same database entity, with
different properties defined in the classes. I have never tried that
though, so I am not sure if it would work, and definitely would not be
convenient.

About mapping collections with many entities inside, I think I just
wouldn't do it. If the collection is too big to be effectively loaded
into memory, then you are right to be using queries instead. In this
case you should not map it as a collection, but handle the parent-
child relationship explicitly. But still, collection mapping can be a
convenient option if you have only a small number of entities in your
collection. This does not make JDO less flexible, on the contrary, it
introduces an extra service.

Your idea about processing just part of the results at once in a query
seems to be okay. I think a similar approach is described to handle
pagination of large result sets somewhere in the forums.

As for me, I would not recommend you to create your own data access
layer using the low level API unless you really need it or you really
do not need any of the features that JDO provides. It still provides
some convenient features that you would have to live without or
reimplement if you decide not to use JDO (starting with mapping java
classes to persistent storage, which I think is a good thing). Most of
the problems you mentioned are not solved by using the low level API
anyway, so if you want to create some classes that make data access
easier for you applications then you can build them on top of JDO as
well, without any major drawbacks.

And as final reason why to use JDO, these guys who wrote the docs
recommended to do so, and they must have some reason to say that. :)

Marton
--~--~-~--~~~---~--~~
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: JPA - User Defined Types

2009-09-21 Thread Max Ross
Creating an Embedded object works great and should give you the result
you're looking for.

On Mon, Sep 21, 2009 at 6:26 AM, || Sudhir Nimavat || <
sudhir_nima...@yahoo.com> wrote:

>
>  Does any one has any idea ?
>
>   *Sudhir Nimavat*
> *Senior software engineer. **
> Quick start global PVT LTD.
> Baroda - 390007* *Gujarat, India
>
> Personally I'm always ready to learn, although I do not always like being
> taught
> *
>
>
>
> --
> *From:* "sud...@jsptube.com" 
> *To:* Google App Engine for Java 
> *Sent:* Monday, 21 September, 2009 4:10:18 PM
> *Subject:* [appengine-java] JPA - User Defined Types
>
>
> Is it possible to create custom user defined types as explained in
> this article
> http://www.datanucleus.org/extensions/rdbms_java_types.html
>
> I need to create custom types like Gender, Height Income etc...
>
> Thanks
> --
> Yahoo! India has a new look. Take a sneak 
> peek
> .
>
> >
>

--~--~-~--~~~---~--~~
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] Plugin Hosted Mode failing to resolve import java.net.* on Macintosh

2009-09-21 Thread ken

Hi,

I seem to have an issue with the Google Plugin Hosted Mode and
java.net on a Mac OS X 10.5.8.
I have Eclipse Galilio with:
Google App Engine Java SDK 1.2.5
Google Plugin for Eclipse 3.5
Google Web Toolkit SDK 1.7.0

I created a new default GWT/AppEngine project (both checked) named
TestOne with package minman.
I set out to try to add a simple URL Fetch call to the generated entry
point class TestOne.java.
In the class TestOne.java, the only added code is these additional
imports at the top:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;

The Eclipse editor does NOT complain about these.
I'm using the Mac JVM 1.5.0 MacOS X default in Eclipse.

However, when I try to Debug or Run the TestOne app, the Google Web
Tookit Hosted Mode panel shows the following (in red after the first):

Initializing AppEngine server
Loading an instance of module 'testone'
   Refreshing module from source
  Validating new compiled units
 Removing Units with errors
Errors in 'file:/blah...blah/TestOne/src/minman/client/
TestOne.java
   Line 6: The import java.net cannot be resolved
   Line 7: The import java.net cannot be resolved
.etc

[Of course, the app works ok without the 2 'import java.net.*'  lines
listed above.]

Also, I have code in other Java projects including those two import
lines and which compiles and runs fine under Eclipse 3.3.

Can this be resolved??

Thanks in advance,
Ken Bowen
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [gae] [appengine-java] How to get eclipse with google app engine plugin to copy jars to /war/WEB-INF/lib

2009-09-21 Thread Jason Parekh
Hey Allen,

Thanks for linking to the previous discussion.

Unfortunately, we haven't revisited the issues mentioned in that thread
yet.  It may be worthwhile to star a similar feature request at
http://code.google.com/p/google-web-toolkit/issues/detail?id=3810 since we
use stars as one signal to gauge interest in features.

jason


On Mon, Sep 21, 2009 at 9:05 AM, Allen Firstenberg wrote:

> This issue was first raised back on April 16th:
>
> http://groups.google.com/group/google-appengine-java/browse_thread/thread/67cb7cdaefc8429f#
>
> At the time, the Google team gave a couple of suggestions, admitted that
> some work needed to be done in this area, and said that they were tracking
> this internally.  If there has been an update to the issue since - I've
> missed it.
>
> On Mon, Sep 21, 2009 at 8:12 AM, brendan wrote:
>
>>
>> I've just spent a couple hours tracking down an issue.  It turns out
>> that i was missing gin.jar and junit.jar from my /war/WEB-INF/lib
>> directory.
>>
>> Using eclipse I have specified a number of "User Libraries", and have
>> added those to the Libraries section of the Java Build path in my
>> project properties.
>>
>> It would be handy if the jars specified in the User Libraries section
>> were copied over to /war/WEB-INF/lib automatically.  Otherwise I worry
>> what happens when I update the central location where the jars are
>> stored, but forget to copy some of them over to /war/WEB-INF/lib.
>>
>> Thanks,
>> Brendan
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Retrieve of Collection model not working

2009-09-21 Thread Dhamu

my bad.. my stupid programming style I guess

I changed from

PersistenceManager pm = ...getPersistenceManager();
try {
return pm.getObjectById(MyModel.class, id);
} finally {
pm.close();
}

to

PersistenceManager pm = ...getPersistenceManager();
try {
MyModel m = pm.getObjectById(MyModel.class, id);
return pm.detachCopy(m);

} finally {
pm.close();
}

and still it didn't work. and then I changed to

PersistenceManager pm = ...getPersistenceManager();
MyModel m = null, detached = null;
try {
m = pm.getObjectById(MyModel.class, id);
detached = pm.detachCopy(m);

} finally {
pm.close();
}
return detached;

and hurray!!! it works now.. Thanks anyways...
Anybody know why?

On Sep 21, 2:42 pm, Dhamu  wrote:
> // MyModel
> String id
> List values
> List scores;
>
> // get(id)
> PersistenceManager pm = ...getPersistenceManager();
> try {
>         return pm.getObjectById(MyModel.class, id);
>
> } finally {
>         pm.close();
> }
>
> // store(obj);
> PersistenceManager pm = ...getPersistenceManager();
> try {
>         pm.makePersistent(obj);
>
> } finally {
>         pm.close();
> }
>
> MyModel m = new MyModel();
> m.setId("key1");
> m.addValue("value1");
> m.addScore(100);
> store(m);
>
> Datastore (snapshot): I can see the following values in datastore
> (thats ok).
> key1, [value1], [100]
>
> if I call get("key1") and print the properties, it prints only the id
> but values and scores are always null
>
> // I am trying to update like this
> MyModel m = get("key1"); // values and scores property are null, only
> id has the value.
> m.addValue("value2");
> m.addScore(200);
> store(m); // this always replaces the old row in database.
> i.e. now the database has only
> key1, [value2], [200]
>
> Why? Please help. I might be doing something 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: Plugin Hosted Mode failing to resolve import java.net.* on Macintosh

2009-09-21 Thread Jason Parekh
Hi Ken,

Seems like there are two separate issues you're pointing out:

(1) The Eclipse validation is missing some classes that GWT really doesn't
allow, and
(2) java.net used to work in GWT, but not anymore?

If that breakdown is accurate, would you mind opening a bug for (1)?

Someone from the GWT team can give you an answer for (2).

Thanks!
jason

On Mon, Sep 21, 2009 at 12:04 PM, ken  wrote:

>
> Hi,
>
> I seem to have an issue with the Google Plugin Hosted Mode and
> java.net on a Mac OS X 10.5.8.
> I have Eclipse Galilio with:
>Google App Engine Java SDK 1.2.5
>Google Plugin for Eclipse 3.5
>Google Web Toolkit SDK 1.7.0
>
> I created a new default GWT/AppEngine project (both checked) named
> TestOne with package minman.
> I set out to try to add a simple URL Fetch call to the generated entry
> point class TestOne.java.
> In the class TestOne.java, the only added code is these additional
> imports at the top:
>
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.io.InputStreamReader;
> import java.net.MalformedURLException;
> import java.net.URL;
>
> The Eclipse editor does NOT complain about these.
> I'm using the Mac JVM 1.5.0 MacOS X default in Eclipse.
>
> However, when I try to Debug or Run the TestOne app, the Google Web
> Tookit Hosted Mode panel shows the following (in red after the first):
>
> Initializing AppEngine server
> Loading an instance of module 'testone'
>   Refreshing module from source
>  Validating new compiled units
> Removing Units with errors
>Errors in 'file:/blah...blah/TestOne/src/minman/client/
> TestOne.java
>   Line 6: The import java.net cannot be resolved
>   Line 7: The import java.net cannot be resolved
> .etc
>
> [Of course, the app works ok without the 2 'import java.net.*'  lines
> listed above.]
>
> Also, I have code in other Java projects including those two import
> lines and which compiles and runs fine under Eclipse 3.3.
>
> Can this be resolved??
>
> Thanks in advance,
> Ken Bowen
> >
>

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



[appengine-java] ...appengine.api.users.User object missing getUserId method

2009-09-21 Thread chris

I'm probably just overlooking something, but according to the API
documentation located here (http://code.google.com/appengine/docs/java/
javadoc/com/google/appengine/api/users/User.html) the User object
should have a public getUserId method on it. However, in my dev
environment this method is unavailable for some reason. As far as I
know my AppEngine SDK is up-to-date (version 1.2.2).

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



[appengine-java] Re: ...appengine.api.users.User object missing getUserId method

2009-09-21 Thread Don Schwarz
1.2.5 is the latest version.  Please upgrade and make sure that you are
copying the latest API jar (appengine-api-1.0-sdk-1.2.5.jar) into your
application's WEB-INF/lib directory.

On Mon, Sep 21, 2009 at 11:48 AM, chris  wrote:

>
> I'm probably just overlooking something, but according to the API
> documentation located here (http://code.google.com/appengine/docs/java/
> javadoc/com/google/appengine/api/users/User.html) the User object
> should have a public getUserId method on it. However, in my dev
> environment this method is unavailable for some reason. As far as I
> know my AppEngine SDK is up-to-date (version 1.2.2).
>
> Any ideas for fixing this issue?
> >
>

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



[appengine-java] Re: java.lang.IllegalArgumentException: Must set a body

2009-09-21 Thread Jason (Google)
According to the docs, the message body should be a named POST parameter in
the request object passed into the servlet. Can you log or otherwise take
note of this parameter and the other XMPP parameters before calling
parseMessage and report what you find?
- Jason

On Thu, Sep 17, 2009 at 10:47 PM, Prashant  wrote:

> Hi,
>
>
> It seems like xmpp api is missing message body once every few requests. I
> am getting following error repeatedly, saying "Must set a body", while
> parsing the request to Message. I am not using */_ah/xmpp/message/chat/*url 
> for anything except for receiving xmpp messages. Neither this url is
> accessible to anyone.
>
>
>
>
>
> #
> 09-17 10:29PM 25.686
>
> /_ah/xmpp/message/chat/
> java.lang.IllegalArgumentException: Must set a body
> at
> com.google.appengine.api.xmpp.MessageBuilder.build(MessageBuilder.java:54)
> at
> com.google.appengine.api.xmpp.InboundMessageParser.parseMessage(InboundMessageParser.java:51)
> at
> com.google.appengine.api.xmpp.XMPPServiceImpl.parseMessage(XMPPServiceImpl.java:111)
> at antshpra.chat.servlets.Main.doPost(Main.java:97)
> 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.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> 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.serviceRequest(JettyServletEngineAdapter.java:139)
> at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
> at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4950)
> at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4948)
> at
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
> at
> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
> at com.google.net.rpc.impl.Server$2.run(Server.java:823)
> at
> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
> at
> com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
> at com.google.net.rpc.impl.Server.startRpc(Server.java:778)
> at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
> at
> com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:437)
> at
> com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
> at
> com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
> at com.google.net.async.Connection.handleReadEvent(Connection.java:428)
> at
> com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
> at
> com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
> at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
> at
> com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
> at
> com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:392)
> at java.lang.Thread.run(Unknown Source)
>
> #
> C 09-17 10:29PM 25.688
>
> Uncaught exception from servlet
> java.lang.IllegalArgumentException: Must set a body
> at
> com.google.appengine.api.xmpp.MessageBuilder.build(MessageBuilder.java:54)
> at
> com.google.appengine.api.xmpp.InboundMessageParser.p

[appengine-java] Re: what's the bigger/complex application Java/Python running on GAE

2009-09-21 Thread Jason (Google)
Hi Patrizio. We have an article coming out soon which will help you
determine how much data your application will use. If you're concerned about
storage, be sure to note which properties you'll never use in queries and
mark these as unindexed from the start so you don't have to incur a storage
penalty for an index you'll never need.
- Jason

On Fri, Sep 18, 2009 at 12:18 AM, Patrizio Munzi
wrote:

>  But at the moment is there any application which is consuming a lot of
> storage???
>
> Do you know guys how to see how much data storage I'm going to use??
> Is that related to the local datastore usage??
>
> Thanks
>
> Clay Lenhart wrote:
>
> A Google guy responded to a similar question:
>
> "We have no limits :)
> Are they talking about 1TB, 10TB, 100s TB?
>
> We would want to work with them to ensure their data moves on smoothly
> and that their app has enough storage allocated, but there are no
> practical limits."
>
> Based on the documentation, you'll want to pay attention to how you
> set your "ancestors" when you have a large amount of data.
>
>
>
>
>
> --
>
> *Patrizio Munzi*
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail: patrizio.mu...@eris4.com
> web: http://www.eris4.com
> skype: eris4_munzi
>
> >
>

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

<>

[appengine-java] JUnit best practices questions

2009-09-21 Thread Pion

My environments are: Google App Engine (GAE) Java SDK 1.2.5, Google
Web Toolkit (GWT) 1.7, Eclipse-Galileo on Windows Vista.

GWT (http://code.google.com/webtoolkit/tutorials/1.6/JUnit.html)
provides junitCreator tool and creates a default folders for the
junit. I got this thing running on command line already.

GAE (http://code.google.com/appengine/docs/java/howto/
unittesting.html) does not mention any tool and/or recommend where to
put/structure the test files.

What are the junit best practices when using both GAE and GWT?

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



[appengine-java] Re: Problem with indexes that stay in "Building" status for a long time (forever?)

2009-09-21 Thread Juan Pablo Picasso
Well, I checked today and the mentioned index is now in "serving" status. In
my opinion, this should have a more predictable behaviour.

On Sat, Sep 19, 2009 at 4:18 PM, Juan Pablo Picasso <
jpica...@getsense.com.ar> wrote:

> Hi, thanks for your reply,
> do you know if there's any way to speed that up? because our application
> will be unusable until that index is ready
> Did you perform the "vacuum" or anything like that?
>
>
> On Sat, Sep 19, 2009 at 10:28 AM, dflorey  wrote:
>
>>
>> It can take up to 24 hours. I've experienced slow index creation as
>> well in the last days or so.
>>
>> On 19 Sep., 15:02, Juan Pablo Picasso 
>> wrote:
>> > Hi,
>> > recently we've added an attribute to one of our persistent entities,
>> > resulting in the following error when performing a query that involves
>> the
>> > new attribute:
>> >
>> > com.google.appengine.api.datastore.DatastoreNeedIndexException: no
>> matching
>> > index found.
>> >
>> > We have an index for that entity, but it shows as "Building" in the
>> > administrator page, and it has been like this for about an hour or so.
>> >
>> > I've googled for this and it seems that the only way out is asking for
>> the
>> > indexes to be manually set to "error" state, and then perform a Vacuum
>> using
>> > the Python SDK (although we are using Google App Engine for Java?). Is
>> this
>> > correct?
>> >
>> > For now the deployed version of our application has become unusable,
>> plese
>> > help!
>> >
>> > Furthermore, is there any good practices documentation regarding this
>> type
>> > of issues? (ie. What to avoid or how to modify already persisted
>> entities in
>> > a live environment without taking down the application).
>> >
>> > thanks, regards,
>> > Juan
>> >>
>>
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [gae] Re: [appengine-java] How to get eclipse with google app engine plugin to copy jars to /war/WEB-INF/lib

2009-09-21 Thread Allen Firstenberg
Thanks for pointing out the open bug, Jason.  It wasn't clear from the
discussion in April if opening an issue was the right/best way to handle
this, but I'm glad to see its been opened and the previous discussion noted
there.

Thank you, as always, for everything!

Allen

On Mon, Sep 21, 2009 at 12:17 PM, Jason Parekh wrote:

> Hey Allen,
>
> Thanks for linking to the previous discussion.
>
> Unfortunately, we haven't revisited the issues mentioned in that thread
> yet.  It may be worthwhile to star a similar feature request at
> http://code.google.com/p/google-web-toolkit/issues/detail?id=3810 since we
> use stars as one signal to gauge interest in features.
>
> jason
>
>
>
> On Mon, Sep 21, 2009 at 9:05 AM, Allen Firstenberg wrote:
>
>> This issue was first raised back on April 16th:
>>
>> http://groups.google.com/group/google-appengine-java/browse_thread/thread/67cb7cdaefc8429f#
>>
>> At the time, the Google team gave a couple of suggestions, admitted that
>> some work needed to be done in this area, and said that they were tracking
>> this internally.  If there has been an update to the issue since - I've
>> missed it.
>>
>> On Mon, Sep 21, 2009 at 8:12 AM, brendan wrote:
>>
>>>
>>> I've just spent a couple hours tracking down an issue.  It turns out
>>> that i was missing gin.jar and junit.jar from my /war/WEB-INF/lib
>>> directory.
>>>
>>> Using eclipse I have specified a number of "User Libraries", and have
>>> added those to the Libraries section of the Java Build path in my
>>> project properties.
>>>
>>> It would be handy if the jars specified in the User Libraries section
>>> were copied over to /war/WEB-INF/lib automatically.  Otherwise I worry
>>> what happens when I update the central location where the jars are
>>> stored, but forget to copy some of them over to /war/WEB-INF/lib.
>>>
>>> Thanks,
>>> Brendan
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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 view stack dumps in GAE

2009-09-21 Thread Rajeev Dayal
Maybe you could try e.printStackTrace(System.out) and see if that makes a
difference?
On Sat, Sep 19, 2009 at 11:34 AM, Diana Cruise wrote:

>
> What does GAE do with standard dumps such as e.printStackTrace()?
> Here is the Admin Console Log output in DEBUG mode for my test:
>
> I 09-19 08:14AM 54.605 [app1-widget/1.336449820535414591].:
> hello, testMode=false
> I 09-19 08:14AM 54.605 org.apache.jsp.test_jsp _jspService: hello2
> I 09-19 08:14AM 54.606 [app1-widget/1.336449820535414591].:
> hello3
>
> The output above comes from the code snippet below which tests Stdout,
> Logger, and then a forced stack dump.  As you can see the stack dump
> identified with the message "hello4" is NOT in the log output above.
> How do I view this stack dump in GAE?
>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> <%@ page import="java.util.*,
>widget.presentation.common.*"
> %>
> <%
> try {
>  UserSession userSess = UserSession.get(session, request, response);
>  System.out.println("hello, testMode=" + userSess.isTestMode());
>  java.util.logging.Logger logger = java.util.logging.Logger.getLogger
> ("widget");
>  logger.log(java.util.logging.Level.INFO, "hello2");
>  userSess.logInfo("hello3");
>  if (true) throw new Exception("hello4");
> %>
> 
> 
>
>
> width="100%">
> ...
> 
> <%
> } catch (Exception e) { e.printStackTrace(); }
> %>
>
> >
>

--~--~-~--~~~---~--~~
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: Unicode problems

2009-09-21 Thread Jason (Google)
Hi George. Which version of the SDK are you using? Just to clarify, you're
seeing this in all HTML files under war/, not your JSPs? Would it be
possible for you to post a sample HTML file that I can use to reproduce the
issue? I've tried with UTF-8 encoding in my local development environment,
but everything is rendering correctly even after being deployed.
Thank you,
- Jason

On Fri, Sep 18, 2009 at 1:12 AM, George Moschovitis <
george.moschovi...@gmail.com> wrote:

>
> > But if the file with local characters is inside "src\..." dir, there
> > is everythign fine. This is sufficient for me.
>
> saddly, this is not sufficient for me :(
> I am still looking for a way to fix the encoding problem in files that
> reside in war/
>
> quite interestingly in my HTML files I have some friend-connect code
> for signin etc. While the FC code renders correct Greek chars on the
> development server,
> again it renders garbage ('??' strings) on AppEngine.
>
> -g.
> >
>

--~--~-~--~~~---~--~~
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 400 while trying to upload my application for the first time

2009-09-21 Thread Jason (Google)
What is your registered application ID? From the looks of the URL that
returned 400, you're using ID which is not a valid identifier. Have you
registered an application ID via http://appengine.google.com?
- Jason

On Fri, Sep 18, 2009 at 2:13 AM, 6real  wrote:

>
> Hello guys,
>
> I feel sorry to up this post but I really need help. Can anyone just
> guide me to a solution ? I try to change the version number to 0 but
> with exactly the same result.
>
> Thanks a lot.
>
> On 16 sep, 23:13, 6real  wrote:
> > Hi,
> >
> > my application runs fine locally. I'd like to upload it for the fist
> > time and I get the following error :
> >
> > java.io.IOException: Error posting to URL:
> http://appengine.google.com/api/appversion/create?app_id=ID&version=1&;
> > 400 Bad Request
> > Error when loading application configuration:
> > while scanning a simple key
> >   in "", line 23, column 1:
> > \
> > ^
> > could not found expected ':'
> >   in "", line 25, column 9:
> >   script: unused
> > ^
> >
> > II try to upload from the Eclipse plugin.
> >
> > Can someone help me in debugging this ?
> >
> > Thx !
> >
> > 
> > Note: I posted this message inthe general group and Nick from Google
> > advices me to post in the java group with some files.
> > Here they are :
> >
> > web.xml
> > 
> > 
> >  > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> > "http://java.sun.com/dtd/web-app_2_3.dtd";>
> >
> > 
> >   
> > greetServlet
> > com.me.myapp.is.server.GreetingServiceImpl > class>
> >   
> >   
> > greetServlet
> > /myapp/greet
> >   
> >
> >   
> > stationListUpdater
> > com.me.myapp.is.servlet.StationListUpdater > class>
> >   
> >   
> > stationListUpdater
> > /update
> >   
> >
> >   
> > StationAvailabilitiesUpdater
> >  > class>com.me.myapp.is.servlet.StationAvailabilitiesUpdater > class>
> >   
> >   
> > StationAvailabilitiesUpdater
> > /
> >
> > 
> >   
> >
> >   
> >   
> > myapp.html
> >   
> >
> >   
> > 
> > /*
> > 
> > 
> > admin
> > 
> > 
> >
> > 
> >
> > -
> >
> > logging.properties :
> > # A default java.util.logging configuration.
> > # (All App Engine logging is through java.util.logging by default).
> > #
> > # To use this configuration, copy it into your application's WEB-INF
> > # folder and add the following to your appengine-web.xml:
> > #
> > # 
> > #   
> > # 
> > #
> >
> > # Set the default logging level for all loggers to INFO
> > .level = INFO
> >
> > # Set the default logging level for ORM, specifically, to WARNING
> > DataNucleus.JDO.level=WARNING
> > DataNucleus.Persistence.level=WARNING
> > DataNucleus.Cache.level=WARNING
> > DataNucleus.MetaData.level=WARNING
> > DataNucleus.General.level=WARNING
> > DataNucleus.Utility.level=WARNING
> > DataNucleus.Transaction.level=WARNING
> > DataNucleus.Datastore.level=WARNING
> > DataNucleus.ClassLoading.level=WARNING
> > DataNucleus.Plugin.level=WARNING
> > DataNucleus.ValueGeneration.level=WARNING
> > DataNucleus.Enhancer.level=WARNING
> > DataNucleus.SchemaTool.level=WARNING
> >
> > ---
> > cron.xml:
> >
> > 
> > 
> >   
> > /update_availabilities
> > Rempli les dispo des groupes - Group Reseau 1 > description>
> > every 3 minutes
> >   
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > ---
> > 
> > http://appengine.google.com/ns/1.0";>
> > myappid
> > 1
> >
> > 
> > 
> >  value="WEB-INF/
> > logging.properties"/>
> > 
> >
> > 
> >
> > 
> >
> > I  use eclipse and the plugin Google App Engine Java SDK 1.2.5
> > 1.2.5.v200909021031
> > com.google.appengine.eclipse.sdkbundle.e35.feature.feature.group
> >
> > If i try to update with appcfg I get the additionnal log lines :
> >
> >  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:429)
> > at
> > com.google.appengine.tools.admin.AppVersionUpload.beginTransaction
> > (AppVersionUpload.java:243)
> > at com.google.appengine.tools.admin.AppVersionUpload.doUpload
> > (AppVersionUpload.java:98)
> > at com.google.appengine.tools.admin.AppAdminImpl.update
> > (AppAdminImpl.java:53)
> > ... 4 more
> >
> > -
> > and finally I use as applicationid the id given in the field
> > "Application Identifier" under application settings section.
> >
> > I do not expect a patch but just a workaround :-) or an
> > explanation :-)
> >
> > Thks to everybody for your help.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java

[appengine-java] Re: Do app engine support "OR" operator??

2009-09-21 Thread Jason (Google)
The general workaround for OR is to issue separate queries, then merge the
results.
- Jason

On Thu, Sep 17, 2009 at 9:51 PM, Francis  wrote:

>
> hi:
>
> I wrote the following query:
> Select p From we.bean.base.Player p where p.Id = 664778005 OR p.Id =
> 999
>
> and I get:
>
> Nested in org.apache.jasper.JasperException:
> org.datanucleus.store.appengine.query.DatastoreQuery
> $UnsupportedDatastoreOperatorException: Problem with query  FROM we.bean.base.Player p WHERE p.facebookId = 664778005 OR
> p.facebookId = 999>: App Engine datastore does not support operator
> OR :
> org.datanucleus.store.appengine.query.DatastoreQuery
> $UnsupportedDatastoreOperatorException: Problem with query  From we.bean.base.Player p where p.Id = 664778005 OR p.Id = 999>: App
> Engine datastore does not support operator  OR
>
> App Engine datastore does not support operator  OR
>
> so we can't use or in datatstore.???
>
> 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: Colabolo is now running on GAE/J

2009-09-21 Thread Jason (Google)
Congratulations on completing your migration, kaz! You know where to find us
if you have any more questions down the road. :)
- Jason

On Fri, Sep 18, 2009 at 8:36 AM, kaz  wrote:

>
> Hi,
>
> I'd like to thank you all for the supports I got here for the last
> several month. We finally were able to migrate the production server
> of Colabolo from existing Rails server to the App Engine.
>
> http://www.colabolo.com/
>
> http://www.techcrunch.com/2009/06/21/colabolo-takes-another-stab-at-team-task-management/
>
> It was a challenge for us to migrate the existing DB schema and >3M
> records into the Datastore. We were able to design a modified DB
> schema successfully, that is suitable for the Datastore
> characteristics and the entity group transaction, with many helps and
> advices I got here.
>
> And also it was so lucky and exciting for us to utilize the latest
> Task Queue feature (although we understand it is still an experimental
> API, it was really a silver bullet for us). We were able to spray a
> big load into many small Tasks that are processed in paralell.
> Eventually we achieved 10 times faster performance than old sequential
> solution.
>
> Thanks again to you and Google for this great technologies!
>
> Thanks,
>
> Kaz
>
> >
>

--~--~-~--~~~---~--~~
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: ClassCastException blues

2009-09-21 Thread Jason (Google)
Hi James. Are you using the latest version of the SDK?
I use  in a few of my projects and I haven't seen an exception
yet in either the local or production environments, so I don't think the
include tag itself is the issue. It's certainly possible that the included
JSP has an error which is getting bubbled up as this other exception. Can
you narrow this down any more?

- Jason

On Fri, Sep 18, 2009 at 11:26 AM, James H wrote:

>
> Jayson, the include in my JSP looks like this:
>
> jsp:include page="homeLeft.jsp" flush="true"
>
> I assume the Google plugin for Eclipse is handling this in a
> compatible manner between the test environment provided by the plugin
> versus production.  So, I'm not sure what to change by your comment on
> "include".  I did miss the try/catch there...I'll try that next.
> Thanks, J
>
> On Sep 18, 12:41 pm, Jayson Falkner  wrote:
> > You could catch this exception to find out more about it; however, I
> > think you just  need to use the normal Servlet RequestDispatcher
> > instead of Apache's specific implementation. e.g.
> >
> > request.getRequestDispatcher().include(request, response);
> >
> > Note that the JSP/Servlet spec doesn't require Apache. Meaning you
> > should stick to the spec's classes and interfaces if you expect your
> > code to work between possibly different containers.
> >
> > Hope it helps,
> >
> > Jayson
> >
> >
> >
> > On Thu, Sep 17, 2009 at 10:09 PM, James H 
> wrote:
> >
> > > This cast exception is NOT obvious.  Here's the production stack
> > > snippet:
> >
> > > /homeIndex.jsp
> > > java.lang.ClassCastException: java.lang.ClassCastException cannot be
> > > cast to javax.servlet.ServletException
> > >at org.apache.jasper.runtime.PageContextImpl.handlePageException
> > > (PageContextImpl.java:754)
> > >at
> org.apache.jsp.homeIndex_jsp._jspService(homeIndex_jsp.java:67)
> > >at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> > >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
> > > ...
> >
> > > And here's the homeIndex_jsp.java (from my local runtime test
> > > environment).  Line 67 is the last one listed here:
> >
> > > ...
> > >  out.write("\t\t\t\t\n");
> > >  out.write("\t\t\t\t\t\n");
> > >  org.apache.jasper.runtime.JspRuntimeLibrary.include(request,
> > > response, "homeLeft.jsp", out, true);
> > >  out.write("\n");
> > > ...
> >
> > > Any ideas on how a class cast exception could occur above?  Naturally,
> > > this runs fine in my test environment but NOT in production!
> >
> > > Thanks, J- Hide quoted text -
> >
> > - Show quoted text -
> >
>

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



[appengine-java] Re: Java + Python run-time on GAE

2009-09-21 Thread Jason (Google)
No, not in a single version.
- Jason

On Fri, Sep 18, 2009 at 8:03 PM, YONG  wrote:

>
> Can java and python run-time coexist in one single application?
>
> I had tried that, in one single version could not, but in different
> version then it is OK. Can have a way to make both run-time coexists
> in one single version?
>
>
> >
>

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



[appengine-java] Re: Java Low Level commit timeout

2009-09-21 Thread Jason (Google)
Hi Clay. The datastore timeout limit is fixed. If you're using transactions,
you should be able to rollback your changes if any of the writes (in this
case, deletes) failed. But this will only work if all entities that you're
deleting are in the same entity group. Since bulk updates to entities in the
same group are performed sequentially and not in parallel, you will likely
see these errors consistently if you pass in the maximum of 500. You should
try lowering this number until this particular exception stops being
triggered consistently.
- Jason

On Fri, Sep 18, 2009 at 5:04 AM, Clay Lenhart  wrote:

>
> I received an error that the commit timed out using the Java low-level
> API. The transaction actually succeeded, which was unexpected.
>
> The operation deleted around 1000 to 2000 entities (in batches of
> 500).
>
> The biggest issue is when the timeout occurs, we are not sure whether
> the transaction will succeed or not. This uncertainty goes against one
> of the reasons we'd want to use transactions (think: transfer money
> from one bank account to another where one bank account is in GAE).
>
> Can you give us the opportunity to specify our own timeout as we'll
> know what is best for our apps?  Or set a larger default timeout?
>
> Also, can you rollback on timeout?
>
> Cheers,
> Clay
> >
>

--~--~-~--~~~---~--~~
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: UTF-8 in the URL resource

2009-09-21 Thread Jason (Google)
It looks like there is an issue in using JSPs or other files with non-ASCII
characters in their names. Please file a new issue in the tracker and avoid
using these characters as folder/file names for the time being.
http://code.google.com/p/googleappengine/issues/list

- Jason

On Fri, Sep 18, 2009 at 8:28 PM, YONG  wrote:

>
> if I have some resources is in UTF-8 filename or folder, when I upload
> those file, error is giving like this...
>
> [java] Sep 19, 2009 10:52:43 AM
> com.google.appengine.tools.admin.AppVersionUpload addFile
> [java] SEVERE: Invalid character in filename: Hokkaido/???/
> IMG_0993.JPG
> [java] 25% Scanned 250 files.
> [java] Sep 19, 2009 10:52:45 AM
> com.google.appengine.tools.admin.AppVersionUpload addFile
> [java] SEVERE: Invalid character in filename: __static__/
> Hokkaido/???/IMG_0993.JPG
> [java] 28% Initiating update.
> [java] 31% Cloning 144 static files.
> [java] 33% Cloned 100 files.
>
> how to resolve this? GAE does not support UTF-8 resource ?
>
>
> >
>

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



[appengine-java] Re: java.lang.IllegalArgumentException: Must set a body

2009-09-21 Thread Don Schwarz
This is a known bug:
http://code.google.com/p/googleappengine/issues/detail?id=2082

Please star the issue to be notified when we fix it.  In the mean time, I
believe it's safe to ignore these XMPP messages.

On Mon, Sep 21, 2009 at 12:09 PM, Jason (Google) wrote:

> According to the docs, the message body should be a named POST parameter in
> the request object passed into the servlet. Can you log or otherwise take
> note of this parameter and the other XMPP parameters before calling
> parseMessage and report what you find?
> - Jason
>
>
> On Thu, Sep 17, 2009 at 10:47 PM, Prashant  wrote:
>
>> Hi,
>>
>>
>> It seems like xmpp api is missing message body once every few requests. I
>> am getting following error repeatedly, saying "Must set a body", while
>> parsing the request to Message. I am not using */_ah/xmpp/message/chat/*url 
>> for anything except for receiving xmpp messages. Neither this url is
>> accessible to anyone.
>>
>>
>>
>>
>>
>> #
>> 09-17 10:29PM 25.686
>>
>> /_ah/xmpp/message/chat/
>> java.lang.IllegalArgumentException: Must set a body
>> at
>> com.google.appengine.api.xmpp.MessageBuilder.build(MessageBuilder.java:54)
>> at
>> com.google.appengine.api.xmpp.InboundMessageParser.parseMessage(InboundMessageParser.java:51)
>> at
>> com.google.appengine.api.xmpp.XMPPServiceImpl.parseMessage(XMPPServiceImpl.java:111)
>> at antshpra.chat.servlets.Main.doPost(Main.java:97)
>> 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.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>> 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.serviceRequest(JettyServletEngineAdapter.java:139)
>> at
>> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
>> at
>> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4950)
>> at
>> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4948)
>> at
>> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>> at
>> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
>> at com.google.net.rpc.impl.Server$2.run(Server.java:823)
>> at
>> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
>> at
>> com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
>> at com.google.net.rpc.impl.Server.startRpc(Server.java:778)
>> at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
>> at
>> com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:437)
>> at
>> com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
>> at
>> com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
>> at
>> com.google.net.async.Connection.handleReadEvent(Connection.java:428)
>> at
>> com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
>> at
>> com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
>> at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
>> at
>> com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
>> at
>> com.google.apph

[appengine-java] Re: Type Owned by Two Different Types?

2009-09-21 Thread Marton Papp

Hi,

The code in that form also works for me, but just because the
exception is caught and never reported. If you rethrow any exceptions
from the catch blocks than you should get something like the
following:

Detected attempt to establish Parent2(3) as the parent of Parent1(1)/
Child1(2) but the entity identified by Parent1(1)/Child1(2) is already
a child of Parent1(1).  A parent cannot be established or changed once
an object has been persisted.
org.datanucleus.exceptions.NucleusUserException: Detected attempt to
establish Parent2(3) as the parent of Parent1(1)/Child1(2) but the
entity identified by Parent1(1)/Child1(2) is already a child of Parent1
(1).  A parent cannot be established or changed once an object has
been persisted.
at
org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch
(DatastoreRelationFieldManager.java:214)
at org.datanucleus.store.appengine.DatastoreRelationFieldManager
$1.setObjectViaMapping(DatastoreRelationFieldManager.java:129)
at org.datanucleus.store.appengine.DatastoreRelationFieldManager
$1.apply(DatastoreRelationFieldManager.java:108)
at
org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
(DatastoreRelationFieldManager.java:80)
at
org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
(DatastoreFieldManager.java:795)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
(DatastorePersistenceHandler.java:288)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
(DatastorePersistenceHandler.java:241)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
(DatastorePersistenceHandler.java:225)
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.makePersistent
(JDOPersistenceManager.java:694)
at hu.mapro.gae.test.forum.TestForum.testMultiParent(TestForum.java:
44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at org.junit.internal.runners.MethodRoadie.runTestMethod
(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:
79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters
(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod
(JUnit4ClassRunner.java:88)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods
(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run
(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected
(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected
(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run
(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)

The error message is self-explanatory. According to my knowledge it is
impossible for a single entity to have multiple parents, just as it is
impossible to change the parent of an entity (or any other part of its
primary key).

But you were talking about a "class" being in owned realationship with
two different classes, not an "entity". If I remove the comment from
the code above that creates a new child entity before assigning it to
the second parent instance then it is working as expected. Of course
they will be two different employee instances with different parents
(of different types)

[appengine-java] Re: How-to view stack dumps in GAE

2009-09-21 Thread Toby Reyelts
Hi Diana,

Throwable.printStackTrace() writes to System.err. App Engine ties System.err
to the java.util.logging.Logger named  using the Warning logging
level. If you've redirected System.err or don't have logging configured
correctly, your stacktraces can end up going somewhere else or getting
squashed. If you don't believe that's the problem, please provide us with
the simplest war that reproduces the symptom. You might also want to verify
that you can print to System.err directly without problems.

On Sat, Sep 19, 2009 at 11:34 AM, Diana Cruise wrote:

>
> What does GAE do with standard dumps such as e.printStackTrace()?
> Here is the Admin Console Log output in DEBUG mode for my test:
>
> I 09-19 08:14AM 54.605 [app1-widget/1.336449820535414591].:
> hello, testMode=false
> I 09-19 08:14AM 54.605 org.apache.jsp.test_jsp _jspService: hello2
> I 09-19 08:14AM 54.606 [app1-widget/1.336449820535414591].:
> hello3
>
> The output above comes from the code snippet below which tests Stdout,
> Logger, and then a forced stack dump.  As you can see the stack dump
> identified with the message "hello4" is NOT in the log output above.
> How do I view this stack dump in GAE?
>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> <%@ page import="java.util.*,
>widget.presentation.common.*"
> %>
> <%
> try {
>  UserSession userSess = UserSession.get(session, request, response);
>  System.out.println("hello, testMode=" + userSess.isTestMode());
>  java.util.logging.Logger logger = java.util.logging.Logger.getLogger
> ("widget");
>  logger.log(java.util.logging.Level.INFO, "hello2");
>  userSess.logInfo("hello3");
>  if (true) throw new Exception("hello4");
> %>
> 
> 
>
>
> width="100%">
> ...
> 
> <%
> } catch (Exception e) { e.printStackTrace(); }
> %>
>
> >
>

--~--~-~--~~~---~--~~
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 vs low level API

2009-09-21 Thread Corneliu Paul Lupulet
Thank you very much for your feedback Marton  :)
I hope you don't mind, but i will write some further comments to sustain my
cause.

I also would like to hear the opinion of someone from Google. I know you
guys recommend JDO, but can you give me some arguments against using the low
level API, besides portability (i plan to stick to google datastore
services) or code complexity. Why not harness the full power and flexibility
that the datastore has to offer ?!

On Mon, Sep 21, 2009 at 6:35 PM, Marton Papp  wrote:

>
> Hi Corneliu!
>
>
> I also had doubts about using JDO in GAE when I started to work with
> it. Especially because I met several bugs and it was annoying and time
> wasting to figure out what was going wrong. But then the bugs were
> fixed in the next release, so I think the guys are generally doing a
> good job.
>
> About the limitation with the non-existing property, you are right. It
> seems to me that JDO will create a property with a null value once you
> declare and map it. Do you have a real-life scenario where this
> limitation is an issue that you cannot overcome with the features
> provided by JDO? I think if you really need to have some entities
> having some properties, and others not, and still use JDO, then you
> could try to *map different classes to the same database entity*, with
> different properties defined in the classes. I have never tried that
> though, so I am not sure if it would work, and definitely would not be
> convenient.
>

How would i map different classes to the same database entity? They need to
have the same name. What do i do? I put them in different packages? On the
other hand, if i have an older version and a newer version of the same
object (with an extra field let's say) and i want to update a common field
on all objects (both old and new), i can do it with a couple of lines of
code using the low level API.

Again i would like the opinion of someone from Google. Why "hide" this
wonderful feature (dynamic schema - different properties of objects of the
same kind) while using JDO.


> About mapping collections with many entities inside, I think I just
> wouldn't do it. If the collection is too big to be effectively loaded
> into memory, then you are right to be using queries instead. In this
> case you should not map it as a collection, but handle the parent-
> child relationship explicitly. But still, collection mapping can be a
> convenient option if you have only a small number of entities in your
> collection. This does not make JDO less flexible, on the contrary, it
> introduces an extra service.
>



>
> Your idea about processing just part of the results at once in a query
> seems to be okay. I think a similar approach is described to handle
> pagination of large result sets somewhere in the forums.
>
> As for me, I would not recommend you to create your own data access
> layer using the low level API unless you really need it or you really
> do not need any of the features that JDO provides. It still provides
> some convenient features that you would have to live without or
> reimplement if you decide not to use JDO (starting with mapping java
> classes to persistent storage, which I think is a good thing). Most of
> the problems you mentioned are not solved by using the low level API
> anyway, so if you want to create some classes that make data access
> easier for you applications then you can build them on top of JDO as
> well, without any major drawbacks.
>
> And as final reason why to use JDO, these guys who wrote the docs
> recommended to do so, and they must have some reason to say that. :)
>
> Marton
> >
>

-- 
Corneliu Paul Lupulet

--~--~-~--~~~---~--~~
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: Plugin Hosted Mode failing to resolve import java.net.* on Macintosh

2009-09-21 Thread Toby Reyelts
Hey Ken,

As Jason says, the Eclipse plugin does not directly support validation of
GWT code, so you only see an error after running Hosted Mode. If you use've
intended this to be just server code, you should pull it up out of the GWT
client package you currently have it in.

On Mon, Sep 21, 2009 at 12:04 PM, ken  wrote:

>
> Hi,
>
> I seem to have an issue with the Google Plugin Hosted Mode and
> java.net on a Mac OS X 10.5.8.
> I have Eclipse Galilio with:
>Google App Engine Java SDK 1.2.5
>Google Plugin for Eclipse 3.5
>Google Web Toolkit SDK 1.7.0
>
> I created a new default GWT/AppEngine project (both checked) named
> TestOne with package minman.
> I set out to try to add a simple URL Fetch call to the generated entry
> point class TestOne.java.
> In the class TestOne.java, the only added code is these additional
> imports at the top:
>
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.io.InputStreamReader;
> import java.net.MalformedURLException;
> import java.net.URL;
>
> The Eclipse editor does NOT complain about these.
> I'm using the Mac JVM 1.5.0 MacOS X default in Eclipse.
>
> However, when I try to Debug or Run the TestOne app, the Google Web
> Tookit Hosted Mode panel shows the following (in red after the first):
>
> Initializing AppEngine server
> Loading an instance of module 'testone'
>   Refreshing module from source
>  Validating new compiled units
> Removing Units with errors
>Errors in 'file:/blah...blah/TestOne/src/minman/client/
> TestOne.java
>   Line 6: The import java.net cannot be resolved
>   Line 7: The import java.net cannot be resolved
> .etc
>
> [Of course, the app works ok without the 2 'import java.net.*'  lines
> listed above.]
>
> Also, I have code in other Java projects including those two import
> lines and which compiles and runs fine under Eclipse 3.3.
>
> Can this be resolved??
>
> Thanks in advance,
> Ken Bowen
> >
>

--~--~-~--~~~---~--~~
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: Retrieve of Collection model not working

2009-09-21 Thread Marton Papp

Hi,

Those two are equivalent Java constructs, and it should not be the
solution to your problem. Have you tried rewriting your code to the
original (having the return statement within the try block) and run it
again? Are you sure you have not changed anything else?

Marton


On Sep 21, 6:29 pm, Dhamu  wrote:
> my bad.. my stupid programming style I guess
>
> I changed from
>
> PersistenceManager pm = ...getPersistenceManager();
> try {
>         return pm.getObjectById(MyModel.class, id);} finally {
>
>         pm.close();
>
> }
>
> to
>
> PersistenceManager pm = ...getPersistenceManager();
> try {
>         MyModel m = pm.getObjectById(MyModel.class, id);
>         return pm.detachCopy(m);
>
> } finally {
>
>         pm.close();
>
> }
>
> and still it didn't work. and then I changed to
>
> PersistenceManager pm = ...getPersistenceManager();
> MyModel m = null, detached = null;
> try {
>         m = pm.getObjectById(MyModel.class, id);
>         detached = pm.detachCopy(m);
>
> } finally {
>
>         pm.close();}
>
> return detached;
>
> and hurray!!! it works now.. Thanks anyways...
> Anybody know why?
>
> On Sep 21, 2:42 pm, Dhamu  wrote:
>
> > // MyModel
> > String id
> > List values
> > List scores;
>
> > // get(id)
> > PersistenceManager pm = ...getPersistenceManager();
> > try {
> >         return pm.getObjectById(MyModel.class, id);
>
> > } finally {
> >         pm.close();
> > }
>
> > // store(obj);
> > PersistenceManager pm = ...getPersistenceManager();
> > try {
> >         pm.makePersistent(obj);
>
> > } finally {
> >         pm.close();
> > }
>
> > MyModel m = new MyModel();
> > m.setId("key1");
> > m.addValue("value1");
> > m.addScore(100);
> > store(m);
>
> > Datastore (snapshot): I can see the following values in datastore
> > (thats ok).
> > key1, [value1], [100]
>
> > if I call get("key1") and print the properties, it prints only the id
> > but values and scores are always null
>
> > // I am trying to update like this
> > MyModel m = get("key1"); // values and scores property are null, only
> > id has the value.
> > m.addValue("value2");
> > m.addScore(200);
> > store(m); // this always replaces the old row in database.
> > i.e. now the database has only
> > key1, [value2], [200]
>
> > Why? Please help. I might be doing something 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: Type Owned by Two Different Types?

2009-09-21 Thread objectuser

I'll let leszek talk more about the code, but I assumed that the
commented out line was just testing both scenarios.  In the scenario
without comment on the line, it would be my scenario: the same "owned
type" but not the same "owned instance".

My original question is not about one particular entity having two
parents (in an owned relationship), but having two entity groups share
the same "owned" Java type.

Does that make sense?

On Sep 21, 2:00 pm, Marton Papp  wrote:
> Hi,
>
> The code in that form also works for me, but just because the
> exception is caught and never reported. If you rethrow any exceptions
> from the catch blocks than you should get something like the
> following:
>
> Detected attempt to establish Parent2(3) as the parent of Parent1(1)/
> Child1(2) but the entity identified by Parent1(1)/Child1(2) is already
> a child of Parent1(1).  A parent cannot be established or changed once
> an object has been persisted.
> org.datanucleus.exceptions.NucleusUserException: Detected attempt to
> establish Parent2(3) as the parent of Parent1(1)/Child1(2) but the
> entity identified by Parent1(1)/Child1(2) is already a child of Parent1
> (1).  A parent cannot be established or changed once an object has
> been persisted.
>         at
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch
> (DatastoreRelationFieldManager.java:214)
>         at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $1.setObjectViaMapping(DatastoreRelationFieldManager.java:129)
>         at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $1.apply(DatastoreRelationFieldManager.java:108)
>         at
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
> (DatastoreRelationFieldManager.java:80)
>         at
> org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
> (DatastoreFieldManager.java:795)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
> (DatastorePersistenceHandler.java:288)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
> (DatastorePersistenceHandler.java:241)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
> (DatastorePersistenceHandler.java:225)
>         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.makePersistent
> (JDOPersistenceManager.java:694)
>         at hu.mapro.gae.test.forum.TestForum.testMultiParent(TestForum.java:
> 44)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
>         at org.junit.internal.runners.MethodRoadie.runTestMethod
> (MethodRoadie.java:98)
>         at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:
> 79)
>         at
> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters
> (MethodRoadie.java:87)
>         at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
> 77)
>         at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
>         at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod
> (JUnit4ClassRunner.java:88)
>         at org.junit.internal.runners.JUnit4ClassRunner.runMethods
> (JUnit4ClassRunner.java:51)
>         at org.junit.internal.runners.JUnit4ClassRunner$1.run
> (JUnit4ClassRunner.java:44)
>         at org.junit.internal.runners.ClassRoadie.runUnprotected
> (ClassRoadie.java:27)
>         at org.junit.internal.runners.ClassRoadie.runProtected
> (ClassRoadie.java:37)
>         at org.junit.internal.runners.JUnit4ClassRunner.run
> (JUnit4ClassRunner.java:42)
>         at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> (JUnit4TestReference.java:46)
>         at org.eclipse.jdt.internal.junit.runner.TestExecution.run
> (TestExecution.java:38)
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> (RemoteTestRunner.java:467)
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> (RemoteTestRunner.java:683)
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
> (RemoteTestRunner.java:390)
>         at org.eclipse.jdt.internal.ju

[appengine-java] Changing Item location in list..

2009-09-21 Thread Danny

class Container
{
private List items;
}


i added 3 items to the list then i saved it. loaded the list back
their position is saved and every
thing works.

now i want to change item 3 postition to be the first so i remove it
and add it to the start
then i save the container class. when i load back i still get the same
position.

how can i change the items location?(without deleting)
please 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: Plugin Hosted Mode failing to resolve import java.net.* on Macintosh

2009-09-21 Thread ken

Actually, it was a test of just having a button issue a URL Fetch (to
a public web service).
I shouldn't think that one would have to RPC first to a service,
depending of course on what was really going to be accomplished.  In
this case, I was going to extend this to a simple GET with an attached
query which was intended to trigger a certain action in the target
(non-Google-App) server, and the return value from the GET was to be
trivial (probably just a boolean).
  Of course, if the GET was going to obtain significant data for
processing, then it makes sense to issue the URL Fetch from the first
through the server which is going to process it.

Let me know if the App Engine architecture really requires me to run
my case via RPC through the App server too.  {I've posted to the GWT
list about the original question too.}

Thanks,
Ken

On Sep 21, 3:34 pm, Toby Reyelts  wrote:
> Hey Ken,
>
> As Jason says, the Eclipse plugin does not directly support validation of
> GWT code, so you only see an error after running Hosted Mode. If you use've
> intended this to be just server code, you should pull it up out of the GWT
> client package you currently have it in.
>
>
>
> On Mon, Sep 21, 2009 at 12:04 PM, ken  wrote:
>
> > Hi,
>
> > I seem to have an issue with the Google Plugin Hosted Mode and
> > java.net on a Mac OS X 10.5.8.
> > I have Eclipse Galilio with:
> >    Google App Engine Java SDK 1.2.5
> >    Google Plugin for Eclipse 3.5
> >    Google Web Toolkit SDK 1.7.0
>
> > I created a new default GWT/AppEngine project (both checked) named
> > TestOne with package minman.
> > I set out to try to add a simple URL Fetch call to the generated entry
> > point class TestOne.java.
> > In the class TestOne.java, the only added code is these additional
> > imports at the top:
>
> > import java.io.BufferedReader;
> > import java.io.IOException;
> > import java.io.InputStreamReader;
> > import java.net.MalformedURLException;
> > import java.net.URL;
>
> > The Eclipse editor does NOT complain about these.
> > I'm using the Mac JVM 1.5.0 MacOS X default in Eclipse.
>
> > However, when I try to Debug or Run the TestOne app, the Google Web
> > Tookit Hosted Mode panel shows the following (in red after the first):
>
> > Initializing AppEngine server
> > Loading an instance of module 'testone'
> >   Refreshing module from source
> >      Validating new compiled units
> >         Removing Units with errors
> >            Errors in 'file:/blah...blah/TestOne/src/minman/client/
> > TestOne.java
> >               Line 6: The import java.net cannot be resolved
> >               Line 7: The import java.net cannot be resolved
> > .etc
>
> > [Of course, the app works ok without the 2 'import java.net.*'  lines
> > listed above.]
>
> > Also, I have code in other Java projects including those two import
> > lines and which compiles and runs fine under Eclipse 3.3.
>
> > Can this be resolved??
>
> > Thanks in advance,
> > Ken Bowen
--~--~-~--~~~---~--~~
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] Newbie

2009-09-21 Thread jonisccp

Hi,

I am a newbiew to this environment but willing to learn.  I would like
to use Google apps engine to create a website like a fantasy football
league.  Can anyone tell me where I can start and what I can do to
learn how to program the website to be hiosted on google app engine?

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] Cascade delete

2009-09-21 Thread Marcel Overdijk

I have a Drinks entity which just contains a key which holds a String
to indicate the drink. Like "Coca Cola", "Pepsi", etc.
In my User entity I like to connect one or more favourite drinks of
the user.

I'm wondering if I delete a Drink if it will be removed from the users
automatically?

Theoretically this could be millions of users. So if need to it
manually I need to check all users and remove it. I guess this could
take more then the so important 30 secs.






--~--~-~--~~~---~--~~
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: Plugin Hosted Mode failing to resolve import java.net.* on Macintosh

2009-09-21 Thread Toby Reyelts
Hi Ken,

GWT and App Engine support two different sets of API, because they run on
two entirely different platforms (someone's browser vs Google's cloud). To
issue http requests from GWT, you can use
RequestBuilderwhich
delegates to your browser's implementation of XmlHttpRequest. To issue
http requests from App Engine you can use java.net.URL or our FetchService
directly.

On Mon, Sep 21, 2009 at 3:54 PM, ken  wrote:

>
> Actually, it was a test of just having a button issue a URL Fetch (to
> a public web service).
> I shouldn't think that one would have to RPC first to a service,
> depending of course on what was really going to be accomplished.  In
> this case, I was going to extend this to a simple GET with an attached
> query which was intended to trigger a certain action in the target
> (non-Google-App) server, and the return value from the GET was to be
> trivial (probably just a boolean).
>  Of course, if the GET was going to obtain significant data for
> processing, then it makes sense to issue the URL Fetch from the first
> through the server which is going to process it.
>
> Let me know if the App Engine architecture really requires me to run
> my case via RPC through the App server too.  {I've posted to the GWT
> list about the original question too.}
>
> Thanks,
> Ken
>
> On Sep 21, 3:34 pm, Toby Reyelts  wrote:
> > Hey Ken,
> >
> > As Jason says, the Eclipse plugin does not directly support validation of
> > GWT code, so you only see an error after running Hosted Mode. If you
> use've
> > intended this to be just server code, you should pull it up out of the
> GWT
> > client package you currently have it in.
> >
> >
> >
> > On Mon, Sep 21, 2009 at 12:04 PM, ken  wrote:
> >
> > > Hi,
> >
> > > I seem to have an issue with the Google Plugin Hosted Mode and
> > > java.net on a Mac OS X 10.5.8.
> > > I have Eclipse Galilio with:
> > >Google App Engine Java SDK 1.2.5
> > >Google Plugin for Eclipse 3.5
> > >Google Web Toolkit SDK 1.7.0
> >
> > > I created a new default GWT/AppEngine project (both checked) named
> > > TestOne with package minman.
> > > I set out to try to add a simple URL Fetch call to the generated entry
> > > point class TestOne.java.
> > > In the class TestOne.java, the only added code is these additional
> > > imports at the top:
> >
> > > import java.io.BufferedReader;
> > > import java.io.IOException;
> > > import java.io.InputStreamReader;
> > > import java.net.MalformedURLException;
> > > import java.net.URL;
> >
> > > The Eclipse editor does NOT complain about these.
> > > I'm using the Mac JVM 1.5.0 MacOS X default in Eclipse.
> >
> > > However, when I try to Debug or Run the TestOne app, the Google Web
> > > Tookit Hosted Mode panel shows the following (in red after the first):
> >
> > > Initializing AppEngine server
> > > Loading an instance of module 'testone'
> > >   Refreshing module from source
> > >  Validating new compiled units
> > > Removing Units with errors
> > >Errors in 'file:/blah...blah/TestOne/src/minman/client/
> > > TestOne.java
> > >   Line 6: The import java.net cannot be resolved
> > >   Line 7: The import java.net cannot be resolved
> > > .etc
> >
> > > [Of course, the app works ok without the 2 'import java.net.*'  lines
> > > listed above.]
> >
> > > Also, I have code in other Java projects including those two import
> > > lines and which compiles and runs fine under Eclipse 3.3.
> >
> > > Can this be resolved??
> >
> > > Thanks in advance,
> > > Ken Bowen
> >
>

--~--~-~--~~~---~--~~
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: about gzip issue

2009-09-21 Thread Jason (Google)
Can you reply with the request and response headers for a response that
should have been gzipped by App Engine but wasn't? If the Accept Encoding
header reports that the client can accept compressed responses, then App
Engine should gzip the response automatically:
http://code.google.com/appengine/docs/java/runtime.html#Responses

- Jason

On Fri, Sep 18, 2009 at 10:54 PM, congli...@gmail.com
wrote:

>
> Hi,
>   I found that the google app engine can't gzip my web response even
> if Accept-Encoding has been set by client.
>   Is there anything we need to do for this gzip protocol ?
>
>  thx a lot
>
>
> Regards,
> Cong Ling
> >
>

--~--~-~--~~~---~--~~
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 vs low level API

2009-09-21 Thread Marton Papp

Hi Corneliu!


About mapping different classes to the same table, this worked for me
in the dev server:

@PersistenceCapable(identityType = IdentityType.APPLICATION,
table="mappedTable")
public class Mapped1 {

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

String valueInCommon;

String value1;

  // ... getters-setters

}

@PersistenceCapable(identityType = IdentityType.APPLICATION,
table="mappedTable")
public class Mapped2 {

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

String valueInCommon;

String value2;

  // ... getters-setters

}

@Test
public void testMultiMapping() throws Exception {
PersistenceManager pm = pmf.getPersistenceManager();
Mapped1 m1 = null;
Mapped2 m2 = null;

pm.currentTransaction().begin();
m1 = new Mapped1();
m1.setValueInCommon("m1valueincommon");
m1.setValue1("m1value1");
pm.makePersistent(m1);
pm.currentTransaction().commit();

pm.currentTransaction().begin();
m2 = pm.getObjectById(Mapped2.class, m1.getId());
Assert.assertEquals("m1valueincommon", m2.getValueInCommon());
Assert.assertNull(m2.getValue2());
pm.currentTransaction().commit();
}

The thing is that you can specify the name of the target table in the
@PersistenceCapable annotation. It can be independent of the classes,
they do not need to be in separate packages. This way if you really
want to you can create entities in the same table using JDO, some of
them having a particular attribute while others not.


Marton

On Sep 21, 9:20 pm, Corneliu Paul Lupulet 
wrote:
> Thank you very much for your feedback Marton  :)
> I hope you don't mind, but i will write some further comments to sustain my
> cause.
>
> I also would like to hear the opinion of someone from Google. I know you
> guys recommend JDO, but can you give me some arguments against using the low
> level API, besides portability (i plan to stick to google datastore
> services) or code complexity. Why not harness the full power and flexibility
> that the datastore has to offer ?!
>
>
>
> On Mon, Sep 21, 2009 at 6:35 PM, Marton Papp  wrote:
>
> > Hi Corneliu!
>
> > I also had doubts about using JDO in GAE when I started to work with
> > it. Especially because I met several bugs and it was annoying and time
> > wasting to figure out what was going wrong. But then the bugs were
> > fixed in the next release, so I think the guys are generally doing a
> > good job.
>
> > About the limitation with the non-existing property, you are right. It
> > seems to me that JDO will create a property with a null value once you
> > declare and map it. Do you have a real-life scenario where this
> > limitation is an issue that you cannot overcome with the features
> > provided by JDO? I think if you really need to have some entities
> > having some properties, and others not, and still use JDO, then you
> > could try to *map different classes to the same database entity*, with
> > different properties defined in the classes. I have never tried that
> > though, so I am not sure if it would work, and definitely would not be
> > convenient.
>
> How would i map different classes to the same database entity? They need to
> have the same name. What do i do? I put them in different packages? On the
> other hand, if i have an older version and a newer version of the same
> object (with an extra field let's say) and i want to update a common field
> on all objects (both old and new), i can do it with a couple of lines of
> code using the low level API.
>
> Again i would like the opinion of someone from Google. Why "hide" this
> wonderful feature (dynamic schema - different properties of objects of the
> same kind) while using JDO.
>
>
>
> > About mapping collections with many entities inside, I think I just
> > wouldn't do it. If the collection is too big to be effectively loaded
> > into memory, then you are right to be using queries instead. In this
> > case you should not map it as a collection, but handle the parent-
> > child relationship explicitly. But still, collection mapping can be a
> > convenient option if you have only a small number of entities in your
> > collection. This does not make JDO less flexible, on the contrary, it
> > introduces an extra service.
>
> > Your idea about processing just part of the results at once in a query
> > seems to be okay. I think a similar approach is described to handle
> > pagination of large result sets somewhere in the forums.
>
> > As for me, I would not recommend you to create your own data access
> > layer using the low level API unless you really need it or you really
> > do not need any of the features that JDO provides. It still 

[appengine-java] Re: Pointing Domains

2009-09-21 Thread Danny

i mapped both domains and used the wild card
the only problem is that google enforces users currently to
register to google apps and then register the app to my domain
which is a very complicated and long process which not all users
understand how
plus whats worse is that there is no way to create an automated
creation

the process:
fill in questions about your domain + org create username and password
create a cname on your dns point to google
then register your app
create a new cname with the subdomain for your app

== very long and complicated :(


On 17 ספטמבר, 22:07, sal  wrote:
> You could just map both domains to one appengine app Id.
>
> Then inside your app, make a servlet that intercepts requests, looks
> at the domain/url and gives different HTML based on what was
> requested.
>
> (Servlets can be mapped to '*' wildcard URLs so that you can access /
> xyz or slash /foobar/x/y/z and its all the same.)
>
> On Sep 13, 10:31 am, Danny  wrote:
>
>
>
> > Hello,
> > i would like to know if is it possible in some way to add a dns server
> > in the google app engine ?
>
> > allowing multiple domains refereing to specifc urls inside my account
>
> > exmple: (without using the versions because these are not versions of
> > the application)
>
> >www.myapp1.com/p1
> > pointing to (internal) showPage?pageId="p1"
>
> >www.myapp2.com/index.html
> > pointing to (internal) showPage?pageId="index.html"
>
> > ..
>
> > this can be done on any host when using a dns server and refering to a
> > specific directory/file.
> > any one has any idea of how to do this here ?
> > or any work around?-הסתר טקסט מצוטט-
>
> -הראה טקסט מצוטט-
--~--~-~--~~~---~--~~
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: Owned One-to-One Relationship and Owned One-to-Many Relationship aren't compatible

2009-09-21 Thread Jason (Google)
Yes, it's related.
- Jason

On Sat, Sep 19, 2009 at 10:32 AM, objectuser wrote:

>
> Jason, is it also true that you can't have two one-to-one
> relationships of the same kind?  I'm able to save such a relationship,
> but when I fetch it, I get the same child in both values.  I need to
> debug further (would not be surprised if it's just something I'm doing
> wrong), but wondering if it's just a known issue.
>
> On Sep 17, 4:12 pm, "Jason (Google)"  wrote:
> > This is a known issue. At present, you can't have both a one-to-one and
> > one-to-many relationship of the same kind.
> > - Jason
> >
> > On Tue, Sep 15, 2009 at 2:57 PM, Tim  wrote:
> >
> > > It appears that these two statements work individually but not
> > > together.
> >
> > >@Persistent
> > >private ContactInfomanager;
> > >@Persistent
> > >private List  staff = new ArrayList();
> >
> > > Change either @Persistent to @NotPersistent and the unit test
> > > succeeds.
> >
> > > SDK: appengine-java-sdk-1.2.5
> >
> > > ** Stack Trace
> > > ***
> >
> > > java.lang.ClassCastException: oid is not instanceof
> > > javax.jdo.identity.ObjectIdentity
> > >at
> roster.ContactInfo.jdoCopyKeyFieldsFromObjectId(ContactInfo.java)
> > >at
> >
> > >
> org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObjectAsValue
> > > (PersistenceCapableMapping.java:657)
> > >at
> > >
> org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObject
> > > (PersistenceCapableMapping.java:364)
> > >at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> > > $1.setObjectViaMapping(DatastoreRelationFieldManager.java:132)
> > >at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> > > $1.apply(DatastoreRelationFieldManager.java:108)
> > >at
> >
> > >
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
> > > (DatastoreRelationFieldManager.java:80)
> > >at
> > > org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
> > > (DatastoreFieldManager.java:795)
> > >at
> >
> > >
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
> > > (DatastorePersistenceHandler.java:288)
> > >at
> > >
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
> > > (DatastorePersistenceHandler.java:241)
> > >at
> > >
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
> > > (DatastorePersistenceHandler.java:225)
> > >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.makePersistent
> > > (JDOPersistenceManager.java:694)
> > >at
> > > testing.TestContactInfo.testTwoRelationShips(TestContactInfo.java:
> > > 75)
> > >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >at sun.reflect.NativeMethodAccessorImpl.invoke
> > > (NativeMethodAccessorImpl.java:39)
> > >at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > > (DelegatingMethodAccessorImpl.java:25)
> > >at java.lang.reflect.Method.invoke(Method.java:597)
> > >at junit.framework.TestCase.runTest(TestCase.java:164)
> > >at junit.framework.TestCase.runBare(TestCase.java:130)
> > >at junit.framework.TestResult$1.protect(TestResult.java:106)
> > >at junit.framework.TestResult.runProtected(TestResult.java:124)
> > >at junit.framework.TestResult.run(TestResult.java:109)
> > >at junit.framework.TestCase.run(TestCase.java:120)
> > >at
> > > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
> > > (JUnit3TestReference.java:130)
> > >at org.eclipse.jdt.internal.junit.runner.TestExecution.run
> > > (TestExecution.java:38)
> > >at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> > > (RemoteTestRunner.java:467)
> > >at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> > > (RemoteTestRunner.java:683)
> > >at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
> > > (RemoteTestRunner.java:390)
> > >at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
> > > (RemoteTestRunner.java:197)
> > > *ContactInfo.java *
> > > import javax.jdo.annotations.IdGeneratorStrategy;
> > > import javax.jdo.annotations.IdentityType;
> > > import javax.jdo.an

[appengine-java] Re: Error 500 uploading index definitions

2009-09-21 Thread Jason (Google)
Your quotas look fine, including your indices count quota. Can you try
uploading one more time?
The vacuum_indexes command is currently only available in the Python SDK,
but you can still use this command even if you deployed your app using the
Java SDK.

- Jason

On Sat, Sep 19, 2009 at 1:52 PM, WSouza  wrote:

>
> Hello,
>
> I am trying to update my application and it shows the following error:
> Uploading index definitions.
> java.io.IOException: Error posting to URL:
>
> http://appengine.google.com/api/datastore/index/add?app_id=footbattle&version=1&;
> 500 Internal Server Error
>
>
> It was working until now, and the datastore-indexes.xml wasn't
> modified since last update that worked. From what I read on previous
> posts, it seems it is related to a problem with GAE reporting that my
> indexes quota is over limit, what is not true (it seems ok on Quota
> Details too, everything is at 0%, except CPU Time and deployments that
> are at 6%). How can I fix that?
>
>
> And, is there a way to do a vacuum indexes in a java application? Or
> just for python?
>
> 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: date between jdo query

2009-09-21 Thread Jason (Google)
Read more on indexes here:
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Introducing_Indexes

For more complex queries, you may have to define an index. If you run your
application in the local development server, it should generate the needed
index for you, then when you deploy your application, your index should
automatically start building. You can check this by clicking "Indexes" in
your app's Admin Console.

- Jason

On Fri, Sep 18, 2009 at 11:47 AM, sprz wrote:

>
> Thanks for your answers guys,
>
> actually I ran the exact same query as you bcottam, but as soon as I
> add other parameters in the query(like "&& field1==param1"), a
> DatastoreNeedIndexException is thrown every time.
> any idea why?
>
> On 18 sep, 16:56, bcottam  wrote:
> > I do this quite a bit in my app.
> > Basically I make a query like this:
> > Query q = pm.newQuery(MyClass.class, "myDate >= :firstDateParam &&
> > myDate <= :secondDateParam");
> > Map params = new HashMap();
> > params.put("firstDateParam", startDate);
> > params.put("secondDateParam", endDate);
> > q.executeWithMap(params);
> >
> > I typed this on my phone, so I may have bitchered some meathod
> > signatures, but this is about what I am doing. Hope it helps.
> >
> > On Sep 18, 12:44 am, sproz  wrote:
> >
> >
> >
> > > I am trying to write a JDO query where an entity field java.util.Date
> > > "DATEFIELD" is between 2 others java.util.Date parameters...but can
> > > not succeed
> > > Has anybody tried this before?
> >
> > > that would be a big help
> >
> > > Steve
> >
>

--~--~-~--~~~---~--~~
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: support for task queues in development environment?

2009-09-21 Thread Jason (Google)
Some of these requests may already have been filed in the public tracker,
but if they haven't, please feel free:
http://code.google.com/p/googleappengine/issues/list

- Jason

On Sat, Sep 19, 2009 at 10:54 PM, Tristan  wrote:

>
> I agree with this! Additionally, it'd be great to be able turn
> manualtaskexecution on/off from the admin console.
>
> -Tristan
>
> On Sep 8, 4:07 pm, Vince Bonfanti  wrote:
> > Being able to examine thetaskqueue, and release tasks manually--and
> > in different order than they were queued--is proving quite valuable.
> > It would be nice to keep this as an option when you add automatic
> > execution.
> >
> > Vince
> >
> > On Tue, Sep 8, 2009 at 2:42 PM, Max 
> > Ross>
> wrote:
> > > Interesting.  We were planning on getting rid of manualtaskexecution so
> > > that dev would completely match prod, but if your experience is shared
> by
> > > others it sounds like we should consider leaving the door open for
> manual
> > >taskexecution as well.
> >
> > > Thanks,
> > > Max
> >
> > > On Mon, Sep 7, 2009 at 8:52 AM, Vince Bonfanti 
> wrote:
> >
> > >> Perfect! At least for initial debugging, that's actually better than
> > >> having the tasks execute automatically--it makes it easier to see
> > >> what's going on with multiple tasks being queued.
> >
> > >> Thanks.
> >
> > >> On Sun, Sep 6, 2009 at 7:05 PM, Max 
> > >> Ross>
> wrote:
> > >> > Hi Vince,
> >
> > >> > In order to get thetaskqueue into the 1.2.5 release we had to take a
> > >> > shortcut with the local development environment.  Tasks execute
> > >> > automatically in production but not locally.  However, in the local
> > >> > environment you can kick off your tasks manually by visiting thetask
> > >> > queue
> > >> > admin console page, accessible via a link off of
> > >> >http://localhost:8080/_ah/admin
> >
> > >> > We thought we had this properly documented but it appears we do not.
> > >> > I've
> > >> > filed a bug and we'll get this taken care of quickly.
> >
> > >> > Sorry for the trouble.
> >
> > >> > Thanks,
> > >> > Max
> >
>

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



[appengine-java] Re: How to location my service in Unit testing?

2009-09-21 Thread Jason (Google)
Are you importing the class correctly? In the mail example, you can see that
it depends on the class Bug which is in the same package as the
BugNotificationTest class. If you import your classes, assuming they're in a
different package, you should be able to use them in your tests. If you can
be more specific about what you're seeing or post some code, I can try to
help you further.

- Jason

On Sat, Sep 19, 2009 at 7:42 PM, Donny  wrote:

>
> Hi,  I have a problem on locating my service in unit testing.
>
> I tried to follow the guide
> http://code.google.com/appengine/docs/java/howto/unittesting.html
> the sample code in guide to locate mail service is ok, but I cann't
> configure out how to location my own service.
> As I am using eclipse, the created project has a greeting service, how
> can I locate it? Neither using url, like "/myproject/greet" or class
> name works.
>
> Can anybody help? TIA.
>
>
> >
>

--~--~-~--~~~---~--~~
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] Lists not being saved with JDO

2009-09-21 Thread T_even

Hello,

I am new to google app engine and i am having some trouble in saving
some data.
I have a  class that have lists, those list have been 'declared'
persistent and i don't want any relation to be involved. However when
i try to save the object the data on the lists aren't saved. From what
i read of the documentation i should be able to save the lists without
any problem.
Here is the relevant code:

@Persistent
private List incomingFollowRequest;

public User(String name, String screenName, String adress, String
zipCode, String email)
{
this.name= name;
this.screenName= screenName;
this.adress= adress;
this.zipCode= zipCode;
this.email= email;
this.incomingFollowRequest= new ArrayList();
this.messageManager= new MessageManager();
this.following= new ArrayList();
this.followedBy= new ArrayList();
this.incomingFollowRequest.add(11l); // to see if the data is being
saved
}

user= new User("Test 2", "Bla2", "C2", "guess it 2",
"t...@da.com");
CommonDbCommands.AddUser(user);

static public void AddUser(User user)
{
PersistenceManager pm = PMF.get().getPersistenceManager();
Transaction tx= pm.currentTransaction();
try
{
tx.begin();
pm.makePersistent(user);
tx.commit();
}
finally
{
if(tx.isActive())
{
tx.rollback();
}
pm.close();
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Query a collection of entities with their IDs

2009-09-21 Thread Marton Papp

Hi Max,

I am surprised that this actually works. :)

I could not find the documentation describing this feature. Do you
know how is this implemented? Is it more efficient than just calling
getObjectByIdentity  N (=listOfKeys.size()) times?

Thanks,
Marton


On Sep 8, 9:14 pm, Max Ross  wrote:
> You can do the equivalent of a low level batch get with jdoql:
>
> Query q = pm.newQuery("select from " + Flight.class.getName() + " where
> id == :ids");
> @SuppressWarnings("unchecked")
> List flights = (List) q.execute(listOfKeys);
>
> Hope this helps,
> Max
>
> 2009/9/6 Zhi Le Zou 
>
> > Hi,
> > I have a class Foo defined as below:
>
> >   public class Foo{
>
> >   @PrimaryKey
> >   @Persistent(valueStrategy=
> > IdGeneratorStrategy.IDENTITY)
> >   private String fooID;
>
> >...
>
> >   }
>
> > Now, I have a list of IDs of the Foo entities, is it possible to retrieve
> > the corresponding collection of Foo entities in a single query? I found the
> > in the documentation, it says logic "or" and "IN" are not supported in the
> > java version app engine sdk, although it is supported in the python version.
>
> > Thanks in advance :-)
>
> > --
> > Best Regards
> > Robin (邹志乐)
--~--~-~--~~~---~--~~
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: Page taking too long to process. Need advice.

2009-09-21 Thread Jason (Google)
Are you seeing these response times on subsequent refreshes? I assume so
given the timestamps. What is your application ID?
One idea that would certainly help is using memcache to avoid querying on
every request, but I'll follow up on why you're seeing these response times
with the query. Are you doing anything else in your JSP besides displaying
these names?

- Jason

On Sun, Sep 20, 2009 at 1:50 AM, Gaurav  wrote:

>
> The JSP page I created is using too much of CPU and showing high
> latency.
>
> The page lists all the entities of type Person.class. (At present
> there are 43 entities in the datastore.)
> (Person is a root entity)
>
> Following is the method to return the list of all Person objects in
> the datastore :-
>
> public class ListPersons {
>
>public static List allPersons(){
>
>PersistenceManager pm = PMF.get().getPersistenceManager();
>Query query = pm.newQuery(Person.class);
>List results = (List) query.execute();
>return results;
>}
> }
>
>
> The JSP page code :
>
> <%
>List peopleList = ListPersons.allPersons();
>Iterator iter = peopleList.iterator();
>while(iter.hasNext()){
>Person p = (Person) iter.next();
>out.print(""+p.getFullName());
>}
>
> %>
>
>
> Request logs for this page:
>
> 09-20 01:29AM 35.604 / 200 848ms 1383cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:29AM 33.286 / 200 850ms 1344cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:29AM 29.196 / 200 807ms 1383cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:29AM 24.946 / 200 792ms 1364cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:29AM 20.197 / 200 839ms 1383cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:26AM 55.564 / 200 779ms 1364cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:26AM 38.545 / 200 737ms 1344cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:26AM 36.355 / 200 869ms 1325cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:26AM 34.205 / 200 817ms 1402cpu_ms 1072api_cpu_ms 1kb
> 09-20 01:26AM 32.245 / 200 782ms 1364cpu_ms 1072api_cpu_ms 1kb
>
> Clearly I am doing something wrong. I just don't know what it is.
> The page is displaying the results correctly. It's just taking too
> long.
>
> How can I optimize it? Need help.
> >
>

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



[appengine-java] Re: How to use Unencoded String as primarykey with JDO

2009-09-21 Thread Jason (Google)
Hi Jaap. Can you paste the code you're using to create and persist the
Employee? This would be a good point to write a quick unit test for the
local environment to make sure that the Employee persist code is working as
expected -- verifying the String passed into the constructor isn't null,
etc.
http://code.google.com/appengine/docs/java/howto/unittesting.html

- Jason

On Sun, Aug 16, 2009 at 4:09 PM, Jaap  wrote:

>
> Hi,
>
> According to
> http://code.google.com/intl/de/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys
>
> it is possible to set the primay keys yourself to a unique string.
> When I use the code below this email however the hosted server gives
> the following error
>
> SEVERE: [1250461028948000] javax.servlet.ServletContext log: Exception
> while dispatching incoming RPC call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method
> 'public abstract java.lang.String
> org.haitsma.gwttest.client.GreetingService.greetServer
> (java.lang.String)' threw an unexpected exception:
> org.datanucleus.exceptions.NucleusUserException: The primary key for
> org.haitsma.gwttest.client.Employee is an unencoded string but the key
> of the corresponding entity in the datastore does not have a name.
> You may want to either change the primary key to be an encoded string
> (add the "gae.encoded-pk" extension), change the primary key to be of
> type com.google.appengine.api.datastore.Key, or, if you're certain
> that this class will never have a parent, change the primary key to be
> of type Long.
>
> What do I do wrong? Also when I add @Persistent annotation behind
> @PrimaryKey I get the same error.
>
> Thanks,
>
> Jaap
>
>
> Example code
> --
> import java.util.Date;
> import javax.jdo.annotations.IdGeneratorStrategy;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.Persistent;
> import javax.jdo.annotations.PrimaryKey;
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Employee {
>@PrimaryKey
>private String name;
>
>@Persistent
>private Date hireDate;
>
>public Employee(String name, Date hireDate) {
>this.name = name;
>this.hireDate = hireDate;
>}
>
>public String getName() {
>return name;
>}
>
>public void setName(String name) {
>this.name = name;
>}
>
>public Date getHireDate() {
>return hireDate;
>}
>
>public void setHireDate(Date hireDate) {
>this.hireDate = hireDate;
>}
> }
> >
>

--~--~-~--~~~---~--~~
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 : How to make an unowned reference to an entity if we don't know its key yet ?

2009-09-21 Thread Jason (Google)
FYI, the low-level datastore has a new allocateIds function, so you can get
a reference to an entity's key before writing the entity. This seems to be
what you're looking for. Using unowned relationships wouldn't work because,
as objectuser pointed out, your entities would all be in separate entity
groups and hence you wouldn't be able to use transactions -- you would have
to use owned relationships for this.

- Jason

On Sat, Sep 19, 2009 at 6:47 AM, mlenormand wrote:

>
> Hi Everybody,
>
> Here's my problem with JDO and unowned relationships :
>
> I have several entities of the same kind that are organized in a
> hierarchical way, maintained with unowned relationships.
> JDO can generate keys for my entities when they are written to the
> datastore, but with this option, I can't know my entity's keys until
> they are saved to the datastore. If I want to make a reference to an
> entity A from an entity B, it seems to be impossible because at this
> time I don't know A's key, that will be generated when transaction is
> committed.
>
> One solution would be to use several transactions, each one would
> persist an entity, but it's not good because I want to persist all the
> entities in the same transaction.
>
> I know that defining keys myself could solve the problem, but maybe
> there is an other solution that would be better ?
>
> Thank you for your help. And thank you to the GAE team for the
> fantastic work you did !
> >
>

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



[appengine-java] Re: can xmpp api send and receive messages using gmail ids?

2009-09-21 Thread Jason (Google)
A Gmail address is a valid Jabber ID, so yes, you should be able to do this.
Along the same lines, you can use Google Talk to send and receive XMPP
messages to/from your App Engine app.
- Jason

On Sun, Sep 20, 2009 at 8:26 AM, Prashant  wrote:

> Hi,
>
>
> is it possible to use xmpp api to send and receive messages using gmail ids
> ?
>
>
> 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] Multimap in JDO

2009-09-21 Thread Dhamu

How to use multimap (http://google-collections.googlecode.com/svn/
trunk/javadoc/com/google/common/collect/Multimap.html) in jdo?


I get the following exception.
org.datanucleus.exceptions.NucleusUserException: Field
"...model.jdo.MyModel.content" is declared as a reference type
(interface/Object) but no implementation classes of
"com.google.common.collect.Multimap" have been found!

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



[appengine-java] Re: appengine with gwt and gwt-ext

2009-09-21 Thread Jason (Google)
Hi Greg. In that case, you may want to post in the GWT discussion group --
if the JAR is in your lib folder, it should be deployed with your
application.
I've been told that the error can occur when the GWT compiler doesn't know
where to pull in the code because you haven't old it to include the
third-party module code via an "inherits" tag inside your gwt.xml module
file, but since it works in Eclipse, it should work elsewhere.

It also may be possible that you're launching a different gwt.xml module
file in Eclipse than on the command-line build, the latter of which is
broken, but this is largely outside the scope of my expertise. Please look
into this, and if your error persists, ping the GWT forum.

Thank you,
- Jason

On Fri, Sep 18, 2009 at 6:55 AM, GregGG  wrote:

>
> I put the single gwtext.jar in war/WEB-INF/lib and added it to my
> library build list in eclipse.  I'm not sure if this is relevant but I
> haven't updated to the most recent version of the eclipse plugin yet.
> I plan on doing that this weekend to see if it resolves my problem.
>
>
> On Sep 17, 7:38 pm, "Jason (Google)"  wrote:
> > Were your gwt-ext JARs in war/WEB-INF/lib when you deployed your app or
> did
> > you reference them from another location in your Eclipse build path?
> >
> > - Jason
> >
> > On Tue, Sep 15, 2009 at 8:30 PM, GregGG  wrote:
> >
> > > Just in case others are interested, after getting my app working with
> > > gwt, I decided to see if I could use gwt-ext as well.   I seem to have
> > > gotten my app working with gwt-ext fine in my eclipse developer
> > > environment by following the helpful instructions at
> >
> > >http://paulgrenyer.blogspot.com/2009/04/setting-up-gwt-ext-for-gwt-16.
> ..
> > > (note, I only had to unzip the following to my js directory; adapter/,
> > > resources/, ext-all-debug.js, ext-all.js, ext-core-debug.js, ext-
> > > core.js) .  But I get the following errors when I upload to appspot:
> >
> > > Removing units with errors
> > > [ERROR] Errors in 'file:/C:/unscanned/workspaces/project/src/com/
> > > project/web/client/WebPage.java'
> > > [ERROR] Line 418: No source code is available for type
> > > com.gwtext.client.widgets.CycleButton; did you forget to inherit a
> > > required module?
> > > [ERROR] Line 422: No source code is available for type
> > > com.gwtext.client.widgets.menu.CheckItem; did you forget to inherit a
> > > required module?
> > > [ERROR] Line 425: No source code is available for type
> > > com.gwtext.client.widgets.event.CycleButtonListenerAdapter; did you
> > > forget to inherit a required module?
> >
> > > Regardless of these errors, the app seems to be running fine on
> > > appspot.  If anyone has any ideas how I can prevent these errors,
> > > please let me know.
> >
> > > 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: Plugin Hosted Mode failing to resolve import java.net.* on Macintosh

2009-09-21 Thread ken

Thanks Toby,

And no surprise, moving my URL Fetch from the GWT client to the GWT
serverimpl makes it all work fine.
And from the GWT list:java.net package is not supported by GWT

Re: Jason's original comment, I'm not sure there's a bug to be filed.
It would be nice if the Plugin could distinguish GWT client classes
from all others (including GWT serverimpl classes) and validate
accordingly, but that might be some unpleasant work.

Thanks to all,
Ken

On Sep 21, 4:09 pm, Toby Reyelts  wrote:
> Hi Ken,
>
> GWT and App Engine support two different sets of API, because they run on
> two entirely different platforms (someone's browser vs Google's cloud). To
> issue http requests from GWT, you can use
> RequestBuilderwhich
> delegates to your browser's implementation of XmlHttpRequest. To issue
> http requests from App Engine you can use java.net.URL or our FetchService
> directly.
>
>
>
> On Mon, Sep 21, 2009 at 3:54 PM, ken  wrote:
>
> > Actually, it was a test of just having a button issue a URL Fetch (to
> > a public web service).
> > I shouldn't think that one would have to RPC first to a service,
> > depending of course on what was really going to be accomplished.  In
> > this case, I was going to extend this to a simple GET with an attached
> > query which was intended to trigger a certain action in the target
> > (non-Google-App) server, and the return value from the GET was to be
> > trivial (probably just a boolean).
> >      Of course, if the GET was going to obtain significant data for
> > processing, then it makes sense to issue the URL Fetch from the first
> > through the server which is going to process it.
>
> > Let me know if the App Engine architecture really requires me to run
> > my case via RPC through the App server too.  {I've posted to the GWT
> > list about the original question too.}
>
> > Thanks,
> > Ken
>
> > On Sep 21, 3:34 pm, Toby Reyelts  wrote:
> > > Hey Ken,
>
> > > As Jason says, the Eclipse plugin does not directly support validation of
> > > GWT code, so you only see an error after running Hosted Mode. If you
> > use've
> > > intended this to be just server code, you should pull it up out of the
> > GWT
> > > client package you currently have it in.
>
> > > On Mon, Sep 21, 2009 at 12:04 PM, ken  wrote:
>
> > > > Hi,
>
> > > > I seem to have an issue with the Google Plugin Hosted Mode and
> > > > java.net on a Mac OS X 10.5.8.
> > > > I have Eclipse Galilio with:
> > > >    Google App Engine Java SDK 1.2.5
> > > >    Google Plugin for Eclipse 3.5
> > > >    Google Web Toolkit SDK 1.7.0
>
> > > > I created a new default GWT/AppEngine project (both checked) named
> > > > TestOne with package minman.
> > > > I set out to try to add a simple URL Fetch call to the generated entry
> > > > point class TestOne.java.
> > > > In the class TestOne.java, the only added code is these additional
> > > > imports at the top:
>
> > > > import java.io.BufferedReader;
> > > > import java.io.IOException;
> > > > import java.io.InputStreamReader;
> > > > import java.net.MalformedURLException;
> > > > import java.net.URL;
>
> > > > The Eclipse editor does NOT complain about these.
> > > > I'm using the Mac JVM 1.5.0 MacOS X default in Eclipse.
>
> > > > However, when I try to Debug or Run the TestOne app, the Google Web
> > > > Tookit Hosted Mode panel shows the following (in red after the first):
>
> > > > Initializing AppEngine server
> > > > Loading an instance of module 'testone'
> > > >   Refreshing module from source
> > > >      Validating new compiled units
> > > >         Removing Units with errors
> > > >            Errors in 'file:/blah...blah/TestOne/src/minman/client/
> > > > TestOne.java
> > > >               Line 6: The import java.net cannot be resolved
> > > >               Line 7: The import java.net cannot be resolved
> > > > .etc
>
> > > > [Of course, the app works ok without the 2 'import java.net.*'  lines
> > > > listed above.]
>
> > > > Also, I have code in other Java projects including those two import
> > > > lines and which compiles and runs fine under Eclipse 3.3.
>
> > > > Can this be resolved??
>
> > > > Thanks in advance,
> > > > Ken Bowen
--~--~-~--~~~---~--~~
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] GAE JUnit testing documentation

2009-09-21 Thread Pion

I am reading http://code.google.com/appengine/docs/java/howto/unittesting.html.
I am having a hard time to understand it.

Where can I find any/all of the following doc/code/sample?

* Complete "Hello World" sample?

* Complete sample using the GAE Getting Started
http://code.google.com/appengine/docs/java/gettingstarted/usingdatastore.html

* The Javadoc of
com.google.appengine.tools.development.ApiProxyLocalImpl and
 com.google.apphosting.api.ApiProxy.

* Any more doc/sample/code will help.

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



[appengine-java] Re: Type Owned by Two Different Types?

2009-09-21 Thread objectuser

After some more testing this is what I observe:
- If A has one C property and B has two C properties, I can save both
the A and the B instances, when I get the B instance, both C
properties point to the same instance of C.
- If A has one C property and B has a property that is a List of Cs, I
get the exception in my original post.

I guess I need to work this down to a repeatable example and file a
defect report.

On Sep 21, 2:49 pm, objectuser  wrote:
> I'll let leszek talk more about the code, but I assumed that the
> commented out line was just testing both scenarios.  In the scenario
> without comment on the line, it would be my scenario: the same "owned
> type" but not the same "owned instance".
>
> My original question is not about one particular entity having two
> parents (in an owned relationship), but having two entity groups share
> the same "owned" Java type.
>
> Does that make sense?
>
> On Sep 21, 2:00 pm, Marton Papp  wrote:
>
> > Hi,
>
> > The code in that form also works for me, but just because the
> > exception is caught and never reported. If you rethrow any exceptions
> > from the catch blocks than you should get something like the
> > following:
>
> > Detected attempt to establish Parent2(3) as the parent of Parent1(1)/
> > Child1(2) but the entity identified by Parent1(1)/Child1(2) is already
> > a child of Parent1(1).  A parent cannot be established or changed once
> > an object has been persisted.
> > org.datanucleus.exceptions.NucleusUserException: Detected attempt to
> > establish Parent2(3) as the parent of Parent1(1)/Child1(2) but the
> > entity identified by Parent1(1)/Child1(2) is already a child of Parent1
> > (1).  A parent cannot be established or changed once an object has
> > been persisted.
> >         at
> > org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch
> > (DatastoreRelationFieldManager.java:214)
> >         at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> > $1.setObjectViaMapping(DatastoreRelationFieldManager.java:129)
> >         at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> > $1.apply(DatastoreRelationFieldManager.java:108)
> >         at
> > org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
> > (DatastoreRelationFieldManager.java:80)
> >         at
> > org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
> > (DatastoreFieldManager.java:795)
> >         at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
> > (DatastorePersistenceHandler.java:288)
> >         at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
> > (DatastorePersistenceHandler.java:241)
> >         at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
> > (DatastorePersistenceHandler.java:225)
> >         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.makePersistent
> > (JDOPersistenceManager.java:694)
> >         at hu.mapro.gae.test.forum.TestForum.testMultiParent(TestForum.java:
> > 44)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke
> > (NativeMethodAccessorImpl.java:39)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > (DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:597)
> >         at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
> >         at org.junit.internal.runners.MethodRoadie.runTestMethod
> > (MethodRoadie.java:98)
> >         at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:
> > 79)
> >         at
> > org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters
> > (MethodRoadie.java:87)
> >         at 
> > org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
> > 77)
> >         at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
> >         at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod
> > (JUnit4ClassRunner.java:88)
> >         at org.junit.internal.runners.JUnit4ClassRunner.runMethods
> > (JUnit4ClassRunner.java:51)
> >         at org.junit.internal.runners.JUnit4ClassRunner$1.run
> > (JUnit4ClassRunner.java:44)
> >         at org.junit.internal.runners.ClassRoadie.runUnprotected
> > (ClassRoadie.java:27)
> >         at org.junit.internal.runners.ClassRoadie.runProtected
> > (ClassRoadie.java:37)
> >         

[appengine-java] ApiProxyLocalImpl.getService question [junit]

2009-09-21 Thread Pion

I have the following server side code:

package com.foo.server;
// code deleted for brevity
/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class FooServiceImpl extends RemoteServiceServlet implements
FooService {
// code deleted for brevity
@Override
public String barTest() {
return "unitTest";
}
} // FooServiceImpl

I copied/implemented the TestEnvironment and LocalServiceTestCase
classes as shown on 
http://code.google.com/appengine/docs/java/howto/unittesting.html.

Then, I implemented the following:
public class ServerTest extends LocalServiceTestCase {

ApiProxyLocalImpl proxy = (ApiProxyLocalImpl)
ApiProxy.getDelegate();
FooServiceImpl server =  (FooServiceImpl ) proxy.getService
("com.foo.server");

String result = barTest();  // produces
java.lang.NullPointerException
assertEquals("unitTest", result);

} // ServerTest

I got the java.lang.NullPointerException on this line "String result =
barTest();"

My environments: GAE 1.25, GWT 1.7, Eclipse-Galileo on Windows Vista.

I am new on this. What did I do wrong?

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



[appengine-java] Re: JDO query using LIKE

2009-09-21 Thread rissen

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



[appengine-java] Re: can xmpp api send and receive messages using gmail ids?

2009-09-21 Thread Prashant
no, no, no, i meant to say that i want to send/receive xmpp to my friends'
ids etc. form my gmail id using my app (instead of gTalk), say a kind of
automated replies. if it is possible then how?

--~--~-~--~~~---~--~~
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] JDO/JPA Snippets That Work - Executing Batch Gets

2009-09-21 Thread Max Ross
Hello again and welcome to this week's installment of JDO/JPA Snippets That
Work: Executing Batch Gets

Did you know that the App Engine datastore supports batch gets?  Batch gets
are a super-efficient way to load multiple entities when you already have
the keys of the entities you want loaded.  Here's an example using the
low-level Datastore API:

  public Map getById(List keys) {
  DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
  return ds.get(keys);
  }

Now lets see how we can accomplish the same thing in JPA and JDO:

JPA:
@Entity
public class Book {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Key key;
private String title;

// additional members, getters and setters
}


public List getById(List keys) {
Query q = em.createQuery("select from " + Book.class.getName() + " where
key = :keys");
q.setParameter("keys", keys);
return (List) q.getResultList();
}


JDO:
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Book {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Key key;
private String title;

// additional members, getters and setters
}

public List getById(List keys) {
Query q = pm.newQuery("select from " + Book.class.getName() + " where
key == :keys");
return (List) q.execute(keys);
}

Notice how in both examples we're constructing a query to pull back the
entities by key.  The App Engine JDO/JPA implementation detects queries that
are filtering only by key and fulfills them using a low level batch get
rather than a datstore query.  This works no matter the type of your primary
key field, so whether you're using a Long, an unencoded String, an encoded
String, or a Key, the same technique will work.  However, even though this
looks like a query, all the fetch-related transaction restrictions apply: if
you're executing your batch get query inside a txn, all of the entities
you're attempting to fetch must belong to the same entity group or you'll
get an exception. Be careful with this.

The next time you need to pull back multiple entities and you already have
their keys, issue a query that filters only by your object's key field and
reap the benefits of the datastore's optimized batch get mechanism.

Until next time
Max

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



[appengine-java] excel to datatstore.. help

2009-09-21 Thread mar_novice

Is there a way to import data from excel to datastore??
--~--~-~--~~~---~--~~
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: excel to datatstore.. help

2009-09-21 Thread datanucleus

Use the DataNucleus excel plugin and make the data available to GAE/J
using the DataNucleus REST plugin ?
--~--~-~--~~~---~--~~
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] not able to send emails using google apps engine

2009-09-21 Thread Vik
Hie
Getting following exception:


javax.mail.MessagingException: Illegal Arguments
(java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized
sender



The from address is on of the user i have created in my google apps
account associated with my domain www.sakshum.com



the from id i m using is subscr...@sakshum.com



So, how to fix this? I may like to use different from ids depending
upon the context in which a request is raised in my app.


Thankx and Regards

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

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



[appengine-java] Re: excel to datatstore.. help

2009-09-21 Thread datanucleus

In fact, as long as GAE/J allows opening of files then the DataNucleus
Excel plugin could be used to retrieve the data into Java objects, and
these persisted straight to BigTable using the Google DataNucleus
plugin, just like "replication".
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---