[appengine-java] Re: App engine SDK jars in WEB-INF/lib. Why???

2011-05-16 Thread Philippe Marschall


On May 12, 11:56 pm, Toby Reyelts  wrote:
> arjan,
>
> There are two sides to the App Engine API: the client and the server. The
> client side (appengine-api.jar) lives entirely in "user-land". If you so
> chose, you could create your own version of these classes.
> ...

But that's the case the other way too. For example spring-test
implements parts of the servlet-api as stubs for testing reasons.
That's not affected at all by which classloader servlet-api is
provided at runtime.

> Having this separation means that you can evolve the client and server
> independently. For example, dev_appserver and prod obviously have two
> different server backends for the same client API. You can take that one
> step further and even independently implement your own server if you so
> chose. It also means that its trivial to do things like test out and even
> deploy hotfixes for individual applications instead of waiting for full
> releases.

I don't see how you can evolve and API is affected by which
classloader provides it.

Cheers
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: App engine SDK jars in WEB-INF/lib. Why???

2011-05-15 Thread Philippe Marschall


On May 16, 5:57 am, Toby Reyelts  wrote:
> On Sun, May 15, 2011 at 7:58 AM, Philippe Marschall <
>
>
>
>
>
>
>
>
>
> philippe.marsch...@gmail.com> wrote:
>
> > On May 13, 2:29 am, Nichole  wrote:
> > > Just a quick summary, the servlet spec requires that a servlet
> > > container such as appengine
> > > provider an implementation for a service.  Those jars such as servlet-
> > > api-2.4.jar are needed
> > > at compile time.
>
> > That's why there's provided scope in Maven.
>
> > > They are sometimes provided by the servlet container/
> > > engines at run time
> > > in a global directory that is found by the container/engine
> > > classloader.
>
> > They have to always be provided by the container. E.g. the
> > HttpServletRequest interface that the container classes implement and
> > that you program against have to be the same class defined by the same
> > classloader otherwise you get a LinkageError.
>
> > > appengine provides
> > > the servlet, jsp implementations for us at runtime.
>
> > > The appengine specific service implementations are also needed at
> > > runtime and compile
> > > time and are present in the appengine-api-1.0-sdk-.jar.
> > > They've chosen not to add the latest sdk to the container global
> > > classpath, so yes, the
> > > application must provide it.
>
> > But that's silly. That means you deploy the local simulation
> > implementations into production.
>
> No, appengine-api.jar is the definition of the App Engine API, with a
> convenient interface that wraps the running API implementation. In the case
> of the dev_appserver, the implementation is in appengine-local-runtime.jar
> (which you should not be uploading). In the case of production, the
> implementation is our production servers, running code you do not have
> access to.

That makes even less sense. So you're providing the implementation
classes through the container that link against the API classes coming
from the WebAppClassLoader? Why not just provide the API classes
through the container as well?

Cheers
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: App engine SDK jars in WEB-INF/lib. Why???

2011-05-15 Thread Philippe Marschall


On May 13, 2:29 am, Nichole  wrote:
> Just a quick summary, the servlet spec requires that a servlet
> container such as appengine
> provider an implementation for a service.  Those jars such as servlet-
> api-2.4.jar are needed
> at compile time.

That's why there's provided scope in Maven.

> They are sometimes provided by the servlet container/
> engines at run time
> in a global directory that is found by the container/engine
> classloader.

They have to always be provided by the container. E.g. the
HttpServletRequest interface that the container classes implement and
that you program against have to be the same class defined by the same
classloader otherwise you get a LinkageError.

> appengine provides
> the servlet, jsp implementations for us at runtime.
>
> The appengine specific service implementations are also needed at
> runtime and compile
> time and are present in the appengine-api-1.0-sdk-.jar.
> They've chosen not to add the latest sdk to the container global
> classpath, so yes, the
> application must provide it.

But that's silly. That means you deploy the local simulation
implementations into production.

Cheers
Philipe

-- 
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: Google Plugin for Eclipse 3.6 is now available

2010-06-28 Thread Philippe Marschall


