[appengine-java] Re: Disable Eclipse DataNucleus Enhancer from maven-eclipse-plugin?

2011-03-25 Thread Philippe Beaudoin
There is no maven-datanucleus-plugin in my POM. The datanucleus is brought 
in by the Google Eclipse Plugin I believe.

-- 
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] Disable Eclipse DataNucleus Enhancer from maven-eclipse-plugin?

2011-03-23 Thread Philippe Beaudoin
Hi!

My project uses Objectify and therefore does not need the DataNucleus 
Enhancer to run. Running it is long and causes some nasty error popups in 
Eclipse. I usually disable it via:
  Right click on project  Properties  Builders
Where I uncheck Enhancer.

However, my project uses Maven and the eclipse project files is not part of 
my development artifacts. I'd therefore like to configure the 
maven-eclipse-plugin to automatically disable this builder. Unfortunately, 
all my experiments have failed. Any idea if this is possible?

-- 
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] Eclipse Run As Web Application overwrites all the libs

2011-03-20 Thread Philippe Beaudoin
I'm using maven with m2eclipse and want to use to nice debugging tools by 
running my app directly from Eclipse via the Run As Web Application 
command. This used to work well, but recently I've discovered that all the 
external dependencies in target/MyProject/WEB-INF/lib are deleted every time 
I hit Run As Web Application. As a result Guice and other libs are not 
found.

Has something changed in the Google Eclipse Plugin to cause that? Is there 
any workaround?

(Cross-posted to AppEngine java.)

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Eclipse Run As Web Application overwrites all the libs

2011-03-20 Thread Philippe Beaudoin
I found a workaround by disabling and reenabling Maven dependency injection 
in Eclipse:
Right-click on the project  Maven  Disable Dependency Management
Right-click on the project  Maven  Enable Dependency Management

I still think there may be something wrong with the GEP though...

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



Re: [appengine-java] Re: URLFetchService

