[appengine-java] The requested URL was not found on this server error message

2011-06-30 Thread Pion
My folder structure on Eclipse project is as the following:

war
  /b/abc
  /css
  /js
  /image
  index.html

It works fine on my development machine

But after uploading to Google App Engine, I received the following error 
message: The requested URL /b/abc was not found on this
server .

I am using GAE Java SDK 1.5.1 and Google Plugin for Eclipse 3.6.

Thanks in advance for your help.

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



Re: [appengine-java] The requested URL was not found on this server error message

2011-06-30 Thread Pion
war/b/abc has static html file. I cannot access war/b/abc/foo.html using 
http://example.appspot.com/b/abc/foo.html

But I can access another folder war/xyz/pqr.html using 
http://example.appspot.com/xyz/pqr.html

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



[appengine-java] Re: Integration with Ning App (authentication)

2010-01-14 Thread Pion
I have just found the following:

http://wiki.opensocial.org/index.php?title=Introduction_To_Signed_Requests
http://wiki.opensocial.org/index.php?title=Validating_Signed_Requests
https://opensocialresources.appspot.com/certificates/

I'll try it if it works with Ning.

On Jan 13, 3:45 pm, Pion onlee2...@gmail.com wrote:
 I am wondering if anyone has experience integrating Ning App (http://
 developer.ning.com/) with GAE for Java. Note that Ning only supports a
 subset of OpenSocial API. Specifically, I need help on the following:

 1. Let a user login to Ning network.
 2. Once Ning has authenticated the user, I'd like to let the user to
 access my app on GAE without having to login twice.
 3. The user could store additional data on GAE.

 I don't know how to do the step #2 above.

 I am open with other scenario as long as I can achieve #1 and #3
 (using Ning's username  authentication) to access the data on the
 GAE.

 Thanks in advance for your help.
-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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] Integration with Ning App (authentication)

2010-01-13 Thread Pion
I am wondering if anyone has experience integrating Ning App (http://
developer.ning.com/) with GAE for Java. Note that Ning only supports a
subset of OpenSocial API. Specifically, I need help on the following:

1. Let a user login to Ning network.
2. Once Ning has authenticated the user, I'd like to let the user to
access my app on GAE without having to login twice.
3. The user could store additional data on GAE.

I don't know how to do the step #2 above.

