Solved : Re: [appengine-java] Re: XML to Object libraries and Vice Versa

2009-11-24 Thread Ravi Sharma
Hi Guys,
I tried Betwixt from apache(http://commons.apache.org/betwixt/index.html).
And it works out of box. I only got into some problems as i downloaded some
older version of dependecies(Digester and beanutils).
So when using Betwixt make sure you have latest version of all dependecnies.

Also in local it will not ask for dependecies as GWT-window jar contains
DIgester and Collection classes, but on GAE server you need it. So download
those jars and keep them in your lib folder.

I dont miss JAXB any more :)

Thanks,
Ravi.



On Sun, Nov 22, 2009 at 8:13 PM, Rusty Wright wrote:

> Here are some bookmarks I have for xml:
>
> http://www.xom.nu/
> http://www.smooks.org/mediawiki/index.php?title=Main_Page
> http://jibx.sourceforge.net/
> http://xstream.codehaus.org/
> http://castor.org/
>
> I'll be trying castor.
>
>
> Ravi wrote:
> > Hi Few days back i asked a question that which libraries can be used
> > to Convert Object to Xml and vice versa, and got advice to use betwixt
> > (http://commons.apache.org/betwixt/)
> ..
> > I tried it and its working locally but on GAE server its not working
> > and throwing following exception
> >
> > org.apache.commons.betwixt.XMLIntrospector introspect: Security
> > manager does not allow bean info search path to be set
> >
> > then i suppose we can not use Betwixt on GAE. If we can then can
> > anyone tell what i can do to make it work.
> > If not then can you suggest any othe rlibarary which can be used.
> >
> > Thanks,
> > Ravi.
> >
> > On Nov 8, 5:50 pm, LUAI KASSAR  wrote:
> >> Use Apache betwixt ,its works on GAEhttp://commons.apache.org/betwixt/
> >>
> >>
> >>
> >> On Sun, Nov 8, 2009 at 7:46 PM, Ravi Sharma 
> wrote:
> >>> I am not sure if i understand you.
> >>> Can you explain bit more, an example or link would be great.
> >>> I can do normal Sax parsing but then writing code for each different
> kind
> >>> of xml is gonna be very tidious work.So looking for some GAE supported
> >>> libararies like JAXB or XMLBEAN
> >>> My Requirment is as follows(in cae is there was any misunderstanding)
> >>> 
> >>> 
> >>>
> >>>   
> >>>   
> >>>
> >>>
> >>> 
> >>> PersonName
> >>> 2
> >>> 
> >>> 
> >>>
> >>>
> >>>My Venod ltd
> >>>ABC 234
> >>>
> >>> 
> >>> and now in java if i want to get the vbendor name
> >>> tehn i should be able to access it using classes directly(which will be
> >>> generated compile time)
> >>> Order  order = SomeMarsheller.unmashel("fullxml");
> >>> String vendorName = order.getVendor().getName();
> >>> My Orginal Mail was
> >>> Hi,
> >>> Is there any library like Apache XMLBeans/JAXB supported in Google APP
> >>> Engine which can be used for converting XML to Java Object and Java
> >>> Objects to XML.
> >>> I checked the White lists of libraries and found that
> >>> JAXB is not supported ( I have already stared the issue related to it)
> >>> and Xmlbeans was not mentioned as Supported Library.
> >>> I am sure lots of people here doing this normal thing to convert Java
> >>> Object to XML and Vice Versa.
> >>> Please Suggest some thing
> >>> Ravi.
> >>> On Fri, Nov 6, 2009 at 3:59 PM, rakeshv  wrote:
> > I am sure lots of people here doing this normal thing to convert Java
> > Object to XML and Vice Versa.
> > Please Suggest some thing.
>  The XML element/attribute pair maps quite well into the low level API
>  Entity/properties structure.  That should be all you need.
>  Rakesh- 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.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=.
> >
> >
>
> --
>
> 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=.
>
>
>

--

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] Weird results for JOD query with List item filter (List.contains(....))

2009-11-24 Thread Prashant
Hi,

Following is a snippet of JDO class:


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

@Persistent(primaryKey = "true")
private String EmailID;

@Persistent
private String Name;

@Persistent
private List Groups;



I am trying to display entities with pagination. Every thing is working fine
except for following query:


Query query = pm.newQuery(_Contact.class);
query.setOrdering("EmailID desc");
query.setRange("0,10");

String filter = "EmailID < '" + *cursor *+ "'";

if(groups != null)
   for(String group : *groups*){
filter += " && Groups.contains(\"" + group + "\")";
}

query.setFilter(filter);


For this query, some entities are not getting fetched which actually fall in
the selection criteria although it works fine for *EmailID > cursor &&
Groups.contains(group) ORDER BY EmailID asc* OR if there is no *
Groups.contains* filter.

One more thing I figured out that if I use* Groups.contains *filter
with *EmailID
> cursor*, entity *EmailID == cursor* is also being returned.


Any idea where I am wrong or is it a known bug?

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] Re: Server Code for Chat Service / Matchmaking

2009-11-24 Thread Craig
Great, thank you for the clarification.

Craig

On Nov 23, 10:32 pm, Timothy Spear  wrote:
> Craig,
>         The short answer is. No threads may not be spawned. Use the datastore 
>  
> to update/change status for the users. Only use memcache for reference  
> information or information which a invalid current status may be  
> acceptable. If the current status of a user must be valid, then the  
> datastore is the only way to persist the information.
>         Short reason for GAE thinking. The datastore handles replication  
> between all the servers automatically. The application servers are  
> load balanced and constantly in a state of flux. For example, server A  
> may answer the initial request by one user and Server B may answer the  
> request by the second user. Server A & B may actually be located in  
> separate data centers around the world.
>
> Tim
>
> On Nov 21, 2009, at 10:35 PM, Craig wrote:
>
> > Hi,
>
> > I have some questions regarding the limits of server code in GAE.  Can
> > I write server code that isn't tied to an http request - i.e. a thread
> > that would always be running on the server and which servlets could
> > communicate with?  From what I've read it isn't possible but I just
> > wanted to confirm.
>
> > The application I'm writing is analogous to a chat system where 10
> > users would log in and indicate their status (busy, idle, etc).  I
> > would prefer to be able to write a single server thread which would
> > maintain this information and could give it to the individual servlets
> > as needed.  I.e. if I could write a persistent thread to manage this
> > data I wouldn't need to deal with the data store, memcache, etc.  I
> > understand that this isn't possible - but please let me know if it is
> > and what term I need to search for.
>
> > Next, please let me know if the following architecture for my app
> > makes sense.  Since I cannot write a central thread to manage the
> > information and respond to requests, I'll accomplish that using the
> > memcache & data store.  As users update their status the servlets will
> > update the data.  Then when the other clients refresh themselves, the
> > servlets that they spawn will retrieve everyone's status from the data
> > store and return it to the client.  Does this structure make sense or
> > am I missing something?
>
> > (Eventually I'll use ServerPush to accomplish the refresh but I don't
> > think that is relevant to the question).
>
> > Thanks for your response and advice,
>
> > Craig
>
> > --
>
> > You received this message because you are subscribed to the Google  
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com
> > .
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=
> > .

