[appengine-java] Re: including data file in JAR

2010-04-19 Thread Vaclav Bartacek
Better way is to use  getClass().getResourceAsStream for accessing
files packed in jars
or for acccessing files located directly in the war you can use the
following (in a servlet):
ServletContext ctx = getServletContext();
InputStream is = ctx.getResourceAsStream( resourceName );

Do not forget to declare the data file as the resource file in
appengine-web.xml
(if it is located outside of the WEB-INF directory):
resource-files
  include path=/resources/data-file.csv /
/resource-files

Vaclav


On Apr 18, 4:00 am, Philip Tucker ptuc...@gmail.com wrote:
 I have a data file I need to access on the server. If I include it in
 my source path on the client I can load it via
 ClassLoader.getSystemResourceAsStream. But this breaks on the server
 (I'm not sure if the eclipse plugin is even deploying it). What's the
 best way to do this? I don't want to incur a DB hit if I can avoid it,
 and it's too much data to embed in a class (~4MB).

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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] open source pdf engine for GAE

2010-04-19 Thread jeno
Hi Guys,

Anyone know open source java  pdf engine for GAE.

Thanks
Jeno

-- 
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-j...@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] com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException The response could not be deserialized

2010-04-19 Thread luka
Hi All,

I am trying to evaluate GAE + GWT (1.3.2) and I have some issue with
the detach feature of JDO-2.0. I have a simple service which return
all questions:

public ListQuestion getQuestions() {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
Query query = pm.newQuery(Question.class);
ListQuestion questions =
(ListQuestion)pm.detachCopyAll((ListQuestion)query.execute());

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

The Question entity is a Persistent object which defined with
detachable = true and has a bidirectional one to many relationship
to an Answer entity (which defined in the same way.

Unfortunately I started getting the
IncompatibleRemoteServiceException from yesterday (till than all
worked well :( ).

I browsed the forums of Google groups and tried to make some changes
to make things working like:
- Implementing from IsSerializable instead of Serializable (on
entities Question  Answer)
- Using detachCopyAll

Nothing seems to make a different.

I assume the code will work if I will create DTO for each persistent
entity although I really wish to avoid code duplication, plus that's
missing some of JDO 2.0 nicest feature

Question Code:



@PersistenceCapable (detachable = true)
public class Question implements IsSerializable   {

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

@Persistent
private String topic;

@Persistent
private String language;

@Persistent
private String category;

@Persistent
private String experience;

@Persistent
private String difficultLevel;

// Question details

@Persistent
private String title;

@Persistent
private String body;

@Persistent
private String type;

@Persistent
private String image;

@Persistent(mappedBy = question)
private ListAnswer answers;


//@Persistent
//private Author author;


// Classification properties

public Question(){}

public Question(String topic, String language,
String category, String experience, String 
difficultLevel,
String title, String body, String type, String image,
ListAnswer answers) {
super();
//this.author = author;
this.topic = topic;
this.language = language;
this.category = category;
this.experience = experience;
this.difficultLevel = difficultLevel;
this.title = title;
this.body = body;
this.type = type;
this.image = image;
this.answers = answers;
}

public Key getKey() {
return key;
}

public void setKey(Key key) {
this.key = key;
}

//  public Author getAuthor() {
//  return author;
//  }
//
//  public void setAuthor(Author author) {
//  this.author = author;
//  }

public String getTopic() {
return topic;
}

public void setTopic(String topic) {
this.topic = topic;
}

public String getLanguage() {
return language;
}

public void setLanguage(String language) {
this.language = language;
}

public String getCategory() {
return category;
}

public void setCategory(String category) {
this.category = category;
}

public String getExperience() {
return experience;
}

public void setExperience(String experience) {
this.experience = experience;
}

public String getDifficultLevel() {
return difficultLevel;
}

public void setDifficultLevel(String difficultLevel) {
this.difficultLevel = difficultLevel;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getBody() {
return body;
}

public void setBody(String body) {
this.body = body;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getImage() {
return image;
}

public void setImage(String image) {
this.image = image;
}

public ListAnswer getAnswers() {
return answers;
}

public void setAnswers(ListAnswer 

[appengine-java] Re: owned one to many relationship problem

2010-04-19 Thread Ian Marshall
Because A is the entity group parent of B, the key of an instance of B
must contain information about its entity group parent instance of A.

Instead of using b.key.getId() in

  // We cannot retrieve this object. Why?
  B newB = pm.getObjectById(B.class,b.key.getId());

you might care to use the KeyFactory.Builder class as detailed in

http://code.google.com/intl/en/appengine/docs/java/datastore/
creatinggettinganddeletingdata.html#Creating_and_Using_Keys

in order to build a key instance which contains information about both
your B instance and its parental A instance.

-- 
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-j...@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: RE : Re: RE : Re: RE : [appengine-java] ANT - Guestbook tutorial - [java] INFO: Unable to access http://appengine.google.com/api/updatecheck?

2010-04-19 Thread Romain Pelisse
No problem.

As it is a DNS problem, the simpliest solution is to add google-appengine IP
address to your local hosts file (would be /etc/hosts on unix like system,
no idea on its whereabouts on windows)

On 19 April 2010 07:25, Raj rajkumar@gmail.com wrote:

 Thanks again, yes you are right, the ping cannot find the host.

 Sorry to have wrote to you directly and thanks for your help.
 My apologies.


 On 18 Apr, 18:30, Romain Pelisse bela...@gmail.com wrote:
  Raj,
 
  Romain Pelisse,
  Sorry to bother you with this one and wrote to you directly.
 
  Do not fork the thread. Even if I'm the only answering to your issue does
  not means you can switch this to a personal discussion. Maybe other
 people
  are facing the same issues and are waiting for this thread to unfold the
  solution. Even more probably, other people will run into this issue and
  would like to find the answer to their problem here.
 
  As suggested I have captured the verbose of the ANT and attached to this
  email.
 
  I see 2 errors in it, the first error, I have been ignoring all this
 time,
 
  thinking that it doesn't matter,
 
  Well, you shouldn't have and it seems to be the root cause:
 
   [java] INFO: Unable to accesshttp://
 appengine.google.com/api/updatecheck?runtime=javarelease=1.3['1.0']
   [java] java.net.UnknownHostException: appengine.google.com
 
  It's pretty clear that the host 'appengine.google.com' is not known
  from the DNS of your company (I guess added to the proxy, DNS queries
  seems not to be foward to public DNS but are resolved by your company
  network system).
 
  When you try your small Java program with only one URL, did you try
  with this one 
 http://appengine.google.com/api/updatecheck?runtime=javarelease=1.3['1.0']
 '
  ?
 
  I would strongly suggest to do so...
 
  Also, ping the host appengine.google.com from your localhost (and if
  you don't know how to ping, just google that), to see your windows
  box is able resolve the adress.
 
  My guess is that your company security approach to internet is not only
  proxy but proxy + private DNS with a white list (site that you can access
 so
  there are going to be resolved). This is merely a guess, I'm not a
 network
  expert - even though I graduated from this area, and, most importantly, I
 do
  not know your company network organisation.
 
  Please help.
 
  Thanks
 
  An English related piece of advice : as I'm French I'm getting it wrong
 but
  the please help sounds rather annoying to me, a simple thanks for your
  help would seems to me more polite and less demanding (again I'm maybe
  wrong on this).
 
  On 18 April 2010 16:48, Romain Pelisse bela...@gmail.com wrote:
 
 
 
 
 
   Weird. Execute your ant script with -v option, see if it shed some
 light on
   what is happening here.
 
   Le 18 avr. 2010 16:38, Raj rajkumar@gmail.com a écrit :
 
   Just wrote a small java code to open a url and thats works fine. What
   is the real probblem then?
 
   On 18 Apr, 15:04, Raj rajkumar@gmail.com wrote:
 ie ? Poor of you...well some corporate..b...
 
   You received this message because you are subscribed to the Google
 Groups
   Google App Engine for Jav...
 
  --
  Romain PELISSE,
  The trouble with having an open mind, of course, is that people will
 insist
  on coming along and trying to put things in it -- Terry Pratchetthttp://
 belaran.eu/
 
  --
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group athttp://
 groups.google.com/group/google-appengine-java?hl=en.- 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Romain PELISSE,
The trouble with having an open mind, of course, is that people will insist
on coming along and trying to put things in it -- Terry Pratchett
http://belaran.eu/

-- 
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-j...@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: open source pdf engine for GAE

2010-04-19 Thread François Masurel
Hi Jeno,

You can try the PDFjet Open Source Edition : http://pdfjet.com/os/edition.html

François

On 19 avr, 01:55, jeno jeno...@gmail.com wrote:
 Hi Guys,

 Anyone know open source java  pdf engine for GAE.

 Thanks
 Jeno

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: RE : Re: RE : Re: RE : [appengine-java] ANT - Guestbook tutorial - [java] INFO: Unable to access http://appengine.google.com/api/updatecheck?

2010-04-19 Thread Raj
Thanks. The IT policy in this company is very stringent. They even
block me from writing any to the hosts file!!
Its really frustrating.


On 19 Apr, 09:32, Romain Pelisse bela...@gmail.com wrote:
 No problem.

 As it is a DNS problem, the simpliest solution is to add google-appengine IP
 address to your local hosts file (would be /etc/hosts on unix like system,
 no idea on its whereabouts on windows)

 On 19 April 2010 07:25, Raj rajkumar@gmail.com wrote:





  Thanks again, yes you are right, the ping cannot find the host.

  Sorry to have wrote to you directly and thanks for your help.
  My apologies.

  On 18 Apr, 18:30, Romain Pelisse bela...@gmail.com wrote:
   Raj,

   Romain Pelisse,
   Sorry to bother you with this one and wrote to you directly.

   Do not fork the thread. Even if I'm the only answering to your issue does
   not means you can switch this to a personal discussion. Maybe other
  people
   are facing the same issues and are waiting for this thread to unfold the
   solution. Even more probably, other people will run into this issue and
   would like to find the answer to their problem here.

   As suggested I have captured the verbose of the ANT and attached to this
   email.

   I see 2 errors in it, the first error, I have been ignoring all this
  time,

   thinking that it doesn't matter,

   Well, you shouldn't have and it seems to be the root cause:

        [java] INFO: Unable to accesshttp://
  appengine.google.com/api/updatecheck?runtime=javarelease=1.3['1.0']
        [java] java.net.UnknownHostException: appengine.google.com

   It's pretty clear that the host 'appengine.google.com' is not known
   from the DNS of your company (I guess added to the proxy, DNS queries
   seems not to be foward to public DNS but are resolved by your company
   network system).

   When you try your small Java program with only one URL, did you try
   with this one 
 http://appengine.google.com/api/updatecheck?runtime=javarelease=1.3['1.0']
  '
   ?

   I would strongly suggest to do so...

   Also, ping the host appengine.google.com from your localhost (and if
   you don't know how to ping, just google that), to see your windows
   box is able resolve the adress.

   My guess is that your company security approach to internet is not only
   proxy but proxy + private DNS with a white list (site that you can access
  so
   there are going to be resolved). This is merely a guess, I'm not a
  network
   expert - even though I graduated from this area, and, most importantly, I
  do
   not know your company network organisation.

   Please help.

   Thanks

   An English related piece of advice : as I'm French I'm getting it wrong
  but
   the please help sounds rather annoying to me, a simple thanks for your
   help would seems to me more polite and less demanding (again I'm maybe
   wrong on this).

   On 18 April 2010 16:48, Romain Pelisse bela...@gmail.com wrote:

Weird. Execute your ant script with -v option, see if it shed some
  light on
what is happening here.

Le 18 avr. 2010 16:38, Raj rajkumar@gmail.com a écrit :

Just wrote a small java code to open a url and thats works fine. What
is the real probblem then?

On 18 Apr, 15:04, Raj rajkumar@gmail.com wrote:
  ie ? Poor of you...well some corporate..b...

You received this message because you are subscribed to the Google
  Groups
Google App Engine for Jav...

   --
   Romain PELISSE,
   The trouble with having an open mind, of course, is that people will
  insist
   on coming along and trying to put things in it -- Terry Pratchetthttp://
  belaran.eu/

   --
   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-j...@googlegroups.com.
   To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2b­unsubscr...@googlegroups.com
  .
   For more options, visit this group athttp://
  groups.google.com/group/google-appengine-java?hl=en.- 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-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2b­unsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.

 --
 Romain PELISSE,
 The trouble with having an open mind, of course, is that people will insist
 on coming along and trying to put things in it -- Terry 
 Pratchetthttp://belaran.eu/

 --
 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-j...@googlegroups.com.
 To 

Re: [appengine-java] Blobstore upload from Flash?

2010-04-19 Thread bimbo jones
hi,

the blobstoreService.createUploadUrl() returns a string that you should use
as the action for the form.
I never used flash for this type work so i don't know if you have to use a
absolute path in the action for it to work.

You can make a servlet that give you the blobstoreService.createUploadUrl()
string as a response


2010/4/18 Gazza gazzar.jo...@gmail.com

 Anybody got any idea how to do this? I've got the demo code from the
 Java api overview working and can download stored ByteArray blobs from
 my Flash client, but can't work out how to upload a ByteArray from
 Flash.

 I've been looking at building mime forms for submission (like this
 blog entry
 http://blog.mikestead.me/upload-multiple-files-with-a-single-request-in-flash/
 ) but am perplexed by the interaction with the
 blobstoreService.createUploadUrl() function.

 Any pointers would be gratefully dereferenced.

 Gareth

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://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-j...@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: [appengine-java] Re: Cannot persist a HashMap

2010-04-19 Thread sreenidhi b.s
@mscwd01
i acknowledge it is  not the best solution ,but in my case i wanted a quick
dirty solution and it worked. my app rarely updates hashmap so my problem is
temporarily solved.if you find a better solution please post it here.

like i said before
 DataNucleus has no way of seeing
the changes you make to the internal values of a serialized field, and as a
result it doesn't know when it needs to flush changes to these fields to the

datastore.  However, DataNucleus *can* see when the top-level serialized
field reference changes.
So you need to provide *new* reference to the updated hashmap.



On Mon, Apr 19, 2010 at 10:49 AM, hsjawanda hsjawa...@gmail.com wrote:

 The following posting by Max Ross of the Google App Engine engineering
 team is extremely useful for the case of all serialized fields (which
 is the only way you can store HashMap-s in GAE (at least so far)):

 JDO/JPA Snippets That Work - Serialized Fields
 http://bit.ly/9fMbPs


 On Apr 18, 5:11 pm, mscwd01 mscw...@gmail.com wrote:
  Thanks for your informative reply.
 
  So basically, the only solution you found was to create a copy of the
  whole object holding the HashMap, persist the new object and delete
  the old object?
  I sincerely hope I have misunderstood you as this is a terrible way to
  have to go about it.
 
  Is there any other way, you can update a HashMap rather than creating
  a whole new object to persist?
 
  Thanks again for your help with this.
 
  On Apr 18, 6:50 am, sreenidhi b.s sreenidh...@gmail.com wrote:
 
 
 
  http://groups.google.com/group/google-appengine-java/browse_thread/th.
 ..
 
   the link above works only for persisting and retrieving hash maps ,but
 i did
   not  find any proper solution for updating and persisting the updated
   hashmaps.
 
   You have to provide a new reference to the updated hashmap ,since
 datastore
   cannot identify between updated and stale hashmap.
   But it did not work in my case and i urge you to try the same before
 you try
   alternatives.
 
   The Alternative i found was ,
   1) retrieve the persisted hashmap ,
   2) create a new hashmap reference to updated hashmap
   3) make the new reference persistent.
   4)delete the previous reference.
 
   code: /* i have used some custom classes ,but the you should be able to
   understand the logic i've employed to get the solution */
 
   /*Retrieve the persisted HashMap*/
   PersistenceManager pm0= PMF.get().getPersistenceManager();
   Query query0 = pm0.newQuery(VocabHashMap.class);
   ListVocabHashMap results1 = (ListVocabHashMap) query0.execute();
/*if there are no hashmaps, create a new one */
   if (results1.isEmpty())
   {
 
   HashMapString, Double map = new HashMapString, Double();
   for (String a : linelist) {
Double freq = map.get(a);
 map.put(a, (freq == null) ? 1 : freq + 1);
   }
   VocabHashMap vhm =new VocabHashMap(map);
   pm0.makePersistent(vhm);
   pm0.close();
 
   }
 
   else{
 
   for (VocabHashMap vhm : results1) {
 
   /*if you already have a hashmap,then update it */
 
HashMapString,Double map1=vhm.getMap();  /* assign a new reference
 to
   retrieved hashmap */
 
for (String a : linelist) {
Double freq = map1.get(a);
 map1.put(a, (freq == null) ? 1 : freq + 1);
 
   }
 
   VocabHashMap vhm1=new VocabHashMap(map1);/* create  a new
 hashmap*/
   pm0.makePersistent(vhm1); /*save the updated one */
   pm0.deletePersistent(vhm);  /*delete the old reference */
 
   }
 
   pm0.close();
 
   }
   On Sun, Apr 18, 2010 at 10:41 AM, seleronm seler...@gmail.com wrote:
Hi,
 
I was useful referring to this thread.
You might be also useful for it.
 
   
 http://groups.google.com/group/google-appengine-java/browse_thread/th...
 
Hope some of this helps.
 
thanks.
 
 I am not able to persist a HashMap field. This is how I define it:
 
 @Persistent(serialized = true, defaultFetchGroup = true)
 private MapString, Integer items;
 
 When I create the Object which the Map is a field of, I instantiate
 the Map as follows:
 
 items = new HashMapString, Integer();
 
 When I update the items HashMap I try to persist the object by
 doing
 the following:
 
 PersistenceManager pm = PMF.get().getPersistenceManager();
 // Query for Object (HashMap is a field of this Object)
 // Update HashMap
 pm.makePersistent(objectContainingHashMap);
 
 However, when I attempt to retrieve the object after persisting it
 and
 read the HashMap it is always empty, as though I never updated it.
 
 Has anyone experienced this before?
 
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 

[appengine-java] Re: Is it necessary on deployment server to explicitly call HttpSession.setAttribute?

2010-04-19 Thread Vaclav Bartacek
Sessions are stored in a Memcache and that's the reason of the
behaviour you described. The Memcache low-level API documentation
says:

The values returned from this API are mutable copies from the
cache; altering them has no effect upon the cached value itself until
assigned with one of the put methods. Likewise, the methods returning
collections return mutable collections, but changes do not affect the
cache.

Imagine that the session object is not stored only on one server
machine, but it needs to be distributed across all machines currenlty
serving your application. So you must tell google app engine to re-
distribute your modified session object.

Vaclav


On Apr 18, 4:19 am, Thomas mylee...@gmail.com wrote:
 I have a class which has a counter field.

 public Class Foo implements Serializable {
    private static final long serialVersionUID = 1L;
    private int counter = 0;
    // getter and setter omitted for simplicity

 }

 And in my program I put a Foo instance into HttpSession.

 HttpSession session = request.getSession(true);
 Foo foo = (Foo)session.getAttribute(foo);
 if (foo==null) {
         foo = new idv.Foo();
         session.setAttribute(foo, foo);}

 else
         foo.setCounter(foo.getCounter()+1);
 // continue processing with foo

 If session.setAttribute is executed, the session (and foo) is
 serialized correctly and I can get the correct counter value at the
 next request. But the counter value never gets increased at subsequent
 requests.

 If I move the session.setAttribute call to behind the if-else block
 to force execution in every request, the counter value increases
 correctly.

 if (foo==null)
         foo = new idv.Foo();
 else
         foo.setCounter(foo.getCounter()+1);
 session.setAttribute(foo, foo);

 I didn't see any doc about this. Is it a bug or a feature?

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: Is it necessary on deployment server to explicitly call HttpSession.setAttribute?

2010-04-19 Thread Thomas
Hi Vaclav:

   Thanks for your reply.

   HttpSession is a defined standard interface in JEE. The standard
doesn't ask developers for explicitly calling
HttpSession.setAttribute. The GAE/J provides a servlet container
implementation which utilize datastore and memcache to store session
data. It is supposed that the underlying implementation detail should
be transparent to developers. The bottom line is that Google should
document it clearly. But I didn't see any document about 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-j...@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: Cannot persist a HashMap

2010-04-19 Thread datanucleus
 like i said before
  DataNucleus has no way of seeing
 the changes you make to the internal values of a serialized field, and as a
 result it doesn't know when it needs to flush changes to these fields to the
 datastore.  However, DataNucleus *can* see when the top-level serialized
 field reference changes.

DataNucleus loads the Map field in the first place, so replaces it
with a wrapper and intercepts all mutator methods. This ought to be
present in the log. Any mutator call will make that field in the owner
object dirty, also in the log. This dirty field will cause an update,
in the log. Hence why I said look at the log to debug your problem.

GAE/J not wrapping the Map field would be a bug in GAE/J's plugin (if
it is that that is the 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-j...@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: [appengine-java] Re: Cannot persist a HashMap

2010-04-19 Thread Bhim Khadka
Dear friends,

thank you very much sent mail. I will recive to allready massage any time.
Who every one told me Question than Give any time give answer.

Bhim Bdr. Khadka
Lalrakshak Prakashan Pvt. Ltd

On Sun, Apr 18, 2010 at 11:35 AM, sreenidhi b.s sreenidh...@gmail.comwrote:



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

 the link above works only for persisting and retrieving hash maps ,but i
 did not  find any proper solution for updating and persisting the updated
 hashmaps.


 You have to provide a new reference to the updated hashmap ,since
 datastore cannot identify between updated and stale hashmap.
 But it did not work in my case and i urge you to try the same before you
 try alternatives.

 The Alternative i found was ,
 1) retrieve the persisted hashmap ,
 2) create a new hashmap reference to updated hashmap
 3) make the new reference persistent.
 4)delete the previous reference.

 code: /* i have used some custom classes ,but the you should be able to
 understand the logic i've employed to get the solution */



 /*Retrieve the persisted HashMap*/
 PersistenceManager pm0= PMF.get().getPersistenceManager();
 Query query0 = pm0.newQuery(VocabHashMap.class);
 ListVocabHashMap results1 = (ListVocabHashMap) query0.execute();
  /*if there are no hashmaps, create a new one */
 if (results1.isEmpty())
 {


 HashMapString, Double map = new HashMapString, Double();
 for (String a : linelist) {
  Double freq = map.get(a);
   map.put(a, (freq == null) ? 1 : freq + 1);
 }
 VocabHashMap vhm =new VocabHashMap(map);
 pm0.makePersistent(vhm);
 pm0.close();

 }
 else{


 for (VocabHashMap vhm : results1) {

 /*if you already have a hashmap,then update it */

  HashMapString,Double map1=vhm.getMap();  /* assign a new reference to
 retrieved hashmap */

  for (String a : linelist) {
  Double freq = map1.get(a);
   map1.put(a, (freq == null) ? 1 : freq + 1);
 }

 VocabHashMap vhm1=new VocabHashMap(map1);/* create  a new hashmap*/
 pm0.makePersistent(vhm1); /*save the updated one */
 pm0.deletePersistent(vhm);  /*delete the old reference */

 }



 pm0.close();
 }











 On Sun, Apr 18, 2010 at 10:41 AM, seleronm seler...@gmail.com wrote:

 Hi,

 I was useful referring to this thread.
 You might be also useful for it.


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

 Hope some of this helps.

 thanks.

  I am not able to persist a HashMap field. This is how I define it:
 
  @Persistent(serialized = true, defaultFetchGroup = true)
  private MapString, Integer items;
 
  When I create the Object which the Map is a field of, I instantiate
  the Map as follows:
 
  items = new HashMapString, Integer();
 
  When I update the items HashMap I try to persist the object by doing
  the following:
 
  PersistenceManager pm = PMF.get().getPersistenceManager();
  // Query for Object (HashMap is a field of this Object)
  // Update HashMap
  pm.makePersistent(objectContainingHashMap);
 
  However, when I attempt to retrieve the object after persisting it and
  read the HashMap it is always empty, as though I never updated it.
 
  Has anyone experienced this before?
 
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
who tell me I am eassy man