I am open with other scenario as long as I can achieve #1 and #3
(using Ning's username  authentication) to access the data on the
GAE.

Thanks in advance for your help.
-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: https on my domain

2010-01-05 Thread Pion
I have just found good discussion on HTTPS Support for appspot.com
on 
http://groups.google.com/group/google-appengine/browse_thread/thread/1aa08effbb5839ab/6c6552cf7bdaedaa?lnk=gstq=https#

On Jan 4, 9:43 am, Pion onlee2...@gmail.com wrote:
 I just found this SSL/HTTPSSupporton Google Apps domains (issue
 792) 
 onhttp://code.google.com/p/googleappengine/issues/detail?id=792q=https

 There are 50+ comments on this issue.

 On Jan 3, 10:26 am, Pion onlee2...@gmail.com wrote:

 http://www.slideshare.net/bess.ho/google-health-architecture-api
  (slide 28) shows that Google Health is using Google App Engine.

  I just registered to Google Health. After logging in, the url of the
  Google Health ishttps://health.google.com/health/p/--notice the
 httpsand no *.appspot.com

  How is it done?

  Thanks in advance for your help.

  On Jan 3, 10:01 am, Pion onlee2...@gmail.com wrote:

  http://code.google.com/appengine/kb/general.html#httpsappssays, Can
   I use SSL (HTTPS) on App Engine with my Google Apps domain?

   All secure traffic with Google App Engine must be served from your
   appspot.com domain (https://your-app-id.appspot.com). If you are
   serving your app off of a Google Apps domain, you must direct all
   secure traffic through your app's appspot domain.

   On Thursday, October 16, 
   2008,http://googleappengine.blogspot.com/2008/10/announcing-https-support-...
   says, You may be wondering why we're only supporting appspot.com
   right now, and not arbitrary Google Apps domains. This has to do with
   fundamental limitations in the SSL protocol. We're currently
   investigating workarounds for this using e.g. SNI, which provides a
   viable solution for newer browsers--we'll keep you posted! 

   I don't see it the product 
   roadmaphttp://code.google.com/appengine/docs/roadmap.html.

   What's the latest status/plan on this?

--

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

2010-01-05 Thread Pion
I found the following HIPAA related discussions:


HIPAA requirements vs. AppEngine security guidelines
http://groups.google.com/group/google-appengine/browse_thread/thread/78b40375b8b5af41/4cb5de1b17aae039?lnk=gstq=HIPAA#

IPAA and client data stored w/ Google's App Engine framework
http://groups.google.com/group/google-appengine/browse_thread/thread/9599673ca86d7f7c/d60097ab14c11966?lnk=gstq=HIPAA#

On Jan 3, 8:22 pm, Doug doug...@gmail.com wrote:
 From reading the Google Health FAQ I think the answer to your question
 is no, but they don't need to be.

 Is Google Health covered byHIPAA?

 Unlike a doctor or health plan, Google Health is not regulated by the
 Health Insurance Portability and Accountability Act (HIPAA), a federal
 law that establishes data confidentiality standards for patient health
 information. This is because Google does not store data on behalf of
 health care providers. Instead, our primary relationship is with you,
 the user. UnderHIPAA, you have a right to obtain a copy of your
 medical records. If you choose to use Google Health, we'll help you
 store and manage your medical records online.

 Although Google Health is not covered byHIPAA, we are committed to
 protecting your privacy. Our Google Health privacy policy governs what
 information Google Health collects and how we use it, and any
 violation of that policy can be enforced by the Federal Trade
 Commission, which takes action against companies that engage in unfair
 and deceptive trade practices -- including violations of their privacy
 policies.

 On Jan 3, 11:17 am, Pion onlee2...@gmail.com wrote:

 http://www.slideshare.net/bess.ho/google-health-architecture-api
  (slide 28) shows that Google Health is using Google App Engine.

  Is Google App EngineHIPAA(Health Insurance Portability and
  Accountability Act -http://en.wikipedia.org/wiki/HIPAA) compliance ?

--

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: https on my domain

2010-01-04 Thread Pion
I just found this SSL/HTTPS Support on Google Apps domains (issue
792) on
http://code.google.com/p/googleappengine/issues/detail?id=792q=httpscolspec=ID%20Type%20Status%20Priority%20Stars%20Owner%20Summary%20Log%20Component.

There are 50+ comments on this issue.

On Jan 3, 10:26 am, Pion onlee2...@gmail.com wrote:
 http://www.slideshare.net/bess.ho/google-health-architecture-api
 (slide 28) shows that Google Health is using Google App Engine.

 I just registered to Google Health. After logging in, the url of the
 Google Health ishttps://health.google.com/health/p/-- notice the
 https and no *.appspot.com

 How is it done?

 Thanks in advance for your help.

 On Jan 3, 10:01 am, Pion onlee2...@gmail.com wrote:

 http://code.google.com/appengine/kb/general.html#httpsappssays, Can
  I use SSL (HTTPS) on App Engine with my Google Apps domain?

  All secure traffic with Google App Engine must be served from your
  appspot.com domain (https://your-app-id.appspot.com). If you are
  serving your app off of a Google Apps domain, you must direct all
  secure traffic through your app's appspot domain.

  On Thursday, October 16, 
  2008,http://googleappengine.blogspot.com/2008/10/announcing-https-support-...
  says, You may be wondering why we're only supporting appspot.com
  right now, and not arbitrary Google Apps domains. This has to do with
  fundamental limitations in the SSL protocol. We're currently
  investigating workarounds for this using e.g. SNI, which provides a
  viable solution for newer browsers--we'll keep you posted! 

  I don't see it the product 
  roadmaphttp://code.google.com/appengine/docs/roadmap.html.

  What's the latest status/plan on this?

--

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

2010-01-03 Thread Pion
http://www.slideshare.net/bess.ho/google-health-architecture-api
(slide 28) shows that Google Health is using Google App Engine.

Is Google App Engine HIPAA (Health Insurance Portability and
Accountability Act - http://en.wikipedia.org/wiki/HIPAA) compliance ?

--

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] https on my domain

2010-01-03 Thread Pion
http://code.google.com/appengine/kb/general.html#httpsapps says, Can
I use SSL (HTTPS) on App Engine with my Google Apps domain?

All secure traffic with Google App Engine must be served from your
appspot.com domain (https://your-app-id.appspot.com). If you are
serving your app off of a Google Apps domain, you must direct all
secure traffic through your app's appspot domain.

On Thursday, October 16, 2008,
http://googleappengine.blogspot.com/2008/10/announcing-https-support-for-appspotcom.html
says, You may be wondering why we're only supporting appspot.com
right now, and not arbitrary Google Apps domains. This has to do with
fundamental limitations in the SSL protocol. We're currently
investigating workarounds for this using e.g. SNI, which provides a
viable solution for newer browsers--we'll keep you posted! 

I don't see it the product roadmap 
http://code.google.com/appengine/docs/roadmap.html.

What's the latest status/plan on this?

--

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

2010-01-03 Thread Pion
http://www.slideshare.net/bess.ho/google-health-architecture-api
(slide 28) shows that Google Health is using Google App Engine.

I just registered to Google Health. After logging in, the url of the
Google Health is https://health.google.com/health/p/ -- notice the
https and no *.appspot.com

How is it done?

Thanks in advance for your help.

On Jan 3, 10:01 am, Pion onlee2...@gmail.com wrote:
 http://code.google.com/appengine/kb/general.html#httpsappssays, Can
 I use SSL (HTTPS) on App Engine with my Google Apps domain?

 All secure traffic with Google App Engine must be served from your
 appspot.com domain (https://your-app-id.appspot.com). If you are
 serving your app off of a Google Apps domain, you must direct all
 secure traffic through your app's appspot domain.

 On Thursday, October 16, 
 2008,http://googleappengine.blogspot.com/2008/10/announcing-https-support-...
 says, You may be wondering why we're only supporting appspot.com
 right now, and not arbitrary Google Apps domains. This has to do with
 fundamental limitations in the SSL protocol. We're currently
 investigating workarounds for this using e.g. SNI, which provides a
 viable solution for newer browsers--we'll keep you posted! 

 I don't see it the product 
 roadmaphttp://code.google.com/appengine/docs/roadmap.html.

 What's the latest status/plan on this?

--

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

2009-12-20 Thread Pion
I am following the http://code.google.com/appengine/docs/java/mail/overview.html
instructions.

My code (snippets):

import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Properties;
import java.util.logging.Logger;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public void execute(HttpServletRequest request, HttpServletResponse
response, PrintWriter out) {
String userName = System.getProperty
(com.galensystems.calendarEmail);
String body = This is a test;

Properties props = System.getProperties();

// Get a Session object
Session session = Session.getInstance(props, null);

Message message = new MimeMessage(session);
try {
message.setFrom(new InternetAddress(userName, Admin
Email));
message.addRecipient(Message.RecipientType.TO,
new 
InternetAddress(some-receipe...@gmail.com, Mr. John
Smith));
message.setSubject(Your Example.com account has been
activated);
message.setText(body);
Transport.send(message);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}

}

After deploying and running it on GAE, I got the following log info/
warning exceptions below. I did not add Sun's JavaMail JARs to my app.
It did send the email successfully.  It showed up on my inbox as
expected.

My environments: GAE 1.3.0, Eclipse-Galileo.

Do I need to worry about the exceptions below?
Thanks in advance for your help.

12-20 07:05AM 49.119
com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
init: Failed to start reference finalizer thread. Reference cleanup
will only occur when new references are created.
java.lang.reflect.InvocationTargetException
at com.google.appengine.runtime.Request.process-8ef88bb7edeb9b03
(Request.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:42)
at
com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue.init
(FinalizableReferenceQueue.java:124)
at
com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools
$WeakInterningPool.clinit(InterningPools.java:104)
at
com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools.newWeakInterningPool
(InterningPools.java:48)
at
com.google.appengine.repackaged.com.google.io.protocol.ProtocolSupport.clinit
(ProtocolSupport.java:55)
at com.google.appengine.api.mail.MailServicePb$MailMessage.init
(MailServicePb.java:643)
at com.google.appengine.api.mail.MailServicePb$MailMessage$1.init
(MailServicePb.java:1600)
at com.google.appengine.api.mail.MailServicePb$MailMessage.clinit
(MailServicePb.java:1600)
at com.google.appengine.api.mail.MailServiceImpl.doSend
(MailServiceImpl.java:49)
at com.google.appengine.api.mail.MailServiceImpl.send
(MailServiceImpl.java:32)
at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage
(GMTransport.java:247)
at javax.mail.Transport.send(Transport.java:95)
at javax.mail.Transport.send(Transport.java:48)
at com.galensystems.pchr.server.DoEmail.execute(DoEmail.java:57)
at com.galensystems.pchr.server.DoServer.main(DoServer.java:72)
at com.galensystems.pchr.server.DoServer.doPost(DoServer.java:43)
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.utils.servlet.ParseBlobUploadFilter.doFilter
(ParseBlobUploadFilter.java:97)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
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 

[appengine-java] Accessing GMail Inbox

2009-12-20 Thread Pion
The http://java.sun.com/products/javamail/FAQ.html#gmail shows how to
access Gmail Inbox using JavaMail.
//String host = imap.gmail.com;
String host = pop.gmail.com;
String username = user;
String password = passwd;
// ...
//Store store = session.getStore(imaps);
Store store = session.getStore(pop3s);
store.connect(host, username, password);
// ...

I tried the above code and deployed it on GAE. I received the
following log:

Unable to locate provider for protocol: pop3s

I switched to 'Store store = session.getStore(imaps);', It gave me
similar error.

Unable to locate provider for protocol: imaps

I am using GAE 1.3.0.

Please advise if this is even possible. If yes, what did I do wrong?
Thanks in advance for your help.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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] Google Calendar log on GAE: Redirect requested but followRedirects is disabled

2009-12-18 Thread Pion
I have the following code snippets (remove exceptions code for
brevity) which is based on the example on
http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html#RetrievingAllCalendars

String appName = companyName-appName-1.0;
CalendarService myService = new CalendarService
(appName);

String id = myEmail;
String password = myPassword;
String host = http://www.google.com/calendar/feeds/;
+ id + @gmail.com/owncalendars/full;
myService.setUserCredentials(id, password);
URL feedUrl = new URL(host);
CalendarFeed resultFeed = myService.getFeed(feedUrl,
CalendarFeed.class);

for (int i = 0; i  resultFeed.getEntries().size(); i++) {
entry = resultFeed.getEntries().get(i);
logger.info(entry.getTitle().getPlainText())
}

I receive the following log info:

Dec 18, 2009 3:25:34 PM
org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled

Dec 18, 2009 3:25:35 PM org.apache.commons.httpclient.HttpMethodBase
getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using
getResponseBodyAsStream instead is recommended.

Dec 18, 2009 3:25:35 PM com.galensystems.pchr.server.DoServer
doCalendar
INFO: myem...@gmail.com

I am wondering if I am doign something wrong and have to worry the
above INFO and WARNING.

--

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: Google Calendar log on GAE: Redirect requested but followRedirects is disabled

2009-12-18 Thread Pion
I have just compiled and executed the Google Calendar sample from
http://code.google.com/p/gdata-java-client/downloads/list (version
1.40.1) locally without using any GAE stuffs. EventFeedDemo.java

  private static void printUserCalendars(CalendarService service)
  throws IOException, ServiceException {
// Send the request and receive the response:
CalendarFeed resultFeed = service.getFeed(metafeedUrl,
CalendarFeed.class);

System.out.println(Your calendars:);
System.out.println();
for (int i = 0; i  resultFeed.getEntries().size(); i++) {
  CalendarEntry entry = resultFeed.getEntries().get(i);
  System.out.println(\t + entry.getTitle().getPlainText());
}
System.out.println();
  }

It prints 2 calendars. On the other hand, using similar code but
running on GAE, it returns only 1 calendar.

I am using GAE 1.3.

On Dec 18, 7:46 am, Pion onlee2...@gmail.com wrote:
 I have the following code snippets (remove exceptions code for
 brevity) which is based on the example 
 onhttp://code.google.com/apis/calendar/data/2.0/developers_guide_java.h...

                 String appName = companyName-appName-1.0;
                 CalendarService myService = new CalendarService
 (appName);

                 String id = myEmail;
                 String password = myPassword;
                 String host = http://www.google.com/calendar/feeds/;
 + id + @gmail.com/owncalendars/full;
                 myService.setUserCredentials(id, password);
                 URL feedUrl = new URL(host);
                 CalendarFeed resultFeed = myService.getFeed(feedUrl,
 CalendarFeed.class);

                 for (int i = 0; i  resultFeed.getEntries().size(); i++) {
                     entry = resultFeed.getEntries().get(i);
                     logger.info(entry.getTitle().getPlainText())
                 }

 I receive the following log info:

 Dec 18, 2009 3:25:34 PM
 org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
 INFO: Redirect requested but followRedirects is disabled

 Dec 18, 2009 3:25:35 PM org.apache.commons.httpclient.HttpMethodBase
 getResponseBody
 WARNING: Going to buffer response body of large or unknown size. Using
 getResponseBodyAsStream instead is recommended.

 Dec 18, 2009 3:25:35 PM com.galensystems.pchr.server.DoServer
 doCalendar
 INFO: myem...@gmail.com

 I am wondering if I am doign something wrong and have to worry the
 above INFO and WARNING.

--

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: Google Calendar log on GAE: Redirect requested but followRedirects is disabled

2009-12-18 Thread Pion
By using the appropriate URLs as shown on the example,
// The base URL for a user's calendar metafeed (needs a username
appended).
private static final String METAFEED_URL_BASE = http://
www.google.com/calendar/feeds/;

// The string to add to the user's metafeedUrl to access the event
feed for their primary calendar.
private static final String EVENT_FEED_URL_SUFFIX = /private/full;

I could retrieve the calendars. But the log info messages below still
show:
Dec 18, 2009 3:25:34 PM
org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled

Dec 18, 2009 3:25:35 PM
org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size.
Using getResponseBodyAsStream instead is recommended.

On Dec 18, 9:44 am, Pion onlee2...@gmail.com wrote:
 I have just compiled and executed the Google Calendar sample 
 fromhttp://code.google.com/p/gdata-java-client/downloads/list(version
 1.40.1) locally without using any GAE stuffs. EventFeedDemo.java

   private static void printUserCalendars(CalendarService service)
       throws IOException, ServiceException {
     // Send the request and receive the response:
     CalendarFeed resultFeed = service.getFeed(metafeedUrl,
 CalendarFeed.class);

     System.out.println(Your calendars:);
     System.out.println();
     for (int i = 0; i  resultFeed.getEntries().size(); i++) {
       CalendarEntry entry = resultFeed.getEntries().get(i);
       System.out.println(\t + entry.getTitle().getPlainText());
     }
     System.out.println();
   }

 It prints 2 calendars. On the other hand, using similar code but
 running on GAE, it returns only 1 calendar.

 I am using GAE 1.3.

 On Dec 18, 7:46 am, Pion onlee2...@gmail.com wrote:

  I have the following code snippets (remove exceptions code for
  brevity) which is based on the example 
  onhttp://code.google.com/apis/calendar/data/2.0/developers_guide_java.h...

                  String appName = companyName-appName-1.0;
                  CalendarService myService = new CalendarService
  (appName);

                  String id = myEmail;
                  String password = myPassword;
                  String host = http://www.google.com/calendar/feeds/;
  + id + @gmail.com/owncalendars/full;
                  myService.setUserCredentials(id, password);
                  URL feedUrl = new URL(host);
                  CalendarFeed resultFeed = myService.getFeed(feedUrl,
  CalendarFeed.class);

                  for (int i = 0; i  resultFeed.getEntries().size(); i++) {
                      entry = resultFeed.getEntries().get(i);
                      logger.info(entry.getTitle().getPlainText())
                  }

  I receive the following log info:

  Dec 18, 2009 3:25:34 PM
  org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
  INFO: Redirect requested but followRedirects is disabled

  Dec 18, 2009 3:25:35 PM org.apache.commons.httpclient.HttpMethodBase
  getResponseBody
  WARNING: Going to buffer response body of large or unknown size. Using
  getResponseBodyAsStream instead is recommended.

  Dec 18, 2009 3:25:35 PM com.galensystems.pchr.server.DoServer
  doCalendar
  INFO: myem...@gmail.com

  I am wondering if I am doign something wrong and have to worry the
  above INFO and WARNING.

--

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: Data Store Indexes

2009-11-03 Thread Pion

Also, I updated my datastore-indexes.xml as the following:

?xml version=1.0 encoding=utf-8?
datastore-indexes
  xmlns=http://appengine.google.com/ns/datastore-indexes/1.0;
  autoGenerate=true

 datastore-index kind=MDsIri ancestor=false
 property name=iri direction=asc /
 property name=name direction=asc /
 property name=image direction=asc /
 property name=iriLowerCase direction=asc /
 property name=nameLowerCase direction=asc /
 /datastore-index

/datastore-indexes

I changed the kind from com.col.server.MDsIri to MDsIri. It still
produced No results.

I cannot test it on Development Server -- please let me know if there
is a way to test it locally.. I uploaded it and only tested it on the
(deployed) App Engine.

My app id is http://foafan2000.appspot.com/

On Nov 2, 7:49 pm, Pion onlee2...@gmail.com wrote:
 Thanks Jason.

 I tried the following:

      SELECT __key__ FROM MDsIri

 Also,

      SELECT * FROM MDsIri

 No more error. But it returns No results.

 The Data Viewer shows that I have many entities.

 http://code.google.com/appengine/docs/python/datastore/gqlreference.html
 shows the following syntax:
     SELECT [* | __key__] FROM kind
        [WHERE condition [AND condition ...]]
        [ORDER BY property [ASC | DESC] [, property [ASC |
 DESC] ...]]
        [LIMIT [offset,]count]
        [OFFSET offset]

 Why didn't I get any result?

 On Nov 2, 4:15 pm, Jason (Google) apija...@google.com wrote:

  Yes, that is the correct doc for the Java indexes.

  Regarding your GQL query, the name of the kind is not the full name of the
  class (including the package) but the simple name. So try using MDsIri
  instead of com.col.server. MDsIri. You should be able to see any entities
  you saved in the data viewer and the valid kind names are provided in the
  drop down.

  - Jason

  On Fri, Oct 30, 2009 at 12:05 PM, Pion onlee2...@gmail.com wrote:

   I found this
  http://code.google.com/appengine/docs/java/datastore/queriesandindexe...
   with the following example:
   ?xml version=1.0 encoding=utf-8?
   datastore-indexes
     xmlns=http://appengine.google.com/ns/datastore-indexes/1.0;
    autoGenerate=true
      datastore-index kind=Person ancestor=false
          property name=lastName direction=asc /
          property name=height direction=desc /
      /datastore-index
   /datastore-indexes

   But I still cannot solve my query error.

   On Oct 30, 9:34 am, Pion onlee2...@gmail.com wrote:
I just deployedmy app to the GAE for the first time.

I went to the Admin Console - DataStore - Indexes which says, You
have not created indexes for this application. Some types of queries
require an index to be built. You can manage your indexes in an
index.yaml file. Learn more abouthttp://
   code.google.com/appengine/kb/general.html#indexes
.

   http://code.google.com/appengine/kb/general.html#indexeslinkstohttp://
   code.google.com/appengine/docs/python/datastore/queriesandinde
It seems to be Python specific.

What's the corresponding one on Java? It seems to be on war\WEB-INF
\appengine-generated\datastore-indexes.xml. Please correct me if I am
wrong. My datastore-indexes.xml is empty.

?xml version=1.0 encoding=utf-8?
datastore-indexes  autoGenerate=true

/datastore-indexes

Also, I didi the following:

o Go to the Admin Console - DataStore - Data Viewer. It displays my
low-level datastore contents.
o Click the Query (using GQL). It displays SELECT * FROM
com.col.server.MDsIri automatically by default.
o Click Run Query button
o It says, Invalid GQL query string.

I suspect because I do not have any indexes yet.

What are the syntax to populate datastore-indexes.xml so I can do the
above query.

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



[appengine-java] Re: Data Store Indexes

2009-11-02 Thread Pion

Thanks Jason.

I tried the following:

 SELECT __key__ FROM MDsIri

Also,

 SELECT * FROM MDsIri

No more error. But it returns No results.

The Data Viewer shows that I have many entities.

http://code.google.com/appengine/docs/python/datastore/gqlreference.html
shows the following syntax:
SELECT [* | __key__] FROM kind
   [WHERE condition [AND condition ...]]
   [ORDER BY property [ASC | DESC] [, property [ASC |
DESC] ...]]
   [LIMIT [offset,]count]
   [OFFSET offset]


Why didn't I get any result?

On Nov 2, 4:15 pm, Jason (Google) apija...@google.com wrote:
 Yes, that is the correct doc for the Java indexes.

 Regarding your GQL query, the name of the kind is not the full name of the
 class (including the package) but the simple name. So try using MDsIri
 instead of com.col.server. MDsIri. You should be able to see any entities
 you saved in the data viewer and the valid kind names are provided in the
 drop down.

 - Jason

 On Fri, Oct 30, 2009 at 12:05 PM, Pion onlee2...@gmail.com wrote:

  I found this
 http://code.google.com/appengine/docs/java/datastore/queriesandindexe...
  with the following example:
  ?xml version=1.0 encoding=utf-8?
  datastore-indexes
    xmlns=http://appengine.google.com/ns/datastore-indexes/1.0;
   autoGenerate=true
     datastore-index kind=Person ancestor=false
         property name=lastName direction=asc /
         property name=height direction=desc /
     /datastore-index
  /datastore-indexes

  But I still cannot solve my query error.

  On Oct 30, 9:34 am, Pion onlee2...@gmail.com wrote:
   I just deployedmy app to the GAE for the first time.

   I went to the Admin Console - DataStore - Indexes which says, You
   have not created indexes for this application. Some types of queries
   require an index to be built. You can manage your indexes in an
   index.yaml file. Learn more abouthttp://
  code.google.com/appengine/kb/general.html#indexes
   .

  http://code.google.com/appengine/kb/general.html#indexeslinkstohttp://
  code.google.com/appengine/docs/python/datastore/queriesandinde
   It seems to be Python specific.

   What's the corresponding one on Java? It seems to be on war\WEB-INF
   \appengine-generated\datastore-indexes.xml. Please correct me if I am
   wrong. My datastore-indexes.xml is empty.

   ?xml version=1.0 encoding=utf-8?
   datastore-indexes  autoGenerate=true

   /datastore-indexes

   Also, I didi the following:

   o Go to the Admin Console - DataStore - Data Viewer. It displays my
   low-level datastore contents.
   o Click the Query (using GQL). It displays SELECT * FROM
   com.col.server.MDsIri automatically by default.
   o Click Run Query button
   o It says, Invalid GQL query string.

   I suspect because I do not have any indexes yet.

   What are the syntax to populate datastore-indexes.xml so I can do the
   above query.

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



[appengine-java] AccessControlException on DatastoreService.put() method

2009-10-31 Thread Pion

I got the AccessControlException on the following code snippet:

public void add(ListString iriList, ListString nameList,
ListString imageList) {
// deleted for brevity

 try {
 datastore.put(eList);   // The log 
below shows this line as at
com.col.server.MDsIri.add(MDsIri.java:74)
 } catch (IllegalArgumentException exIA) {
 
logger.severe(IllegalArgumentException when trying to
datastore.put. Exception message:  + exIA.getMessage());
 } catch (ConcurrentModificationException  
exCM) {
 
logger.severe(ConcurrentModificationException when trying to
datastore.put. Exception message:  + exCM.getMessage());
 } catch (Exception ex) {
 logger.severe(Exception when trying 
to datastore.put. Exception
message:  + ex.getMessage()); // the log (last line) below says that
the message is unknown
 }
}
// deleted for brevity
}

I follow the guideline that the eList has only 500 entities at most as
mentioned on 
http://code.google.com/appengine/docs/java/datastore/overview.html#Quotas_and_Limits.
Also, I don't call any thread or system threads as mentioned on
http://code.google.com/appengine/docs/java/runtime.html#The_Sandbox.

I did not get the error below on my Development Server.

I don't know how to interpret the error because the exception/error
message is Unknown(last line of the log).

I appreciate any help.

Log from the Google Apple Engine Admin Console - Main - Logs
10-31 09:06AM 07.119
com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
$SystemLoader loadFinalizer: Not allowed to access system class
loader.
I 10-31 09:06AM 07.145
com.google.appengine.repackaged.com.google.common.base.internal.Finalizer
getInheritableThreadLocalsField: Couldn't access
Thread.inheritableThreadLocals. Reference finalizer threads will
inherit thread local values.
I 10-31 09:06AM 07.148
com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
init: Failed to start reference finalizer thread. Reference cleanup
will only occur when new references are created.
java.lang.reflect.InvocationTargetException
at com.google.appengine.runtime.Request.process-69e6389d93ef7f72
(Request.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:40)
at
com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue.init
(FinalizableReferenceQueue.java:124)
at
com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools
$WeakInterningPool.clinit(InterningPools.java:104)
at
com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools.newWeakInterningPool
(InterningPools.java:48)
at
com.google.appengine.repackaged.com.google.io.protocol.ProtocolSupport.clinit
(ProtocolSupport.java:55)
at com.google.apphosting.api.DatastorePb$PutRequest.freeze
(DatastorePb.java:8452)
at com.google.apphosting.api.DatastorePb$PutRequest$1.init
(DatastorePb.java:8367)
at com.google.apphosting.api.DatastorePb$PutRequest.clinit
(DatastorePb.java:8364)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:155)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:147)
at com.col.server.MDsIri.add(MDsIri.java:74) // please see the code
snippet above
at com.col.server.tool.DsWriter.writeIri(DsWriter.java:73)
at com.col.server.CAdmin.doIriWriteIri(CAdmin.java:165)
at com.col.server.CAdmin.doGet(CAdmin.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter
(SaveSessionFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle

[appengine-java] Re: PreparedQuery.countEntities() clarifications

2009-10-31 Thread Pion

One more thing ... The Admin Console - Datastore - Statistics says,
Statistics are updated at least once per day. on the top right
corner the page.

It explains the differences between real-time query about the size and
the Admin Console Statistics.

On Oct 30, 6:58 pm, Pion onlee2...@gmail.com wrote:
 Interesting ...

 I have two kinds of entity.

 I tried the 2nd entity. It matches. Then, I tried the first entity
 again. Now they all match!  Maybe there was a lag on The Admin
 Console - Datastore - Statistic

 Thanks Yasuo.

 On Oct 30, 6:44 pm, Yasuo Higa higaya...@gmail.com wrote:

  Hi Pion,

   It still returns 6218 entities while The Admin Console - Datastore -
   Statistic shows 5029.

  It is unusual.
  I think the admin console uses Statistics API.
  The Statistic data may be wrong or ...

  Could you try an another sample?

  Thanks,

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



[appengine-java] Re: PreparedQuery.countEntities() clarifications

2009-10-31 Thread Pion

One more thing ... The Admin Console - Datastore - Statistics says,
Statistics are updated at least once per day. on the top right
corner the page.

It explains the differences between real-time query about the size and
the Admin Console Statistics.

On Oct 30, 6:58 pm, Pion onlee2...@gmail.com wrote:
 Interesting ...

 I have two kinds of entity.

 I tried the 2nd entity. It matches. Then, I tried the first entity
 again. Now they all match!  Maybe there was a lag on The Admin
 Console - Datastore - Statistic

 Thanks Yasuo.

 On Oct 30, 6:44 pm, Yasuo Higa higaya...@gmail.com wrote:

  Hi Pion,

   It still returns 6218 entities while The Admin Console - Datastore -
   Statistic shows 5029.

  It is unusual.
  I think the admin console uses Statistics API.
  The Statistic data may be wrong or ...

  Could you try an another sample?

  Thanks,

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



[appengine-java] DatastoreService.put behaves differently in development server and deployed env

2009-10-30 Thread Pion

I can store a few thousands of entities incrementally in Development
Server environment using the method below.

public void add(ListString iriList, ListString nameList,
ListString imageList) {
int counter = 0;
ArrayListEntity eList = new ArrayListEntity();
for (int index=0; indexiriList.size(); index++) {
 Entity e = createEntity(iriList.get(index), 
nameList.get(index),
imageList.get(index)); // e should be less than 1,000 bytes each
 eList.add(e);

 counter++;  // Break down the storing to DS_LIMIT each 
due to
Google limitation/quotas
 if ((counter % CUtility.DS_LIMIT) == 0) { // DS_LIMIT 
= 200
 logger.info(Storing  + 
Integer.toString(counter) +  IRIs.);
 datastore.put(eList);  // Store in 
batch
 eList = new ArrayListEntity();// 
Reset the array
 } // if

} // for

if (eList.size()  0)
datastore.put(eList);   // Store in batch

logger.info(Storing  + Integer.toString(counter) +  IRIs.);
}

But when using it in deployed environment, it can only store 1,000
entities. It never adds beyond it. It does not hit the 30-second
limitation because I call it incrementally. After having 1,000
entities, I tried to add more. Below is the log from the deployed
server and verified it stored additional 225 entities without throwing
any exception.

I 10-30 11:38AM 02.852 com.col.server.tool.DsWriter writeIri: Writing
225 to MDsIri
I 10-30 11:38AM 02.867 com.col.server.MDsIri add: Storing 200 IRIs.
I 10-30 11:38AM 04.551 com.col.server.MDsIri add: Storing 225 IRIs.
I 10-30 11:38AM 04.551 com.col.server.tool.DsWriter writeIri:
Done 

Do I have to do something differently in deployed environment? Any
configuration changes or something? What did I do wrong? I know some
people have stored millions of entities successfully.

Thanks in advance for your help.


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



[appengine-java] Re: Data Store Indexes

2009-10-30 Thread Pion

I found this 
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Defining_Indexes_With_Configuration
with the following example:
?xml version=1.0 encoding=utf-8?
datastore-indexes
  xmlns=http://appengine.google.com/ns/datastore-indexes/1.0;
  autoGenerate=true
datastore-index kind=Person ancestor=false
property name=lastName direction=asc /
property name=height direction=desc /
/datastore-index
/datastore-indexes

But I still cannot solve my query error.

On Oct 30, 9:34 am, Pion onlee2...@gmail.com wrote:
 I just deployedmy app to the GAE for the first time.

 I went to the Admin Console - DataStore - Indexes which says, You
 have not created indexes for this application. Some types of queries
 require an index to be built. You can manage your indexes in an
 index.yaml file. Learn more 
 abouthttp://code.google.com/appengine/kb/general.html#indexes
 .

 http://code.google.com/appengine/kb/general.html#indexeslinks 
 tohttp://code.google.com/appengine/docs/python/datastore/queriesandinde
 It seems to be Python specific.

 What's the corresponding one on Java? It seems to be on war\WEB-INF
 \appengine-generated\datastore-indexes.xml. Please correct me if I am
 wrong. My datastore-indexes.xml is empty.

 ?xml version=1.0 encoding=utf-8?
 datastore-indexes  autoGenerate=true

 /datastore-indexes

 Also, I didi the following:

 o Go to the Admin Console - DataStore - Data Viewer. It displays my
 low-level datastore contents.
 o Click the Query (using GQL). It displays SELECT * FROM
 com.col.server.MDsIri automatically by default.
 o Click Run Query button
 o It says, Invalid GQL query string.

 I suspect because I do not have any indexes yet.

 What are the syntax to populate datastore-indexes.xml so I can do the
 above query.

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



[appengine-java] Re: PreparedQuery.countEntities() clarifications

2009-10-30 Thread Pion

Thanks Yasuo. It's definitely very helpful. I am just reading
http://code.google.com/appengine/docs/java/datastore/stats.html.
Your example clarifies a few things which is unclear on the doc.

It works now!

With my original code ... On the Development server, it returns
whatever the number of the entities. On the (deployed) App Engine
always returns 1000 due to the limitation as shown on
http://code.google.com/appengine/docs/java/datastore/overview.html#Quotas_and_Limits

I have changed my code as the following (using your example)

protected int count(String kind) {
   Query query = new Query(__Stat_Kind__);
   query.addFilter(kind_name, FilterOperator.EQUAL,
kind);
   PreparedQuery preparedQuery = datastore.prepare
(query);
   Entity statKind = preparedQuery.asSingleEntity();  //
It works on (deployed App Engine). It returns null on Development
server.
   Long totalEntities = (Long) statKind.getProperty
(count);
   int result = totalEntities.intValue();

   return result;
}

BUT this new code only works on the (deployed) App Engine.

On the Development server, the statKind is null. How do I make it work
on the Development Server?

My environments: GAE 1.2.6, GWT 1.7.1, Eclipse(Galileo), Windows Vista
(32-bit).

Again, thanks.

On Oct 30, 4:13 pm, Yasuo Higa higaya...@gmail.com wrote:
 Hi Pion,

  On my Development Server, it returns the total number of the entities
  which is over 40,000 entities.

  But when deploying it on GAE, it always returns 1,000 entities. Is
  this because of this limitation
 http://code.google.com/appengine/docs/java/datastore/overview.html#Qu...
  If so, what is the best way to find total number of entities I have?

 If your query has no filter condition, I recommend the following query:

 DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
 Query query = new Query(__Stat_Kind__);
 query.addFilter(kind_name, FilterOperator.EQUAL, kind);
 Entity stat = ds.prepare(query).asSingleEntity();
 Long count = (Long) stat.getProperty(count);

 If your query has some filter conditions, I recommend the following query:

 DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
 Query query = new Query(kind);
 query.setKeysOnly();
 query.addFilter(...);
 int count = 
 ds.prepare(query).asList(FetchOptions.Builder.withOffset(0)).size();

 The first query is faster than the second one.

 Hope this helps,

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



[appengine-java] Re: PreparedQuery.countEntities() clarifications

2009-10-30 Thread Pion

Now I have 3 versions of this method.

protected int count(String kind) {

// Version 1 - It works on Development Server.
// But it does not work (deployed) App Engine because 1000 entities
limitation 
http://code.google.com/appengine/docs/java/datastore/overview.html#Quotas_and_Limits
//  Query query = new Query(kind);
//  PreparedQuery preparedQuery = datastore.prepare(query);
//  int result = preparedQuery.countEntities();

// Version 2 - This one only works on (deployed) App Engine.
// But it does not work on Development Server
//  Query query = new Query(__Stat_Kind__);
//  query.addFilter(kind_name, FilterOperator.EQUAL, kind);
//  PreparedQuery preparedQuery = datastore.prepare(query);
//  Entity statKind = preparedQuery.asSingleEntity();   
// It returns
null on Development server
//  Long totalEntities = (Long) statKind.getProperty(count);
//  int result = totalEntities.intValue();

// Version 3 - This code works on both (deployed) App Engine and
Development server
// But The Admin Console - Datastore - Statistic shows that it has
about 5,000 entities
// This code returns about 6, entities
Query query = new Query(kind);
query.setKeysOnly();
FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0);
PreparedQuery preparedQuery = datastore.prepare(query);
int result = preparedQuery.asList(fetchOptions).size();

logger.info(Integer.toString(result));

return result;
}

Please correct me what I did wrong.
Thanks.

On Oct 30, 4:43 pm, Pion onlee2...@gmail.com wrote:
 Thanks Yasuo. It's definitely very helpful. I am just 
 readinghttp://code.google.com/appengine/docs/java/datastore/stats.html.
 Your example clarifies a few things which is unclear on the doc.

 It works now!

 With my original code ... On the Development server, it returns
 whatever the number of the entities. On the (deployed) App Engine
 always returns 1000 due to the limitation as shown 
 onhttp://code.google.com/appengine/docs/java/datastore/overview.html#Qu...

 I have changed my code as the following (using your example)

         protected int count(String kind) {
                Query query = new Query(__Stat_Kind__);
                query.addFilter(kind_name, FilterOperator.EQUAL,
 kind);
                PreparedQuery preparedQuery = datastore.prepare
 (query);
                Entity statKind = preparedQuery.asSingleEntity();  //
 It works on (deployed App Engine). It returns null on Development
 server.
                Long totalEntities = (Long) statKind.getProperty
 (count);
                int result = totalEntities.intValue();

                return result;
         }

 BUT this new code only works on the (deployed) App Engine.

 On the Development server, the statKind is null. How do I make it work
 on the Development Server?

 My environments: GAE 1.2.6, GWT 1.7.1, Eclipse(Galileo), Windows Vista
 (32-bit).

 Again, thanks.

 On Oct 30, 4:13 pm, Yasuo Higa higaya...@gmail.com wrote:

  Hi Pion,

   On my Development Server, it returns the total number of the entities
   which is over 40,000 entities.

   But when deploying it on GAE, it always returns 1,000 entities. Is
   this because of this limitation
  http://code.google.com/appengine/docs/java/datastore/overview.html#Qu...
   If so, what is the best way to find total number of entities I have?

  If your query has no filter condition, I recommend the following query:

  DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
  Query query = new Query(__Stat_Kind__);
  query.addFilter(kind_name, FilterOperator.EQUAL, kind);
  Entity stat = ds.prepare(query).asSingleEntity();
  Long count = (Long) stat.getProperty(count);

  If your query has some filter conditions, I recommend the following query:

  DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
  Query query = new Query(kind);
  query.setKeysOnly();
  query.addFilter(...);
  int count = 
  ds.prepare(query).asList(FetchOptions.Builder.withOffset(0)).size();

  The first query is faster than the second one.

  Hope this helps,

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



[appengine-java] Re: PreparedQuery.countEntities() clarifications

2009-10-30 Thread Pion

I have just made the changes per your suggestion below.

It still returns 6218 entities while The Admin Console - Datastore -
Statistic shows 5029.

Thanks.

On Oct 30, 5:55 pm, Yasuo Higa higaya...@gmail.com wrote:
 Hi Pion,



  // Version 3 - This code works on both (deployed) App Engine and
  Development server
  // But The Admin Console - Datastore - Statistic shows that it has
  about 5,000 entities
  // This code returns about 6, entities
                 Query query = new Query(kind);
                 query.setKeysOnly();
                 FetchOptions fetchOptions = 
  FetchOptions.Builder.withOffset(0);

 How about:
 FetchOptions fetchOptions =
     FetchOptions.Builder.withOffset(0).limit(Integer.MAX_VALUE);

 Instead of:
  FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0);

                 PreparedQuery preparedQuery = datastore.prepare(query);
                 int result = preparedQuery.asList(fetchOptions).size();

         logger.info(Integer.toString(result));

                 return result;
         }

 Hope this helps,

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