On Jun 28, 4:10 pm, Jason Parekh  wrote:
> On Fri, Jun 25, 2010 at 1:01 AM, Philippe Marschall <
>
>
>
> philippe.marsch...@gmail.com> wrote:
>
> > On Jun 23, 11:14 pm, Jason Parekh  wrote:
> > > Hey folks,
>
> > > Google Plugin for Eclipse 1.3.3 is out with support for Eclipse 3.6.
> > >  Install it with Eclipse 3.6's new Eclipse Marketplace feature by going
> > to
> > > Help > Eclipse Marketplace, and search for Google Plugin for Eclipse.
>
> > > Alternatively, here are the update sites:
> > > - Eclipse Helios (3.6):http://dl.google.com/eclipse/plugin/3.6
> > > - Eclipse Galileo (3.5):http://dl.google.com/eclipse/plugin/3.5
> > > - Eclipse Ganymede (3.4):http://dl.google.com/eclipse/plugin/3.4
> > > - Eclipse Europa (3.3):http://dl.google.com/eclipse/plugin/3.3
>
> > > Need detailed instructions?  Check out the quick start guide:
> >http://code.google.com/eclipse/docs/getting_started.html
>
> > I find it a bit strange that you have and update site for each and
> > every eclipse version. Eclipse has a very strict API versioning policy
> > and good tool support that make it easy to create a plugin that runs
> > on multiple versions. What's the reason why you need to do this?
>
> We've had to use internal Eclipse APIs for some of our features (two
> examples are JSNI editing inside the Java editor and custom at-rules for
> CssResource inside UiBinder XML templates.)  Unfortunately, with the use of
> internal APIs comes future incompatibility issues, leading to our separate
> GPE update site for each Eclipse release.

IC, thanks for the explanation.

Cheers
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-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 Plugin for Eclipse 3.6 is now available

2010-06-24 Thread Philippe Marschall


On Jun 23, 11:14 pm, Jason Parekh  wrote:
> Hey folks,
>
> Google Plugin for Eclipse 1.3.3 is out with support for Eclipse 3.6.
>  Install it with Eclipse 3.6's new Eclipse Marketplace feature by going to
> Help > Eclipse Marketplace, and search for Google Plugin for Eclipse.
>
> Alternatively, here are the update sites:
> - Eclipse Helios (3.6):http://dl.google.com/eclipse/plugin/3.6
> - Eclipse Galileo (3.5):http://dl.google.com/eclipse/plugin/3.5
> - Eclipse Ganymede (3.4):http://dl.google.com/eclipse/plugin/3.4
> - Eclipse Europa (3.3):http://dl.google.com/eclipse/plugin/3.3
>
> Need detailed instructions?  Check out the quick start 
> guide:http://code.google.com/eclipse/docs/getting_started.html

I find it a bit strange that you have and update site for each and
every eclipse version. Eclipse has a very strict API versioning policy
and good tool support that make it easy to create a plugin that runs
on multiple versions. What's the reason why you need to do this?

Cheers
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-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: What Framework to use?

2010-05-24 Thread Philippe Marschall


On May 21, 6:29 pm, "hurray!"  wrote:
> I am looking for a web framework to use on GAE that
> 1. Provides pretty URLs
> 2. Makes passing data to views easier.
> 3. Is productive.
>
> I tried Grails for a small app, but the startup time was too long.
>
> I am curious what framework do you guys use for a small to medium
> sizeapp (that gets a few hundred visits per day)? Please advise based
> on your production level experience on GAE.

I used Wicket and the low level datastore API. I was quite happy with
it but had slow, high CPU loading requests. So I went to static html,
JQuery and JAX-RS handlers or servlets. Performance is stellar now.
It's a small application though.

Cheers
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-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 Plugin for Eclipse 1.3 plans

2010-02-06 Thread Philippe Marschall