-- 
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-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, 

[appengine-java] Re: Is it necessary on deployment server to explicitly call HttpSession.setAttribute?

2010-04-19 Thread Peter Ondruska
Actually I would call this a bug in my opinion.. If you create a bug
issue I am the second to star it.

On Apr 19, 12:20 pm, Thomas mylee...@gmail.com wrote:
 Hi Vaclav:

    Thanks for your reply.

    HttpSession is a defined standard interface in JEE. The standard
 doesn't ask developers for explicitly calling
 HttpSession.setAttribute. The GAE/J provides a servlet container
 implementation which utilize datastore and memcache to store session
 data. It is supposed that the underlying implementation detail should
 be transparent to developers. The bottom line is that Google should
 document it clearly. But I didn't see any document about 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: Is it necessary on deployment server to explicitly call HttpSession.setAttribute?

2010-04-19 Thread Thomas
I have submitted the issue#3112.
http://code.google.com/p/googleappengine/issues/detail?id=3112

-- 
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-j...@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] One - Many Child Persistence help

2010-04-19 Thread DeliveryNinja
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 ListServerComment comments = new
ArrayListServerComment();


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-j...@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] Eclipse plugin requires fixed location for src directory

2010-04-19 Thread Sudhir Ramanandi
I can not change the source folder (/src) to anything else, otherwise
enhancer will not be able to find source folder and enhance entity classes
I just created
http://code.google.com/p/googleappengine/issues/detail?id=3111