[appengine-java] Re: DatastoreService.put behaves differently in development server and deployed env

2009-10-30 Thread Pion

This issue is being discussed on 
PreparedQuery.countEntities() clarifications
http://groups.google.com/group/google-appengine-java/browse_thread/thread/f97bdd5bdf91c114/486958d3b4da1310#486958d3b4da1310

On Oct 30, 1:31 pm, Pion onlee2...@gmail.com wrote:
 I went to Admin Console - DataStore - Statistics. It shows that I
 have stored more than 1,000 entities. It confirms that the method
 below stores entities correctly.

 I need to look at the code that retrieves the entity why it is saying
 that it is only 1,000. I just found out this 
 dochttp://code.google.com/appengine/docs/java/datastore/stats.html

 On Oct 30, 11:58 am, Pion onlee2...@gmail.com wrote:

  I can store a few thousands of entities incrementally in Development
  Server environment using the method below.

          public void add(ListString iriList, ListString nameList,
  ListString imageList) {
                  int counter = 0;
                  ArrayListEntity eList = new ArrayListEntity();
                  for (int index=0; indexiriList.size(); index++) {
                           Entity e = createEntity(iriList.get(index), 
  nameList.get(index),
  imageList.get(index)); // e should be less than 1,000 bytes each
                           eList.add(e);

                           counter++;  // Break down the storing to DS_LIMIT 
  each due to
  Google limitation/quotas
                           if ((counter % CUtility.DS_LIMIT) == 0) { // 
  DS_LIMIT = 200
                                   logger.info(Storing  + 
  Integer.toString(counter) +  IRIs.);
                                   datastore.put(eList);          // Store in 
  batch
                                   eList = new ArrayListEntity();  // Reset 
  the array
                           } // if

                  } // for

                  if (eList.size()  0)
                          datastore.put(eList);           // Store in batch

                  logger.info(Storing  + Integer.toString(counter) +  
  IRIs.);

  }

  But when using it in deployed environment, it can only store 1,000
  entities. It never adds beyond it. It does not hit the 30-second
  limitation because I call it incrementally. After having 1,000
  entities, I tried to add more. Below is the log from the deployed
  server and verified it stored additional 225 entities without throwing
  any exception.

  I 10-30 11:38AM 02.852 com.col.server.tool.DsWriter writeIri: Writing
  225 to MDsIri
  I 10-30 11:38AM 02.867 com.col.server.MDsIri add: Storing 200 IRIs.
  I 10-30 11:38AM 04.551 com.col.server.MDsIri add: Storing 225 IRIs.
  I 10-30 11:38AM 04.551 com.col.server.tool.DsWriter writeIri:
  Done 

  Do I have to do something differently in deployed environment? Any
  configuration changes or something? What did I do wrong? I know some
  people have stored millions of entities successfully.

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



