[appengine-java] Any easy way to run demos on 1.4 release?

2010-12-21 Thread John
Start by installing the Eclipse plugin from the download 
site. 
Then File -> Import -> Existing Projects into Workspace in Eclipse.

-- 
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] Any easy way to run demos on 1.4 release?

2010-12-21 Thread NeoK
Thank you for your comment, though, I couldn't find the context menu you 
mentioned(Convert project to GWT project) on Project Explorer view in 
Eclipse 3.6 with GAE 1.4 plugin. And I believe some of demos are not GWT 
based example, they only use GAE.
Though I have succeeded in compiling "helloorm" example somehow.( compile 
error was there - "couldn't resolve .  import 
javax.jdo.PersistenceManager;")

But when I launched the "helloorm" example with Ant "runserver" and tried to 
access localhost:8080 on my Chrome web browser and I get the error messages 
below

HTTP ERROR 500

Problem accessing /. Reason:

INTERNAL_SERVER_ERROR

Caused by:

java.lang.ExceptionInInitializerError
at 
com.google.appengine.demos.helloorm.GetFlights.queryJPA(GetFlights.java:65)
at 
com.google.appengine.demos.helloorm.GetFlights.doGet(GetFlights.java:34)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at 
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

.

I'm wondering if the demos in GAE 1.4 release are working or not.
Oh, and I found only "guestbook" demo works fine with Ant build.xml file 
configuration which is useless because I've gone through it with the 
tutorial.

-- 
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] Setting up Warmup Requests

2010-12-21 Thread John
There's now an issue proposing some changes to the documentation for Java 
warm-up 
requests.  
The last section of the current document is quite misleading. I can't say 
whether there's a dependency on defining a servlet named _ah_warmup. On the 
other hand, if the web.xml doesn't include a servlet-mapping with an 
explicit url-pattern of /_ah/warmup, I haven't seen any of the warm-up 
behavior, at all. Of course, it's pretty difficult to examine the GAE 
behavior for wamups, particularly without knowing what its heuristics are.

In other words, the app needs to provide a servlet that can be called in the 
warmup context. That means web.xml should include something like 

_ah_warmup

com.example.warming_test.WarmingServlet


_ah_warmup
/_ah/warmup



The servlet class needn't do anything:

package com.example.warming_test;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
@SuppressWarnings("serial")
public class WarmingServlet extends HttpServlet {
private static Logger log = 
Logger.getLogger("com.example.warming_test");

@Override
public void log(String msg) {
log.finest(msg);
}

@Override
public void init() throws ServletException {
log("Warming init ");
}

@Override
public void service(ServletRequest arg0, ServletResponse arg1)
throws ServletException, IOException {
log("Warming service");
}


}

-- 
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] NoClassDefFoundError even though the jar is in WEB-INF/lib

2010-12-21 Thread Madhusuthanan Seetharam
Can someone chime in here? I'm pretty much blocked.

Had the GAE SDK dev server and the GAE behaved consistently I could have
avoided most of the issues. Now that if I'm making a change, I will have to
deploy it on  App Engine and see if it is working there without any issues
instead of depending on the dev server in the SDK.

Thanks,
  - Madhu

On Tue, Dec 21, 2010 at 11:12 PM, A. Stevko  wrote:

> According to previous threads, the repackaged jars are for internal use
> only.
> Folks have used them from time to time but find that they do not always
> behave as expected or are missing from the next release.
>
> Assuming that the jar is being uploaded, the expected behavior for a
> forbidden class is usually a Security Exception rather than a
> ClassDefNotFound exception.
>
> I wonder if anyone else on this list has successfully used JSTL Resource
> Bundles?
>
>
>
> On Tue, Dec 21, 2010 at 12:15 AM, Madhusuthanan Seetharam <
> mseet...@gmail.com> wrote:
>
>> Thanks for the info, Stevko. But I couldn't really find out if this class
>> org.apache.taglibs.standard.tag.common.fmt.BundleSupport is in the
>> white-list though. On the development box I could see this class in the 
>> lib/tools/jsp/repackaged-appengine-jakarta-standard-1.1.2.jar.
>> Does this mean that this class or library cannot be used?
>>
>> Thanks,
>>   - Madhu
>>
>> On Tue, Dec 21, 2010 at 2:01 AM, A. Stevko  wrote:
>>
>>> maybe something on this page that can help you -
>>> http://code.google.com/p/googleappengine/wiki/WillItPlayInJava
>>>
>>>
>>> On Mon, Dec 20, 2010 at 7:35 AM, Madhusuthanan Seetharam <
>>> mseet...@gmail.com> wrote:
>>>
 Any help on this is highly appreciated.

 Thanks,
   - Madhu


 On Sun, Dec 19, 2010 at 8:36 AM, Madhu  wrote:

> Hi,
>I'm facing a peculiar issue. One of my JSPs uses
> javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage to get
> localized message from resource bundles. I have copied the jakarta-
> taglibs-standard-1.1.2.jar and jakarta-taglibs-jstl-1.1.2.jar into WEB-
> INF/lib directory. On my local SDK the application works just fine.
> But when I deploy it on GAE it gives out the following error.
>
> java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/common/
> fmt/BundleSupport
>at
>
> javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(LocaleSupport.java:
> 143)
>at
>
> javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(LocaleSupport.java:
> 63)
>at
>
> org.apache.jsp.templates.default_.LoginContent_jsp._jspService(LoginContent_jsp.java:
> 547)
>
>This happens on both 1.3.8 and 1.4.0 SDKs. Any clues on what is
> happening?
>
> Thanks,
>  - Madhu
>
> --
> 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.
>>
>
>
>
> --
> -- A. Stevko
> ===
> "If everything seems under control, you're just not going fast enough." M.
> Andretti
>
>
>
>
>
>  --
> 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+unsu