is it me only or other too have same issue?

Thanks
Sudhir

-- 
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-j...@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: Update to GAE/J 1.3.2 - Project in Eclipse broken

2010-04-19 Thread Dannemano
Hi,

Any updates on the bug? I have the exact same problems and have been
unable to fix it.


Regards,
Daniel


On 5 Apr, 15:04, Miguel Méndez mmen...@google.com wrote:
 Can you file a bug with a project that reproduces the problem?  I think that
 will be the best way to get to bottom of what is going on.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@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] Doubt In Eclipse Plugin Development

2010-04-19 Thread Pallavi Jadhav
I have to extend the existing problem view of Eclipse..
But I have problem to display problems i.e errors,warning,infos at run
time...
I am able to get that runtime but when we change any error i.e after
removing or adding any error,warning that changes not reflect
immediately in problem view table..
Can anyone help me?





 
Thanking you,
 
Pallavi Jadhav

-- 
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-j...@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: Is it necessary on deployment server to explicitly call HttpSession.setAttribute?

2010-04-19 Thread Nacho Coloma
What you are seeing is normal JEE behavior with cluster environments.
The standard does not say that modifications to your session-stored
beans should be propagated to other cluster nodes unless you
explicitely invoke setAttribute().

You are experiencing the worst possible case (never increments)
because GAE always serializes your sessions to memcache between
requests. With any other app server in cluster you would get undefined
behavior (only increments as long as there is no node failure).