[appengine-java] Re: PreparedQuery.countEntities() clarifications

2009-10-30 Thread Pion

Iteresting ...

I have two kinds of entity.

I tried the 2nd entity. It matches. Then, I tried the first entity
again. Now they all match!  Maybe there was a lag on The Admin
Console - Datastore - Statistic

Thanks Yasuo.

On Oct 30, 6:44 pm, Yasuo Higa higaya...@gmail.com wrote:
 Hi Pion,

  It still returns 6218 entities while The Admin Console - Datastore -
  Statistic shows 5029.

 It is unusual.
 I think the admin console uses Statistics API.
 The Statistic data may be wrong or ...

 Could you try an another sample?

 Thanks,

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



[appengine-java] Re: An internal error occurred during deployment

2009-10-29 Thread Pion

Thanks. You are correct.

This line causes the problem - Notice that there is a space before  /

property name=com.foo value=bar /

This line is correct - Remove the space before /
property name=com.foo value=bar/

Again, thanks.


On Oct 29, 2:44 am, Raphael André Bauer
raphael.andre.ba...@gmail.com wrote:
 On Wed, Oct 28, 2009 at 6:14 PM, Pion onlee2...@gmail.com wrote:

  I have been developing my app in the hosted mode for the past few
  months. It works fine on the hosted mode.

  Today, I got an internal error below when I tried to deploy it for the
  first time using Eclipse.

  My environments: GAE Java 1.2.6, GWT 1.7.1, Eclipse(Galileo), Windows
  Vista (32-bit).

  Any help is is appreciated.
  Thanks in advance for your help.

  ERROR LOGS
  eclipse.buildId=M20090917-0800
  java.version=1.6.0_15
  java.vendor=Sun Microsystems Inc.
  BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
  Framework arguments:  -product org.eclipse.epp.package.jee.product
  Command-line arguments:  -os win32 -ws win32 -arch x86 -product
  org.eclipse.epp.package.jee.product

  Error
  Wed Oct 28 09:41:50 PDT 2009
  An internal error occurred during: Deploying col to Google.

  com.google.apphosting.utils.config.AppEngineConfigException: XML error
  validating D:\workspace\google\col\war\WEB-INF\appengine-web.xml
  against D:\download\eclipse-galileo\plugins

 i suppose you changed something in the appengine-web.xml and the
 changes are not ok. this is what the stacktrace tells you.

 check the file for consistency and it will run again...

 cheers,

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