On Feb 4, 8:52 pm, Keith Platfoot  wrote:
> Hey all,
>
> Many of you have reported incompatibilities between the Google Plugin for
> Eclipse and other build systems/project structures, most notably Maven and
> J2EE/Dynamic Web Projects.  For example, issue 1515 (Eclipse plugin requires
> fixed location for war
> directory)
> has
> collected well over 100 stars, and a similar one in the GWT issue tracker
> has attracted a lot of attention as well.  Based on this feedback, we've
> decided to try and address as many of the incompatibilities as possible with
> our upcoming 1.3 release of the plugin.  To deliver on that goal, we want to
> share with your our current plans, and also let you know about a preview
> build that we'll make available so you can test the changes for yourself and
> give us feedback before final release.
>
> Our plans for the 1.3 release include 4 changes designed to make integration
> with Maven and J2EE projects easier:
>
>    1. The WAR directory can now be configured to be *any* project-relative
>    path (e.g. src/main/webapp if you're using Maven).  You'll also be able
>    to specify whether that directory is source-only (typical Maven/J2EE
>    scenario), or whether it should also function as the WAR output directory
>    from which to run/debug or deploy to App Engine.  If your WAR directory is
>    input *and* output (which will remain the default for new Web App
>    projects), the plugin will manage synchronizing the contents of WEB-INF/lib
>    WEB-INF/classes with your project's build path and compiled output.
>     Otherwise, we'll leave your WAR source directory alone and you'll need to
>    specify your WAR output location when launching, deploying, etc (the plugin
>    will remember the location once you set it the first time).
>    2. The Web App launch configuration UI is being redesigned to allow you
>    to see, and if necessary change, *any* of the launch arguments.
>     Previously, we were waiting until launch time to set many of these
>    arguments based on heuristics that were invisible and inaccessible to you.
>     Now you'll be in full control of how your projects get launched.  Also,
>    we're adding the capability to automatically migrate your launch
>    configurations when necessary, for example, updating the -javaagent flag
>    when changing App Engine SDKs.
>    3. GWT/App Engine projects will no longer require our SDK library on the
>    classpath.  This means Maven users will be able to pull in JAR files from
>    their M2 repository as they're accustomed to and the plugin won't mind a
>    bit.
>    4. The severity of any problem marker generated by the plugin will be
>    fully customizable via an Errors/Warnings preference page (similar to the
>    Java Errors/Warnings page), letting you specify either Error, Warning, or
>    Ignore.
>
> We'll also be including a few smaller features and bug fixes as well.
>
> What does everyone think about the 4 changes outlined above?  We've been
> testing the plugin against various Maven and J2EE configurations to try to
> ensure that we've eliminated the most critical roadblocks.  However, we're
> very interested in also having you folks take it for a spin before the
> official release date (slated for next month).  We're not quite ready yet,
> but stay tuned for a 1.3 preview build to be made available hopefully in a
> few weeks.  We'll distribute it as a zip file for dropin
> installation
> so
> it will come with the standard warnings and caveats (use with a clean
> Eclipse install and workspace, use at your risk, etc.).  However, it will
> hopefully give you a chance to give us any last-minute feedback about our
> changes before the final release.

Sounds like a good start. Ideally the maven eclipse plugin [1] could
be configured to automatically generate the configuration for the
Google Plugin and M2Eclipse [2] picking that up as well. Also an
archetype would help quick starting. I assume you're aware that you
get the most benefit out of that only when there are up to date Maven
artifacts wit good metadata in a publicly available repo, preferably
Maven central.

 [1] http://maven.apache.org/eclipse-plugin.html
 [2] http://m2eclipse.sonatype.org/

Cheers
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-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: RESTfull - JAX-RS and GAE/J

2010-01-19 Thread Philippe Marschall


On Jan 19, 1:34 am, Jeff Schnitzer  wrote:
> Or you can just get rid of that trainwreck called Maven.

Right. But you have the same problem if you use Ivy, Gradle, Buildr or
whatever consumes POMs because it's at the metadata level. But then
again avoid that too.

Cheers
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-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: RESTfull - JAX-RS and GAE/J

2010-01-18 Thread Philippe Marschall


On Jan 16, 10:23 pm, Jeff Schnitzer  wrote:
> JBoss Resteasy works fine without any special customization for GAE.
> I use it extensively.
>
> http://www.jboss.org/resteasy

You have to work around their POMs:
https://jira.jboss.org/jira/browse/RESTEASY-180

Apparently it is cool if you have to write half a dozen of excludes if
you use resteasy in production as long that that saves you two
dependencies when posting a snippet in a blog.

Cheers
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-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: GAE roadmap for 2010

2009-12-27 Thread Philippe Marschall


On Dec 20, 10:54 am, Antoine Sabot-durand 
wrote:
> Hi,
>
> I found the roadmap for 2009 but is there one for 2010 ? I'd like to
> propose my company to start developement on GAE but the lack of
> visibility on the platform is an issue. Will you support some of the
> JEE6 new standard (JSF 2, CDI, JPA 2, EJB 3.1 ?). Is the imageio issue
> with the JSF richfaces library will be corrected ?
> I saw a lot of question in the forum but few answer (or wasn't able to
> find them).

What seems to help is when issues gets voted a lot. JAXB and StAX are
good examples of this.

Cheers
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-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: Logging in JUnit tests

2009-12-12 Thread Philippe Marschall


On Dec 12, 2:50 pm, "a.maza"  wrote:
> Hello,
>
> I have currently some troubles with logging in junit tests. In
> general, I have the following questions:
>
> -) According to the manuals, I could basically use any log framework
> which logs to System.out and System.err, respectively (e.g., log4j).
> However, for having a fine grained selection mechanism in the admin
> console, the use of java.util.logging (JUL) is required. Is this true,
> since the log levels of the admin console remind me rather to those of
> log4j than those of JUL.
>
> -) JUL logging works quite fine for running the web application on
> jetty. However, when doing junit tests, JUL does not automatically
> read the logging.properties from the file system resulting in logging
> INFO and above.
> I have learned that the logging.properties file can be set using the -
> Djava.util.logging.config.file jvm argument. However, doing this for
> every junit test is a little bit cumbersome. (i.e., not an option).
> Some websites state that setting a system property
> (java.util.logging.config.file) in the base test class may work - but
> not in my case.
> JUL would allow to read a logging.properties file from the filesystem
> using the LogManager class. However, the LogManager is a restricted
> class on GAE (also in the dev environment).
>
> I also thought about the option of using SLF4J with the JUL binding
> for the web application and SLF4J with a log4j binding for JUnit
> tests... but I am not sure if this works out