--

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: Help Requested: How to persist a HashMap>?

2009-11-24 Thread Nick
I had the same problem and came up with this snippet of code to work
around the issue. Use it when you are updating your object:

/**
 * Iterates through the object and makes any persistent annotated
objects that are serialized = "true"
 * dirty using javax.jdo.JDOHelper.makeDirty.
 * @param 
 * @param tInstance
 */
public static  void makeSerializedDirty(T tInstance){
for (Field field : tInstance.getClass().getDeclaredFields()) {
Persistent persistent = 
field.getAnnotation(Persistent.class);
if(persistent != null && 
Boolean.valueOf(persistent.serialized())){
javax.jdo.JDOHelper.makeDirty(tInstance, 
field.getName());
}
}
}

-Nick

On Oct 11, 7:34 pm, doc  wrote:
> This sample work but could not update content of HashMap
>
> Thank you Jason to provide useful sample.  Based on this sample I have
> implemented my application which use hashMap. But when I add additem
> method like following added Item is not stored in a datastore.
>
> public void addUsers(String userID, CustomUser user)
> {
>     users.put(userID, user.)
>
> }
>
> I guess the reason of this problem come from that JDO recognize this
> HashMap users as a serializable Blob. So when we access HashMap users,
> JOD deserialize Blob and create HashMap instance and provide us as a
> HashMap users instance. But JDO can not recognize what happen to the
> users after deserialization. So JDO do not try to save users when I
> close StateCore instance.
>
> So I changed code as following. This code could store added
> CoustomUser instance when I close StateCore instance.
>
> @NotPersistent
> private HashMapusersTemp;
>
> public void addUsers(String userID, CustomUser addUser)
> {
>     users.put(userID, addUser.)
>
> usersTemp=users;
> users=null;
> users=UsersTemp
>
> }
>
> Not sure this is the best counter measure for this problem but if
> someone has same problem , please try.

--

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: Weird results for JOD query with List item filter (List.contains(....))

2009-11-24 Thread Prashant
this is surely a bug following is my test case


PersistenceManager pm = pmf.getPersistenceManager();
Query query = pm.newQuery(_Contact.class);

query.setOrdering("EmailID");
query.setFilter("Groups.contains(\"mygroup\")");

int i = 1;
for(_Contact cont : (List<_Contact>) query.execute()){
resp.getWriter().print(i++ + " " + cont.getID() + "");
}

pm.close();


above code printed 23 contacts and when I replaced
*query.setOrdering("EmailID");
*by *query.setOrdering("EmailID desc"); *it printed 18 contacts only.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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 there a recommended way to differentiate between production and dev GAE environments?

2009-11-24 Thread Marcel Overdijk
Or use a Listener as described here
http://marceloverdijk.blogspot.com/2009/10/determining-runtime-environment-on.html

On 23 nov, 15:58, Nacho Coloma  wrote:
> To answer my own question, this has been my best shot this far:
>
> SecurityManager sm = System.getSecurityManager();
> localDevelopmentEnvironment = sm == null ||
> "com.google.appengine.tools.development.DevAppServerFactory
> $CustomSecurityManager".equals(sm.getClass().getName());
>
> If anyone has a better way, I will be glad to hear.
>
> On Nov 23, 1:17 pm, Nacho Coloma  wrote:
>
>
>
> > Hi all,
>
> > I was considering options, but I first wanted to ask: is there a
> > recommended way to differentiate between my local development
> > environment and the real GAE server? This far, the only options I can
> > think of are:
>
> > * adding a -Dtest=true to my eclipse launcher
>
> > * looking up for any test environment classes (Class.forName) but it's
> > not reliable as they could get included by mistake in any WAR release.
>
> > * I have been searching for instanceof alternatives i.e.:
> > DatastoreServiceFactory.getService() instanceof LocalDatastoreService
> > but I could not find any such expression that could possibly work.
>
> > Ideas? What are people using out there?
>
> > Nacho.

--

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] List of Child Objects Not Loading

2009-11-24 Thread Justin
Hello:
I am having trouble retrieving a collection of child objects
(PackageEntry) in my parent class(Student). The PackageEntry objects
are persisting correctly and I can see that they are in the same
entity group as their associated student, but when I retrieve the
parent parent Student, the List of PackageEntry is null.

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Student implements Entity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Key key;
.
@Persistent(mappedBy = "student")
List packages;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PackageEntry implements Entity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Key key;

@Persistent Student student;
}

All of the PackageEntry objects that I persist are returned when I
query all objects of that type, but the ones attached to a particular
student are not present when I retrieve the student. What is going on?

Your help is greatly appreciated.

Thanks,
Justin

--

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] Any Sample Authentication Examples using GWT-App Engine

2009-11-24 Thread Sumit Shrotri
Hi All,
 Do any of you know of a sample authentication example, preferably using
certificates.

 (I am not looking to authenticate against google authentication or openid.)

Regards,
Sumit

--

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] Problem in uploading jsp file

2009-11-24 Thread sahil mahajan
Hello

I am working on java google app engine. When I try to upload my application,
I receive following error


Error Details:

Nov 24, 2009 10:18:11 PM org.apache.jasper.JspC processFile

INFO: Built File: \addressbook.jsp

java.lang.IllegalStateException: cannot find javac executable based on
java.home

, tried "C:\Program Files\Java\jre1.6.0_04\bin\javac.exe" and "C:\Program
Files\

Java\bin\javac.exe"

Unable to upload app: cannot find javac executable based on java.home, tried
"C:

\Program Files\Java\jre1.6.0_04\bin\javac.exe" and "C:\Program
Files\Java\bin\ja

vac.exe"


If I remove addressbook.jsp file, error does not occur

What could be the reason?

--

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: Weird results for JOD query with List item filter (List.contains(....))

2009-11-24 Thread Prashant
Max please help me out, it is killing my app. :(

On Tue, Nov 24, 2009 at 8:45 PM, Prashant  wrote:

> this is surely a bug following is my test case
>
>
> PersistenceManager pm = pmf.getPersistenceManager();
>
> Query query = pm.newQuery(_Contact.class);
>
> query.setOrdering("EmailID");
> query.setFilter("Groups.contains(\"mygroup\")");
>
> int i = 1;
> for(_Contact cont : (List<_Contact>) query.execute()){
> resp.getWriter().print(i++ + " " + cont.getID() + "");
> }
>
> pm.close();
>
>
> above code printed 23 contacts and when I replaced  
> *query.setOrdering("EmailID");
> *by *query.setOrdering("EmailID desc"); *it printed 18 contacts only.
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] memcache memory leak on dev server

2009-11-24 Thread Vince Bonfanti
There appears to be a memory leak with the memcache implementation on the
dev server; I've opened a new issue for this:

http://code.google.com/p/googleappengine/issues/detail?id=2428

I have some testcases that make heavy use of memcache that are failing due
to this issue.

Vince

--

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] Problem in uploading jsp file

2009-11-24 Thread Stephan Hartmann
You are using a Java Runtime Environment (JRE) which does not include a 
compiler.

You have to use a JDK instead.

Regards,
Stephan