[appengine-java] Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread John
I proposed some changes to the documentation: 
http://code.google.com/p/googleappengine/issues/detail?id=4288

-- 
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: Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread John
I've gotten some testing done and concluded that the  name is not 
relevant to configuring warmup. It appears that GAE looks to see if there's 
a  for the url-pattern /_ah/warmup and if it finds that 
will it issue a GET request for /_ah/warmup. We are free to name the servlet 
as we please. It also seems that if there is no such servlet-mapping, there 
is no warm-up for the app. I haven't found a way to observe a difference 
between the behavior when  is false and when it is 
true while there is no servlet-mapping for /_ah/warmup. It seems likely that 
 false  only disables the GET on /_ah/warmup; 
giving the same effect as not supplying the .

-- 
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: Persist child - Problem

2010-12-21 Thread andrew
can you show the parent class, with the field for for the Equipo
child?

It will no doubt have @Persistence annotations too...

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

2010-12-21 Thread John
I'd like to be sure that there is no loss from overriding _ah_warmup. The 
documentation is rather ambiguous on this point: "[... 
defaults to true ... causes the App Engine infrastructure to issue 
GET requests to /_ah/warmup, initializing 
servlets,
 
ServletContextListeners,
 
and custom 
servlets—which
 
allow you to initialize your application's code as it requires." I'll admit 
it seems reasonable to interpret the statement to mean that all the 
initialization will take place in addition to running the Servlet#servicemethod 
of a Servlet named _ah_warmup. It would be nice if it were clear that 
_ah_warmup's service method is the last thing in the initialization sequence 
before directing user requests to the instance.

I've tried a few tests and I'm not sure if I'm getting a warmup when going 
from one instance to 2 instances. At any rate, my filter is not seeing a 
Request for /_ah/warmup.

-- 
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: Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread Stephen Johnson
My bad, it should be:


 _ah_warmup
 com.your.servlet.Here




On Tue, Dec 21, 2010 at 1:21 PM, Stephen Johnson wrote:

> I should add that there is no need to invoke GAE's default warming. I'm
> sure it's basically a no-op and just gets the basic servlet classes loaded
> that your own servlet will do by being invoked.
>
>
> On Tue, Dec 21, 2010 at 1:10 PM, Stephen Johnson 
> wrote:
>
>> Just map a servlet to 
>> /_ah/warmupin
>>  your web.xml. This will override the default one provided by app engine.
>>
>>
>> On Tue, Dec 21, 2010 at 11:51 AM, John  wrote:
>>
>>> Trying ServletContext#getServletRegistration was disappointing, since
>>> ServletContext#getServletRegistrations and
>>> ServletContext#getServletRegistration are not implemented on
>>> com.google.apphosting.utils.jetty.AppEngineWebAppContext$AppEngineServletContext
>>> while ServletContext#getServlet returns null and
>>> ServletContext#getServlets returns an empty Enumeration (as documented).
>>>
>>> I'm now thinking I should install a filter that will do the
>>> initialization after calling FilterChain#doFilter. I'll see if I can a
>>> filter to run if mapped by the url-pattern '/_ah/warmup'.
>>>
>>>
>>> Please let me know if there's a more straightforward way to invoke GAE's
>>> default warming.
>>>
>>> Thanks!
>>> John
>>>
>>>
>>>  --
>>> 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: Persist child - Problem

2010-12-21 Thread A. Stevko
Perhaps Equipo is not properly linked to Fetcha?

something like:

@Persistent
private Equipo myEquipo;

public setEquipo( Equipo e ) { this.myEquipo = e; };


On Mon, Dec 20, 2010 at 1:36 PM, lisandrodc  wrote:

> Thanks andrew! My class Equipo has @persistence capable and
> and serializable... The code:
> import java.io.Serializable;
> import javax.jdo.annotations.IdGeneratorStrategy;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.Persistent;
> import javax.jdo.annotations.PrimaryKey;
>
>
> import com.google.appengine.api.datastore.Key;
>
> @PersistenceCapable(identityType =
> IdentityType.APPLICATION,detachable="true")
> public class Equipo implements Serializable {
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key id;
>@Persistent
>private String nombre;
>@Persistent
>private String imagen;
>
>
>
> I'm not understand because it not pesist in the datastore.
> Regards!
> Lisandro
>
> On 20 dic, 04:02, andrew  wrote:
> > Is the child annotated as @persistence capable?
> > Is it serializable?
> > It also depends on the type of keys used and key generator strategy.
> >
> > Show us the code defining each class and we'll let you know.
> >
> > Quizas asi te ayudamos a poner tu equipo en primera división! :-)
>
> --
> 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.
>
>


-- 
-- A. Stevko
===
"If everything seems under control, you're just not going fast enough." M.
Andretti

-- 
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: Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread Stephen Johnson
I should add that there is no need to invoke GAE's default warming. I'm sure
it's basically a no-op and just gets the basic servlet classes loaded that
your own servlet will do by being invoked.