Since SLF4J is just a facade it doesn't support any configuration.

>  I would be happy to hear from others how they manage logging
> (especially in JUnit tests) or any suggestions that might help...

I don't use JUL if I have a choice. With logback you can just add a
logback-test.xml to src/test/resources and you're set. For JUL
configuring argLine in the surefire plugin might be an option. You
could also put a MethodRule or some setup method an abstract super
class for all tests that set up JUL.

Cheers
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-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: eclipse plugin and maven?

2009-12-12 Thread Philippe Marschall


On Dec 5, 7:45 pm, Rusty Wright  wrote:
> Is it possible to use the GAE Eclipse plugin if you're using Maven?  Maven 
> uses a different directory structure so I'm guessing that's why the GAE 
> plugin doesn't recognize the project as a GAE web app.

Google seems determined to make it a pain to use Maven. One of the
biggest hurdles is that they don't provide Maven artifacts. The
Eclipse plugin seems to be targeted at novices writing their first web
application within a few clicks. Integration with existing Eclipse
infrastructure (e.g. WTP) or build systems (e.g. Maven) doesn't seem a
priority.

Cheers
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-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: Java heap size

2009-12-03 Thread Philippe Marschall


On Dec 3, 4:51 am, "jacek.ambroziak" 
wrote:
> My application, an XML search engine, likes to manipulate its index
> data structures in memory during indexing.
> Searches are naturally much faster too when index data structures are
> in the heap.
> Unfortunately, I started running into OutOfMemory errors while
> indexing larger numbers of publications,
> but not huge number either: ~ 300. Data (typically byte arrays) I
> manipulate are on the order of 20 MB,
> again a very small mem requirement for this Century (both my dev
> computers are now 4 GB).
>
> Yes, I could bend over backwards and start using Datastore for some
> form of poor man's virtual memory
> but it wouldn't win all that much more space, would slow down and
> complicate the code.
>
> So... how much heap space do we have?

http://kohlerm.blogspot.com/2009/04/some-facts-about-java-used-by-googles.html

> Can we affect the size?

Doesn't look like it.

Cheers
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-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: How to return a file from a servlet

2009-12-01 Thread Philippe Marschall