sahil mahajan schrieb:
>
> Hello
>
> I am working on java google app engine. When I try to upload my 
> application, I receive following error
>
>
> Error Details:
>
> Nov 24, 2009 10:18:11 PM org.apache.jasper.JspC processFile
>
> INFO: Built File: \addressbook.jsp
>
> java.lang.IllegalStateException: cannot find javac executable based on 
> java.home
>
> , tried "C:\Program Files\Java\jre1.6.0_04\bin\javac.exe" and 
> "C:\Program Files\
>
> Java\bin\javac.exe"
>
> Unable to upload app: cannot find javac executable based on java.home, 
> tried "C:
>
> \Program Files\Java\jre1.6.0_04\bin\javac.exe" and "C:\Program 
> Files\Java\bin\ja
>
> vac.exe"
>
>
> If I remove addressbook.jsp file, error does not occur
>
> What could be the reason?
>
> --
>
> 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.




Re: [appengine-java] Re: InputStream read returning -1, but avalible btyes correct ?

2009-11-24 Thread Ikai L (Google)
Toby's email is correct. The correct way to read from an InputStream is to
create a buffer of bytes, then iterate over it. You should be doing
something like this:


while ((len = stream.read(buffer, 0, buffer.length)) != -1) {
output.write(buffer, 0, len);
}

As far as your question goes, per Sun's documentation of the ServletRequest
class:

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getInputStream()

getParameter

public java.lang.String *getParameter*(java.lang.String name)

*If the parameter data was sent in the request body, such as occurs with an
HTTP POST request, then reading the body directly via
**getInputStream()*<../../javax/servlet/ServletRequest.html#getInputStream()>
* or **getReader()* <../../javax/servlet/ServletRequest.html#getReader()>* can
interfere with the execution of this method.*


On Mon, Nov 23, 2009 at 7:04 PM, Bourke Floyd IV  wrote:

> //I figured out the problem. Example case: POST Request from a webpage
> with 2 text fields (userEmail = '5...@gmail.com', and favCar =
> 'corvette')
> //If I use
> String email = req.getParameter("userEmail")
>
> //and then try to get the whole body of the POST
>
> InputStream inputStream = req.getInputStream();
> if (inputStream != null) {
> byte[] body = new byte[inputStream.available()];
> inputStream.read(body);
> String body = new String(body);
> }
>
> //body = ""
> //but if I comment out the use of ANY getParameter Call, I get body
> fine.
> //Also, the reverse also holds true
>
> //if you get the body using the InputStream, then try to use
> getParameter
> //then all of your getParameters will return null
>
> //I don't know if this is by design or a bug because I'm not
> experienced Java Programmer
>
> -Bourke
>
>
>
> On Nov 23, 5:50 pm, "Ikai L (Google)"  wrote:
> > What are you posting? This code works for me:
> >
> > public class TestPostServlet extends HttpServlet {
> >
> > protected void doPost(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException {
> > InputStream in = request.getInputStream();
> >
> > int size = in.available();
> > byte[] body = new byte[size];
> > int status = in.read(body);
> > in.close();
> >
> > response.getWriter().println("Status of read: " + status + "
> Size: "
> > + size);
> > response.getWriter().println("Got your post: " + new
> String(body));
> >
> > }
> >
> > }
> >
> > What mechanism are you using to POST to your application? Is it a browser
> > form or a custom client?
> >
> > On Sat, Nov 21, 2009 at 12:37 PM, Bourke Floyd IV 
> wrote:
> >
> >
> >
> >
> >
> > > //This was working before I overhauled the authentication of my app
> > > //I'm trying to store the body of a Http POST as Text, I also plan on
> > > doing a Blob version
> > > //The maxLength is returning the correct size, but the read is
> > > returning -1 instead of properly
> > > //updating the body byte array
> >
> > > //...
> >
> > > InputStream httpIn = req.getInputStream();
> > > byte[] body = new byte[httpIn.available()];
> > > httpIn.read(body);
> >
> > > Text myPostBody = new Text(new String(body)); //wasteful maybe? but
> > > should work
> >
> > > //...
> >
> > > //My old code was roughly the same
> >
> > > //...
> >
> > > int maxLength = req.getContentLength();
> > > byte[] body = new byte[maxLength];
> >
> > > InputStream httpIn = req.getInputStream();
> > > httpIn.read(body, 0, maxLength);
> >
> > > String  myPostBody = new String(body); //wasteful maybe? but should
> > > work
> >
> > > //...
> >
> > > --
> >
> > > 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 unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=.
> >
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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-appen

Re: [appengine-java] memcache memory leak on dev server

2009-11-24 Thread Toby Reyelts
I've posted a reply to the issue, which I'm copying below:

Unlike production, the dev_appserver's memcache implementation has a
100M limit which
it will happily attempt to fill, regardless of how much heap space you
actually have
free in your JVM. You can either increase your heap size to accomodate
the limit, or
change the limit to accomodate your heap size. You can change the
limit by setting
the system property, memcache.maxsize. For example,

$SDK_HOME/bin/dev_appserver.sh --jvm_flag=-Dmemcache.maxsize=50M


On Tue, Nov 24, 2009 at 12:59 PM, Vince Bonfanti wrote:

> There appears to be a memory leak with the memcache implementation on the
> dev server; I've opened a new issue for this:
>
> http://code.google.com/p/googleappengine/issues/detail?id=2428
>
> I have some testcases that make heavy use of memcache that are failing due
> to this issue.
>
> Vince
>
> --
> 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.




Re: [appengine-java] Datastore Issues

2009-11-24 Thread Jeffrey Goetsch
Here is a subset of the code.  It doesn't run or have the logic that changes
the values.  I have included the ChallengeDao, which highlights what I had
to do to make work correctly.  If I remove the PM.closePersistentManager()
it fails in many different ways.  I can even get a failure about can't
modify multiple entities from different groups in the same transaction, and
I don't even have transactions.

My goal is to have one PersistenceManager per request.  That way I don't
have to re-query the objects from datastore twice, because I have read-only
logic afterwards that packets the data needed for the GWT front end.

Like I said before, I am will to share the entire code base with people that
are working on these issues in datanucleus code, but not to the entire
group.  I am willing to answer any questions you might have.

Thanks,
Jeffrey

public class *PM* {
private PM() {
}

static private PersistenceManagerFactory pmfInstance;
static private HashMap pmSet = new
HashMap();
static private HashSet testThreads = new HashSet();
static private long testId = 0;
static private HashMap testObj;


synchronized static private void createPmfInstance() {
if (pmfInstance == null) {
pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-optional");
}
}

static public void startTest() {
testThreads.add(Thread.currentThread());
}

static public void endTest() {
testThreads.remove(Thread.currentThread());
}

static public Long createTestId(Object obj) {
if (!testThreads.contains(Thread.currentThread())) {
throw new IllegalStateException
("TestId is illegal when PersistenceManagerFactory is
active");
}
if (testObj == null) {
testObj = new HashMap();
}

long newId = testId++;
while (testObj.containsKey(newId)) {
newId = testId++;
}
testObj.put(newId, obj);
return newId;
}

static public Long setTestId(long id, Object obj) {
if (!testThreads.contains(Thread.currentThread())) {
throw new IllegalStateException
("TestId is illegal when PersistenceManagerFactory is
active");
}
if (testObj == null) {
testObj = new HashMap();
}

testObj.put(id, obj);
return id;
}

static public PersistenceManager getPersistenceManager() {
if (pmfInstance == null) {
createPmfInstance();
}

PersistenceManager pm = pmSet.get(Thread.currentThread());
if (pm == null) {
pm = pmfInstance.getPersistenceManager();
pmSet.put(Thread.currentThread(), pm);
}

return pm;
}

static public void closePersistenceManager() {
PersistenceManager pm = pmSet.remove(Thread.currentThread());
if (pm != null) {
pm.close();
}
}

static public void rollbackPersistenceManager() {
org.datanucleus.jdo.JDOPersistenceManager pm =
(JDOPersistenceManager) PM.getPersistenceManager();
ObjectManager om = pm.getObjectManager();
om.clearDirty();
PM.closePersistenceManager();
}

static public  T getObjectById(Class cls, Object key) {
Object obj;
if (testThreads.contains(Thread.currentThread())) {
obj = testObj.get(key);
} else {
obj = getPersistenceManager().getObjectById(cls, key);
}

return (T) obj;
}

static public  Collection getObjectsById(Class cls,
Collection keys) {
Collection collection = new LinkedList();
if (testThreads.contains(Thread.currentThread())) {
if (keys != null && !keys.isEmpty()) {
for (Object key : keys) {
collection.add((T) testObj.get(key));
}
}
} else {
if (keys != null && !keys.isEmpty()) {
//TODO this is not optimized for Batch gets - switch to low
level api
PersistenceManager pm = getPersistenceManager();
LinkedList oids = new LinkedList();
for (Object key : keys) {
oids.addLast(pm.newObjectIdInstance(cls, key));
}
collection = pm.getObjectsById(oids);
}
}

return collection;
}
}

//*
public class *ChallengeDao* {
public ChallengeDao() {
}

public Challenge newChallenge(PlayerId targetId, PlayerId attackerId,
Troops troops) {
PM.closePersistenceManager();
PersistenceManager pm = PM.getPersistenceManager();

PlayerDao playerDao = SessionUtil.getPlayerDao();

Player target = playerDao.getPlayer(targetId);

//This is to prevent the challenge from being cre

[appengine-java] Re: List of Child Objects Not Loading

2009-11-24 Thread datanucleus
> What is going on?

So you didn't put them in the fetch group then, so they weren't
fetched. aka lazy loading. Read up on fetch groups and JDO

--

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] memcache memory leak on dev server

2009-11-24 Thread Vince Bonfanti
But in the testcase I attached to the issue report, I'm doing a put of the
same key every time--why would this take more and more memory (and never
release it)? Shouldn't the value be replaced, and the memory for the
previous value be freed?

Vince

On Tue, Nov 24, 2009 at 1:30 PM, Toby Reyelts  wrote:

> I've posted a reply to the issue, which I'm copying below:
>
> Unlike production, the dev_appserver's memcache implementation has a 100M 
> limit which
> it will happily attempt to fill, regardless of how much heap space you 
> actually have
> free in your JVM. You can either increase your heap size to accomodate the 
> limit, or
> change the limit to accomodate your heap size. You can change the limit by 
> setting
> the system property, memcache.maxsize. For example,
>
> $SDK_HOME/bin/dev_appserver.sh --jvm_flag=-Dmemcache.maxsize=50M
>
>
> On Tue, Nov 24, 2009 at 12:59 PM, Vince Bonfanti wrote:
>
>> There appears to be a memory leak with the memcache implementation on the
>> dev server; I've opened a new issue for this:
>>
>> http://code.google.com/p/googleappengine/issues/detail?id=2428
>>
>> I have some testcases that make heavy use of memcache that are failing due
>> to this issue.
>>
>> Vince
>>
>> --
>> 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.
>

--

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] out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-24 Thread david ruescas
When receiving email I get an out of memory error when calling
getCount on the MimeMultipart object.

Heres the stack trace:

Error for /_ah/mail/rev...@reviewengine.appspotmail.com
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.io.ByteArrayOutputStream.write(Unknown Source)
at 
javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
at com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at 
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
at 
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
at 
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
at 
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)

--

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] memcache memory leak on dev server

2009-11-24 Thread Toby Reyelts
My apologies Vince,

I didn't take a close enough look to notice that you were using the same
key. There's certainly something unusual going on there.

On Tue, Nov 24, 2009 at 1:42 PM, Vince Bonfanti  wrote:

> But in the testcase I attached to the issue report, I'm doing a put of the
> same key every time--why would this take more and more memory (and never
> release it)? Shouldn't the value be replaced, and the memory for the
> previous value be freed?
>
> Vince
>
>
> On Tue, Nov 24, 2009 at 1:30 PM, Toby Reyelts  wrote:
>
>> I've posted a reply to the issue, which I'm copying below:
>>
>> Unlike production, the dev_appserver's memcache implementation has a 100M 
>> limit which
>> it will happily attempt to fill, regardless of how much heap space you 
>> actually have
>> free in your JVM. You can either increase your heap size to accomodate the 
>> limit, or
>> change the limit to accomodate your heap size. You can change the limit by 
>> setting
>> the system property, memcache.maxsize. For example,
>>
>> $SDK_HOME/bin/dev_appserver.sh --jvm_flag=-Dmemcache.maxsize=50M
>>
>>
>> On Tue, Nov 24, 2009 at 12:59 PM, Vince Bonfanti wrote:
>>
>>> There appears to be a memory leak with the memcache implementation on the
>>> dev server; I've opened a new issue for this:
>>>
>>> http://code.google.com/p/googleappengine/issues/detail?id=2428
>>>
>>> I have some testcases that make heavy use of memcache that are failing
>>> due to this issue.
>>>
>>> Vince
>>>
>>> --
>>> 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.
>>
>
>  --
> 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.




Re: [appengine-java] Re: convert JDO query to JPA

2009-11-24 Thread Ikai L (Google)
This actually makes more sense. JPA does not write to the data store until
either the EntityManager is closed or the transaction is flushed. Here's an
example using transactions:

  EntityManager em = EMF.get().createEntityManager();
PrintWriter out = response.getWriter();

List dogs;

try {
Dog newDog = new Dog("New dog!", 1);

EntityTransaction tx = em.getTransaction();
tx.begin();
em.persist(newDog);
tx.commit();

Query query = em.createQuery("SELECT FROM Dog"); // WHERE key =
:key");
dogs = (List) query.getResultList();
   // etc

Here are some examples:
http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/jpa_overview_em_lifeexamples.html

On Mon, Nov 23, 2009 at 8:18 PM, lp  wrote:

>
> > EntityManager em = EMF.get().createEntityManager();
> > PrintWriter out = response.getWriter();
> >
> > List dogs;
> >
> > try {
> >
> > Query query = em.createQuery("SELECT FROM Dog WHERE
> > dogFriends = :key");
> > query.setParameter("key", key);
> > dogs = (List) query.getResultList();
> >
> > dogs.size();  // Do this so we can eager load the list and
>
> solve it!
>
> running your code in my unit test i still get a 0 size result list.
>
> *until* i added the following in my unittest
>
> Dog user1 = new Dog()
>
> //blah blah
> em.merge(user1);
>
> em.close();  <-- needed to close existing em
>
> em = getEnityManager();
>
> //query now executes correctly
>
>
> it seems that the entity manager is not working as i expected.
> by doing em.close after making objects persistent and then getting new
> em, allowed the em.query to execute correctly.
>
> i am not clear of why the em behaviours like that, given the em.find()
> seem to find the correct object.
>
> any ideas?
>
> -lp
>
> --
>
> 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.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Discussion on will-it-play-in-app-engine

2009-11-24 Thread Lombo
<%...@tag isElIgnored="false" %> didn't compile to me
<%...@tag isELIgnored="false" %> with capital L did

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] request for example [links] -- { gwt + appengine + bigtable + jpa + maven + {xstream(JSON)} } CRUD

2009-11-24 Thread James Northrup
for some context on my request, 

first, and foremost, it sure is hard to find complete, and contemporary 
examples of the numerous open source advancements since the first, and 
seemingly only literature of gwt was rushed out in the 2007-2008 timeframe.  
there is 0 literature for purchase about gwt+gae/J, and almost as little about 
gae/j in general ; however, there are competing and confusing bands of 
mavenization efforts, all of which seem to lack a meaty CRUD archetype to close 
the gap on the repo choices and the lib/ inclusion choices.  If I'm missing 
some modern publications, please clue me in!  I have located fractions of 
real-world CRUD solutions in several [e]books, less from blogs, but using gae/j 
really adds bleeding to the process. 

second, I'm a complete newcomer to gae/j and gwt altogether, basing estimates, 
and customer expectations on what can be considered anecdotal uncertainties, 
uncertain as to where i can borrow example solutions from at least.   

so the root of my request for this formula of buzzwords is:

view: gwt: I am porting a swing (JNLP) kiosk client and sharing hopefully some 
super-user RPC or JSON CRUD events with a hosted application.  part2 is 
replacing swing outright.  
model: appengine,xstream: I am looking to migrate said kiosk from a standalone 
OpenJPA/Derby Model to a split model of Local Appengine/Cloud-Appengine 
Datanucleus JPA to run the kiosk on mini-me appengine and the various 
super-usecases on the hosted appengine with some level of record transfer
parsimony: maven,bigtable,jpa: migrating from derby embedded storage on JPA, to 
uniform, mavenized model package with syncronicity between kiosk and hosted 
super-CRUD usecases, for this purpose JDO is not out of the question, if it 
opens up the pool of examples to draw from.  that's not a desired goal, since 
it involves retooling the persistence manager on the swing client in 
production.   

issues i am aware of involve prior to finalizing the gameplan is choosing a 
path of inter-app rpc a) JDO, b) JPA+DTO, or c) including the 
javax.persistence.* source code in the model layer, the latter sounding 
preferable.   commentaries on experience here would be helpful.  


