[appengine-java] One – Many Child Persistence help

I’ve been trying to tweak this to get it working for a while now and

I’ve had no luck at all.

First off I create two classes

@PersistenceCapable(identityType = IdentityType.APPLICATION,

detachable = "true")

public class ServerContent implements Serializable {

private static final long serialVersionUID = 7230645578648036546L;

@PrimaryKey

@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)

private Key id;

@Persistent

private int rating = 0;

@Persistent

private Text widgetContent;

@Persistent

private String user;

@Persistent

private Date date;

@Persistent

private String title;

@Persistent(mappedBy = "parentKey")

@Element(dependent = "true")

private List<ServerComment> comments = new

ArrayList<ServerComment>();

And the second class

@PersistenceCapable(identityType = IdentityType.APPLICATION,

detachable = "true")

public class ServerComment implements Serializable {

private static final long serialVersionUID = 7577060064503658111L;

@PrimaryKey

@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)

private Key id;

@Persistent

private ServerContent parentKey;

@Persistent

private Text content;

@Persistent

private Date date;

@Persistent

private String user;

@Persistent

private boolean approved;

@Persistent

private int rating;

I have a method which will create a comment on some content. The Web

page updates correctly but the call to save ServerContent never works.

I get a silent failure in by AsyncCallback and it throws a

com.google.gwt.user.client.rpc.SerializationException with the details

null and stacktrace null.

I have saved the parent class with an empty set of ServerComment

When I add new ServerComments to by ServerContent class and then try

and save the parent, the error is thrown. I’ve been trying to get

around this for over a day now! any help is much appreciated 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+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.

Re: [google-appengine] Re: relationship…

Basically GAE is a web-hosting with (currently) two platforms available -

Python and Java, and with "kinda weird" database to build upon. :)

On Wed, Apr 21, 2010 at 4:52 PM, Wooble <geoffspear@gmail.com> wrote:

>

>

> On Apr 21, 9:47 am, Matlab <rizvan.asga…@yahoo.com> wrote:

> > Hi friends,

> > I’m new at this forum and hope that everything will be ‘OK’…

> >

> > My question is that what is the relationship between GAE and GWT?

> >

> > Thanks in advance,

> > Matlab

>

> They’re both made by Google and they both have something to do with

> the web. Other than that, there’s no relationship. You can certainly

> use GAE as the backend for a GWT application, but it’s no different

> than using any other host.

>

> –

> You received this message because you are subscribed to the Google Groups

> "Google App Engine" group.

> To post to this group, send email to google-appengine@googlegroups.com.

> To unsubscribe from this group, send email to

> google-appengine+unsubscribe@googlegroups.com<google-appengine%2Bunsubscribe@googlegroups.com>

> .

> For more options, visit this group at

> http://groups.google.com/group/google-appengine?hl=en.

>

>

You received this message because you are subscribed to the Google Groups "Google App Engine" group.

To post to this group, send email to google-appengine@googlegroups.com.

To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Basically GAE is a web-hosting with (currently) two platforms available – Python and Java, and with "kinda weird" database to build upon. :)

On Wed, Apr 21, 2010 at 4:52 PM, Wooble <geoffspear@gmail.com> wrote:

On Apr 21, 9:47 am, Matlab <rizvan.asga…@yahoo.com> wrote:
> Hi friends,
> I'm new at this forum and hope that everything will be 'OK'…
>
> My question is that what is the relationship between GAE and GWT?
>
> Thanks in advance,
> Matlab

They're both made by Google and they both have something to do with
the web.  Other than that, there's no relationship.  You can certainly
use GAE as the backend for a GWT application, but it's no different
than using any other host.


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


You received this message because you are subscribed to the Google Groups “Google App Engine” group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

[appengine-java] Re: java.lang.RuntimeException: Version not ready.

