Re: [appengine-java] Automatic restart of development server in Eclipse

2010-07-06 Thread Yasuo Higa
Hi  jesbox,

Slim3 supports HOT reloading.
HOT reloading means a new version of a class is automatically reloaded
on the fly.

The site of Slim3 is here:
http://slim3.org

Hope this helps,

Yasuo Higa

On Sun, Jul 4, 2010 at 1:40 PM, jesbox  wrote:
> Hi!
> I have read that it should be sufficient to save a java source file
> and that the development server would reload the class. Then I could
> reload the page and it would be the latest version I would look at.
>
> This does not happen to me, I have to stop the development server and
> then run the application again.
>
> Many thanks for advice 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.
>
>

-- 
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: Automatic restart of development server in Eclipse

2010-07-06 Thread jesbox
I thought it was possible also without GWT. But thanks for the tip!

And thanks for the link to Slim3, it looks promising. A recent
encounter with Struts2 fuelled my preference for lightwheight
frameworks ...

On 5 Juli, 15:37, "l.denardo"  wrote:
> This is true only for the GWT client side (and not completely, since
> Gin modules don't seem to be refreshed correctly).
>
> For server side, JSPs look to be refreshed automatically, but you must
> reload the server to have your RPC services updated.
> If you use Eclipse there's a reload icon in the "Development Mode"
> tab, just near the one to stop the server (yes, it looks like tab's
> refresh...)
> Be careful when doing this, since restart adds up space to the process
> and it eventually goes out of memory after a couple of reloads (at
> least, this happens to me. Should be configurable but I never tried).
>
> Regards
> Lorenzo
>
> On Jul 4, 6:40 am, jesbox  wrote:
>
>
>
> > Hi!
> > I have read that it should be sufficient to save a java source file
> > and that the development server would reload the class. Then I could
> > reload the page and it would be the latest version I would look at.
>
> > This does not happen to me, I have to stop the development server and
> > then run the application again.
>
> > Many thanks for advice 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] Uploading App to GAE with JSP compile Error

2010-07-06 Thread RAVINDER MAAN
Hello all
  I have jsp file which  I am including in other jsp`s using include
directive.I am declaring variables in the parent JSP .So included jsp
has compilation errors because it is refering parent jsp`s
variables.It is working fine on local .But when i try to upload
application to GAE because of compilation errors it is not allowing me
to upload the app.I know that by setting those variables at request
scope i can   solve this problem.I just want to know is there any way
that i can upload app with jsp compilation errors? I have tried
 false
its not working.
Thanks

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



[appengine-java] Getting images from the blobstore - going to be slow?

2010-07-06 Thread Mark
Hi,

I'd like to serve user avatar pics. I can store them in blobstore. I
think I can modify the blobstore example to make it work like this:

// sevlet which serves my images:
public class Serve extends HttpServlet {
private BlobstoreService blobstoreService =
BlobstoreServiceFactory.getBlobstoreService();

public void doGet(HttpServletRequest req, HttpServletResponse
res)
  throws IOException {
BlobKey blobKey = new BlobKey(req.getParameter("img_id"));
blobstoreService.serve(blobKey, res);
}
}

// user jsp page:

  


this is all we really need, right? In my example, I can locate a
user's avatar image blob by using their unique username.

Is this a lot slower than just hosting the avatar on a static url like
on a php server for example?:



I'm worried that every time a user's avatar is served, the
BlobstoreServiceFactory.getBlobstoreService() method needs to be
called and then a fetch from the datastore must be done - if I have a
few dozen such images to locate on a single page, am I going to be in
trouble?

Thanks

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



[appengine-java] image service is changing some white backgrounds to black

2010-07-06 Thread JakeP

I have an app that does two image transforms - it reduces the size of
images from rss feeds and spits out jpeg format images that are stored
in the datastore. It also stores the original size images that it
stores in jpeg format.

image1:  original image => resize => "I'm Feeling Lucky" => jpeg

image2: original image  => "I'm Feeling Lucky" => jpeg

When I look at the reduced size image in a browser, sometimes, the
image's white background is changed to black.  Known issue or Bug?

orig:
http://salonnewsapp.appspot.com/server?imagekey=da866db2b26c03e8e7866987e433431b6c068ea3&fullsize=1

reduced size:
http://salonnewsapp.appspot.com/server?imagekey=da866db2b26c03e8e7866987e433431b6c068ea3

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



Re: [appengine-java] image service is changing some white backgrounds to black

2010-07-06 Thread Ronmell Fuentes
Hi JakeP
as far as I know, when you have an PNG image this allows you to write
metadata in order to make the background transparent, but in JPEG/JPG files
this cannot be done. So all I can see is that the app is working properly
but when an image in JPG/JPEG is showed, the viewer doesn't know how to
interpret the background-metadata so, the easiest thing to do is show it in
black colour.

Rgds.

Ronmell

2010/7/6 JakeP 

>
> I have an app that does two image transforms - it reduces the size of
> images from rss feeds and spits out jpeg format images that are stored
> in the datastore. It also stores the original size images that it
> stores in jpeg format.
>
> image1:  original image => resize => "I'm Feeling Lucky" => jpeg
>
> image2: original image  => "I'm Feeling Lucky" => jpeg
>
> When I look at the reduced size image in a browser, sometimes, the
> image's white background is changed to black.  Known issue or Bug?
>
> orig:
>
> http://salonnewsapp.appspot.com/server?imagekey=da866db2b26c03e8e7866987e433431b6c068ea3&fullsize=1
>
> reduced size:
>
> http://salonnewsapp.appspot.com/server?imagekey=da866db2b26c03e8e7866987e433431b6c068ea3
>
> --
> 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.
>
>


-- 
ausencia de evidencia  ≠  evidencia de ausencia
http://culturainteractiva.blogspot.com/

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



Re: [appengine-java] Re: Uploading to blobstore gives OutOfMemoryError

2010-07-06 Thread Adrian Petrescu
Okay guys, I think I've figured out the source of the problem.

If you fail to add a "setName()" attribute on your FileInput element (or,
presumably, any other in the form), the resulting HTTP request is
unparseable which causes the MimeMultipart parser to explode in the way all
of you have encountered. I fixed this just by adding a
"fileInput.setName("file");" and now it uploads to the Blobstore upload url
without any problems.