thanks for reading this far. 
Jim

--

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] Make application available for Google Apps customers

2009-11-24 Thread Ikai L (Google)
Peter,

The recommended approach is to create a new app per Google Apps domain. This
won't be a violation of the terms of service.

On Sun, Nov 22, 2009 at 7:32 AM, Peter Ondruska wrote:

> This is less technical question and I am not sure if it can be
> answered.
>
> I have a Google App Engine application I would like to be used by
> Google Apps domains (and publish to Google Enterprise Marketplace to
> make it available for any Google Apps customers). However when testing
> I found that if I use Google Apps authentication this application is
> available to just one Google Apps domain and cannot be used by
> another. If I allow use by any Google account Google Apps customers
> can add this application but they are unable to sign in using their
> Google Apps domain account.
>
> How is this done? There are plenty of applications available
> (Moderator for instance) which you can hook up to any domain.
>
> Thanks,
>
> Peter
>
> --
>
> 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=.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Package.getImplementationVersion() not supported?

2009-11-24 Thread Peter Niederwieser
I've tried the following in Groovy Web Console (http://
groovyconsole.appspot.com/):

println Closure.getClassLoader()
println Closure.getPackage()
println Closure.getPackage().getImplementationVersion()

Output:

com.google.apphosting.runtime.security.userclassloa...@4bb369
package groovy.lang
null

Why does getImplementationVersion() return null? Is this the expected
behavior on GAE?

Cheers,
Peter

--

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] Package.getImplementationVersion() not supported?

2009-11-24 Thread Toby Reyelts
If the classes are being loaded from UserClassLoader from a jar in your
WEB-INF/lib containing a manifest, they should get package information from
that manifest. If that's not what you're seeing, please file an issue in the
tracker for us with a simple reproducing webapp.

On Tue, Nov 24, 2009 at 4:11 PM, Peter Niederwieser wrote:

> I've tried the following in Groovy Web Console (http://
> groovyconsole.appspot.com/):
>
> println Closure.getClassLoader()
> println Closure.getPackage()
> println Closure.getPackage().getImplementationVersion()
>
> Output:
>
> com.google.apphosting.runtime.security.userclassloa...@4bb369
> package groovy.lang
> null
>
> Why does getImplementationVersion() return null? Is this the expected
> behavior on GAE?
>
> Cheers,
> Peter
>
> --
>
> 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: Problems with JDO Query.setCandidates(Collection)

2009-11-24 Thread Ricky
hi, guys:

Is there any update on this issue? I am running into the same problem
when I query on candidates: I used the empty list returned from first
query as the candidates of the second query, however result of the
second query is not empty.


On Nov 4, 10:08 pm, datanucleus  wrote:
> > App Engine's DataNucleus plugin doesn't support the setCandidates method
>
> Jason/Max, DataNucleus can do all of that for you, I'm sure I've
> mentioned this before.
> Here I'll even donate you some code that you can plug into your
> JDOQLQuery.performExecute() method
>
> 
>         if (candidateCollection != null)
>         {
>             // Supplied collection of instances, so evaluate in-memory
>             if (candidateCollection.isEmpty())
>             {
>                 return Collections.EMPTY_LIST;
>             }
>             else
>             {
>                 ClassLoaderResolver clr = om.getClassLoaderResolver();
>                 List candidates = new ArrayList(candidateCollection);
>                 JavaQueryEvaluator resultMapper = new JDOQLEvaluator
> (this, candidates, compilation,
>                     parameters, clr);
>                 return resultMapper.execute(true, true, true, true,
> true);
>             }
>         }
> 
>
> So the query will be executed in memory using the user-supplied
> instances.
>
> No excuses now ;-)
>
> --Andy (DataNucleus)

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: Now available: JDO/JPA preview release with inheritance support

2009-11-24 Thread Abe Parvand
I have this exact same problem. So, +1. Temporary workaround? Should
we just omit parent reference in child for now?