[appengine-java] Re: An internal error occurred during deployment

2009-10-28 Thread Pion

Per http://code.google.com/appengine/docs/java/gettingstarted/uploading.html,
I did use the command prompt by typing ..\appengine-java-sdk\bin
\appcfg.cmd update war. It produces the same error - expected I
guess.

On Oct 28, 10:14 am, Pion onlee2...@gmail.com wrote:
 I have been developing my app in the hosted mode for the past few
 months. It works fine on the hosted mode.

 Today, I got an internal error below when I tried to deploy it for the
 first time using Eclipse.

 My environments: GAE Java 1.2.6, GWT 1.7.1, Eclipse(Galileo), Windows
 Vista (32-bit).

 Any help is is appreciated.
 Thanks in advance for your help.

 ERROR LOGS
 eclipse.buildId=M20090917-0800
 java.version=1.6.0_15
 java.vendor=Sun Microsystems Inc.
 BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
 Framework arguments:  -product org.eclipse.epp.package.jee.product
 Command-line arguments:  -os win32 -ws win32 -arch x86 -product
 org.eclipse.epp.package.jee.product

 Error
 Wed Oct 28 09:41:50 PDT 2009
 An internal error occurred during: Deploying col to Google.

 com.google.apphosting.utils.config.AppEngineConfigException: XML error
 validating D:\workspace\google\col\war\WEB-INF\appengine-web.xml
 against D:\download\eclipse-galileo\plugins
 \com.google.appengine.eclipse.sdkbundle_1.2.6.v200910131704\appengine-
 java-sdk-1.2.6\docs\appengine-web.xsd
         at com.google.appengine.tools.admin.Application.validateXml
 (Application.java:321)
         at com.google.appengine.tools.admin.Application.init
 (Application.java:87)
         at com.google.appengine.tools.admin.Application.readApplication
 (Application.java:120)
         at
 com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.createAppAdmin
 (AppEngineBridgeImpl.java:204)
         at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy
 (AppEngineBridgeImpl.java:265)
         at
 com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace
 (DeployProjectJob.java:148)
         at org.eclipse.core.internal.resources.InternalWorkspaceJob.run
 (InternalWorkspaceJob.java:38)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
 Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:
 Invalid content was found starting with element 'system-properties'.
 One of '{http://appengine.google.com/ns/1.0:static-files, http://
 appengine.google.com/ns/1.0:resource-files, http://
 appengine.google.com/ns/1.0:env-variables, http://
 appengine.google.com/ns/1.0:ssl-enabled, http://appengine.google.com/
 ns/1.0:sessions-enabled, http://appengine.google.com/ns/1.0:user-
 permissions, http://appengine.google.com/ns/1.0:public-root, http://
 appengine.google.com/ns/1.0:inbound-services, http://
 appengine.google.com/ns/1.0:precompilation-enabled}' is expected.
         at
 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
 (Unknown Source)
         at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
 (Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator
 $XSIErrorReporter.reportError(Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
 $FragmentContentDriver.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
 (Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
 (Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.validate
 (Unknown Source)
         at
 com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate
 (Unknown Source)
         at javax.xml.validation.Validator.validate(Unknown Source)
         at com.google.appengine.tools.admin.Application.validateXml
 (Application.java:318)
         ... 7 more
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send

[appengine-java] Re: Extra log output

2009-09-23 Thread Pion

Thanks for your reply, Toby.

I am using log4j because I want to be consistent with some existing
modules/classes. I did the following:

  import org.apache.log4j.Logger;

I just saw http://logging.apache.org/log4j/1.2/faq.html#duplicate-messages.
log4j call is cumulative/additive. I called the
BasicConfigurator.configure(); methods more than once. Now it is
fixed.

Again, thanks.

On Sep 23, 2:20 pm, Toby Reyelts to...@google.com wrote:
 You're using java.util.logging, not log4j. What does your logging.properties
 file look like?

 On Wed, Sep 23, 2009 at 5:02 PM, Pion onlee2...@gmail.com wrote:

  I have the following code snippet:

  public class FooServiceImpl extends RemoteServiceServlet implements
  ControllerInputService {

        �...@override
      public String bar(String input) {
           ...
           logger.debug(Entering ... bar());
          ...
      }

         private static final Logger logger = Logger.getLogger
  (FooServiceImpl .class.getName());
  } // FooServiceImpl

  It prints out the following messages:

  0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
  0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
  0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()

  Notice that it prints out more than 1 time. I double/triple checked
  that I only call the bar() method once.

  Then, I modified the code as the following:

  public class FooServiceImpl extends RemoteServiceServlet implements
  ControllerInputService {

        �...@override
      public String bar(String input) {
           ...
           counter++;
           logger.debug(counter +  Entering ... bar());
           System.out.println(counter +  Entering ... bar() from
  System.out.println());
          ...
      }

         private int counter = 0;

         private static final Logger logger = Logger.getLogger
  (FooServiceImpl .class.getName());
  } // FooServiceImpl

  It produces the following output:

  0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
  ()
  0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
  ()
  0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
  ()
  1 Entering ... bar() from System.out.println()

  Notice that there are still several log outputs (not as expected - I
  only expect only 1 output) but only one output from System.out.println
  () (as expected) and the counter is still 1 (as expected).

  My log4j.properties

  # A default log4j configuration for log4j users.
  #
  # To use this configuration, deploy it into your application's WEB-INF/
  classes
  # directory.  You are also encouraged to edit it as you like.

  # Configure the console as our one appender
  log4j.appender.A1=org.apache.log4j.ConsoleAppender
  log4j.appender.A1.layout=org.apache.log4j.PatternLayout
  log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c]
  - %m%n

  My environtments: GAE 1.2.5, GWT 1.7, Eclipse-Galileo on Windows
  Vista.

  Why do I have several log output?

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



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

2009-09-22 Thread Pion

This line fails:

   FooServiceImpl server =  (FooServiceImpl ) proxy.getService
(com.foo.server);

The server is null.

On Sep 21, 6:48 pm, Pion onlee2...@gmail.com wrote:
 I have the following server side code:

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

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

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

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

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

         } // ServerTest

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

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

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

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



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

2009-09-22 Thread Pion
org.eclipse.equinox.simpleconfigurator.manipulator but it cannot be
resolved.
17 [main] ERROR DataNucleus.Plugin  - Bundle org.eclipse.jdt.junit
requires org.eclipse.equinox.simpleconfigurator.manipulator but it
cannot be resolved.
08:20:35,898 ERROR [DataNucleus.Plugin] - Bundle
org.eclipse.jdt.junit requires org.eclipse.equinox.frameworkadmin
but it cannot be resolved.
08:20:35,898 ERROR [DataNucleus.Plugin] - Bundle
org.eclipse.jdt.junit requires org.eclipse.equinox.frameworkadmin
but it cannot be resolved.
17 [main] ERROR DataNucleus.Plugin  - Bundle org.eclipse.jdt.junit
requires org.eclipse.equinox.frameworkadmin but it cannot be
resolved.


On Sep 22, 7:51 am, Toby Reyelts to...@google.com wrote:
 ApiProxy gives you access to the dev_appserver's internal interfaces for the
 services that Google provides, such as mail, urlfetch, memcache, xmpp,
 etc... ApiProxy is entirely unrelated to GWT RemoteServiceServlets, which is
 what your code is trying to use it for.
 You only need to use our internal dev_appserver interfaces if you
 specifically need to do something with the services that isn't supported on
 prod via the standard interfaces. For example, in the page you referenced,
 the code clears all record of sent messages:

 mailService.clearSentMessages();

 That capability makes no sense in production, but it is very useful for
 testing locally.

 On Tue, Sep 22, 2009 at 10:35 AM, Pion onlee2...@gmail.com wrote:

  This line fails:

    FooServiceImpl server =  (FooServiceImpl ) proxy.getService
  (com.foo.server);

  The server is null.

  On Sep 21, 6:48 pm, Pion onlee2...@gmail.com wrote:
   I have the following server side code:

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

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

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

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

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

           } // ServerTest

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

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

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

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



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

2009-09-22 Thread Pion

I just did the following on the Eclipse-Galileo:

o Click on the Eclipse menu bar Windows - Preferences - General -
Capabilitiies. I then enabled the Class Update
o Click on  the Eclipse menu bar Help - Software Update - Manage
Configurations. I then expanded the plugins.
o There is no DataNucleus plugin installed.

I don't recall explicitly installing DataNucleus plugin unless GAE or
something else installed as part of their installations.

Also, I tried the following:
o Wrote a populate() method to populate my database (from scratch) in
regular environment (not using junit). It worked fine -- the database
was created.

o Called the same populate() method above in junit environment. It did
not create the database.

Thanks.


On Sep 22, 9:08 am, Toby Reyelts to...@google.com wrote:
 Can you check and see if you have the Eclipse DataNucleus plugin installed?
 If so, can you try disabling it?

 On Tue, Sep 22, 2009 at 11:34 AM, Pion onlee2...@gmail.com wrote:

  Thanks, Toby.

  I have changed the code to
               FooServiceImpl server = new FooServiceImpl ();

  Also, I changed the GWT servlet test method to

         public String unitTest() {
                 PersistenceManager pm = PMF.get().getPersistenceManager();
                 return unitTest;
         }

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

  Now, I receive the following DataNucleus.Plugin warning and error
  messages below.

  Again, thanks for your help.

  08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.views not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.views not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  0 [main] WARN DataNucleus.Plugin  - Extension Point
  org.eclipse.ui.views not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.perspectiveExtensions not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.perspectiveExtensions not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  2 [main] WARN DataNucleus.Plugin  - Extension Point
  org.eclipse.ui.perspectiveExtensions not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.preferencePages not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.preferencePages not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  3 [main] WARN DataNucleus.Plugin  - Extension Point
  org.eclipse.ui.preferencePages not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.keywords not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.ui.keywords not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  3 [main] WARN DataNucleus.Plugin  - Extension Point
  org.eclipse.ui.keywords not registered, but plugin
  org.eclipse.jdt.junit defined in file:/D:/download/eclipse-galileo/
  configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
  refers to it.
  08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
  org.eclipse.debug.core.launchConfigurationTypes not registered

[appengine-java] JUnit best practices questions

2009-09-21 Thread Pion

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

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

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

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

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



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

2009-09-21 Thread Pion

I have the following server side code:

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

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

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

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

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

} // ServerTest

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

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

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

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