On Tue, Dec 21, 2010 at 1:10 PM, Stephen Johnson wrote:

> Just map a servlet to 
> /_ah/warmupin
>  your web.xml. This will override the default one provided by app engine.
>
>
> On Tue, Dec 21, 2010 at 11:51 AM, John  wrote:
>
>> Trying ServletContext#getServletRegistration was disappointing, since
>> ServletContext#getServletRegistrations and
>> ServletContext#getServletRegistration are not implemented on
>> com.google.apphosting.utils.jetty.AppEngineWebAppContext$AppEngineServletContext
>> while ServletContext#getServlet returns null and
>> ServletContext#getServlets returns an empty Enumeration (as documented).
>>
>> I'm now thinking I should install a filter that will do the initialization
>> after calling FilterChain#doFilter. I'll see if I can a filter to run if
>> mapped by the url-pattern '/_ah/warmup'.
>>
>>
>> Please let me know if there's a more straightforward way to invoke GAE's
>> default warming.
>>
>> Thanks!
>> John
>>
>>
>>  --
>> 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: Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread Stephen Johnson
Just map a servlet to
/_ah/warmupin
your web.xml. This will override the default one provided by app
engine.

On Tue, Dec 21, 2010 at 11:51 AM, John  wrote:

> Trying ServletContext#getServletRegistration was disappointing, since
> ServletContext#getServletRegistrations and
> ServletContext#getServletRegistration are not implemented on
> com.google.apphosting.utils.jetty.AppEngineWebAppContext$AppEngineServletContext
> while ServletContext#getServlet returns null and
> ServletContext#getServlets returns an empty Enumeration (as documented).
>
> I'm now thinking I should install a filter that will do the initialization
> after calling FilterChain#doFilter. I'll see if I can a filter to run if
> mapped by the url-pattern '/_ah/warmup'.
>
>
> Please let me know if there's a more straightforward way to invoke GAE's
> default warming.
>
> Thanks!
> John
>
>
>  --
> 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] low-lewel put method outside of a transaction

2010-12-21 Thread ss.require
Please, help!
According to this: 
http://code.google.com/intl/uk-UA/appengine/articles/life_of_write.html.

Let's suppose that I call the low-level put method outside of a
transaction and an exception throws. If exception occures at the
commit phase entity won't be saved otherwise if exception occures at
the applyed phase entity will be saved.

Is there a way to find out entity is really saved or not in the
datastore after exception?

If I execute the same operation inside a transaction, for exampe:
Transaction tx = datastore.beginTransaction();
try {
  put entity code ...
  tx.commit();
} finally {
  if (tx.isActive()) {
tx.rollback();
}
Suppose exception occures in the apply phase, then  tx.rollback() will
be fired? Can it make sure that enitty really won't be saved in the
datastore?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] low-lewel put method outside of a transaction

2010-12-21 Thread ss.require
Please, help!
According to this: 
http://code.google.com/intl/uk-UA/appengine/articles/life_of_write.html.

Suppose I call low-level put method outside of a transaction and after
an exception throws. If exception occures at the commit phase entity
won't be saved otherwise if exception occures at the applyed phase
entity will be saved.

Is there a way to find out entity is really saved or not after
exception?

If I execute the same operation inside the transaction, for exampe:
Transaction tx = datastore.beginTransaction();
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] removing data in JDO collections - clear vs delete

2010-12-21 Thread A. Stevko
I've got to release a huge tree of JDO persistent data like
/**
 * books associated with this library
 * books are huge trees of similarly declared objects (100s MBs, 1000s
objects, 5 layers deep)
 */
@Persistent(mappedBy = "library")
@Element(dependent = "true")
private List books = new ArrayList();

Which is better for the DB to call?
books.clear()
or
books = null;

Will orphaning a dependent child collection actually remove it from storage?
I'm asking this because I'm getting nasty NPEs from within ArrayList.clear()
as I reported in issue 224
http://code.google.com/p/datanucleus-appengine/issues/detail?id=224


-- 
-- A. Stevko
===
"If everything seems under control, you're just not going fast enough." M.
Andretti

-- 
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: Cant retrieve a list of objects when using GAE and JPA.

2010-12-21 Thread Stevko
I may be dated on this with not keeping up on the latest gwt advances.
The problems is a JPA or JDO augmented class is not directly 
portable (serialize/deserialize)  from the GAE/J class to a GWT/js class 
like non-persistent classes are.

The classic DTO case (and not elegant) is to copy+paste your persistent 
classes into a shared model w/o the database twist and write the 
transporters.
Many folks today have decided to skip the JPA layer and use Objectify for 
GAE database access. Its led to less headaches for some bloggers.




-- 
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: Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread John
Trying ServletContext#getServletRegistration was disappointing, since 
ServletContext#getServletRegistrations and 
ServletContext#getServletRegistration are not implemented on 
com.google.apphosting.utils.jetty.AppEngineWebAppContext$AppEngineServletContext
 
while ServletContext#getServlet returns null and 
ServletContext#getServletsreturns an empty 
Enumeration (as documented).

I'm now thinking I should install a filter that will do the initialization 
after calling FilterChain#doFilter. I'll see if I can a filter to run if 
mapped by the url-pattern '/_ah/warmup'.


Please let me know if there's a more straightforward way to invoke GAE's 
default warming.