On Nov 23, 2:15 pm, "Max Ross (Google)" 
wrote:
> Thanks for the report!  I've made a lot of fixes since the RC1 build but
> they're not backwards-compatible with the 1.2.6 SDK, so unfortunately I
> can't release them until the next SDK is out.  Your test case works for me
> with my latest build so this will behave correctly in the next release.
>
> Thanks,
> Max
>
> On Mon, Nov 23, 2009 at 1:56 PM, R. A.  wrote:
>
> >http://datanucleus-appengine.googlecode.com/files/appengine-orm-1.0.4...
> > >> This release provides support for inheritance of native datastore types
> > and embedded classes.
>
> > Can't get inheritance to run. Tested on *-1.0.3 and *-1.0.4.RC1.
> > Without AbstractEntity, 2 entities with OneToMany relationship works
> > perfectly. Is it the problem with  Key id type? NullPointerException
> > is thrown when i access child list element:
>
> > public void test() {
> >        List parents = tdao.load();
> >        for (ParentEntity pe : parents) {
> >                List childs = pe.getChilds();
> >                System.out.println(".. childs.size: " + childs.size());
> >                for(ChildEntity ce : childs) { // <- NPE
> >                }
> >        }
> > }
>
> > @Entity
> > @MappedSuperclass
> > public abstract class AbstractEntity {
>
> >       �...@id
> >       �...@generatedvalue(strategy = GenerationType.IDENTITY)
> >        private Key id;
>
> >        private String name;
> > ...
> > }
>
> > @Entity
> > public class ParentEntity extends AbstractEntity {
>
> >       �...@onetomany(mappedBy="parent", cascade=CascadeType.ALL)
> >        private List childs;
> > ...
> > }
>
> > @Entity
> > public class ChildEntity extends AbstractEntity {
>
> >        private Long value;
>
> >       �...@manytoone
> >        private ParentEntity parent;
> > ...
> > }
>
> > Nov 23, 2009 8:20:34 PM com.google.apphosting.utils.jetty.JettyLogger
> > warn
> > WARNING: Nested in
> > org.springframework.web.util.NestedServletException: Request
> > processing failed; nested exception is java.lang.NullPointerException:
> > java.lang.NullPointerException
> >        at
>
> > org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.getObjectForApplicationIdentity
> > (PersistenceCapableMapping.java:971)
> >        at
> > org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.getObject
> > (PersistenceCapableMapping.java:720)
> >        at
> > org.datanucleus.store.appengine.DatastoreRelationFieldManager.lookupParent
> > (DatastoreRelationFieldManager.java:309)
> >        at
>
> > org.datanucleus.store.appengine.DatastoreRelationFieldManager.fetchRelationField
> > (DatastoreRelationFieldManager.java:289)
> >        at
> > org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField
> > (DatastoreFieldManager.java:271)
> >        at org.datanucleus.state.AbstractStateManager.replacingObjectField
> > (AbstractStateManager.java:1197)
> >        at gae.test.ChildEntity.jdoReplaceField(ChildEntity.java)
> >        at gae.test.AbstractEntity.jdoReplaceFields(AbstractEntity.java)
> >        at org.datanucleus.state.JDOStateManagerImpl.replaceFields
> > (JDOStateManagerImpl.java:2772)
> >        at org.datanucleus.state.JDOStateManagerImpl.replaceFields
> > (JDOStateManagerImpl.java:2791)
> >        at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject
> > (DatastorePersistenceHandler.java:443)
> >        at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo
> > (DatastoreQuery.java:433)
> >        at
>
> > org.datanucleus.store.appengine.DatastoreElementContainerStoreSpecialization.getChildren
> > (DatastoreElementContainerStoreSpecialization.java:103)
> >        at org.datanucleus.store.appengine.DatastoreFKListStore.listIterator
> > (DatastoreFKListStore.java:47)
> >        at
> > org.datanucleus.store.mapped.scostore.AbstractListStore.listIterator
> > (AbstractListStore.java:84)
> >        at org.datanucleus.store.mapped.scostore.AbstractListStore.iterator
> > (AbstractListStore.java:74)
> >        at org.datanucleus.sco.backed.List.loadFromStore(List.java:241)
> >        at org.datanucleus.sco.backed.List.iterator(List.java:507)
> >        at
> > java.util.AbstractCollection.toString(AbstractCollection.java:414)
> >        at java.lang.String.valueOf(String.java:2826)
> >        at java.lang.StringBuilder.append(StringBuilder.java:115)
> >        at gae.test.TestServiceImpl.openParentsWithChilds
> > (TestServiceImpl.java:27)
> >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >        at sun.reflect.NativeMethodAccessorImpl.invoke
> > (NativeMethodAccessorImpl.java:39)
> >        at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > (DelegatingMethodAccessorImpl.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:597)
> >        at
> > com.google.appengine.tools.development.agent.runtime.Ru

[appengine-java] Re: out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-24 Thread m seleron
Hi,

I want you to teach the value of
[javax.mail.internetMimeMessage.getContentType() ]
for confirmation.

thanks.

On 11月25日, 午前3:57, david ruescas  wrote:
> When receiving email I get an out of memory error when calling
> getCount on the MimeMultipart object.
>
> Heres the stack trace:
>
> Error for /_ah/mail/rev...@reviewengine.appspotmail.com
> java.lang.OutOfMemoryError: Java heap space
>         at java.util.Arrays.copyOf(Unknown Source)
>         at java.io.ByteArrayOutputStream.write(Unknown Source)
>         at 
> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
>         at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
>         at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
>         at com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>         at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>         at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>         at 
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>         at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>         at 
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>         at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>         at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>         at 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>         at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>         at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>         at 
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>         at 
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
>         at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>         at org.mortbay.jetty.Server.handle(Server.java:313)
>         at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
>         at 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>         at 
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>         at 
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
>         at 
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
>         at 
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
>         at 
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
>         at 
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>         at 
> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)

--

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] Persistable JDO object -> low-level entity?

2009-11-24 Thread Ikai L (Google)
Erem,

You can use the makePersistentAll() method of PersistenceManager to batch
put items. See here:

http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Making_Objects_Persistent

This was introduced in SDK 1.2.5.

On Mon, Nov 23, 2009 at 2:37 PM, Erem  wrote:

> Hey all,
>
> Are there any built in tools in the API to translate a managed JDO
> object into a low-level Entity?
>
> I want to do a batch put of some JDO-managed objects and some low-
> level Entities. If I could translate JDO-managed objects into bigtable
> Entities, I could do this in one call to the low-level API rather than
> one call to persistenceManager.makePersistentAll(Collection) and
> another to datastoreService.put(Iterable).
>
> Thanks for the help!
>
> Erem
>
> --
>
> 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=.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: any plans for deferred.defer in Java?

2009-11-24 Thread Jeff Schnitzer
Attached is a modified version of that class that lets you define any
path you want for the servlet and lets you specify which queue to use
like this: Deferred.defer(task, "queueName");

(I needed this for my own purposes)

Do with it as you wish :-)

The only other major change I would make is to stop masking all the
exceptions during the task processing.  Or at least, if you're going
to log the exception and stop propagation, log the whole thing so we
get a stacktrace in the logs.

Jeff

On Fri, Nov 20, 2009 at 1:03 PM, David Chandler  wrote:
> Vince, this is great! I hadn't been watching my own issue, so didn't
> see this until now. Thanks so much!
>
> Only enhancement I would suggest is to enable multiple deferred
> queues. For example. I would like to defer tasks in an email throttle
> queue separately from a general background queue. Perhaps the
> Deferrable interface could have a getQueueName() method, or
> Deferred.defer could have an additional signature defer(Deferrable
> task, String queueName).
>
> Thanks again,
> /dmc