2011-02-28 Thread Philippe Beaudoin
You're very welcome! This community is great, and so is Google
(although I don't work for them. ;))

Cheers,

Philippe

On Mon, Feb 28, 2011 at 7:55 AM, cyberalgo rythms
cyberalgoryt...@gmail.com wrote:
 Hello again:
 I just want to thank you again for the super help!
 I am now able to remote login using GAE for java. I am able to retrieve the
 information from the pages I want. Instead of using the POST method I use
 the GET method to login and call the method as many times as I need with new
 URLs to fetch the pages I want but definitely the help on how to get the
 cookie header and use it in the subsequent fetches was precious so thanks
 again for the super google help. ;-)
 best regards!
 On Fri, Feb 25, 2011 at 6:51 PM, cyberalgo rythms
 cyberalgoryt...@gmail.com wrote:

 Hi:
 The URL which comes in the response variable is the login page. All the
 fields there are populated according to setPayload field values but the
 password does not get populated ?
 I posted a new thread for this as it might not be related to this one.
 Thank you

 On Fri, Feb 25, 2011 at 6:22 PM, Philippe Beaudoin
 philippe.beaud...@gmail.com wrote:

 I don't know about that... Have you tried checking the URL accessed
 when you manually fill the form and click submit?

 Cheers,

   Philippe

 On Fri, Feb 25, 2011 at 9:30 AM, cyberalgo rythms
 cyberalgoryt...@gmail.com wrote:
  Thank you for the super help. It is first time I using this interface.
  I did use your code and modified a bit and I believe got the cookie
  working.
  Why i say that because after accessing the second fetch and in the view
  source code of the page somewhere inside uses the PHPSESSID i have
  retrieved
  from the login URL page. That indicates me i succeed in tracking the
  session
  id used.
  The cookie and the value I send back to the server looks like this but
  may
  de different for other servers.
  Cookie: PHPSESSID=sfs3892jhfsdkfsldfjsldkfjdfsdfjdfkdfdf
  Code now:
  // BEGIN 
         URLFetchService urlFetchService=
   URLFetchServiceFactory.getURLFetchService();
         URL url = new URL(https://www.somename.com/login.php;);
         HTTPRequest httpRequest = new HTTPRequest(url,HTTPMethod.POST,
  validateCertificate());
         HTTPResponse response = urlFetchService.fetch(httpRequest);
 
         // Get site cookie
         // ...
         String cookies=null;
         for (HTTPHeader header : response.getHeaders())
           {
           if (header.getName().equalsIgnoreCase(set-cookie)) {
           cookies =  header.getValue().substring(0,42); // gets only
  PHPSESSID=value32characters for my server URL
           // prepare second HTTP request with cookie set
           httpRequest.setHeader(new HTTPHeader(Cookie, cookies));
           }
            }
         // ...
         // prepare second HTTP request with cookie set
 
 
  httpRequest.setPayload(lang=enlogin=dm2vdfTpassword=vjfgdaction=login.getBytes());
         response = urlFetchService.fetch(httpRequest);
  // END --
  The problem I am facing now is that it populates the login and lang
  fields
  but the password value is left blank but i do have it in the setPayload
  function. So i don't understand why it does not read it ? Should the
  password value be sent differently from the other fields ?
  Thanks again for you help!
 
  On Thu, Feb 24, 2011 at 5:51 PM, Philippe Beaudoin
  philippe.beaud...@gmail.com wrote:
 
  My guess is that the JSESSIONID (or whichever session cookie used by
  the
  service) that is received in the HTTPResponse of your first fetch() is
  not
  sent back with your second fetch. As a consequence, the service does
  not
  know you're logged in. Here is how I would solve it (I did not test
  that
  code):
  // ...
  HTTPResponse response = urlFetchService.fetch(httpRequest);
  ListHTTPHeader headers = response.getHeaders();
  String cookies;
  for (HTTPHeader header : headers)
    if (Set-Cookie.equals(header.getName())
      cookies = header.getValue();
  httpRequest = new HTTPRequest(url,HTTPMethod.POST,
  validateCertificate());
  if (cookies != null)
    httpRequest.setHeader(new HTTPHeader(Cookie, cookies));
  // ...
  You may run into the following issues, though:
    http://code.google.com/p/googleappengine/issues/detail?id=1704
    http://code.google.com/p/googleappengine/issues/detail?id=3379
  Hope it helps,
     Philippe
 
  --
  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.
 
  --
  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

Re: [appengine-java] Re: URLFetchService

2011-02-25 Thread Philippe Beaudoin
I don't know about that... Have you tried checking the URL accessed
when you manually fill the form and click submit?

Cheers,

   Philippe

On Fri, Feb 25, 2011 at 9:30 AM, cyberalgo rythms
cyberalgoryt...@gmail.com wrote:
 Thank you for the super help. It is first time I using this interface.
 I did use your code and modified a bit and I believe got the cookie working.
 Why i say that because after accessing the second fetch and in the view
 source code of the page somewhere inside uses the PHPSESSID i have retrieved
 from the login URL page. That indicates me i succeed in tracking the session
 id used.
 The cookie and the value I send back to the server looks like this but may
 de different for other servers.
 Cookie: PHPSESSID=sfs3892jhfsdkfsldfjsldkfjdfsdfjdfkdfdf
 Code now:
 // BEGIN 
        URLFetchService urlFetchService=
  URLFetchServiceFactory.getURLFetchService();
        URL url = new URL(https://www.somename.com/login.php;);
        HTTPRequest httpRequest = new HTTPRequest(url,HTTPMethod.POST,
 validateCertificate());
        HTTPResponse response = urlFetchService.fetch(httpRequest);

        // Get site cookie
        // ...
        String cookies=null;
        for (HTTPHeader header : response.getHeaders())
          {
          if (header.getName().equalsIgnoreCase(set-cookie)) {
          cookies =  header.getValue().substring(0,42); // gets only
 PHPSESSID=value32characters for my server URL
          // prepare second HTTP request with cookie set
          httpRequest.setHeader(new HTTPHeader(Cookie, cookies));
          }
           }
        // ...
        // prepare second HTTP request with cookie set

 httpRequest.setPayload(lang=enlogin=dm2vdfTpassword=vjfgdaction=login.getBytes());
        response = urlFetchService.fetch(httpRequest);
 // END --
 The problem I am facing now is that it populates the login and lang fields
 but the password value is left blank but i do have it in the setPayload
 function. So i don't understand why it does not read it ? Should the
 password value be sent differently from the other fields ?
 Thanks again for you help!

 On Thu, Feb 24, 2011 at 5:51 PM, Philippe Beaudoin
 philippe.beaud...@gmail.com wrote:

 My guess is that the JSESSIONID (or whichever session cookie used by the
 service) that is received in the HTTPResponse of your first fetch() is not
 sent back with your second fetch. As a consequence, the service does not
 know you're logged in. Here is how I would solve it (I did not test that
 code):
 // ...
 HTTPResponse response = urlFetchService.fetch(httpRequest);
 ListHTTPHeader headers = response.getHeaders();
 String cookies;
 for (HTTPHeader header : headers)
   if (Set-Cookie.equals(header.getName())
     cookies = header.getValue();
 httpRequest = new HTTPRequest(url,HTTPMethod.POST, validateCertificate());
 if (cookies != null)
   httpRequest.setHeader(new HTTPHeader(Cookie, cookies));
 // ...
 You may run into the following issues, though:
   http://code.google.com/p/googleappengine/issues/detail?id=1704
   http://code.google.com/p/googleappengine/issues/detail?id=3379
 Hope it helps,
    Philippe

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

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


-- 
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: URLFetchService

2011-02-24 Thread Philippe Beaudoin
My guess is that the JSESSIONID (or whichever session cookie used by the 
service) that is received in the HTTPResponse of your first fetch() is not 
sent back with your second fetch. As a consequence, the service does not 
know you're logged in. Here is how I would solve it (I did not test that 
code):

// ...
HTTPResponse response = urlFetchService.fetch(httpRequest);
ListHTTPHeader headers = response.getHeaders();
String cookies;
for (HTTPHeader header : headers)
  if (Set-Cookie.equals(header.getName())
cookies = header.getValue();
httpRequest = new HTTPRequest(url,HTTPMethod.POST, validateCertificate());
if (cookies != null)
  httpRequest.setHeader(new HTTPHeader(Cookie, cookies));
// ...

You may run into the following issues, though:
  http://code.google.com/p/googleappengine/issues/detail?id=1704
  http://code.google.com/p/googleappengine/issues/detail?id=3379

Hope it helps,
   Philippe

-- 
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: HtmlUnit support on GAE for GWT crawlability

2010-12-08 Thread Philippe Beaudoin
Hi Brucko,

Great idea! Can you post a link to your blog, I can't see it here?

   Philippe

On Dec 7, 3:26 pm, brucko geoff.bruck...@gmail.com wrote:
 Always On has made an interesting twist.

 If you want this to work for free, then ATM Gal Dolbers method appears
 to be the best at this stage.

 But with Always On not only do sites with low traffic now get faster
 start ups... It also means that the URLFetch timeout problem for Ajax
 Crawlable appengine sites using GWT, for example, has been lessened.

 No longer are you waiting more than 10 seconds to fire up another
 instance so you can fetch a snapshot.

 This means that the fetching of dynamic content by Googlebot on gwt
 based applications can be done in real time rather than relying on
 fetching dated snapshots from another application. So now you have
 choice.

 I've now updated my site and blog to include this and, on the surface,
 everything seems good. Time will tell.

-- 
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] Extend UrlFetch timeout on development server?

2010-11-04 Thread Philippe Beaudoin
I'm trying to use the UrlFetch API to test my Paypal integration on the
development server. When I send a badly formatted request I quickly get
an error reponse from Paypal's sandbox server. However, as soon as I
issue a valid request, it takes too long to process and I get a timeout
error.


I have tried both with the java.net API and the low-level URLfetch API,
in both cases extending the deadline to 10s via
URLConnection.setConnectTimeout(1) and/or
request.getFetchOptions().setDeadline(10d);


It seems this is not enough, however, as I keep getting:
[WARN] /testpaypal.do: java.io.IOException: Timeout while fetching:
https://api-3t.sandbox.paypal.com/nvp



1) It looks like the timeout occurs well before 10s have elapsed

2) I hear the Paypal sandbox server is slower than the production server
3) I bet my personal internet connection is slower than AppEngine's
4) I just want to test, I don't care about AppEngine's timeout for now


For all these reasons, I'd love to be able to extend the URLFetch
timeout on the development server to more than 10s -- in fact, just
extending it to a real 10s would already be great.


Any idea on how to do that? Or how to test that efficiently?


Anybody has had success integrating with PayPal on App Engine?

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