Thanks!
John

-- 
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] What does "Memcache put: Error setting single item" mean?

2010-12-21 Thread Ikai Lan (Google)
How large is the data? Could it be >1mb?

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Sat, Dec 18, 2010 at 4:00 AM, Shinohara  wrote:

> Hello,
>
> I'm having a trouble when I use memcached.
>
> When I use put method of memcached, I occasionally have a
> MemcacheServiceException.
> It says that "MemcacheServiceException memcache put: Error setting
> single item ([memcache key name])"
>
> It happens NOT always.
> I think it maybe happens when I put large data in memcached.
>
> Could you tell me "Memcache put: Error setting single item" means?
>
> Thenks for your answer
> Shinohara
>
> --
> 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: datanucleus-appengine

2010-12-21 Thread Cesar Ruiz
Can you please help me on my topic.

http://code.google.com/appengine/forum/java-forum.html?place=topic%2Fgoogle-appengine-java%2FCrftYtwWXgw%2Fdiscussion

On 16 December 2010 18:20, George Moschovitis
wrote:

> started a new app. For me, Objectify made Java persistence coding fun
>> again, and words like "persistence manager lifecycle" and "detached
>> instance" are blissfully draining out of my vocabulary :-)
>
>
> you may have a point here ;-)
>
> -g.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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.
>



-- 
Cesar Ruiz.

-- 
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] how to access all values a property has?

2010-12-21 Thread Ikai Lan (Google)
No, we can't know all possible values without traversing the entire index.
Your best bet is to keep a "running count" - when someone enters a new
color, save it. If you need to generate this data based on existing
properties, I would suggest appengine-mapreduce (
http://code.google.com/p/appengine-mapreduce).

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Tue, Dec 21, 2010 at 9:22 AM, jacek.ambroziak
wrote:

> Say, I have a set of Person Entities with List favoriteColor
> property.
> People can specify their own sets of colors for that property.
>
> Can I access the union of these color sets, ie. all the values they have
> entered
> for this property? The values should sit in the DataStore index, ordered,
> but can we access such data?
>
> --
> 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] Cant retrieve a list of objects when using GAE and JPA.

2010-12-21 Thread kidowell
Hey I just want to retrieve a list of subjects, and I receive this 
exception:

GRAVE: javax.servlet.ServletContext log: Exception while dispatching 
incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type 
'org.datanucleus.store.appengine.query.StreamingQueryResult' was not 
included in the set of types which can be serialized by this 
SerializationPolicy or its Class object could not be loaded.

Here's the implementation of the method I called in RCP, aswell as the 
entity class and the method call.

(server side)
--
  public List getSubjects() throws SubjectNotFoundException, 
NullParameterException, GeneralException {
List list;
try {
String sql = "SELECT p FROM Subject p";
list = entityManager.createQuery(sql).getResultList();
} catch (Exception e) {

throw new GeneralException("Exception in method getSubjectes: " 
+ e.getMessage());
}
if (list == null || list.isEmpty()) {

throw new SubjectNotFoundException("Subject not found in method 
getSubjectes");
}
return list;
}

(client side)
--
@Entity
@Table(name = "subject")
public class Subject implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String content;
private int visible;

...setters and getters..

}


and here's when I call the method ( in the onload() ).

  AsyncCallback> callback = new AsyncCallback>() 
{

public void onFailure(Throwable caught) {
throw new UnsupportedOperationException("Not 
supported yet.");
}

public void onSuccess(List result) {
   subjectToString.setText("se cargaron todos los 
temas");
}
};
crudEJB.getSubjects(callback);


Please I need some help. Ive read a workaround with DTO, but its not well 
explained, besides everybody complains is a bad habit to do it that way (the 
threads I found were talked 2 years ago, there must be something better 
nowadays)

Cheers.

Kido

-- 
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] NoClassDefFoundError even though the jar is in WEB-INF/lib

2010-12-21 Thread A. Stevko
According to previous threads, the repackaged jars are for internal use
only.
Folks have used them from time to time but find that they do not always
behave as expected or are missing from the next release.

Assuming that the jar is being uploaded, the expected behavior for a
forbidden class is usually a Security Exception rather than a
ClassDefNotFound exception.

I wonder if anyone else on this list has successfully used JSTL Resource
Bundles?



On Tue, Dec 21, 2010 at 12:15 AM, Madhusuthanan Seetharam <
mseet...@gmail.com> wrote:

> Thanks for the info, Stevko. But I couldn't really find out if this class 
> org.apache.taglibs.standard.tag.common.fmt.BundleSupport
> is in the white-list though. On the development box I could see this class
> in the lib/tools/jsp/repackaged-appengine-jakarta-standard-1.1.2.jar. Does
> this mean that this class or library cannot be used?
>
> Thanks,
>   - Madhu
>
> On Tue, Dec 21, 2010 at 2:01 AM, A. Stevko  wrote:
>
>> maybe something on this page that can help you -
>> http://code.google.com/p/googleappengine/wiki/WillItPlayInJava
>>
>>
>> On Mon, Dec 20, 2010 at 7:35 AM, Madhusuthanan Seetharam <
>> mseet...@gmail.com> wrote:
>>
>>> Any help on this is highly appreciated.
>>>
>>> Thanks,
>>>   - Madhu
>>>
>>>
>>> On Sun, Dec 19, 2010 at 8:36 AM, Madhu  wrote:
>>>
 Hi,
I'm facing a peculiar issue. One of my JSPs uses
 javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage to get
 localized message from resource bundles. I have copied the jakarta-
 taglibs-standard-1.1.2.jar and jakarta-taglibs-jstl-1.1.2.jar into WEB-
 INF/lib directory. On my local SDK the application works just fine.
 But when I deploy it on GAE it gives out the following error.

 java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/common/
 fmt/BundleSupport
at

 javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(LocaleSupport.java:
 143)
at

 javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(LocaleSupport.java:
 63)
at

 org.apache.jsp.templates.default_.LoginContent_jsp._jspService(LoginContent_jsp.java:
 547)

This happens on both 1.3.8 and 1.4.0 SDKs. Any clues on what is
 happening?

 Thanks,
  - Madhu

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



-- 
-- A. Stevko
===
"If everything seems under control, you're just not going fast enough." M.
Andretti

-- 
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: Restlet that works on localhost throws NullPointerException when deployed on GAE

2010-12-21 Thread creativepragmatic
I have tried replacing the serializable object with primitives and
strings just for test purposes but none can be passed to GAE.  All
become null.

-- 
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] how to access all values a property has?