Even though the problem turned out to be mine, and was easily fixable, I
still consider this a bug in AppEngine because there's no way such a simple
mistake should cause an OutOfMemoryException and crash; it could even be the
source of DOS vulnerabilities in the future just by crafting malicious HTTP
POST requests. I'll file a bug report with Google.

Cheers,
Adrian

On Mon, Jul 5, 2010 at 10:40 PM, Thomas  wrote:

> Hi Adrian:
>
> By plain normal servlet I meaned the url path (of the call to
> blobstoreService.createUploadUrl(url) ) is mapping to a simple plain
> HttpServlet implementation. And it is better to have the servlet
> bypass any filter mapping in development phase. It's how I finally
> succeeded to upload lots of blobs without any problems.
>
> On 7月6日, 上午10時07分, Adrian Petrescu  wrote:
> > Hi Thomas,
> >
> > Thanks for your reply :) But I'm not sure what you mean by "a plain
> normal
> > HttpServlet#doPost to handle the upload"; in what sense am I not doing
> that?
> > Do you mean the fact that I'm uploading to Blobstore? Why would that be a
> > problem, and how else would I get them in there?
> >
> > Thanks,
> > Adrian
> >
> > On Mon, Jul 5, 2010 at 10:03 PM, Thomas  wrote:
> > > Hi:
> >
> > > I read the post on Stack Overflow. My opinion is that you had better
> > > use a plain normal HttpServlet#doPost to handle the upload. I also
> > > encountered 500 Internal Server Error, but it worked well after I
> > > replace original handler with a plain servlet.
> >
> > > Hope the above helps!
> >
> > > On 7月6日, 上午8時25分, Adrian Petrescu  wrote:
> > > > I've also posted about the issue on Stack Overflow here:
> > >http://stackoverflow.com/questions/3177092/uploading-to-blobstore-giv.
> ..
> >
> > > > Hopefully getting some more eyeballs on it will help.
> >
> > > > On Jul 4, 10:47 pm, Adrian Petrescu  wrote:
> >
> > > > > I'm having the exact same issue too, down to the line numbers in
> the
> > > > > stack trace.
> >
> > > > > Has anyone figured out what is causing this? I find it hard to
> believe
> > > > > we've all made the exact same identical mistake, all within the
> last
> > > > > month. Is something wrong on Google's end?
> >
> > > > > Cheers,
> > > > > Adrian
> >
> > > > > On Jun 2, 7:14 pm, Jean Hsu  wrote:
> >
> > > > > > Hi all,
> >
> > > > > > I am trying to set up a basic file upload to blobstore,  but I
> get
> > > > > > this OutOfMemoryError:
> >
> > > > > > WARNING: Error for /_ah/upload/
> > > > > > aghvbWdkcmVzc3IcCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGMACDA
> > > > > > java.lang.OutOfMemoryError: Java heap space
> > > > > > at java.util.Arrays.copyOf(Arrays.java:2786)
> > > > > > at
> > > java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
> > > > > > at
> >
> > >
> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:
> > > > > > 316)
> > > > > > at
> > > javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:186)
> > > > > > at
> > > javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
> > > > > > at
> >
> > >
> com.google.appengine.api.blobstore.dev.UploadBlobServlet.handleUpload(Uploa
> > > dBlobServlet.java:
> > > > > > 135)
> > > > > > at
> > > com.google.appengine.api.blobstore.dev.UploadBlobServlet.access
> > > > > > $000(UploadBlobServlet.java:72)
> > > > > > at
> com.google.appengine.api.blobstore.dev.UploadBlobServlet
> > > > > > $1.run(UploadBlobServlet.java:100)
> > > > > > at java.security.AccessController.doPrivileged(Native
> Method)
> > > > > > at
> >
> > >
> com.google.appengine.api.blobstore.dev.UploadBlobServlet.doPost(UploadBlobS
> > > ervlet.java:
> > > > > > 98)
> > > > > > 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:
> > > > > > 511);
> >
> > > > > > I used the Memory Analyzer on Eclipse and it said that the memory
> > > leak
> > > > > > suspect is QueuedThreadPool.  I found this information about a
> memory
> > > > > > leak bug:
> >
> > > > > >http://jira.codehaus.org/browse/JETTY-1188
> >
> > > > > > How can I figure out what release of jetty is running locally?
>  It
> > > > > > looks like they fixed this in version 6.1.23:
> >
> > >http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=11160&vers.
> ..
> >
> > > > > > Has anyone else had this issue?
> >
> > > > > > Thanks,
> > 

[appengine-java] Error on closing PersistenceManager

2010-07-06 Thread Chuck
With a fresh checkout of the Google plugins for Eclipse, my
development server (Mac Snow Leopard) is reporting:

Somehow org.datanucleus.sco.UnsetOwners.storeIntField() was called,
which should have been impossible

Anybody have any idea what this might be?

It occurs when I close the active PersistenceManager:
Home.java line 92:  pm.close();

--
Caused by:

javax.jdo.JDOFatalInternalException: Somehow
org.datanucleus.sco.UnsetOwners.storeIntField() was called, which
should have been impossible
at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:
414)
at
org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
281)
at org.practicezone.Home.doGet(Home.java:92)
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:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
NestedThrowablesStackTrace:
Somehow org.datanucleus.sco.UnsetOwners.storeIntField() was called,
which should have been impossible
org.datanucleus.exceptions.NucleusException: Somehow
org.datanucleus.sco.UnsetOwners.storeIntField() was called, which
should have been impossible
at
org.datanucleus.store.fieldmanager.AbstractFieldManager.storeIntField(AbstractFieldManager.java:
83)
at
org.datanucleus.state.AbstractStateManager.providedIntField(AbstractStateManager.java:
981)
at org.practicezone.User.jdoProvideField(User.java)
at org.practicezone.User.jdoProvideFields(User.java)
at
org.datanucleus.state.JDOStateManagerImpl.provideFields(JDOStateManagerImpl.java:
2715)
at
org.datanucleus.state.JDOStateManagerImpl.unsetOwnerInSCOFields(JDOStateManagerImpl.java:
4668)
at
org.datanucleus.state.JDOStateManagerImpl.disconnect(JDOStateManagerImpl.java:
4693)
at
org.datanucleus.ObjectManagerImpl.disconnectSMCache(ObjectManagerImpl.java:
850)
at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:
818)
at
org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
271)
at org.practicezone.Home.doGet(Home.java:92)
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:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting

[appengine-java] Enabling SSL for a Servlet

2010-07-06 Thread Paul Toth
I would like to enable SSL for a servlet residing on the App Engine.

So, instead of accessing it like so

http://mystuff.appspot.com

it is accessed like so

https://mystuff.appspot.com

All of the information I've been able to find so far focuses on
administrative functions rather than deployment of an SSL-enabled
entity.

Any assistance would be greatly appreciated.

Thanks

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



[appengine-java] many-to-many relationships using JDO - Performance issue

2010-07-06 Thread Jeb
Hi,
   While modelling unowned many-to-many relationship as mentioned in
http://code.google.com/appengine/docs/java/datastore/relationships.html

adding or removing a relationship requires loading of all keys of the
other object.

public void addFavoriteFood(Food food) {
favoriteFoods.add(food.getKey());
food.getFoodFans().add(getKey()); ///loads all the foodFans in the
Food object
}

public void removeFavoriteFood(Food food) {
favoriteFoods.remove(food.getKey());
food.getFoodFans().remove(getKey()); ///loads all the foodFans in
the Food object
}


Is there a way to avoid 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] 500 Server Error

2010-07-06 Thread kizito
Hello someone, I am totally new in this forum. I developed application
in Google App Engine using java. today I deployed it, but it failed to
display me data from the datastore.
First i have midlet running on my phone that should send data to the
datastore through the servlet of course. this seems not to be working.
when i tried to retrieve records I get "The server encountered an
error and could not complete your request".

on the log on the dashboard there is NullpoiterException.

I would appreciate your helps as we build together,

Thanks in advace

I am in uganda

kizito

-- 
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] Facing errors when installing the google plugin for eclipse.

2010-07-06 Thread Siddharth Naik
Hi,

I face an error regarding 'String index out of range 0'. I am using
Eclipse Galileo and jdk 1.6.0_03 32 bit.

Thanks.

Below is the complete error log.
--

!SESSION 2010-07-04 19:47:36.550
---
eclipse.buildId=M20100211-1343
java.version=1.6.0_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  XX:MaxPermSize=256M
Command-line arguments:  -os win32 -ws win32 -arch x86
XX:MaxPermSize=256M

!ENTRY org.eclipse.ecf.provider.filetransfer 4 1001 2010-07-04
19:58:46.294
!MESSAGE Transfer Exception
!STACK 0
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at
org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:
170)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at
org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:
108)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at
org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:
127)
at
org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer
$1.performFileTransfer(AbstractRetrieveFileTransfer.java:140)
at
org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:
73)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.equinox.p2.engine 4 4 2010-07-04 20:04:00.360
!MESSAGE An error occurred while installing the items
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2010-07-04 20:04:00.360
!MESSAGE session context was:(profile=SDKProfile,
phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install,
operand=null --> [R]com.google.appengine.eclipse.core
1.3.3.v201006111302,
action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2010-07-04 20:04:00.360
!MESSAGE String index out of range: 0
!STACK 0
java.lang.StringIndexOutOfBoundsException: String index out of range:
0
at java.lang.String.charAt(String.java:687)
at
org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils.getValueForArgument(ParserUtils.java:
124)
at
org.eclipse.equinox.internal.frameworkadmin.equinox.EclipseLauncherParser.getStartup(EclipseLauncherParser.java:
224)
at
org.eclipse.equinox.internal.frameworkadmin.equinox.EclipseLauncherParser.read(EclipseLauncherParser.java:
59)
at
org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.loadWithoutFwPersistentData(EquinoxManipulatorImpl.java:
358)
at
org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.load(EquinoxManipulatorImpl.java:
331)
at
org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.loadDelegate(LazyManipulator.java:
50)
at
org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.getConfigData(LazyManipulator.java:
108)
at
org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.installBundle(InstallBundleAction.java:
76)
at
org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.execute(InstallBundleAction.java:
29)
at
org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction.execute(ParameterizedProvisioningAction.java:
35)
at
org.eclipse.equinox.internal.provisional.p2.engine.Phase.mainPerform(Phase.java:
129)
at
org.eclipse.equinox.internal.provisional.p2.engine.Phase.perform(Phase.java:
72)
at
org.eclipse.equinox.internal.provisional.p2.engine.PhaseSet.perform(PhaseSet.java:
44)
at
org.eclipse.equinox.internal.provisional.p2.engine.Engine.perform(Engine.java:
54)
at
org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.performProvisioningPlan(ProvisioningUtil.java:
389)
at
org.eclipse.equinox.internal.provisional.p2.ui.operations.ProfileModificationOperation.doExecute(ProfileModificationOperation.java:
61)
at
org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningOperation.execute(ProvisioningOperation.java:
37)
at
org.eclipse.equinox.internal.provisional.p2.ui.ProvisioningOperationRunner
$1.run(ProvisioningOperationRunner.java:94)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.equinox.p2.engine 4 4 2010-07-04 20:05:03.509
!MESSAGE An error occurred while installing the items
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2010-07-04 20:05:03.509
!M

[appengine-java] Confused by jdo relationships

2010-07-06 Thread AC
I just started fooling around w/ GAE this weekend.

I have a Categories class and a CategoryGroup class.  The idea is that
every category must be grouped.  For example the CategoryGroup
"Entertainment" can be assigned to many Categories, such as "movies",
"music" and "television".

Here are my classes.

@PersistenceCapable
public class Categories
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key Id;

@Persistent
private CategoryGroups Group;

@Persistent
private boolean IsDeleted;

@Persistent
private String Name;

@Persistent
private Date CreateDate;

@Persistent
@Column(allowsNull="true")
private Date ModifiedDate;
}

@PersistenceCapable
public class CategoryGroups
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key Id;

@Persistent
boolean IsDeleted;

@Persistent
String Name;