--

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.




Deferred.java
Description: Binary data


Re: [appengine-java] Re: problem with using session.getAttribute()

2009-11-24 Thread Rusty Wright
Did you enable sessions?

http://code.google.com/appengine/docs/java/config/appconfig.html

See the section near the end, Enabling Sessions.


Steph wrote:
> I also have the same issue when retrieving session objects from a
> servlet filter, and running in the local sandbox.
> 
> On Nov 21, 10:11 pm, Sanjay  wrote:
>> Did you solve this problem? I am facing exactly same problem, it would
>> be nice if you could share the solution if you found one.
>>
>> Thank you
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-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] 1.2.8 SDK Prerelease - help us verify!

2009-11-24 Thread Ikai L (Google)
Hello App Engine Developers,

As part of our ongoing efforts to improve release quality and
transparency, we will start prereleasing SDKs for early testing. We
hope this gives developers a chance to participate in our release
process by trying out new changes and sending feedback. As of this
morning, the prerelease SDK for our next release, 1.2.8, is available
in the familiar download location (note that the filename ends in
'prerelease.zip'):

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

If you're interested, please download and give it a try locally with
your favorite App Engine code. Please note that, as a prerelease, this
SDK is not yet supported and still subject to change. Thus, please
don't take critical dependencies or make substantial changes to
production apps based on this SDK.

Importantly, this prerelease is purely for the SDK and is intended for
local testing and development in dev_appserver. The server-side of App
Engine (our production environment) is not at 1.2.8, so deploying with
this SDK is not yet supported. In the future, we might enable a
complete SDK and server test environment for prereleases.

A few notes on 1.2.8 in particular - this release is primarily for
servicing and updates in preparation for some exciting feature
launches we have in the pipeline. The current release notes (still
subject to change) are included below; these release notes do include
changes which will only be available on the server side Admin Console
(non-local) once 1.2.8 is formally released.

Please try 1.2.8 for local development and send us your feedback!

Thanks,

App Engine Team

Version 1.2.8
=
  - Support for JAXB. JAXB is included in JDK 1.6 (and App Engine's
production
servers). If you're using JDK 1.5 with your local dev_appserver,
you will
need to include the JAXB libraries with your application to use
it.
  http://code.google.com/p/googleappengine/issues/detail?id=1267
  - Added Quota API (com.google.appengine.api.quota) to match Python
API.
  - Low-level Memcache API now supports grabTail() and batchIncrement
().
  - HTTPResponse object now has getFinalUrl() method for 302
redirects.
  http://code.google.com/p/googleappengine/issues/detail?id=1464
  - Java Dev Appserver now automatically executes tasks.  If you
prefer the old
behavior where tasks do not automatically execute you can use the
  -Dtask_queue.disable_auto_task_execution flag when starting the
server.
  - Additional file extensions permitted when sending mail.
  http://code.google.com/p/googleappengine/issues/detail?id=494
  - Fixed issue with Java mail handler not processing multipart
messages
correctly.
  - Fixed agent code included in appengine-local-runtime.jar results
in
RuntimeException.
  http://code.google.com/p/googleappengine/issues/detail?id=2280
  - Fixed issue with sort orders defined on properties that allow
multiple
values.
  http://code.google.com/p/googleappengine/issues/detail?id=2349
  - Fixed problem with dropped query strings after requiring log-in.
  http://code.google.com/p/googleappengine/issues/detail?id=2225
  - Removed limitation preventing multiple parameters with the same
name.
  http://code.google.com/p/googleappengine/issues/detail?id=2090
  - Fixed issue with local datastore incorrectly sorting results of
ancestor queries.
  http://code.google.com/p/googleappengine/issues/detail?id=2177
  - New Index building status page in the Admin Console
  - Task Queue now supports purging queues, and deleting tasks and
queues via
the Admin Console.
  http://code.google.com/p/googleappengine/issues/detail?id=2159
  http://code.google.com/p/googleappengine/issues/detail?id=1740
  - Over Quota HTTP status code changed from 403 to 503, other to 500.
  - Task Queue now considers all HTTP 2xx status codes to represent
success.

ORM Changes

  - Explicitly disallow multiple relationships of the same type
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=154
  - Occasional ArrayOutOfBoundsIndexException
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=156
  - Support inheritance
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=25
  - Support != queries
  - Support IN queries
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=39
  - Inheritance is working for simple fields and embedded fields.
Relationships
in base classes are completely untested and probably do not work.
  - Cannot add child to existing one-to-many if parent has Long or
unencoded String pk
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=28
  - Can't query by embedded fields at depth > 1
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=120
  - Positional parameters don't work (JPQL)
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=128
  - Throw JDOCanRetryException when ConcurrentMod hit during txn
commit
  h

Re: Solved : Re: [appengine-java] Re: XML to Object libraries and Vice Versa

2009-11-24 Thread Rusty Wright
(In case anyone is searching for this topic in the archives.)

There's also Simple:

http://simple.sourceforge.net/
http://www.ibm.com/developerworks/xml/library/x-simplexobjs/