I would recommend to use memcache counters for this purpose, using the
session ID (or maybe the user ID) as key.

On Apr 19, 2:12 pm, Thomas mylee...@gmail.com wrote:
 I have submitted the 
 issue#3112.http://code.google.com/p/googleappengine/issues/detail?id=3112

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: One - Many Child Persistence help

2010-04-19 Thread datanucleus
 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.

GWT has got nothing to do with persistence. The exception is in GWT
transfer from the client. Mention the stack trace and your method call
that throws the exception.

-- 
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-j...@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] What's wrong with my JPA Entity

2010-04-19 Thread Sudhir Ramanandi
I have just started with GAE+JPA. However I find it difficult to grasp the
primary key things.
I have created a very simple entity and a test to verify that the primary
key is generated automatically.

Entity

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.google.appengine.api.datastore.Key;
import com.szczytowski.genericdao.api.IEntity;

@Entity
public class Profile implements IEntityKey {

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Key _id;

@Basic
private int _age;

@Basic
@Temporal(TemporalType.DATE)
private Date _dob;

public Profile() {
}

public Key getId() {
return _id;
}

public void setId(Key id) {
_id = id;
}

public int getAge() {
return _age;
}

public void setAge(int age) {
_age = age;
}

public Date getDob() {
return _dob;
}

public void setDob(Date dob) {
_dob = dob;
}
}


Test Class

import java.util.Date;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.ramanandi.matri.infrastructure.jpa.EMF;

import
com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
import
com.google.appengine.tools.development.testing.LocalServiceTestHelper;

public class ProfileDaoTest extends TestCase {

private final LocalServiceTestHelper helper = new
LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
private ProfileDao dao = new ProfileDao();


@Before
public void setUp() {
helper.setUp();
}

@After
public void tearDown() {
helper.tearDown();
}
private void doTest() {
dao.setEntityManager(EMF.get().createEntityManager());
Profile p = new Profile();
p.setAge(20);
p.setDob(new Date());
dao.save(p);
assertNotNull(p.getId());


}

@Test
public void testInsert1() {
doTest();
}

}