@Persistent
Date CreateDate;

@Persistent
@Column(allowsNull="true")
Date ModifiedDate;
}

First I add a record to CategoryGroups.  When I query all, the reult
is :

CategoryGroups(2)

Next, I add a record to Categories.  When I query all CategoryGroups,
the result is :

Categories(3)/CategoryGroups(4)
CategoryGroups(2)

I do not doubt that this works as it was designed to, however, coming
from a RDBMS background, this is very confusing to me.  The screen I
created to manage Categories now has "Entertainment" listed twice in
the CategoryGroups select box.  Is there a better approach to achieve
my goal?

Any advice is much appreciated.

-- 
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] JDO queries do not support inheritance?

2010-07-06 Thread MG
Hello!

I have a @PersistenceCapable _abstract_ class ParentEntity, and a
PersistenceCapable derived class ChildEntity. The Parent class has a
field "s_name".

I created and saved a ChildEntity with s_name "foo".

When I do

query = pm.newQuery( ParentEntity.class );
query.setFilter( "s_name == s" );
query.declareParameters("String s");

@SuppressWarnings("unchecked")
List results =
(List) query.execute("foo");

I receive an empty list. When I do

query = pm.newQuery( ChildEntity.class );
query.setFilter( "s_name == s" );
query.declareParameters("String s");

@SuppressWarnings("unchecked")
List results =
(List) query.execute("foo");

I get a list with my entity.

Question: is this "by design"? Is there a way to query for
ParentEntities and receive all entities (potentially of different
kinds) of derived classes that match the filter? If not, then what is
the use case of the currently supported flavor of inheritance
(complete-table/subclass-table)?

Thanks,
MG

-- 
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] Desarrollo de Aplicaciones con Eclipse

2010-07-06 Thread Edixon Polanco
Buenas Tardes.

Como puedo empezar a desarrollar una aplicación que funcione como una
biblioteca en la cual pueda subir mis archivos o libros y poder buscar
dentro de ellos

Nota: Espero me puedan dar alguna idea

Gracias.

-- 
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] can't figure out how to use JSTL to escape xml (guestbook tutorial)

2010-07-06 Thread decitrig
In the tutorial, I've added the following to the guestbook.jsp file:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>

and made changed this:

<%= g.getAuthor().getNickname() %> wrote:
<%
}
%>

<%
}
}
pm.close();
%>

I get no output from the c:out tag. I've tried a bunch of different
variations and nothing seems to work: I can get a medley of my
favorite exceptions, or no output, or the the literal text of the
expression I was hoping to evaluate. I have searched around, and I can
confirm the following:

I have isELIgnored="false", I do not have any JSLT jar in my WEB-INF/
lib directory. I also tried a  tag, but I got an error about the value
for the "class" attribute being invalid. Please help? I'm happy to
provide additional code or debugging output, if someone can point me
in the right direction.

PS. Might I respectfully submit that this would be a good thing to
include in the tutorial?

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



Re: [appengine-java] Confused by jdo relationships

2010-07-06 Thread Ravi Sharma
You need to understand the concept of Entity group here, and need to
understand the owned relation and unowned relation.
Think of owned and unowned relation like this
You(your house) and your TV has owned relationship, your house has TV, no ne
can see it from outside, and if your friend want the same tv he need to buy
the same TV and own it. And at one point if you ask who all watching my TV
then it will be just you not your friend as he has his own TV(although same
kind of TV).

But You and your favourite movie theatre has unowned relationship, you dont
own it, anyone who knows the address of theatre can go and watch movie. and
at one moment 1000s of people might be watching the same movie/theatre


Back to your question.

Categories(3)/CategoryGroups(4) is an example for owned relation.
CategoryGroup(4) will be available to Category(3) only and if you create
another category Cateory(10) with same category group it will just create
another version of categoryGroup CategoryGroup(11) in that category. But you
may see that CategoryGroup 11 and CategoryGroup 4 both are Entertainment.

In your case many categories can have same categoryGroup.So instead of using
owned relationship, you should use unowned relationship.

Instead of this
@Persistent
   private CategoryGroups Group;

define this
@Persistent
   private Key categoryGroupId;

and save key of CategoryGroup rather then full object. (Dont buy a TV for
every other rmovie you want to watch, just buy a movie theatre ticket go
there and use that :) )

I hope u get the idea,  you can learn more from here

http://code.google.com/appengine/docs/java/datastore/relationships.html

spare me if you dont like my example... :)


Ravi.



On Tue, Jul 6, 2010 at 5:47 PM, AC  wrote:

> I just started fooling around w/ GAE this weekend.
>
> I have a Categories class and a CategoryGroup class.  The idea is that
> every category must be grouped.  For example the CategoryGroup
> "Entertainment" can be assigned to many Categories, such as "movies",
> "music" and "television".
>
> Here are my classes.
>
> @PersistenceCapable
> public class Categories
> {
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key Id;
>
>@Persistent
>private CategoryGroups Group;
>
>@Persistent
>private boolean IsDeleted;
>
>@Persistent
>private String Name;
>
>@Persistent
>private Date CreateDate;
>
>@Persistent
>@Column(allowsNull="true")
>private Date ModifiedDate;
> }
>
> @PersistenceCapable
> public class CategoryGroups
> {
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key Id;
>
>@Persistent
>boolean IsDeleted;
>
>@Persistent
>String Name;
>
>@Persistent
>Date CreateDate;
>
>@Persistent
>@Column(allowsNull="true")
>Date ModifiedDate;
> }
>
> First I add a record to CategoryGroups.  When I query all, the reult
> is :
>
> CategoryGroups(2)
>
> Next, I add a record to Categories.  When I query all CategoryGroups,
> the result is :
>
> Categories(3)/CategoryGroups(4)
> CategoryGroups(2)
>
> I do not doubt that this works as it was designed to, however, coming
> from a RDBMS background, this is very confusing to me.  The screen I
> created to manage Categories now has "Entertainment" listed twice in
> the CategoryGroups select box.  Is there a better approach to achieve
> my goal?
>
> Any advice is much appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] Re: Upload to Blob Storage from Silverlight 4

2010-07-06 Thread Mark
Hi,

It'd be great if you can share what you did,