Ravi Sharma wrote:
> Hi Guys,
> I tried Betwixt from apache(http://commons.apache.org/betwixt/index.html).
> And it works out of box. I only got into some problems as i downloaded 
> some older version of dependecies(Digester and beanutils).
> So when using Betwixt make sure you have latest version of all dependecnies.
> 
> Also in local it will not ask for dependecies as GWT-window jar contains 
> DIgester and Collection classes, but on GAE server you need it. So 
> download those jars and keep them in your lib folder.
> 
> I dont miss JAXB any more :)
> 
> Thanks,
> Ravi.
> 
> 
> 
> On Sun, Nov 22, 2009 at 8:13 PM, Rusty Wright  > wrote:
> 
> Here are some bookmarks I have for xml:
> 
> http://www.xom.nu/
> http://www.smooks.org/mediawiki/index.php?title=Main_Page
> http://jibx.sourceforge.net/
> http://xstream.codehaus.org/
> http://castor.org/
> 
> I'll be trying castor.
> 
> 
> Ravi wrote:
>  > Hi Few days back i asked a question that which libraries can be used
>  > to Convert Object to Xml and vice versa, and got advice to use
> betwixt
>  > (http://commons.apache.org/betwixt/)
> ..
>  > I tried it and its working locally but on GAE server its not working
>  > and throwing following exception
>  >
>  > org.apache.commons.betwixt.XMLIntrospector introspect: Security
>  > manager does not allow bean info search path to be set
>  >
>  > then i suppose we can not use Betwixt on GAE. If we can then can
>  > anyone tell what i can do to make it work.
>  > If not then can you suggest any othe rlibarary which can be used.
>  >
>  > Thanks,
>  > Ravi.
>  >
>  > On Nov 8, 5:50 pm, LUAI KASSAR  > wrote:
>  >> Use Apache betwixt ,its works on
> GAEhttp://commons.apache.org/betwixt/
> 
>  >>
>  >>
>  >>
>  >> On Sun, Nov 8, 2009 at 7:46 PM, Ravi Sharma  > wrote:
>  >>> I am not sure if i understand you.
>  >>> Can you explain bit more, an example or link would be great.
>  >>> I can do normal Sax parsing but then writing code for each
> different kind
>  >>> of xml is gonna be very tidious work.So looking for some GAE
> supported
>  >>> libararies like JAXB or XMLBEAN
>  >>> My Requirment is as follows(in cae is there was any
> misunderstanding)
>  >>> 
>  >>> 
>  >>>
>  >>>   
>  >>>   
>  >>>
>  >>>
>  >>> 
>  >>> PersonName
>  >>> 2
>  >>> 
>  >>> 
>  >>>
>  >>>
>  >>>My Venod ltd
>  >>>ABC 234
>  >>>
>  >>> 
>  >>> and now in java if i want to get the vbendor name
>  >>> tehn i should be able to access it using classes directly(which
> will be
>  >>> generated compile time)
>  >>> Order  order = SomeMarsheller.unmashel("fullxml");
>  >>> String vendorName = order.getVendor().getName();
>  >>> My Orginal Mail was
>  >>> Hi,
>  >>> Is there any library like Apache XMLBeans/JAXB supported in
> Google APP
>  >>> Engine which can be used for converting XML to Java Object and Java
>  >>> Objects to XML.
>  >>> I checked the White lists of libraries and found that
>  >>> JAXB is not supported ( I have already stared the issue related
> to it)
>  >>> and Xmlbeans was not mentioned as Supported Library.
>  >>> I am sure lots of people here doing this normal thing to
> convert Java
>  >>> Object to XML and Vice Versa.
>  >>> Please Suggest some thing
>  >>> Ravi.
>  >>> On Fri, Nov 6, 2009 at 3:59 PM, rakeshv  > wrote:
>  > I am sure lots of people here doing this normal thing to
> convert Java
>  > Object to XML and Vice Versa.
>  > Please Suggest some thing.
>   The XML element/attribute pair maps quite well into the low
> level API
>   Entity/properties structure.  That should be all you need.
>   Rakesh- Hide quoted text -
>  >> - Show quoted text -
>  >
>  > --
>  >
>  > You received this message because you are subscribed to the
> Google Groups "Google App Engine for Java" group.
>  > To post to this group, send email to
> google-appengine-java@googlegroups.com
> .
>  > To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
>  > For more options, vis

Re: [appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-24 Thread Rusty Wright
The filesystem is read only on app engine; would trying to create a file, in 
WEB-INF for example, work?  I'm wondering if there are corner cases I'm not 
thinking of where that might fail and falsely report that you're on app engine; 
for example, if you were doing integration tests under Hudson.


Nacho Coloma wrote:
> Thanks! I searched a lot but didn't get to this thread.
> 
> On Nov 23, 4:13 pm, leszek  wrote:
>> Follow that thread:
>>
>> http://groups.google.co.uk/group/google-appengine-java/browse_frm/thr...
> 
> --
> 
> 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=.
> 
> 

--

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] UUID.ramdomUUID() extremely slow

2009-11-24 Thread Brian Hayward
Looking through my logs, it seems like just about every call for
UUID.randomUUID() takes about 5 seconds.   Is there a better way to
generate UUID's than this when using the app engine?

I know at least some of this is from an inactive app (there are a few
minutes between most requests), but it seems much higher than when the
same thing happens on another type of request.

I'm on Appengine SDK 1.2.5

--

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: Persistable JDO object -> low-level entity?

2009-11-24 Thread Erem
Ikai,

Thanks for the response. The issue is that I have two types of objects
that need to be persisted:

(1) a bunch of JDO managed objects
(2) a bunch of low-level Entity objects.

Is there any way that I could batch put all of them at once through
the same API rather then calling the JDO api followed by the low-level
api?

On Nov 24, 5:09 pm, "Ikai L (Google)"  wrote:
> Erem,
>
> You can use the makePersistentAll() method of PersistenceManager to batch
> put items. See here:
>
> http://code.google.com/appengine/docs/java/datastore/creatinggettinga...
>
> This was introduced in SDK 1.2.5.
>
>
>
> On Mon, Nov 23, 2009 at 2:37 PM, Erem  wrote:
> > Hey all,
>
> > Are there any built in tools in the API to translate a managed JDO
> > object into a low-level Entity?
>
> > I want to do a batch put of some JDO-managed objects and some low-
> > level Entities. If I could translate JDO-managed objects into bigtable
> > Entities, I could do this in one call to the low-level API rather than
> > one call to persistenceManager.makePersistentAll(Collection) and
> > another to datastoreService.put(Iterable).
>
> > Thanks for the help!
>
> > Erem
>
> > --
>
> > 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=.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] UUID.ramdomUUID() extremely slow

2009-11-24 Thread Toby Reyelts
Do you have actual timing code around that one single call, or is other
stuff going on during your request? If you can create a trivial webapp that
consistently shows 5 seconds just to call UUID.randomUUID() please file an
issue for it, and we can look into it.

On Tue, Nov 24, 2009 at 9:19 PM, Brian Hayward  wrote:

> Looking through my logs, it seems like just about every call for
> UUID.randomUUID() takes about 5 seconds.   Is there a better way to
> generate UUID's than this when using the app engine?
>
> I know at least some of this is from an inactive app (there are a few
> minutes between most requests), but it seems much higher than when the
> same thing happens on another type of request.
>
> I'm on Appengine SDK 1.2.5
>
> --
>
> 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.




Re: [appengine-java] Re: Persistable JDO object -> low-level entity?

2009-11-24 Thread Ikai L (Google)
No, there is no easy way to throw them all in. If this is a performance
bottleneck, you could always write converters for each of your JDO managed
entities.

On Tue, Nov 24, 2009 at 6:48 PM, Erem  wrote:

> Ikai,
>
> Thanks for the response. The issue is that I have two types of objects
> that need to be persisted:
>
> (1) a bunch of JDO managed objects
> (2) a bunch of low-level Entity objects.
>
> Is there any way that I could batch put all of them at once through
> the same API rather then calling the JDO api followed by the low-level
> api?
>
> On Nov 24, 5:09 pm, "Ikai L (Google)"  wrote:
> > Erem,
> >
> > You can use the makePersistentAll() method of PersistenceManager to batch
> > put items. See here:
> >
> > http://code.google.com/appengine/docs/java/datastore/creatinggettinga...
> >
> > This was introduced in SDK 1.2.5.
> >
> >
> >
> > On Mon, Nov 23, 2009 at 2:37 PM, Erem  wrote:
> > > Hey all,
> >
> > > Are there any built in tools in the API to translate a managed JDO
> > > object into a low-level Entity?
> >
> > > I want to do a batch put of some JDO-managed objects and some low-
> > > level Entities. If I could translate JDO-managed objects into bigtable
> > > Entities, I could do this in one call to the low-level API rather than
> > > one call to persistenceManager.makePersistentAll(Collection) and
> > > another to datastoreService.put(Iterable).
> >
> > > Thanks for the help!
> >
> > > Erem
> >
> > > --
> >
> > > 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=.
> >
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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.