Same issue in python…..Here we go again : (

On Apr 20, 3:01 pm, Robert Cooper <keber…@gmail.com> wrote:

> I am trying to update "shortyz-xword" and am getting timeouts. I can’t

> extract any useful info from the admin log. Is there something going

> on today?

>

> –

> 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+unsubscribe@googlegroups.com.

> For more options, visit this group athttp://groups.google.com/group/google-appengine-java?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+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.

[google-appengine] stuck in loop, deploying

i’ve deployed and am getting messages rolling back, to keep waiting:

Will check again in 16 seconds.

Checking if new version is ready to serve.

Will check again in 32 seconds.

Checking if new version is ready to serve.

Will check again in 60 seconds.

Checking if new version is ready to serve.

Will check again in 60 seconds.

Checking if new version is ready to serve.

Will check again in 60 seconds.

Checking if new version is ready to serve.

Will check again in 60 seconds.

Checking if new version is ready to serve.

Will check again in 60 seconds.

Checking if new version is ready to serve.

Will check again in 60 seconds.

anyone know how to unstick?

- martin

- id: xinbox-crm

You received this message because you are subscribed to the Google Groups "Google App Engine" group.

To post to this group, send email to google-appengine@googlegroups.com.

To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Re: GWT application parameters

I think the point we’re missing is who is "I" in "If I would like this

program to start in demo mode". You’re saying that you want a setup

where you fire up the server in one mode or the other, and everyone

who accesses the page gets the one same mode depending on how you

start the server? Well that’s pretty easy, you could for instance use

servlet parameters specified in your web.xml file. Here’s a random

google webpage with code for that: http://www.exampledepot.com/egs/javax.servlet/GetInit.html

More normal, and a good use of deferred binding, would be to have two

slightly different addresses, one for demo and one for normal mode, so

you can just point people to the appropriate site and not have to

restart the server every time you want to change the mode everyone

sees. If you do that, you could pass a parameter to your server RPC

calls indicating that the client is running in one mode or the other

to have the server respond with the correct stuff.

On Apr 21, 9:04 pm, "sunny…@gmail.com" <sunny…@gmail.com> wrote:

> hmm…I guess I’m not being clear enough.

>

> Say in your run of the mill Java CLI programs. If I would like this

> program to start in demo mode to show certain messages, then I would

> do:

> java programName demo

> The program would see the ‘demo’ argument in the main method.

>

> In the GWT case, I would like to be able to do the same to the server.

> The client’s GUI can already act in normal or demo mode based on one

> initial "is-the-server-running-in-demo-mode" GWT-RPC call to the

> server. At the moment the RPC implementation is just hardcoded to

> return a static final boolean. The server’s code also looks at this

> variable in various places to decide whether a piece of functionality

> should act in normal or demo mode.

>

> Obviously using a variable in this way is pointless as I would have to

> recompile the code and redeploy the WAR file if I wanted to change

> modes. Hence, if I was able to use something like argv[] in the CLI

> example, it would just be a matter of restarting the server with

> different arguments.

>

> I hope thats made my use case a bit clearer.

>

> Sunny

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-web-toolkit@googlegroups.com.

To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: [appengine-python] module not found when using remote api

Hi John,

are you starting the remote_shell from within the bloggart directory?

I don’t know how the prompt of your console is build, but at first

sight it looks like your working in your home directory.

Regards,

Andi

On Wed, Apr 21, 2010 at 2:45 AM, John <johnnytee@gmail.com> wrote:

> I’m using the remote api to migrate to nick johnson’s bloggart. I can

> log in, but when I try to import a module it says not found.

>

> Here’s my console output:

> john-turners-macbook-pro:~ johnnytee$ PYTHONPATH=. remote_api_shell.py

> john-turner

> /Applications/GoogleAppEngineLauncher.app/Contents/Resources/

> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/

> google/appengine/ext/remote_api/remote_api_stub.py:64:

> DeprecationWarning: the sha module is deprecated; use the hashlib

> module instead

>  import sha

> /Applications/GoogleAppEngineLauncher.app/Contents/Resources/

> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/

> google/appengine/tools/dev_appserver_login.py:33: DeprecationWarning:

> the md5 module is deprecated; use hashlib instead

>  import md5

> Email: johnnytee@gmail.com

> Password:

> App Engine remote_api shell

> Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)

> [GCC 4.2.1 (Apple Inc. build 5646)]

> The db, users, urlfetch, and memcache modules are imported.

> john-turner> import migrate

> Traceback (most recent call last):

>  File "<console>", line 1, in <module>

> ImportError: No module named migrate

> john-turner>

>

> –

> You received this message because you are subscribed to the Google Groups "google-appengine-python" group.

> To post to this group, send email to google-appengine-python@googlegroups.com.

> To unsubscribe from this group, send email to google-appengine-python+unsubscribe@googlegroups.com.

> For more options, visit this group at http://groups.google.com/group/google-appengine-python?hl=en.

>

>

You received this message because you are subscribed to the Google Groups "google-appengine-python" group.

To post to this group, send email to google-appengine-python@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-python+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-python?hl=en.

[google-appengine] Re: Inbound emails on own domain

Actually, it is not a problem to setup mail in Google Apps, problem,

how to make emails, sent to this domain (used for hosting GAE

application) come into my MailHandler in my GAE application.

So, looks like only option to setup own mail-server for mydomain.com

and automatically forward all emails to appspotmail.com?

On Apr 21, 5:51 am, zooly zou <izo…@gmail.com> wrote:

> ok, you could read this blog , some summary here:http://www.hapeblog.com/blog.shtml?id=20001

>

>

>

> On Wed, Apr 21, 2010 at 7:42 AM, akakunin <akaku…@gmail.com> wrote:

> > Hi!