Thanks

On May 25, 3:03 pm, Patrick Brown  wrote:
> Hi
>
>    I found a solution to this issue, if there is any interest out
> there I can write something up on what I did.
>
> Thanks,
> Patrick
>
> On May 19, 4:36 pm, Patrick Brown  wrote:
>
>
>
> > Hi
>
> >    I just noticed something interesting - on the dev server if I can
> > see my __BlobUploadSessions__ created prior to forwarding my call on
> > to have the blobs created, if I skip that forward the sessions stay as
> > I would expect, if I do the same on the AppEngine I don't see the
> > __BlobUploadSessions__, it appears that they are not being created
> > successfully and that is maybe what is "Not found"
>
> > Thank you,
> > Patrick
>
> > On May 19, 3:58 pm, Patrick Brown  wrote:
>
> > > Hi
>
> > >    Sorry to reply to my own message but I am a bit stuck for now, has
> > > anyone done anything similar or have any pointers on where I should
> > > research?
>
> > > Thanks,
> > > Patrick
>
> > > On May 17, 2:13 pm, Patrick Brown  wrote:
>
> > > > Hello
>
> > > >    I have a silverlight application hosted in my Index.html page that
> > > > I am able to upload blobs through to the DevAppServer.  Last week I
> > > > enabled billing in my application, when I attempt in production I
> > > > receive a "Not Found" exception after post but prior to my success
> > > > handler being called.  To make this work I am creating a multipart
> > > > form in silverlight and posting to an "attach" servlet ( shown here ),
> > > > I see all the log messages but my upload handler is not hit running
> > > > under the AppEngine.  Any ideas where I am going wrong or is there a
> > > > better approach?
>
> > > >   I should say, I am very new to all of the technologies I am using
> > > > here so I am sorry if my description is a bit rough.
>
> > > > Thank you for your time and ideas.
> > > > Patrick
>
> > > > public void doPost(HttpServletRequest req, HttpServletResponse resp)
> > > > throws IOException
> > > > {
> > > >   log.info("Post attachment started");
> > > >   BlobstoreService blobstoreService =
> > > > BlobstoreServiceFactory.getBlobstoreService();
> > > >   String uploadUrl = blobstoreService.createUploadUrl("/upload");
>
> > > >   log.info("Upload URL created");
> > > >   RequestDispatcher dispatcher =
> > > > req.getRequestDispatcher(uploadUrl);
> > > >   log.info(String.format("dispatcher for %s retrieved", uploadUrl));
>
> > > >   try {
> > > >      log.info("forwarding");
> > > >      dispatcher.forward(req, resp);
> > > >      log.info("forwarded");
> > > >   } catch (ServletException e) {
> > > >      e.printStackTrace();
> > > >      log.info(e.getMessage());
> > > >   }
>
> > > > }
>
> > > > --
> > > > 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 
> > > > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to 
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > google-appengine-java+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/google-appengine-java?hl=en.-Hidequoted 
> > > text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en.-Hide quoted 
> > text -
>
> > - Show quoted text -

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



[appengine-java] Re: Help! Datastore Viewer Server Error

2010-07-06 Thread Tapir
More info: I made a mass (in fact, not very mass) importing date for a
dev site before the problem occured.

On 7月6日, 上午7时57分, Tapir  wrote:
> Server Error
> A server error has occurred.
> Return to Applications screen >>
>
> For 3 days, I feel helpless. I really can't understand where is wrong.

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



[appengine-java] Re: Help! Datastore Viewer Server Error

2010-07-06 Thread Tapir
More info: I made a mass (in fact, not very mass) data importing from
the
dev site before the problem occured.

On 7月6日, 上午7时57分, Tapir  wrote:
> Server Error
> A server error has occurred.
> Return to Applications screen >>
>
> For 3 days, I feel helpless. I really can't understand where is wrong.

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



[appengine-java] Re: Help! Datastore Viewer Server Error

2010-07-06 Thread Tapir
Any google guys here?

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



[appengine-java] Re: Help! Datastore Viewer Server Error

2010-07-06 Thread Tapir
After some checking, I cautiously suspect there are some bugs in the
PersistenceManager.makePersistentAll function.

-- 
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] Are the two equivalent?

2010-07-06 Thread Tapir
Based on the example in the "Creating Entities With Entity Groups"
section of 
http://code.google.com/appengine/docs/java/datastore/transactions.html#Using_Transactions

1.

KeyFactory.Builder keyBuilder = new
KeyFactory.Builder(Customer.class.getSimpleName(), "custid985135");
Key parentKey = keyBuilder.getKey();
keyBuilder.addChild(AccountInfo.class.getSimpleName(),
"acctidX142516");
Key key = keyBuilder.getKey();

Customer cust = new Customer ();
cust.setKey(parentKey);

AccountInfo acct = new AccountInfo();
acct.setKey(key);
pm.makePersistentAll(cust, acct);

2

Key parentKey = KeyFactory.createKey
(Customer.class.getSimpleName(), "custid985135");
Key key = KeyFactory.createKey (parentKey,
AccountInfo.class.getSimpleName(), "acctidX142516");

Customer cust = new Customer ();
cust.setKey(parentKey);

AccountInfo acct = new AccountInfo();
acct.setKey(key);
pm.makePersistentAll(cust, acct);

-- 
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: Are the two equivalent?

2010-07-06 Thread Tapir
I uses the 2nd method in a transaction in my app.
When creating the 2 entities, there is no problems.
But when I updating the 2 entities, error ocuurs and the log saids:
"java.lang.IllegalArgumentException: can't operate on multiple entity
groups in a single transaction. "

-- 
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: Are the two equivalent?

2010-07-06 Thread Tapir
I use the 2nd method in a transaction in my app.
When creating the 2 entities, there is no problems.
But when I updating the 2 entities, error ocuurs and the log saids:
"java.lang.IllegalArgumentException: can't operate on multiple entity
groups in a single transaction. "