ButassertNotNull(p.getId()); fails. Why the primary key is not generated
automatically? What's wrong.

Thanks
SN

-- 
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-j...@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: Update to GAE/J 1.3.2 - Project in Eclipse broken

2010-04-19 Thread Moritz
No.

Miguel asked for an example project for reproduction, but in each and
every project I try to enable appengine support, I get the same
problem and the SDK is permanently set to {project.home}/war and I'm
not able to change it.

My solution is to get rid of the Eclipse plugin and use the Maven
plugin instead. Maven is better anyway - unfortunately not officially
supported by Google.

Moritz

P.S.: I'm using Eclipse on Mac OS X 10.6.3

On 19 Apr., 13:00, Dannemano daniel.hedenst...@gmail.com wrote:
 Hi,

 Any updates on the bug? I have the exact same problems and have been
 unable to fix it.

 Regards,
 Daniel

 On 5 Apr, 15:04, Miguel Méndez mmen...@google.com wrote:

  Can you file a bug with a project that reproduces the problem?  I think that
  will be the best way to get to bottom of what is going on.

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: [appengine-java] Re: Update to GAE/J 1.3.2 - Project in Eclipse broken

2010-04-19 Thread Miguel Méndez
No,  I don't think that a bug has been filed with a repro case.  Or, at
least, I have not seen it.

On Mon, Apr 19, 2010 at 7:00 AM, Dannemano daniel.hedenst...@gmail.comwrote:

 Hi,

 Any updates on the bug? I have the exact same problems and have been
 unable to fix it.


 Regards,
 Daniel


 On 5 Apr, 15:04, Miguel Méndez mmen...@google.com wrote:
  Can you file a bug with a project that reproduces the problem?  I think
 that
  will be the best way to get to bottom of what is going on.
 
 

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




-- 
Miguel

-- 
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-j...@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] ImagesService make image smaller then 32K to be able to use base64 in IE8

2010-04-19 Thread Vlad Skarzhevskyy
In our application we want user upload-able images to be shown in
application.
The image is re-sized to 150x200 and  Thumbnail are stored in DB.
Then we show images in browser using GWT RPC and retrieve base 64 encoded
image.

But to show image in IE8 the data can only be max 32K.

The question is can we make an image Transformation in GAE that reduce the
image size. e.g. reduce the number of colors, reduce the quality?

I used ImagesServiceFactory.makeImFeelingLucky() BUT it does not help to
reduce the size.

Vlad

PS
 the code snippet we used:

-- Upload ---
try {
Image image = ImagesServiceFactory.makeImage(imageData);
ImagesService imagesService =
ImagesServiceFactory.getImagesService();
// 3x4 proportions, we show 150x200 image
int width;
int height;
if (image.getWidth() * 4 / 3  image.getHeight()) {
height = 200;
width = height * image.getWidth() / image.getHeight();
} else {
width = 150;
height = width * image.getHeight() / image.getWidth();
}
Transform touchup =
ImagesServiceFactory.makeImFeelingLucky();
Transform resize = ImagesServiceFactory.makeResize(width,
height);
CompositeTransform composite =
ImagesServiceFactory.makeCompositeTransform();
composite.concatenate(touchup);
composite.concatenate(resize);
composite.concatenate(touchup);
Image newImage = imagesService.applyTransform(composite,
image, OutputEncoding.PNG);
log.debug(new image size {},
newImage.getImageData().length);


-- Send to GWT client ---

import com.google.appengine.repackaged.com.google.common.util.Base64;

return Base64.encode(imageData);

-- 
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-j...@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: [appengine-java] Debugging stopped working after updating GAE to 3.1.0 and higher

2010-04-19 Thread Jason Parekh
Which URL are you opening from your browser?  It should have
the ?gwt.codesvr=127.0.0.1:9997 (perhaps with a different value) at the
end of it, is that the case?

jason

On Sat, Apr 17, 2010 at 10:14 AM, GAE_User ulrik@gmail.com wrote:

 Since GAE changed debugging from the stand alone test browser to using
 browser plugins i have not been able to debug my old projects.
 The project runs fine, but are just not able to debug.
 When creating new projects, debugging does works. Eclipse takes focus
 when the program cursor hits a breakpoint and debugging works as
 usual.

 How do i make my old projects debuggable again?

 PS.

 GWT version: 2.0.3
 GAE version: 1.3.2
 Eclipse version: Galileo 3.5
 Web browser: Chrome + GWT Developer Plugin - Version: 1.0.7263

 I have updated my VM arguments to:
 -javaagent:MyLocalPath\eclipse\plugins
 \com.google.appengine.eclipse.sdkbundle.
 1.3.1_1.3.1.v201002101412\appengine-java-sdk-1.3.1\lib\agent\appengine-
 agent.jar

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://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-j...@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: [appengine-java] Re: Create Online Game That Contains High Change Data

2010-04-19 Thread Jeff Schnitzer
No.  The GAE documentation is explicit:  There is no guarantee that
your data will exist in the memcache even 1s after putting it there.

Will it be there?  Most likely.  But that's not very comforting given
the time and energy required to develop an online game.  When your
system starts behaving badly, the only response you are going to get
from GAE support is our system is behaving as documented.

The exact algorithm for allocation of memcache resources is not public
and can probably change at any time, but you're sharing it with
everyone else.  Even if your app is treading lightly in the memcache,
that doesn't mean everyone else is.  Even if memory pressure is not
the problem, your memcache data could disappear simply when G decides
to pull a server or roll out a new version of memcached.

Also consider that you will need to build your game with only the most
basic synchronization primitive - increment().  I'm sure you can build
higher level synchronization mechanisms out of this primitive but with
the number of RPCs involved they're going to be really, really slow.

I'm a dedicated fan of Appengine but I've also worked on MMO games in
the past.  Unless your definition of realtime is very lax, Appengine
is just not the appropriate tool for the job.  You will spend *far*
more engineering resources working around GAE limitations than you
would spend setting up a traditional appserver like Resin, Glassfish,
or JBoss.

Jeff

On Sun, Apr 18, 2010 at 7:14 AM, Phuong Nguyen phuongn...@gmail.com wrote:
 A rack server could be purchased anywhere. However, I want to
 streamline my development and it would be best to build every thing on
 GAE structure. Given I want to store real-time game data using
 memcache, If I strictly maintain number of objects stored in memcache
 (thus, limit the use of memcache to certain size), then will my
 memcache be available even if the app is restarted on another server
 in the cloud? What is the probability that my data in memcache get
 lost during normal operation (given I will not let memcache data
 expired)?

 On Apr 18, 12:57 am, Jeff Schnitzer j...@infohazard.org wrote:
 You should never put something in the memcache that you don't mind
 losing when the memcache service flushes your data.  Players are
 probably going to be very unhappy if their scores and current
 positions suddenly disappear mid-game.

 GAE is just not an appropriate platform for a realtime game.  You can
 do turnbased games, or games that have a slow update period (using the
 datastore), but GAE doesn't provide the bread-and-butter of realtime
 games:  persistent socket connections and singleton in-memory data
 structures.

 You could spend months working around this problem with XMPP and
 hacking together a fragile solution on top of memcache, or you could
 just spend a few bucks a month on a more traditional server
 infrastructure running elsewhere in the cloud.  A 256M slice at
 rackspace is $11/mo.  A week of Starbucks costs more than that.

 Jeff



 On Fri, Apr 16, 2010 at 9:28 PM, Timofey Koolin timo...@koolin.ru wrote:
  You can store your data in memcache and in datastore. Then you read
  data from memcache or (if is'n exsists in memcache) from datasrore. Or
  you can use write-behind cachehttp://www.youtube.com/watch?v=HL5igKTuN8M

  On 17 апр, 08:04, Phuong Nguyen phuongn...@gmail.com wrote:
  Hi guys,
  I'm creating an online game server with GAE and there's a few concerns
  that I'd like to ask for advice.

  One of my problem is that I need to manage a lot of information that
  would not make sense to be stored in database. Like the status of each
  player, the last time server seen such player, his current position in
  the game. I'd like to store all of these information in the memory and
  periodically persist back to the data store. Problem is (correct me if
  I'm wrong) that GAE may shutdown my app and restart it on different
  server at any time, so, data in memory would be gone and I need to
  reload them from the database. But, certainly, if GAE Server restart
  my app before the periodical saving happens, then the status of
  players may be gone without my ability to recover back from database.
  And, these data are subject to high change, so, persist them to data
  store frequently would not be sensible.

  So, I may encounter problems to keep these data in memory. And I may
  also encounter performance problem to constantly persist these data to
  data store. So, would you guys please give me some advice? Am I
  missing some thing or there should be any technology/tricks that can
  be employed on GAE that can facilitate me to build such online game
  like this?

  Thanks.
  Phuong

  --
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com.
  

Re: [appengine-java] Working version of Hessian 4.0.3 for Google App Engine?

2010-04-19 Thread Jeff Schnitzer
The Caucho folks have been slow to update the hessian download page,
but the actual binaries are still being generated and put up for
download.  You can craft the download link by hand.

This version works with GAE:

http://caucho.com/download/hessian-4.0.6.jar

Jeff

On Sun, Apr 18, 2010 at 1:36 AM, Romain Pelisse bela...@gmail.com wrote:
 Run into the same problem and had the same question. However note that the
 previous major version of Hessian (3.X) works perfectly with
 google-app-engine.

 On 17 April 2010 23:23, Christoffer Pettersson corgr...@gmail.com wrote:

 According to this thread:


 http://groups.google.com/group/google-appengine-java/browse_thread/thread/0068bf08c5fd3fef/4edb06eb6f316689?lnk=raot

 The Hessian 4.0.3 library is not compatible with Google App Engine.

 Does anyone have a working version of Hessian to use for Google App
 Engine until 4.0.4 is released?

 Sincerely,
 Christoffer

 --
 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-j...@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.




 --
 Romain PELISSE,
 The trouble with having an open mind, of course, is that people will insist
 on coming along and trying to put things in it -- Terry Pratchett
 http://belaran.eu/

 --
 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-j...@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.


-- 
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-j...@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] org.datanucleus.store.appengine.query.DatastoreQuery$2

2010-04-19 Thread CodeMan
Hi,

I am getting the error below in a JSF app when I try to fetch a
ListTemplate.

Using this code:
PersistenceManager pm =
PMF.get().getPersistenceManager();//
String query = select from  + Template.class.getName() + 
where owner=='+owner+' ;
this.templates = (ListTemplate) pm.newQuery(query).execute();

Can you help figure out what's causing it.

Thanks.

#

   1.
  04-19 01:42PM 52.901 /pages/newcbx.faces 500 18322ms 24015cpu_ms
40api_cpu_ms 0kb Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
1.9.0.17) Gecko/2009122116 Firefox/3.0.17 (.NET CLR
3.5.30729),gzip(gfe)
  See details

  98.229.74.17 - - [19/Apr/2010:13:43:11 -0700] POST /pages/
newcbx.faces HTTP/1.1 500 0 http://ezcomment.appspot.com/pages/
dusers.faces Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
1.9.0.17) Gecko/2009122116 Firefox/3.0.17 (.NET CLR
3.5.30729),gzip(gfe) ezcomment.appspot.com

   2.
  W 04-19 01:43PM 02.874

  [ezcomment/1.341368964543160070].stderr: SystemId Unknown;