2010-12-21 Thread jacek.ambroziak
Say, I have a set of Person Entities with List favoriteColor 
property.
People can specify their own sets of colors for that property.

Can I access the union of these color sets, ie. all the values they have 
entered
for this property? The values should sit in the DataStore index, ordered,
but can we access such data?

-- 
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] Any easy way to run demos on 1.4 release?

2010-12-21 Thread A. Stevko
Perhaps they are not GWT/GAE projects?
Right click on Project in Project Explorer,
select context menu item "Google Web Toolkit",
select "Convert project to GWT project..."


On Tue, Dec 21, 2010 at 8:04 AM, NeoK  wrote:

> I'm pretty newbie here who has a great interest learning GAE.
> I think the best way to learn new concepts and dev environment is to see
> the sample codes.
> I found several sample codes of demos under
>  
> \eclipse\plugins\com.google.appengine.eclipse.sdkbundle.1.4.0_1.4.0.v201012021502\appengine-java-sdk-1.4.0\demos
>
> guestbook
> helloorm
> helloxmpp
> ...
>
> But none of them is working in my Eclipse(3.6).
> I built them using their ant build.xml file.
>
> Eclipse File->New->Java Project from Ant Buildfile
>
> Or using the existing eclipse project file(Only 'sticky' demo has the
> project file).
>
> But all of them are throwing some annoying exceptions rather than expected
> results when I tried to access to http://localhost: on my browser.
> (something like entitymanager is null, uninitialized ,... )
> More than that some of them can't get compiled.
>
> Are those project maintained in this 1.4 GAE release? Or am I missing
> something like configuration file...??
>
> --
> 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.
>



-- 
-- A. Stevko
===
"If everything seems under control, you're just not going fast enough." M.
Andretti

-- 
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] Customizing warmup with a Servlet mapped to _ah_warmup

2010-12-21 Thread John
In my app there's some work that can be done to speed up requests by
pre-generating some cached mappings. I'd like to do this only if there
are no users waiting for the instance, so I plan to do it by
registering a Servlet with the name '_ah_warmup'. The question is,
what is the default and is there a recommended way to extend it?

I don't believe it's legal to use ServletContext to register a Servlet
under a name that has already been registered, so I don't suppose I
should try ServletContext#addServlet('_ah_warmup',
MyWarmerUpper.class),. Though that would be nice because I could use
ServletContext#getServletRegistration('_ah_warmup') to find whatever
the current instance is and include a call to its #service method
during my custom warming.

For now, I'll just use ServletContext#getServletRegistration to find
the class and assume that I can just initialize that and call its
#service method until things break. Unfortunately, it's not apparent
how to easily test warming on GAE...

-- 
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] Restlet that works on localhost throws NullPointerException when deployed on GAE

2010-12-21 Thread creativepragmatic
Hello,

The following simple method works well on my local machine but throws
a NullPointerException when I deploy it to App Engine.  Calling any
method on memberVO such as getId() throws NullPointerException.  I
cannot understand why this works on my local network but not on
appspot.com.  I also included the exception from the logs if anyone
has any idea.

Thank you in advance for any insight.

Orville



@Override
public Boolean updateMember(MemberVO memberVO) {

PersistenceManager pm = PMF.get().getPersistenceManager();

try {
Member member = pm.getObjectById(Member.class, 
memberVO.getId());

member.setFirstName(memberVO.getFirstName());
member.setLastName(memberVO.getLastName());

pm.makePersistent(member);
} catch (NullPointerException npe) {
npe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
pm.close();
}

return true;
}