On Jul 7, 6:42 am, Tapir  wrote:
> Based on the example in the "Creating Entities With Entity Groups"
> section 
> ofhttp://code.google.com/appengine/docs/java/datastore/transactions.htm...
>
> 1.
>
>         KeyFactory.Builder keyBuilder = new
> KeyFactory.Builder(Customer.class.getSimpleName(), "custid985135");
>         Key parentKey = keyBuilder.getKey();
>         keyBuilder.addChild(AccountInfo.class.getSimpleName(),
> "acctidX142516");
>         Key key = keyBuilder.getKey();
>
>         Customer cust = new Customer ();
>         cust.setKey(parentKey);
>
>         AccountInfo acct = new AccountInfo();
>         acct.setKey(key);
>         pm.makePersistentAll(cust, acct);
>
> 2
>
>         Key parentKey = KeyFactory.createKey
> (Customer.class.getSimpleName(), "custid985135");
>         Key key = KeyFactory.createKey (parentKey,
> AccountInfo.class.getSimpleName(), "acctidX142516");
>
>         Customer cust = new Customer ();
>         cust.setKey(parentKey);
>
>         AccountInfo acct = new AccountInfo();
>         acct.setKey(key);
>         pm.makePersistentAll(cust, acct);

-- 
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: Are the two equivalent?

2010-07-06 Thread Tapir
Ok, I found a bug in my code. This bug can explain some strange things
in my app.
But, on the other hand, the reason of the bug was not found in time is
because the
makePersistentAll function is not prevent some entities in different
entity groups
are stored in a transaction.

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



[appengine-java] Re: Help! Datastore Viewer Server Error

2010-07-06 Thread Tapir
see the last comment in:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/e1bcdd31021126d7?hl=en#

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



[appengine-java] Re: Confused by jdo relationships

2010-07-06 Thread AC
Thanks.  That answers my question.

On Jul 6, 3:18 pm, Ravi Sharma  wrote:
> You need to understand the concept of Entity group here, and need to
> understand the owned relation and unowned relation.
> Think of owned and unowned relation like this
> You(your house) and your TV has owned relationship, your house has TV, no ne
> can see it from outside, and if your friend want the same tv he need to buy
> the same TV and own it. And at one point if you ask who all watching my TV
> then it will be just you not your friend as he has his own TV(although same
> kind of TV).
>
> But You and your favourite movie theatre has unowned relationship, you dont
> own it, anyone who knows the address of theatre can go and watch movie. and
> at one moment 1000s of people might be watching the same movie/theatre
>
> Back to your question.
>
> Categories(3)/CategoryGroups(4)     is an example for owned relation.
> CategoryGroup(4) will be available to Category(3) only and if you create
> another category Cateory(10) with same category group it will just create
> another version of categoryGroup CategoryGroup(11) in that category. But you
> may see that CategoryGroup 11 and CategoryGroup 4 both are Entertainment.
>
> In your case many categories can have same categoryGroup.So instead of using
> owned relationship, you should use unowned relationship.
>
> Instead of this
> @Persistent
>    private CategoryGroups Group;
>
> define this
> @Persistent
>    private Key categoryGroupId;
>
> and save key of CategoryGroup rather then full object. (Dont buy a TV for
> every other rmovie you want to watch, just buy a movie theatre ticket go
> there and use that :) )
>
> I hope u get the idea,  you can learn more from here
>
> http://code.google.com/appengine/docs/java/datastore/relationships.html
>
> spare me if you dont like my example... :)
>
> Ravi.
>
> On Tue, Jul 6, 2010 at 5:47 PM, AC  wrote:
> > I just started fooling around w/ GAE this weekend.
>
> > I have a Categories class and a CategoryGroup class.  The idea is that
> > every category must be grouped.  For example the CategoryGroup
> > "Entertainment" can be assigned to many Categories, such as "movies",
> > "music" and "television".
>
> > Here are my classes.
>
> > @PersistenceCapable
> > public class Categories
> > {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >        private Key Id;
>
> >   �...@persistent
> >    private CategoryGroups Group;
>
> >       �...@persistent
> >        private boolean IsDeleted;
>
> >       �...@persistent
> >        private String Name;
>
> >       �...@persistent
> >        private Date CreateDate;
>
> >       �...@persistent
> >       �...@column(allowsNull="true")
> >    private Date ModifiedDate;
> > }
>
> > @PersistenceCapable
> > public class CategoryGroups
> > {
> >       �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >        private Key Id;
>
> >       �...@persistent
> >    boolean IsDeleted;
>
> >       �...@persistent
> >    String Name;
>
> >       �...@persistent
> >    Date CreateDate;
>
> >       �...@persistent
> >       �...@column(allowsNull="true")
> >    Date ModifiedDate;
> > }
>
> > First I add a record to CategoryGroups.  When I query all, the reult
> > is :
>
> > CategoryGroups(2)
>
> > Next, I add a record to Categories.  When I query all CategoryGroups,
> > the result is :
>
> > Categories(3)/CategoryGroups(4)
> > CategoryGroups(2)
>
> > I do not doubt that this works as it was designed to, however, coming
> > from a RDBMS background, this is very confusing to me.  The screen I
> > created to manage Categories now has "Entertainment" listed twice in
> > the CategoryGroups select box.  Is there a better approach to achieve
> > my goal?
>
> > Any advice is much appreciated.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

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



[appengine-java] JDO Collection of Serializables

2010-07-06 Thread laserjim
Hello,

I'm still trying to persist a list of serializable objects. I would
expect this to be a standard collection as described here:
http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Collections

FooObject is serializable, but my attempt gave me an exception:
FooObject is not a supported property type.

Everything works as expected if I replace my serializable class
(FooObject) with String.

How can I persist my list of FooObjects using JDO?

Thanks!

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



[appengine-java] why " java.lang.IllegalArgumentException: can't operate on multiple entity groups in a single transaction" is not throwed

2010-07-06 Thread Tapir
Please see the following code, the IllegalArgumentException should be
throwed but not.