>

> > I’mcurrently testing inbound email handling and may process emails

> > sent to some email like user@appid..appspotmail.com

>

> > In case I will use my own domain name for this application (so, web UI

> > will be available atwww.mydomain.com) – will I be able to handle

> > emails sent to u…@mydomain.com?

>

> > Should I do any settings for it in Google Apps account (used for

> > managing mydomain.com)?

>

> > Thanks for help!

>

> > –

> > You received this message because you are subscribed to the Google Groups

> > "Google App Engine" group.

> > To post to this group, send email to google-appengine@googlegroups.com.

> > To unsubscribe from this group, send email to

> > google-appengine+unsubscribe@googlegroups.com<google-appengine%2Bunsubscribe@googlegroups.com>

> > .

> > For more options, visit this group at

> >http://groups.google.com/group/google-appengine?hl=en.

>

> –

> You received this message because you are subscribed to the Google Groups "Google App Engine" group.

> To post to this group, send email to google-appengine@googlegroups.com.

> To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

> For more options, visit this group athttp://groups.google.com/group/google-appengine?hl=en.

You received this message because you are subscribed to the Google Groups "Google App Engine" group.

To post to this group, send email to google-appengine@googlegroups.com.

To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

RichTextArea and, styleWithCSS

Hi all,

I have a somewhat small problem with RichTextArea in Firefox.

When the RichTextArea Formatter calls toggleBold and the like, the

html colde that gets added to the text is styled via CSS. Instead of

"<b>sometext </b>some other text"

we get

"<span style="font-weight: bold;">some text </span>some other text".

The Formatter make execCommand() calls for the formatting, and in

Firefox by default the styleWithCSS is set as true.

Is there an easy way to change the value of styleWithCSS to false in

order to not format text with CSS? I’ve made some attempts to change

styleWithCSS to false and failed miserably.

Thanks in advance,

Saül.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-web-toolkit@googlegroups.com.

To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: [appengine-python] How much are you charged if you use urllib / urllib2 but don’t read the response body

Hi Anthony,

On Wed, Apr 21, 2010 at 8:26 AM, Anthony <anthonygerrard@gmail.com> wrote:

> Hi,

>

> We’re investigating using Google App Engine for a new web based

> service we want to sell. It’s going to involve a batch job that

> accesses other sites on the internet. We want to be able to read the

> HTTP headers of the response to a GET request for images (in cases

> when a HEAD request is not supported by the server) but don’t need to

> access the response body.

>

> If we use urllib / urllib2 to do this will we be charged for the

> bandwidth used by the response body even if we don’t read any bytes

> from it (via the read / readline / readlines methods)?

>

Yes – urlfetch is used for all requests, and fetches the entire body before

the request returns.

Why not simply send HEAD requests, though? Fetching the headers without the

data is exactly what the HEAD method is designed for.

-Nick Johnson

>

> We’re concerned we might be charged because the docs say these

> libraries use Google App Engine’s fetch service under the covers.

>

> thanks

>

> Anthony

>

> –

> You received this message because you are subscribed to the Google Groups

> "google-appengine-python" group.

> To post to this group, send email to

> google-appengine-python@googlegroups.com.

> To unsubscribe from this group, send email to

> google-appengine-python+unsubscribe@googlegroups.com<google-appengine-python%2Bunsubscribe@googlegroups.com>

> .

> For more options, visit this group at

> http://groups.google.com/group/google-appengine-python?hl=en.

>

>

Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. ::

Registered in Dublin, Ireland, Registration Number: 368047

Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:

368047

You received this message because you are subscribed to the Google Groups "google-appengine-python" group.

To post to this group, send email to google-appengine-python@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-python+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-python?hl=en.

Hi Anthony,

On Wed, Apr 21, 2010 at 8:26 AM, Anthony <anthonygerrard@gmail.com> wrote:

Hi,

We're investigating using Google App Engine for a new web based
service we want to sell.  It's going to involve a batch job that
accesses other sites on the internet.  We want to be able to read the
HTTP headers of the response to a GET request for images (in cases
when a HEAD request is not supported by the server) but don't need to
access the response body.

If we use urllib / urllib2 to do this will we be charged for the
bandwidth used by the response body even if we don't read any bytes
from it (via the read / readline / readlines methods)?

Yes – urlfetch is used for all requests, and fetches the entire body before the request returns.
Why not simply send HEAD requests, though? Fetching the headers without the data is exactly what the HEAD method is designed for.
-Nick Johnson
 


We're concerned we might be charged because the docs say these
libraries use Google App Engine's fetch service under the covers.

thanks

Anthony


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


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


You received this message because you are subscribed to the Google Groups “google-appengine-python” group.
To post to this group, send email to google-appengine-python@googlegroups.com.
To unsubscribe from this group, send email to google-appengine-python+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-python?hl=en.