12-20 05:23PM 48.523 /rest/member 500 3162ms 3858cpu_ms 8api_cpu_ms
0kb Restlet-Framework/2.0snapshot,gzip(gfe)
72.27.92.51 - - [20/Dec/2010:17:23:51 -0800] "POST /rest/member HTTP/
1.1" 500 549 - "Restlet-Framework/2.0snapshot,gzip(gfe)"
"myapp.appspot.com" ms=3162 cpu_ms=3858 api_cpu_ms=8 cpm_usd=0.307323
loading_request=1 pending_ms=977
I 12-20 05:23PM 50.343
javax.servlet.ServletContext log: adapter: [Restlet] Attaching
application: com.myapp.myapplicat...@1a3b359 to URI:
W 12-20 05:23PM 51.656
org.restlet.resource.UniformResource doCatch: Exception or error
caught in resource
java.lang.NullPointerException
at com.myapp.MemberResource.updateMember(MemberResource.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:43)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:
453)
at org.restlet.resource.ServerResource.post(ServerResource.java:1095)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:
506)
at
org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:
563)
at
org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:
299)
at org.restlet.resource.ServerResource.handle(ServerResource.java:
821)
at org.restlet.resource.Finder.handle(Finder.java:513)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:495)
at org.restlet.routing.Router.handle(Router.java:735)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:
154)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
at
org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:
72)
at org.restlet.Application.handle(Application.java:382)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:495)
at org.restlet.routing.Router.handle(Router.java:735)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:495)
at org.restlet.routing.Router.handle(Router.java:735)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
at org.restlet.Component.handle(Component.java:387)
at org.restlet.Server.handle(Server.java:488)
at org.restlet.engine.ServerHelper.handle(ServerHelper.java:71)
at
org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:
150)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:
1037)
at
org.restlet.ext.gwt.GwtShellServletWrapper.service(GwtShellServletWrapper.java:
189)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
51

[appengine-java] Any easy way to run demos on 1.4 release?

2010-12-21 Thread NeoK
I'm pretty newbie here who has a great interest learning GAE.
I think the best way to learn new concepts and dev environment is to see the 
sample codes.
I found several sample codes of demos under 
 
\eclipse\plugins\com.google.appengine.eclipse.sdkbundle.1.4.0_1.4.0.v201012021502\appengine-java-sdk-1.4.0\demos

guestbook
helloorm
helloxmpp
...

But none of them is working in my Eclipse(3.6). 
I built them using their ant build.xml file.

Eclipse File->New->Java Project from Ant Buildfile

Or using the existing eclipse project file(Only 'sticky' demo has the 
project file).

But all of them are throwing some annoying exceptions rather than expected 
results when I tried to access to http://localhost: on my browser. 
(something like entitymanager is null, uninitialized ,... )
More than that some of them can't get compiled.

Are those project maintained in this 1.4 GAE release? Or am I missing 
something like configuration file...??

-- 
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: Best way to approach templating?

2010-12-21 Thread Ronoaldo José de Lana Pereira
Hi Jared,

If you are looking for something like Django templates for Python,
take a look at this aproach, this may fit your needs. We are using
this technique at the company:

http://blog.ronoaldo.net/2010/12/templates-estilo-django-para-paginas.html

I wrote this in Portuguese, but take a look at the google translate
toolbar, the translation is very good.

Hope this helps.

On 20 dez, 19:20, jared camarata  wrote:
> Thank you Mike. Once I downloaded and tried out sitemesh, I found it to be
> exactly what I needed.
>
> Thanks,
> Jared
>
>
>
>
>
>
>
> On Mon, Dec 20, 2010 at 2:36 PM, Mike!  wrote:
> > hey Jared,
>
> > You're pretty much limited to <%...@import> statements when separating
> > out the JSP into fragments/files...as for templates, have you used
> > sitemesh before?  That's what I use to do all of my theming...if
> > you're using Spring or other frameworks, they sometimes have themes
> > built into them too
>
> > Mike!
> >http://www.thepixlounge.com
>
> > On Dec 19, 10:37 am, JaredC  wrote:
> > > I'm new to the Java App Engine and I've been searching for a way to have
> > a
> > > general template or theme for my site. I have a header, menu, and side
> > bar
> > > that will stay the same for all pages, so why not manage it through one
> > > single jsp file? My thought was to have a jsp:include for the actual
> > content
> > > of a page. Such as when a user goes to mysite.com/aboutus, the servlet
> > gives
> > > the template, and the template includes aboutus.jsp. I think I've found
> > you
> > > can't have dynamic includes though. I tried this:
>
> > > In the aboutus doGet() :
> > >             req.setAttribute("page", "aboutus");
> > >             req.getRequestDispatcher("/template.jsp").include(req, resp);
>
> > > in the template.jsp:
> > > .jsp"/>
>
> > > but always get errors.
>
> > > Any thoughts on the best practices for templates in GAE/java?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-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=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: Upload to blobstore without form

2010-12-21 Thread timwhunt
I believe this blog posting should help
http://jeremyblythe.blogspot.com/2010/10/manipulating-images-in-blobstore.html

On Dec 20, 7:25 am, Cyrille Vincey  wrote:
> Has any of you succeeded in coding a servlet that uploads a file to the
> blobstore WITHOUT passing through a post jsp form ?
> (apologies, this might have been discussed a zillion time already in this
> group)
>
> Would be VERY helpful to me.
> Thanks in advance,
> cyrille

-- 
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] Processing large xml-files with JAXB in app engine

2010-12-21 Thread Hariharan Anantharaman
Hi,
I have used xpath for xml processing in GAE and it worked well.
Once you know how to query ,it works well. I guess it uses sax parsers.

Thanks
Hari

On Dec 21, 2010 3:37 PM, "androidDeveloper" 
wrote:

Hi all,

I need to parse large xml files. My first try was using JAXB. It works
ok for smaller xml files, but when a large xml is parsed, I get an
DeadlineExceededException and the quota on app engine seems to raise
up very fast...
Furthermore the new JAXB2 jar (JAXB2_20101209.jar) is too large to
deploy on app engine.