// before calling this function, all File entities have already been
created.
public void ImportData (DataInputStream dis) throws Exception {

// this is bug! This line should be put in the for loop. see 
below.
List entityList = new ArrayList (8);

int numFiles = dis.readShort (); // about 20
for (int i = 0; i < numFiles; ++ i) {
Transaction tx = pm.currentTransaction();
try {
tx.begin();

// the beginning line should be here
//List entityList = new ArrayList ();

String filename = dis.readUTF ();
// ... more fields

Key fileKey = KeyFactory.createKey

(FileInfo.class.getSimpleName(), filename);
FileInfo fileInfo = 
pm.getObjectById(FileInfo.class, fileKey);
fileInfo.setFilename(filename);
// ... more fields

entityList.add (fileInfo);

int numRevisions = dis.readInt (); // about 5
for (int j = 0; j < numRevisions; ++ j) {
int revisionId = dis.readShort ();
// ... more fields

Key revisionKey = KeyFactory.createKey
(fileKey, 
revisionId);
FileRevision fileRevision = new 
FileRevision();
fileRevision.setId(revisionKey);
fileRevision.setRevisionId(revisionId);
// ... more fields

entityList.add (fileRevision);
}

// because the bug mentioned above, 
entityList.size ()
// will increase to about 100 in the end.
// The strange thing is the following calling 
will never
// throw Exceptions, although apparently
// there are many entity groups in the 
entityList.

pm.makePersistentAll (entityList);

// using makePersistent instead of 
makePersistentAll
// will also never throw Exceptions.

//for (Object entity : entityList) {
//  pm.makePersistent (entity);
//}

tx.commit ();
} catch (Exception e) {
e.printStackTrace();

if (tx.isActive()) {
tx.rollback();
}

throw e;
}
}
}

-- 
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] why " java.lang.IllegalArgumentExce p­tion: can't operate on multiple entity groups in a single transaction" is not throwed

2010-07-06 Thread Tapir
Please see the following code, the IllegalArgumentException should be
throwed but not.

// before calling this function, all File entities
// have already been created.
public void ImportData (DataInputStream dis) throws Exception {

// this is bug! This line should be put in the for loop.
// see below.
List entityList = new ArrayList ();

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

int numFiles = dis.readShort (); // about 20
for (int i = 0; i < numFiles; ++ i) {
Transaction tx = pm.currentTransaction();
try {
tx.begin();

// the beginning line should be here
//List entityList = new ArrayList ();

String filename = dis.readUTF ();
// ... more fields

Key fileKey = KeyFactory.createKey

(FileInfo.class.getSimpleName(), filename);
FileInfo fileInfo = 
pm.getObjectById(FileInfo.class, fileKey);
fileInfo.setFilename(filename);
// ... more fields

entityList.add (fileInfo);

int numRevisions = dis.readInt (); // about 5
for (int j = 0; j < numRevisions; ++ j) {
int revisionId = dis.readShort ();
// ... more fields

Key revisionKey = KeyFactory.createKey
(fileKey, 
revisionId);
FileRevision fileRevision = new 
FileRevision();
fileRevision.setId(revisionKey);
fileRevision.setRevisionId(revisionId);
// ... more fields

entityList.add (fileRevision);
}

// because the bug mentioned above, 
entityList.size ()
// will increase to about 100 in the end.
// The strange thing is the following calling 
will never
// throw Exceptions, although apparently
// there are many entity groups in the 
entityList.

pm.makePersistentAll (entityList);

// using makePersistent instead of 
makePersistentAll
// will also never throw Exceptions.

//for (Object entity : entityList) {
//  pm.makePersistent (entity);
//}

tx.commit ();
} catch (Exception e) {
e.printStackTrace();

if (tx.isActive()) {
tx.rollback();
}

throw e;
} fanally {
pm.close ();
}
}
}

-- 
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] why " java.lang.IllegalArgumentExce p­­tion: can't operate on multiple entity groups in a sing le transaction" is not throwed

2010-07-06 Thread Tapir
Please see the following code, the IllegalArgumentException should be
throwed but not.

// before calling this function, all File entities
// have already been created.
public void ImportData (DataInputStream dis) throws Exception {

// this is bug! This line should be put in the for loop.
// see below.
List entityList = new ArrayList ();

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

int numFiles = dis.readShort (); // about 20
for (int i = 0; i < numFiles; ++ i) {
Transaction tx = pm.currentTransaction();
try {
tx.begin();

// the beginning line should be here
//List entityList = new ArrayList ();

String filename = dis.readUTF ();
// ... more fields

Key fileKey = KeyFactory.createKey

(FileInfo.class.getSimpleName(), filename);
FileInfo fileInfo = 
pm.getObjectById(FileInfo.class, fileKey);
fileInfo.setFilename(filename);
// ... more fields

entityList.add (fileInfo);

int numRevisions = dis.readInt (); // about 5
for (int j = 0; j < numRevisions; ++ j) {
int revisionId = dis.readShort ();
// ... more fields

Key revisionKey = KeyFactory.createKey 
(fileKey,

FileRevision.class.getSimpleName(), revisionId);
FileRevision fileRevision = new 
FileRevision();
fileRevision.setId(revisionKey);
fileRevision.setRevisionId(revisionId);
// ... more fields

entityList.add (fileRevision);
}

// because the bug mentioned above, 
entityList.size ()
// will increase to about 100 in the end.
// The strange thing is the following calling 
will never
// throw Exceptions, although apparently
// there are many entity groups in the 
entityList.

pm.makePersistentAll (entityList);

// using makePersistent instead of 
makePersistentAll
// will also never throw Exceptions.

//for (Object entity : entityList) {
//  pm.makePersistent (entity);
//}

tx.commit ();
} catch (Exception e) {
e.printStackTrace();

if (tx.isActive()) {
tx.rollback();
}

throw e;
} fanally {
pm.close ();
}
}
}

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



Re: [appengine-java] why " java.lang.IllegalArgument Excep­­tion: can't operate on multiple entity groups in a single transaction" is not throwed

2010-07-06 Thread John Patterson

Local dev server does not implement transactions

On 7 Jul 2010, at 09:21, Tapir wrote:


Please see the following code, the IllegalArgumentException should be
throwed but not.