Issue with deferred binding

[Sorry in advance for the lengthy post, I just posted this question

over on stack overflow and copy/pasted the question here for more

visibilty, so this is formatted with markup and all links referenced

are at the bottom of the post]

I developed a web app using GWT about 2 years ago, since then the

application has evolved. In its current state it relies on fetching a

single XML file and parsing the information from it. Overall this

works great. A requirement of this app is that it needs to be able to

be ran from the filesystem (file:///..) as well as the traditional

model of running from a webserver (http://…)

Fetching this file from a webserver works exactly as expected using a

[RequestBuilder][1] object. When running the app from the filesystem

Firefox, Opera, Safari, and Chrome all behave as expected. When

running the app from the filesystem using IE7 or IE8 the

[RequestBuilder.send()][2] call fails, the information about the error

suggests that there is a problem accessing the file due to violating

the [same origin policy][3].

The app worked as expected in IE6 but not in IE7 or IE8.

So I looked at the source code of [RequestBuilder.java][4] and saw

that the actual request was being executed with an XMLHttpRequest GWT

object. So I looked at the source code for [XMLHttpRequest.java][5]

and found out some information.

Here is the code (starts at line 83 in XMLHttpRequest.java)

public static native XMLHttpRequest create() /*-{

if ($wnd.XMLHttpRequest) {

return new XMLHttpRequest();

} else {

try {

return new ActiveXObject(‘MSXML2.XMLHTTP.3.0′);

} catch (e) {

return new ActiveXObject("Microsoft.XMLHTTP");

}

}

}-*/;

So basically if an XMLHttpRequest cannot be created (like in IE6

because it is not available) an ActiveXObject is used instead.

I read up a little bit more on the IE implementation of

XMLHttpRequest, and it appears that it is only supported for

interacting with files on a webserver.

I found a setting in IE8 (Tools->Internet Options->Advanced->Security-

>Enable native XMLHTTP support), when I uncheck this box my app

works. I assume this is because I am more of less telling IE to not

use their implementation of XmlHttpRequest, so GWT just uses an

ActiveXObject because it doesn’t think the native XmlHttpRequest is

available.

This fixes the problem, but is hardly a long term solution.

I can currently catch a failed send request and verify that it was

trying to fetch the XML file from the filesystem using normal GWT.

What I would like to do in this case is catch the IE7 and IE8 case and

have them use a ActiveXObject instead of a native XmlHttpRequest

object.

There was a posting on the GWT google group that had a supposed

solution for this problem ([link][6]). Looking at it I can tell that

it was created for an older version of GWT. I am using the latest

release and think that this is more or less what I would like to do

(use [GWT deferred binding][7] to detect a specific browser type and

run my own implementation of XMLHttpRequest.java in place of the built

in GWT implementation).

Here is the code that I am trying to use

package com.mycompany.myapp.client;

import com.google.gwt.xhr.client.XMLHttpRequest;

public class XMLHttpRequestIE7or8 extends XMLHttpRequest

{

// commented out the "override" so that eclipse and the ant

build script don’t throw errors

//@Override

public static native XMLHttpRequest create()

/*-{

try

{

return new ActiveXObject(‘MSXML2.XMLHTTP.3.0′);

}

catch (e)

{

return new ActiveXObject("Microsoft.XMLHTTP");

}

}-*/;

// have an empty protected constructor so the ant build script

doesn’t throw errors

// the actual XMLHttpRequest constructor is empty as well so

this shouldn’t cause any problems

protected XMLHttpRequestIE7or8()

{

}

};

And here are the lines that I added to my module xml

<replace-with

class="com.mycompany.myapp.client.XMLHttpRequestIE7or8">

<when-type-is class="com.google.gwt.xhr.client.XMLHttpRequest"/

>

<any>

<when-property-is name="user.agent" value="ie7" />

<when-property-is name="user.agent" value="ie8" />

</any>

</replace-with>

From what I can tell this should work, but my code never runs.

Does anyone have any idea of what I am doing wrong?

Should I not do this via deferred binding and just use native

javascript when I catch the fail case instead?

Is there a different way of approaching this problem that I have not

mentioned?

All replies are welcome.

[1]: http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/http/client/RequestBuilder.html

[2]: http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/http/client/RequestBuilder.html#send%28%29

[3]: http://en.wikipedia.org/wiki/Same_origin_policy

[4]: http://code.google.com/p/google-web-toolkit/source/browse/releases/2.0/user/src/com/google/gwt/http/client/RequestBuilder.java

[5]: http://code.google.com/p/google-web-toolkit/source/browse/releases/2.0/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java

[6]: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/3a3935fe1534a486

[7]: http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsDeferred.html

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-web-toolkit@googlegroups.com.

To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.