[appengine-java] makePersistent() question

2009-09-16 Thread Pion

I am using App Engine SDK 1.2.5 with Eclipse-Galileo on Windows Vista
with the following (simplified/stripped) code:

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class FooDb {
@PrimaryKey
@Persistent
private String id;

@Persistent
private String name;

public FoafIndexDb(String id, String name) {
this.id = id;
this.name = name;
}
}

//

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {

public static PersistenceManagerFactory get() {
return pmfInstance;
}

private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory(transactions-optional);

}

//

PersistenceManager pm = PMF.get().getPersistenceManager();
FooDb fooDb = new FooDb (key, name);
try {
pm.makePersistent(foafIndexDb);
} finally {
pm.close();
}

//

The output from DataNucleus Enhancement during build:

DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
DataNucleus Enhancer completed with success for 1 classes. Timings :
input=147 ms, enhance=29 ms, total=176 ms. Consult the log for full
details

//

The output during execution:

0 [btpool0-3] DEBUG DataNucleus.Connection  - Registered transactional
connection factory under name appengine
1 [btpool0-3] DEBUG DataNucleus.Connection  - Registered
nontransactional connection factory under name appengine
395 [btpool0-3] DEBUG DataNucleus.Connection  - Connection added to
the pool :
org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
$datastoremanagedconnect...@1a2d209
399 [btpool0-3] DEBUG DataNucleus.Connection  - Connection found in
the pool :
org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
$datastoremanagedconnect...@1a2d209
399 [btpool0-3] DEBUG DataNucleus.Connection  - Connection found in
the pool :
org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
$datastoremanagedconnect...@1a2d209
597 [btpool0-3] DEBUG DataNucleus.Connection  - Connection found in
the pool :
org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
$datastoremanagedconnect...@1a2d209
601 [btpool0-3] DEBUG DataNucleus.Reachability  - Performing check of
objects for persistence-by-reachability (commit) ...
601 [btpool0-3] DEBUG DataNucleus.Reachability  - Completed check of
objects for persistence-by-reachability (commit).