My Qeustions:
1. Does anyone know how to tune up jaxb, if it is possible?
I already tried the following hint from

http://stackoverflow.com/questions/794354/jaxbcontext-initialization-speedup
using a system property: -
Dcom.sun.xml.bind.v2.runtime.JAXBContextImpl.fastBoot=true
but putting it in appengine-web.xml like this...

 

...does not change performance to avoid DealineExceededException?
Maybe the property is not configured right?

2. What alternatives are there on app engine for xml processing, which
are better in speed and as easy to use as JAXB?


Thanks for your help!
Greetings!

--
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] KeyFactory.keyToString() and KeyFactory.stringToKey() emulation for gwt

2010-12-21 Thread Gal Dolber
Is there any safe way of emulating those methods?
I looked into the implementation(sorry), and doesn't look very nice:

   public static String keyToString(Key key)

{

if(!key.isComplete())

{

throw new IllegalArgumentException("Key is incomplete.");

} else

{

com.google.storage.onestore.v3.OnestoreEntity.Reference
reference = KeyTranslator.convertToPb(key);

return Base64.encodeWebSafe(reference.toByteArray(), false);

}

}


public static Key stringToKey(String encoded)

{

int modulo = encoded.length() % 4;

if(modulo != 0)

encoded = (new StringBuilder()).append(encoded).append(""
.substring(modulo)).toString();

byte encodedBytes[] = encoded.getBytes();

byte decodedBytes[];

try

{

decodedBytes = Base64.decodeWebSafe(encodedBytes, 0,
encodedBytes.length);

}

catch(Base64DecoderException ex)

{

throw new IllegalArgumentException((new
StringBuilder()).append("Cannot
parse: ").append(encoded).toString(), ex);

}

com.google.storage.onestore.v3.OnestoreEntity.Reference reference =
new com.google.storage.onestore.v3.OnestoreEntity.Reference();

reference.parseFrom(decodedBytes);

return KeyTranslator.createFromPb(reference);

}

The other methods of KeyFactory are easy to emulate on gwt. It will be very
useful to have those two as well.

Thanks in advance.

+1 for an open-source jgae development code

-- 
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/

-- 
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] How to suddenly save changes to datastore using JDO

2010-12-21 Thread cghersi
Hi all,

I'm quite new with GoogleAppEngine and JDO.

I would like to suddenly save my changes to a persistent object before
closing the PersistenceManager object. In this way I hope to reduce
the possibility to get a ConcurrentModification Exception, or at least
it would be far simpler to manage it, given that I can retry a number
of times to change an attribute and re-save the object. Is it
possible?

I mean, now I have this scenario:
*
PersistenceManager pm = //get from factory
MyPersistedObject obj = queryToDB(pm, other_args);
obj.setXXX(...);
//other stuff that needs obj

//save to DB:
try {
pm.makePersistent(obj);
} finally {
pm.close();  //here I can get a ConcurrentModification exception, and
I cannot recall all the changes made in the method!!
}
*

I would like to pass to this scenario:
*
PersistenceManager pm = //get from factory
MyPersistedObject obj = null;
int i = 0;
while (i < MAX_RETRIES) {
  obj = pm.getObjectByID(objKey);
  obj.setXXX(...);
  try {
obj.SAVE(); //here I try save the object!!
break;
  } catch (Exception e) {
i++;
  }
}
//other stuff that needs obj

//close PM:
pm.close();  //here I would not have any ConcurrentModification
exception,given that all the objects have been already saved...
*

Is it possible to have such a SAVE() method that allows me to continue
to use the same PersistenceManager?

Far better should be the possibility to fetch the object with one
PersistenceManager and save it with another. In this way I may
retrieve my object from datastore with a factory method and create my
own SAVE() methods in my object classes. Is it applicable this pattern
to JDO and GoogleAppEngine or am I forced to use the same instance of
PersistenceManager both to fetch and save the data?

Thank you very much!
Bye
cghersi

-- 
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] Processing large xml-files with JAXB in app engine

2010-12-21 Thread androidDeveloper
Hi all,

I need to parse large xml files. My first try was using JAXB. It works
ok for smaller xml files, but when a large xml is parsed, I get an
DeadlineExceededException and the quota on app engine seems to raise
up very fast...
Furthermore the new JAXB2 jar (JAXB2_20101209.jar) is too large to
deploy on app engine.

My Qeustions:
1. Does anyone know how to tune up jaxb, if it is possible?
I already tried the following hint from
  
http://stackoverflow.com/questions/794354/jaxbcontext-initialization-speedup
using a system property: -
Dcom.sun.xml.bind.v2.runtime.JAXBContextImpl.fastBoot=true
but putting it in appengine-web.xml like this...

 

...does not change performance to avoid DealineExceededException?
Maybe the property is not configured right?

2. What alternatives are there on app engine for xml processing, which
are better in speed and as easy to use as JAXB?


Thanks for your help!
Greetings!

-- 
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] How to correctly update a persistent object

2010-12-21 Thread cghersi
Hi all,
I'm new to GoogleAppEngine and I'm not sure about the right procedure
to update an object.