Line #57; Column #31; Failed calling setMethod method


   3.
  W 04-19 01:43PM 03.367

  [ezcomment/1.341368964543160070].stderr: SystemId Unknown;
Line #57; Column #31; Failed calling setMethod method


   4.
  W 04-19 01:43PM 11.177

  /pages/newcbx.faces
  java.lang.RuntimeException: java.io.NotSerializableException:
org.datanucleus.store.appengine.query.DatastoreQuery$2
at
com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:
361)
at
com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession(SessionManager.java:
341)
at com.google.apphosting.runtime.jetty.SessionManager
$AppEngineSession.save(SessionManager.java:162)
at
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
41)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
238)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:
404)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
135)
at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
243)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5485)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5483)
at
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
24)
at
com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:
56)
at
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:
536)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:
369)
at
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
442)
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:474)
at
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:
831)
at
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:
207)
at
com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103)
at
com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:
251)
at com.google.apphosting.runtime.JavaRuntime

Re: [appengine-java] Debugging stopped working after updating GAE to 3.1.0 and higher

2010-04-19 Thread Ulrik Sorber
Jason:

This is my URL:
http://127.0.0.1:/MyPage.html?gwt.codesvr=127.0.0.1:9997http://127.0.0.1:/vehicles.html?gwt.codesvr=127.0.0.1:9997

http://127.0.0.1:/vehicles.html?gwt.codesvr=127.0.0.1:9997The page
runs fine in debug mode, except it doesn't stop at any of my breakpoints.
Hence no debugging :(

I have tried to compare my project with a newly created (debuggable)
project, but i cant find any discrepancies.
But the must be a reason why my older projects wont debug. Just cant figure
out what it is.

Thanks


On Mon, Apr 19, 2010 at 7:53 PM, Jason Parekh jasonpar...@gmail.com wrote:

 Which URL are you opening from your browser?  It should have
 the ?gwt.codesvr=127.0.0.1:9997 (perhaps with a different value) at the
 end of it, is that the case?

 jason


 On Sat, Apr 17, 2010 at 10:14 AM, GAE_User ulrik@gmail.com wrote:

 Since GAE changed debugging from the stand alone test browser to using
 browser plugins i have not been able to debug my old projects.
 The project runs fine, but are just not able to debug.
 When creating new projects, debugging does works. Eclipse takes focus
 when the program cursor hits a breakpoint and debugging works as
 usual.

 How do i make my old projects debuggable again?

 PS.

 GWT version: 2.0.3
 GAE version: 1.3.2
 Eclipse version: Galileo 3.5
 Web browser: Chrome + GWT Developer Plugin - Version: 1.0.7263

 I have updated my VM arguments to:
 -javaagent:MyLocalPath\eclipse\plugins
 \com.google.appengine.eclipse.sdkbundle.
 1.3.1_1.3.1.v201002101412\appengine-java-sdk-1.3.1\lib\agent\appengine-
 agent.jar

 --
 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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://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-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://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-j...@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: [appengine-java] Slow app JVM wake - even with no data store access?

2010-04-19 Thread Jeff Schnitzer
3-4s is pretty close to as good as it gets to start a JVM, load your
app, and begin serving pages.  I've seen 2s load times but 3-4s is
pretty typical.

Consider yourself lucky!  The poor souls running Spring apps usually
wait 15s+ for cold starts...

Jeff

On Mon, Apr 19, 2010 at 4:58 PM, Blake blakecaldw...@gmail.com wrote:
 I switched from JDO to twig-persist to save load time, and it seemed
 to help a bit, but I'm still seeing 3-4 second load times on servlet
 calls that don't even touch the datastore.  Wow.

 Of course, after the JVM loads, it's super-fast... but that first hit
 after a few minutes of inactivity - wow... not good.

 --
 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-j...@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.



-- 
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-j...@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: open source pdf engine for GAE

2010-04-19 Thread jeno
Hi François ,

Thanks for your help. I have used PDFjet (PDFJet.jar  version 2.72)
PDF class missing save method
So i cant call pdf.save(d.pdf) method.

Cheers
jeno


On Apr 19, 6:48 pm, François Masurel fm2...@mably.com wrote:
 Hi Jeno,

 You can try the PDFjet Open Source Edition :http://pdfjet.com/os/edition.html

 François

 On 19 avr, 01:55, jeno jeno...@gmail.com wrote:

  Hi Guys,

  Anyone know open source java  pdf engine for GAE.

  Thanks
  Jeno

  --
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: open source pdf engine for GAE

2010-04-19 Thread jeno
Hi François

Thank for your help. i have used PDFjet. (PDFjet.jar version 2.72).
It is misssing pdf.save() method.

cheers
jeno

On Apr 19, 6:48 pm, François Masurel fm2...@mably.com wrote:
 Hi Jeno,

 You can try the PDFjet Open Source Edition :http://pdfjet.com/os/edition.html

 François

 On 19 avr, 01:55, jeno jeno...@gmail.com wrote:

  Hi Guys,

  Anyone know open source java  pdf engine for GAE.

  Thanks
  Jeno

  --
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@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-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@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-j...@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: Trying a clean compile gives The parameter is incorrect

2010-04-19 Thread Stephen Johnson
In Eclipse, go to Project / Properties menu. Go to Google / App
Engine / ORM setting. It probably is set to src/ (using this setting
DataNucleus puts all class files on its classpath). Instead restrict
the folders (or patterns) to just the folders or file name patterns
for your files that need enhancing. Hopefully, you've put them in one
or just a couple of packages or named them with a common naming scheme
so the fix is then trivial. If you have tons of classes you may still
run in to problems, but it solved my issues. Hope it helps.

On Apr 8, 8:04 pm, dreamy dreamy2c...@gmail.com wrote:
 As you said,  when  Enhance classes is little ,there is OK,  but when
 Enhance classes  has many many(ex: 200 classes) ,the same problem is
 appear.

 how to do with it?

-- 
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-j...@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.