//

THE PROBLEM: No (data) file created after running the above.

war\WEB-INF\appengine-generated\ folder only has datastore-indexes-
auto.xml which contains the following:

!-- Indices written at Wed, 16 Sep 2009 17:58:16 UTC --
datastore-indexes/

I am new on this. What did I miss?

Thanks in advance for your help.


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



[appengine-java] Re: makePersistent() question

2009-09-16 Thread Pion

The local_db.bin shows up now.

It seems that I have to wait for a minute or two before it shows up on
the war\WEB-INF\appengine-generated.

On Sep 16, 12:20 pm, Pion onlee2...@gmail.com wrote:
 I am using App Engine SDK 1.2.5 with Eclipse-Galileo on Windows Vista
 with the following (simplified/stripped) code:

 import javax.jdo.annotations.IdentityType;
 import javax.jdo.annotations.PersistenceCapable;
 import javax.jdo.annotations.Persistent;
 import javax.jdo.annotations.PrimaryKey;

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class FooDb {
     @PrimaryKey
     @Persistent
         private String id;

     @Persistent
     private String name;

         public FoafIndexDb(String id, String name) {
                 this.id = id;
                 this.name = name;
         }

 }

 //

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 public final class PMF {

     public static PersistenceManagerFactory get() {
         return pmfInstance;
     }

     private static final PersistenceManagerFactory pmfInstance =
 JDOHelper.getPersistenceManagerFactory(transactions-optional);

 }

 //

 PersistenceManager pm = PMF.get().getPersistenceManager();
 FooDb fooDb = new FooDb (key, name);
 try {
         pm.makePersistent(foafIndexDb);

 } finally {
         pm.close();
 }

 //

 The output from DataNucleus Enhancement during build:

 DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
 DataNucleus Enhancer completed with success for 1 classes. Timings :
 input=147 ms, enhance=29 ms, total=176 ms. Consult the log for full
 details

 //

 The output during execution:

 0 [btpool0-3] DEBUG DataNucleus.Connection  - Registered transactional
 connection factory under name appengine
 1 [btpool0-3] DEBUG DataNucleus.Connection  - Registered
 nontransactional connection factory under name appengine
 395 [btpool0-3] DEBUG DataNucleus.Connection  - Connection added to
 the pool :
 org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
 $datastoremanagedconnect...@1a2d209
 399 [btpool0-3] DEBUG DataNucleus.Connection  - Connection found in
 the pool :
 org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
 $datastoremanagedconnect...@1a2d209
 399 [btpool0-3] DEBUG DataNucleus.Connection  - Connection found in
 the pool :
 org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
 $datastoremanagedconnect...@1a2d209
 597 [btpool0-3] DEBUG DataNucleus.Connection  - Connection found in
 the pool :
 org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl
 $datastoremanagedconnect...@1a2d209
 601 [btpool0-3] DEBUG DataNucleus.Reachability  - Performing check of
 objects for persistence-by-reachability (commit) ...
 601 [btpool0-3] DEBUG DataNucleus.Reachability  - Completed check of
 objects for persistence-by-reachability (commit).

 //

 THE PROBLEM: No (data) file created after running the above.

 war\WEB-INF\appengine-generated\ folder only has datastore-indexes-
 auto.xml which contains the following:

 !-- Indices written at Wed, 16 Sep 2009 17:58:16 UTC --
 datastore-indexes/

 I am new on this. What did I miss?

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