Let's say that in a servlet I have to fetch an object with a query
(not with its key), update some of its attributes and then save to DB.
I accomplish this task with the following code (up to now it is the
only way I'm able to correctly run this example):
*
PersistenceManager pm = //get from factory
MyPersistedObject obj = queryToDB(pm, other_args);
obj.setXXX(...);
//other stuff that needs obj

//save to DB:
try {
pm.makePersistent(obj);
} finally {
pm.close();
}
*
Now the questions:
1) if the object retrieved in the query changes while the "//other
stuff" is computed, the pm.close() statement throws a
ConcurrentModification exception e my work is gone. Given that "//
other stuff" may take quite a long to complete, this scenario is not
negligible. How can I face this problem?
2) Is it possible to fetch the object with one PersistenceManager
instance and save it with another? This may allow me not to pass pm in
the arguments of queryToDB() method...
3) How can I make this piece of code thread-safe? I mean, I would like
to block the execution of another thread which makes use of the object
fetched with queryToDB(), so that I can never occur into a
ConcurrentModification exception: is it possible? Perhaps with a
clever use of MemCache?
4) I also tried to wrap pm.close() in a loop with a number of retries
until the change is correctly saved onto DB, but once the
ConcurrentModification exception is thrown, seems that the object now
is dirty and cannot be saved anymore...

Please, give me some hints about these topics!!

Thank you very much
Best
cghersi


-- 
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] NoClassDefFoundError even though the jar is in WEB-INF/lib

2010-12-21 Thread Madhusuthanan Seetharam
Thanks for the info, Stevko. But I couldn't really find out if this
class org.apache.taglibs.standard.tag.common.fmt.BundleSupport
is in the white-list though. On the development box I could see this class
in the lib/tools/jsp/repackaged-appengine-jakarta-standard-1.1.2.jar. Does
this mean that this class or library cannot be used?

Thanks,
  - Madhu

On Tue, Dec 21, 2010 at 2:01 AM, A. Stevko  wrote:

> maybe something on this page that can help you -
> http://code.google.com/p/googleappengine/wiki/WillItPlayInJava
>
>
> On Mon, Dec 20, 2010 at 7:35 AM, Madhusuthanan Seetharam <
> mseet...@gmail.com> wrote:
>
>> Any help on this is highly appreciated.
>>
>> Thanks,
>>   - Madhu
>>
>>
>> On Sun, Dec 19, 2010 at 8:36 AM, Madhu  wrote:
>>
>>> Hi,
>>>I'm facing a peculiar issue. One of my JSPs uses
>>> javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage to get
>>> localized message from resource bundles. I have copied the jakarta-
>>> taglibs-standard-1.1.2.jar and jakarta-taglibs-jstl-1.1.2.jar into WEB-
>>> INF/lib directory. On my local SDK the application works just fine.
>>> But when I deploy it on GAE it gives out the following error.
>>>
>>> java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/common/
>>> fmt/BundleSupport
>>>at
>>>
>>> javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(LocaleSupport.java:
>>> 143)
>>>at
>>>
>>> javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(LocaleSupport.java:
>>> 63)
>>>at
>>>
>>> org.apache.jsp.templates.default_.LoginContent_jsp._jspService(LoginContent_jsp.java:
>>> 547)
>>>
>>>This happens on both 1.3.8 and 1.4.0 SDKs. Any clues on what is
>>> happening?
>>>
>>> Thanks,
>>>  - Madhu
>>>
>>> --
>>> 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.



[appengine-java] Re: Entity relationship designing - best practice

2010-12-21 Thread Richard Berger
Har_Shan:

I have been thinking about this topic also (but sadly, am not much of
an expert).  I am using Objectify as a layer on top of the Datastore.
Their website has a lot of good information on structuring data in the
Datastore - see http://code.google.com/p/objectify-appengine/wiki/Concepts?tm=6
).

There is also a good post on the various ways of handling 1 to many
relationships using Objectify.  What appeared to be something that
would work in your situation (which is like my situation) is what I
think of as the "database approach".  What I mean by that is, if you
had a 1 to many relationship, how would you model that in a database?
Specifically if 1 User can have Many Exams, you would have...

User table
* userId
* Other user fields

Exam table
* examId
* userId
* Other exam fields

So, turning this into GWT/Objectify, it would be

public class User  {
  @Id private Long id;
  // Other user fields
}

public class Exam{
  @Id private Long id;
  private Key userKey;
  // Other exam fields
}

The way to find all the exams for a particular user (represented by
"this") is:
  Objectify ofy = ObjectifyService.begin();
  Key userKey = new Key(User.class, this.id);
  List result = ofy.query(Exam.class).filter("userKey",
userKey).list();

This is explained (much better than I could do) at:
http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Relationships

This may not solve all (or any) of your use cases, but it has worked
for me in my admittedly very limited usage.
Also check out:
http://groups.google.com/group/objectify-appengine/browse_frm/thread/102ede7022c7d7cf/30e6070900d5d523?lnk=gst&q=relationships#30e6070900d5d523

Enjoy,
RB




On Dec 19, 12:17 am, Matej  wrote:
> I am not expert in dataStore this is just what I would do:
> Add new entity with fields:
> ID OrderID UserID ExamID PageID QuestionID AnswerID
>
> Yes it is a lot of redundant data, but simple.
> When user starts new Exam, all data are created with AnswerID set to
> general answer unAnswer. After that you just update AnswerID.
>
> What are obstacle in design like this?
>
> Best, M

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