On Nov 30, 11:23 am, Prashant  wrote:
> Hi,
>
> I have a servlet with request handler */file/** . I want to return a file *
> /theme/bg.gif* for all */file/*.gif *. I can check for .gif extension then
> how do i send */theme/bg.gif*, for */file/*.gif* without sending a redirect
> ?

Do a forward?

RequestDispatcher dispatcher = request.getRequestDispatcher
(whereEver);
dispatcher.forward(request, response);

Cheers
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-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: Unit testing 2nd class citizen?

2009-11-22 Thread Philippe Marschall


On Nov 21, 1:18 am, John Towell  wrote:
> I just had to do this
>
> http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> This is a bit shady to still not have been fixed.

I don't see the problem here. It's the same thing with JUnit, Hamcrest
and all the other test dependencies. You can use the same solution you
use there like for example test scoped Maven dependencies.

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




[appengine-java] Re: java doubt : is there any way to get class instance from class' qualified name?

2009-11-08 Thread Philippe Marschall



On Nov 7, 3:53 pm, Prashant  wrote:
> Hi,
>
> Suppose, I have a list of Qualified Names of a set of classes (say, in a
> property or text file) and I want to call a method (pre-decided), from one
> of the listed class, when required. Is there any way to do that? My
> knowledge of java says NO, if you have any idea please reply.

If it has an accessible default constructor:
Class.forName("my.class.Name").getConstructor().newInstance()
otherwise you'll need to pass in the constructor arguments types and
the arguments itself

Don't use:
Class.forName("my.class.Name").newInstance()
although shorter it propagates any exception thrown by the
constructor, including checked ones. You don't want this.

Cheers
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: Memory Limit

2009-10-19 Thread Philippe Marschall



On Oct 17, 12:09 pm, Joebi  wrote:
> Hi,
>
> I have a web application which does some search and refines the
> results using NLP techniques.
> When I load this web app, I use an initialization servlet to load the
> model files and other related resources in the memory. But I am
> getting an error saying "Error: Server Error. The server encountered
> an error and could not complete your request."
>
> I am trying to see how to increase the VM size while deploying the
> application. In my local development server of app engine, I have set -
> Xms1024m -Xmx2048m. Is there a way to specify this limit for the
> production deployment ?

No. You might find some reverseengineered  information about the
limits here:

http://kohlerm.blogspot.com/2009/04/some-facts-about-java-used-by-googles.html

Cheers
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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-24 Thread Philippe Marschall



On Sep 23, 11:40 am, dflorey  wrote:
> I've just refactored my app to use Low-Level API instead of JDO and
> it's much cleaner, works more reliable etc.
> If you are not really forced to use JDO/JPA I'd strongly recommend to
> use the very simple, elegant and clean Low-Level API.
> BigTable simply is not a relational db, so it is highly misleading to
> fake a relational wrapper and to me it caused lots of pain.

+1
Happy with low level API. One of the advantages is that you learn what
BigTable can and can't do. So there won't be any bad surprises later.

Cheers
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: when will BigDecimal be supported in datastore?

2009-09-21 Thread Philippe Marschall



On 20 Sep., 18:56, ted stockwell  wrote:
> On Sep 20, 7:16 am, Philippe Marschall 
> wrote:
>
>
>
> > BigDecimal is the only sane choice for anything that includes monetary
> > calculations.
>
> True, but just because a number is saved as a long doesn't mean you
> can't do calculations using BigDecimal.
> I think the CPU cycles it takes to convert a long to a BigDecimal is
> trivial.

But long is crappy abstraction. Sometimes you need two decimal places,
sometimes three, sometimes six, sometimes "as many as there are".
That's all quite cumbersome to do with a long alone. String seems like
the easier way to go.

Cheers
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: when will BigDecimal be supported in datastore?

2009-09-20 Thread Philippe Marschall



On Sep 19, 11:32 pm, Max Ross  wrote:
> The datastore supports a Double type and we have no plans to support
> anything more precise.

BigDecimal is the only sane choice for anything that includes monetary
calculations.

Cheers
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: about gzip issue

2009-09-19 Thread Philippe Marschall



On Sep 19, 7:54 am, "congli...@gmail.com"  wrote:
> Hi,
>    I found that the google app engine can't gzip my web response even
> if Accept-Encoding has been set by client.
>    Is there anything we need to do for this gzip protocol ?

It's supposed to happen magically:
http://code.google.com/appengine/kb/general.html#compression

Like all magic it will ultimately fail:
http://code.google.com/p/googleappengine/issues/detail?id=2036

Cheers
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: sending binary data (serialized object) via TaskOptions.payload()

2009-09-13 Thread Philippe Marschall



On Sep 9, 2:20 pm, Vince Bonfanti  wrote:
> I'm trying to send binary data--a serialized Java object--via the
> TaskOptions.payload() method, but can't figure out how to send and/or
> read the data properly. First, I serialized an object to a byte[],
> which I know is working properly. Then I set the byte[] as the task
> payload via:
>
>     TaskOptions.payload( byte[], contentType );
>
> I've tried different values for contentType;
> "application/octet-stream" and "application/x-java-serialized-object"
> seemed like the two most reasonable, but this seems to have no effect.
>
> In my task handler (a servlet), I read the data into a byte[] prior to
> object deserialization via the following:
>
>    byte[] bytesIn = new byte[ req.getContentLength() ];
>    req.getInputStream().readLine( bytesIn, 0, bytesIn.length );
>
> However, the byte[] I read in is not the same as the byte[] I wrote
> out. Here are the first few bytes of the array as I wrote it to
> TaskOptions.payload (this is cut-and-paste from the Eclipse debugger):
>
>    -84, -19, 0, 5, 115, 114, 0, 38, 99, 111, 109, 46, 103, 111,
>
> and here are the first few bytes I read in, which is tantalizingly
> close to what was written out:
>
>     63,  63, 5, 115, 114, 38, 99, 111, 109, 46, 103, 111
>
> So then I tried a different tack. I converted the byte[] to a string
> in the outward direction:
>
>    TaskOptions.payload( new String( byte[] ) );

Don't do that, ever. That creates a string from a byte array in the
platform default encoding. Do you know what the platform default
encoding is? On your development machine? On every GAE/J production
server? On every GAE/J production server three years from now? Do you
know whether the algorithm checks for valid byte sequences?

Cheers
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: Get Multipart Data from the request

2009-09-13 Thread Philippe Marschall



On Jul 22, 7:41 pm, "Jason (Google)"  wrote:
> As indicated in the "Will it play in App Engine" page, you will not be able
> to use the "traditional" Apache Commons FileUpload API since it relies on
> java.io.File which is not a supported class. App Engine does not allow
> applications to write to the file system, so the DiskFileItem error thrown
> makes sense. You should be able to use the Streaming API or a custom
> solution like the one in this 
> thread:http://groups.google.com/group/google-appengine-java/browse_thread/th...

Streaming API works fine here.

Cheers
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: Tomcat Instead of Jetty.

2009-09-10 Thread Philippe Marschall



On Sep 10, 8:02 am, maksud  wrote:
> Hi,
> I am planning to use GWT with Server integration to some project. Now google
> uses Jetty as its appengine server. But it have some restriction including
> JPA and Files. How can I use Tomcat as the server instead of Jetty?

You can't. Why do you want Tomcat?

Cheers
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: What are your opinion ?

2009-08-27 Thread Philippe Marschall



On Aug 26, 10:04 pm, Geraldo Lopes  wrote:
> Hi,
>
> The article below review gae's persistence. What are your opinion ?
>
> http://www.ibm.com/developerworks/java/library/j-gaej3.html?ca=dgr-bt...

I'm using the low-level API and am quite happy with it. That nicely
sidesteps many of the issues. It's not so "low-level" actually, it's
more or less like dealing with java.util.Map. However my applications
are all very simple.

Cheers
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: Accept-Encoding doesn't seem to get passed to the application

2009-08-26 Thread Philippe Marschall



On Aug 26, 11:54 pm, "Jason (Google)"  wrote:
> App Engine's gzip compression is described 
> athttp://code.google.com/appengine/docs/java/runtime.html#Responses.
> Please file any feature requests in the public tracker:

Does that make a difference? Up until now everything I reported or
starred there has been ignored. Anyway:
http://code.google.com/p/googleappengine/issues/detail?id=2036

Cheers
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: Accept-Encoding doesn't seem to get passed to the application

2009-08-25 Thread Philippe Marschall



On Aug 25, 8:31 pm, Martin Caslavsky  wrote:
> Hi,
>
> App Engine does automatic gzip compression, so that may be the reason
> why it removes the header before it passes request to an application.

That's a bit uncool, is there a way to disable this? I store my
content in gzip for space reasons, for my use case that's a factor six
to seven improvement. I store it in a Blob and need no indexing. If I
know that the client accepts gzip I can save the decompression which
saves CPU time. Uncompressing only that AppEngine compresses it again
is a bit schizophrenic.

Cheers
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: Request to update jars in http://google-maven-repository.googlecode.com

2009-08-25 Thread Philippe Marschall



On Aug 25, 6:37 pm, David  wrote:
> Hi,
>
> 1.2.2 had been released more than a month ago but was not uploaded on
> the repository.
> The latest in there is 1.2.1

+1
--~--~-~--~~~---~--~~
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: Unicode to ASCII equivalence (java.text.Normalizer not supported by app-engine VM)

2009-08-25 Thread Philippe Marschall


On Aug 25, 2:18 pm, Cornel  wrote:
> Hello!
>
> I need to save unicode strings and also create a "ascii version" of
> them (to make a keyword list for searching purposes) such as:
> "Animale, cu excepţia peştelui" => ["ANIMALE", "EXCEPTIA", "PESTELUI"]
>
> For that i need the following conversions: ţ -> t, ş -> s and so on.
> My first approach was the following:
>
>                 orig = Normalizer.normalize(field, Form.NFKD).toCharArray();
>                 ascii = new byte[orig.length];
>                 count = 0;
>                 for (int i = 0; i < orig.length; i++) {
>                         if (orig[i] < 128) {
>                                 ascii[count++] = (byte) orig[i];
>                         }
>                 }
>                 try {
>                         field = new String(ascii, "UTF-8");
>                 }
>                 catch (UnsupportedEncodingException e) {
>                         e.printStackTrace();
>                 }
>
> This works very well in java generally, but when i tried it in an app-
> engine project i got a compiler error:
>
> "java.text.Normalizer.Form is not supported by Google App Engine's
> Java runtime environment"
>
> What workaround do you suggest?

Open an issue at:
http://code.google.com/p/googleappengine/issues/list

Cheers
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] Accept-Encoding doesn't seem to get passed to the application

2009-08-24 Thread Philippe Marschall

Hi

I'm getting really strange behavior here where it looks as if the
Accept-Encoding wouldn't get passed to the application. My request
looks like this:

GET /the/url HTTP/1.1
Accept-Encoding: gzip
User-Agent: Jakarta Commons-HttpClient/3.1
Host: myapp.appspot.com
Cookie: the cookie

However the only headers I see are User-Agent, Host and Cookie.

Cheers
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: Logging Levels....

2009-08-24 Thread Philippe Marschall



On Aug 24, 8:08 pm, Toby Reyelts  wrote:
> The mappings for java.util.logging levels to GAE log levels are:
>     level >= SEVERE -> Error
>     level >= WARNING -> Warn
>     level >= INFO -> Info
>     else Debug
>
> We reserve the Critical level for errors such as escaping ServletExceptions
> (e.g. errors that would cause 500s).
>
> So, for example, if you want to log at GAE's Debug level, you should be able
> to use Level.FINE, FINER, or FINEST (or even CONFIG).

Wow, this just shows how bad the jul API is. There are these level
that you can't explain unless you put them all into a bag and give
them a different level which doesn't exist.

Cheers
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: Maven

2009-08-23 Thread Philippe Marschall



On Aug 22, 8:25 pm, drone  wrote:
> So, has anyone actually got Maven up and running with a GAE project?
>
> (and I mean really Maven, not Maven for this and Ant for that)

Yeah, but I don't use JDO or GWT. I just build with Maven and upload
with the shell script. I didn't get unit testing [1] running though.
BTW the whole setup could be done really nicely with a rule in JUnit
4.7 but their examples are stuck at JUnit 3.

But the real bitch is the Eclipse "support". There is a way how it
should work, WTP project with an additional WTP server adapter, look
at AWS for an example. The reality couldn't possibly be the further
from this.

 [1] http://code.google.com/appengine/docs/java/howto/unittesting.html

Cheers
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
-~--~~~~--~~--~--~---