// before calling this function, all File entities
// have already been created.
public void ImportData (DataInputStream dis) throws Exception {

// this is bug! This line should be put in the for loop.
// see below.
List entityList = new ArrayList ();

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

int numFiles = dis.readShort (); // about 20
for (int i = 0; i < numFiles; ++ i) {
Transaction tx = pm.currentTransaction();
try {
tx.begin();

// the beginning line should be here
//List entityList = new ArrayList ();

String filename = dis.readUTF ();
// ... more fields

Key fileKey = KeyFactory.createKey

(FileInfo.class.getSimpleName(), filename);
FileInfo fileInfo = 
pm.getObjectById(FileInfo.class, fileKey);
fileInfo.setFilename(filename);
// ... more fields

entityList.add (fileInfo);

int numRevisions = dis.readInt (); // about 5
for (int j = 0; j < numRevisions; ++ j) {
int revisionId = dis.readShort ();
// ... more fields

Key revisionKey = KeyFactory.createKey 
(fileKey,

FileRevision.class.getSimpleName(), revisionId);
FileRevision fileRevision = new 
FileRevision();
fileRevision.setId(revisionKey);
fileRevision.setRevisionId(revisionId);
// ... more fields

entityList.add (fileRevision);
}

// because the bug mentioned above, 
entityList.size ()
// will increase to about 100 in the end.
// The strange thing is the following calling 
will never
// throw Exceptions, although apparently
// there are many entity groups in the 
entityList.

pm.makePersistentAll (entityList);

// using makePersistent instead of 
makePersistentAll
// will also never throw Exceptions.

//for (Object entity : entityList) {
//  pm.makePersistent (entity);
//}

tx.commit ();
} catch (Exception e) {
e.printStackTrace();

if (tx.isActive()) {
tx.rollback();
}

throw e;
} fanally {
pm.close ();
}
}
}

--  
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-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: why " java.lang.IllegalArgument Excep­­tion: can't operate on multiple entity groups in a single transaction" is not throwed

2010-07-06 Thread Tapir
Also apply on appspot.

On Jul 7, 10:22 am, John Patterson  wrote:
> Local dev server does not implement transactions
>
> On 7 Jul 2010, at 09:21, Tapir wrote:
>
>
>
> > Please see the following code, the IllegalArgumentException should be
> > throwed but not.
>
> >    // before calling this function, all File entities
> >    // have already been created.
> >    public void ImportData (DataInputStream dis) throws Exception {
>
> >            // this is bug! This line should be put in the for loop.
> >            // see below.
> >            List entityList = new ArrayList ();
>
> >            PersistenceManager pm = pmf.get().getPersistenceManager();
>
> >            int numFiles = dis.readShort (); // about 20
> >            for (int i = 0; i < numFiles; ++ i) {
> >                    Transaction tx = pm.currentTransaction();
> >                    try {
> >                            tx.begin();
>
> >                            // the beginning line should be here
> >                            //List entityList = new ArrayList ();
>
> >                            String filename = dis.readUTF ();
> >                            // ... more fields
>
> >                            Key fileKey = KeyFactory.createKey
> >                                            (FileInfo.class.getSimpleName(), 
> > filename);
> >                            FileInfo fileInfo = 
> > pm.getObjectById(FileInfo.class, fileKey);
> >                            fileInfo.setFilename(filename);
> >                            // ... more fields
>
> >                            entityList.add (fileInfo);
>
> >                            int numRevisions = dis.readInt (); // about 5
> >                            for (int j = 0; j < numRevisions; ++ j) {
> >                                    int revisionId = dis.readShort ();
> >                                    // ... more fields
>
> >                                    Key revisionKey = KeyFactory.createKey 
> > (fileKey,
> >                                            
> > FileRevision.class.getSimpleName(), revisionId);
> >                                    FileRevision fileRevision = new 
> > FileRevision();
> >                                    fileRevision.setId(revisionKey);
> >                                    fileRevision.setRevisionId(revisionId);
> >                                    // ... more fields
>
> >                                    entityList.add (fileRevision);
> >                            }
>
> >                            // because the bug mentioned above, 
> > entityList.size ()
> >                            // will increase to about 100 in the end.
> >                            // The strange thing is the following calling 
> > will never
> >                            // throw Exceptions, although apparently
> >                            // there are many entity groups in the 
> > entityList.
>
> >                            pm.makePersistentAll (entityList);
>
> >                            // using makePersistent instead of 
> > makePersistentAll
> >                            // will also never throw Exceptions.
>
> >                            //for (Object entity : entityList) {
> >                            //      pm.makePersistent (entity);
> >                            //}
>
> >                            tx.commit ();
> >                    } catch (Exception e) {
> >                            e.printStackTrace();
>
> >                            if (tx.isActive()) {
> >                                    tx.rollback();
> >                            }
>
> >                            throw e;
> >                    } fanally {
> >                            pm.close ();
> >                    }
> >            }
> >    }
>
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com
> > .
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en
> > .- Hide quoted text -
>
> - Show quoted text -

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



[appengine-java] Re: image service is changing some white backgrounds to black

2010-07-06 Thread JakeP
Thanks Ronmell!

-jake



On Jul 6, 11:03 am, Ronmell Fuentes  wrote:
> Hi JakeP
> as far as I know, when you have an PNG image this allows you to write
> metadata in order to make the background transparent, but in JPEG/JPG files
> this cannot be done. So all I can see is that the app is working properly
> but when an image in JPG/JPEG is showed, the viewer doesn't know how to
> interpret the background-metadata so, the easiest thing to do is show it in
> black colour.
>
> Rgds.
>
> Ronmell
>
> 2010/7/6 JakeP 
>
>
>
>
>
>
>
> > I have an app that does two image transforms - it reduces the size of
> > images from rss feeds and spits out jpeg format images that are stored
> > in the datastore. It also stores the original size images that it
> > stores in jpeg format.
>
> > image1:  original image => resize => "I'm Feeling Lucky" => jpeg
>
> > image2: original image  => "I'm Feeling Lucky" => jpeg
>
> > When I look at the reduced size image in a browser, sometimes, the
> > image's white background is changed to black.  Known issue or Bug?
>
> > orig:
>
> >http://salonnewsapp.appspot.com/server?imagekey=da866db2b26c03e8e7866...
>
> > reduced size:
>
> >http://salonnewsapp.appspot.com/server?imagekey=da866db2b26c03e8e7866...
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> ausencia de evidencia  ≠  evidencia de 
> ausenciahttp://culturainteractiva.blogspot.com/

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