[appengine-java] Re: Testing data migration using JDO and DataNucleus

2011-03-03 Thread lp
are u sure u wont to proceed with that plan of changing out enhanced
JDO classes?
just sounds to complicated.

-lp



On Mar 3, 5:21 am, Jason G  wrote:
> Hello everyone!
>
> We've run into a data migration-test problem, and I'm wondering if
> anyone would have any advice on how to proceed...
>
> We're building a system that needs to allow hot-swapping of
> application builds while customers are actively using our webapp, and
> that means we need to support data object "schema" migration in-
> place.  We do this by implementing LoadCallback for version migration,
> and @Deprecated-ing no-longer-used fields.  So far, so good.
>
> Thing is, we'd like to build up a test suite that allows developers to
> write unit tests for data migration against a local environment. That
> means no uploading to GAE, but using
> com.google.appengine.tools.development.testing.LocalServiceTestHelper
> instead.
>
> We have two "classes" directories: Both containing DataNucleus-JDO-
> enhanced .class files, one of the "old" schema, and one of the
> current.
>
> We have a MigrationTestHelper that creates a GroovyClassLoader with
> the old schema set as its classpath.  The targetted class under test
> is found, instantiated, and passed to a test-supplied Closure that
> initializes the object with the old data to be migrated.  The Helper
> calls PersistenceManager.makePersistent and returns
> pm.getObjectId(newlyPersisted).getKey().
>
> The second half of the test involves creating a new GroovyClassLoader
> and setting the context class loader:
> Thread.currentThread().setContextClassLoader(loader).  Then we use a
> different PersistenceManager (from a different
> PersistenceManagerFactory) to load the object by its Key.
>
> What happens is we get a ClassCastException:
> java.lang.ClassCastException: java.lang.Long cannot be cast to
> java.util.List
>         at com.x.model.User.jdoReplaceField(User.groovy)
>         at com.x.model.User.jdoReplaceFields(User.groovy)
>         at
> org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:
> 2772)
>         at
> org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:
> 2791)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject(DatastorePersistenceHandler.java:
> 480)
>
> It *appears* as though the JDOStateManagerImpl uses an array of fields
> to get/set values.  You can crack open the enhanced .class files and
> see there's a method called __jdoFieldNamesInit() that sets up a
> static list of Fields.
>
> The old User contains the field: "balance", which is a Long.
> The new User contains the fields: "balance", which is @Deprecated and
> is Long, and "_balances", which is a List.
>
> Looking in the .class files, it looks like each field is ordered
> alphabetically, so in old User, "balance" is index 0, where in new
> User, "balance" is index 1 and "_balances" is index 0.  Hence the
> ClassCastException.
>
> I'm stuck on how to proceed.  I'd have thought that fields would be
> replaced based on field name, not on an index...  Especially an index
> that we don't appear to be able to control.  But if it's the case that
> fields are placed by index on load, how does data migration work on
> AppEngine itself?  Our migration code works fine there...
>
> Is this a DataNucleus issue?  An issue with LocalServiceTestHelper?
> An issue of developer sanity? ;)
>
> Any insight would be greatly appriciated!
>
> Thanks!
> Jason

-- 
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: Problem with query - jdo

2011-03-03 Thread coder
I have understood the problem.

The persistence layer uses lazy-load approach, so when in jsp it tries to 
access to entities extracted from the database it throws exception because 
the persistence manager is just closed.
So, how to avoid this problem? I have to use DAO class or controller of them 
directly in jsp? Cannot i use in jsp the HttpSession to get the 
requested objects (putted in session by a servlet)?

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



Re: [appengine-java] Re: SystemProperty.applicationId.get() returns s~[APP-ID]

2011-03-03 Thread Jeff Schnitzer
I logged this as a bug:

http://code.google.com/p/googleappengine/issues/detail?id=4673

Jeff

On Mon, Feb 28, 2011 at 8:48 PM, Charms Styler  wrote:
> Thanks for the insight. ;)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



[appengine-java] Getting Null pointer expection

2011-03-03 Thread sachin
Hi all,
I would like to know who is the current user logged in google account, when 
i send a request to particular servlet. I got some part of the code from 
Google app engine site.
I have uploaded required jar in to my application. I assumed, when i call 
this servelet, this will populate the current user Email id.
While executing in 

*User user = userService.getCurrentUser();
*

this part of the line it is throwing Null Pointer exception.



*Bellow is the Code i used*

package guestbook;

import java.io.IOException;
import javax.servlet.http.*;
*import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;*

public class GuestbookServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
  throws IOException {
*UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();

if (user != null) {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, " + user.getEmail());
} else {
resp.sendRedirect(userService.createLoginURL(req.getRequestURI()));
}
}*
}


-- 
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] Problem with query - jdo

2011-03-03 Thread coder
I have a Dao class that extract some records filtered by userId field.

the code is:

Query query=pm.newQuery("select from "+ Customer.class.getName()+" where 
userId == userIdParam parameters String userIdParam");

List customers=(List) query.execute(userId);

but when i use the list customers in jsp page it throws an exception:

Object Manager has been closed

org.datanucleus.exceptions.NucleusUserException: Object Manager has been 
closed

at 
org.datanucleus.ObjectManagerImpl.assertIsOpen(ObjectManagerImpl.java:3876)

at 
org.datanucleus.ObjectManagerImpl.getFetchPlan(ObjectManagerImpl.java:376)

at org.datanucleus.store.query.Query.getFetchPlan(Query.java:497)

at 
org.datanucleus.store.appengine.query.DatastoreQuery$6.apply(DatastoreQuery.java:631)

at 
org.datanucleus.store.appengine.query.DatastoreQuery$6.apply(DatastoreQuery.java:630)

at 
org.datanucleus.store.appengine.query.LazyResult.resolveNext(LazyResult.java:94)

at 
org.datanucleus.store.appengine.query.LazyResult.resolveAll(LazyResult.java:116)

at 
org.datanucleus.store.appengine.query.LazyResult.size(LazyResult.java:110)

at 
org.datanucleus.store.appengine.query.StreamingQueryResult.size(StreamingQueryResult.java:124)

at org.apache.jsp.videos_jsp._jspService(customers_jsp.java:88)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

at 
com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)

at 
com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)

at java.security.AccessController.doPrivileged(Native Method)

at 
com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)

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.handle(ServletHandler.java:390)

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.servlet.Dispatcher.forward(Dispatcher.java:327)

at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)

Although the records to be extracted exist in the database (with the userId 
specified as parameter of query), the list customer (before that i put it in 
HttpSession) is empty (its size is -1 or 0).
>From the logs, it seems that the error is in jsp.
The code that i use in jsp is:



<%@ page import="model.Customer,java.util.*" %>

<% List customers=(List) 
session.getAttribute("customers");

if (customers.size()>0 || customers != null ){

out.print(customers.size());

for (Customer customer: customers){%>

<%=customer.getName() %>

<% }

}%>



Why this strangeness?
Is the query 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-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Accessing an IMAP mailbox

2011-03-03 Thread Guillaume Laforge
Alright, good point, I forgot the fact we can't use non-HTTP protocols!
Thanks for the reminder, Ikai.

Guillaume

On Thu, Mar 3, 2011 at 20:14, Ikai Lan (Google)  wrote:
> Guillaume,
> I don't think this would work. We can only speak HTTP outbound, and IMAP
> uses a different port. This might be possible if we ever support sockets.
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blog: http://googleappengine.blogspot.com
> Twitter: http://twitter.com/app_engine
> Reddit: http://www.reddit.com/r/appengine
>
>
> On Wed, Mar 2, 2011 at 8:42 PM, Guillaume Laforge 
> wrote:
>>
>> Hi all,
>>
>> I'm curious to know if someone has tried to access an IMAP mailbox
>> from an App Engine application?
>>
>> I have an IMAP account from my ISP (ie not a Gmail account), and I was
>> thinking of doing a kind of notification application on App Engine,
>> that would notify me, allow me to quickly browse through titles, etc.
>> And I was wondering if it was possible to access that account thanks
>> to the javax.mail API.
>>
>> Thanks for your feedback,
>>
>> --
>> Guillaume Laforge
>> Groovy Project Manager
>> Head of Groovy Development at SpringSource
>> http://www.springsource.com/g2one
>>
>> --
>> 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.
>>
>
>



-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

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



Re: [appengine-java] Possibility for race condition on datastore?

2011-03-03 Thread Ikai Lan (Google)
Yes. The only way to correctly do this is with transactions and sharded
counters.

The better question, however, is this: what are you doing? Perhaps there is
an alternative solution.

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



On Thu, Mar 3, 2011 at 10:57 AM, justin  wrote:

> I need to write code so that a user has a counter. This counter can be
> read, increase, and decrease. This counter is mission critical so I
> will use the high replication datastore.
>
> So lets say I create a counter entity which has a user entity as the
> ancestor. I increase the counter value and store the value. Almost
> simultaneously I get another request to read the counter. I get the
> entity from the datastore , using the correct ancestor chain, and I
> read the value. Is it possible that these two values will be
> different? If so, is there anyway way to prevent this from happening?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] Possibility for race condition on datastore?

2011-03-03 Thread justin
I need to write code so that a user has a counter. This counter can be
read, increase, and decrease. This counter is mission critical so I
will use the high replication datastore.

So lets say I create a counter entity which has a user entity as the
ancestor. I increase the counter value and store the value. Almost
simultaneously I get another request to read the counter. I get the
entity from the datastore , using the correct ancestor chain, and I
read the value. Is it possible that these two values will be
different? If so, is there anyway way to prevent this from happening?

-- 
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] is it possible to use Java 7 on GAE ?

2011-03-03 Thread zixzigma
is it possible to use Java 7 on GAE ?

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



Re: [appengine-java] Re: Moderation enabled

2011-03-03 Thread Ikai Lan (Google)
It won't work. Spammers are too clever.

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



On Wed, Mar 2, 2011 at 8:55 PM, Charms Styler wrote:

> Hi Jason,
>
> I think perhaps moderation should be employed with certain keywords and
> content types as Roy had shown above. it would make life lot easier..
>
> Regards,
> Charms
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] Accessing an IMAP mailbox

2011-03-03 Thread Ikai Lan (Google)
Guillaume,

I don't think this would work. We can only speak HTTP outbound, and IMAP
uses a different port. This might be possible if we ever support sockets.

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



On Wed, Mar 2, 2011 at 8:42 PM, Guillaume Laforge wrote:

> Hi all,
>
> I'm curious to know if someone has tried to access an IMAP mailbox
> from an App Engine application?
>
> I have an IMAP account from my ISP (ie not a Gmail account), and I was
> thinking of doing a kind of notification application on App Engine,
> that would notify me, allow me to quickly browse through titles, etc.
> And I was wondering if it was possible to access that account thanks
> to the javax.mail API.
>
> Thanks for your feedback,
>
> --
> Guillaume Laforge
> Groovy Project Manager
> Head of Groovy Development at SpringSource
> http://www.springsource.com/g2one
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] java.lang.SecurityException

2011-03-03 Thread Mike Zhou
Toby, by removing the manifest file, the issue is gone. Thanks a lot for the 
help. Mike

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



Re: [appengine-java] java.lang.SecurityException

2011-03-03 Thread Mike Zhou
Toby,

Thanks for the quick response. I will give it a try and let you know how it
goes.

Mike

On Thu, Mar 3, 2011 at 11:15 AM, Toby Reyelts  wrote:

> The jar file containing the class, org.eclipse.emf.ecore.EObject has been
> signed.
> App Engine doesn't currently support signed jar files. One simple way to
> work around this is to yank the manifest out of the jar.
> (META-INF/MANIFEST.MF)
>
>
> On Wed, Mar 2, 2011 at 11:25 PM, Mike Zhou  wrote:
>
>> Hi,
>>
>> I have an Eclipse EMF based application. It runs well in may AppEngine 
>> Eclipse testing env. However, when it is deployed to the cloud, I get the 
>> following error:
>>
>> Caused by: java.lang.SecurityException: SHA1 digest error for 
>> org/eclipse/emf/ecore/EObject.class
>>
>>  at 
>> com.google.appengine.runtime.Request.process-9015283aec833f7d(Request.java)
>>  at 
>> sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:210)
>>  at java.util.jar.JarVerifier.processEntry(JarVerifier.java:218)
>>  at java.util.jar.JarVerifier.update(JarVerifier.java:205)
>>  at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:428)
>>  at sun.misc.Resource.getBytes(Resource.java:114)
>>  at java.net.URLClassLoader.defineClass(URLClassLoader.java:273)
>>  at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
>>  ... 44 more
>>
>>
>> The same application ran well in previous AppEngine version. It seems that 
>> the AppEngine security control has been changes.
>>
>> Anyone can explain the reason? Also, the difference between AppEngine 
>> Eclipse testing env and the real Java running env in the cloud would be 
>> appreciated.
>>
>> Thanks, Mike
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-java@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>

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



[appengine-java] how to cancel uploading request by url created by createUploadUrl()

2011-03-03 Thread peter hong
I am working on multi uploading using blobstore.
Everything's done so far except canceling uploading after calling
url(_ah/upload/...) created by createUploadUrl().
The url is called by ajax. When the cancel button is clicked while a
file is still being uploaded, ajax function, abort() is called. But
after aborting ajax request, uploading process is still on going on
server side, and finished successfully.
Is there any way to stop the uploading process?
I need to find a way to stop the request before a callback is made.
Please help me out. It would be greatly appreciated.

Peter

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



Re: [appengine-java] java.lang.SecurityException

2011-03-03 Thread Don Schwarz
Also, please star this issue:

http://code.google.com/p/googleappengine/issues/detail?id=3754

On Thu, Mar 3, 2011 at 10:15 AM, Toby Reyelts  wrote:

> The jar file containing the class, org.eclipse.emf.ecore.EObject has been
> signed.
> App Engine doesn't currently support signed jar files. One simple way to
> work around this is to yank the manifest out of the jar.
> (META-INF/MANIFEST.MF)
>
>
> On Wed, Mar 2, 2011 at 11:25 PM, Mike Zhou  wrote:
>
>>
>> Hi,
>>
>>
>> I have an Eclipse EMF based application. It runs well in may AppEngine 
>> Eclipse testing env. However, when it is deployed to the cloud, I get the 
>> following error:
>>
>>
>> Caused by: java.lang.SecurityException: SHA1 digest error for 
>> org/eclipse/emf/ecore/EObject.class
>>
>>
>>  at 
>> com.google.appengine.runtime.Request.process-9015283aec833f7d(Request.java)
>>  at 
>> sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:210)
>>  at java.util.jar.JarVerifier.processEntry(JarVerifier.java:218)
>>  at java.util.jar.JarVerifier.update(JarVerifier.java:205)
>>  at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:428)
>>  at sun.misc.Resource.getBytes(Resource.java:114)
>>  at java.net.URLClassLoader.defineClass(URLClassLoader.java:273)
>>  at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
>>  ... 44 more
>>
>>
>>
>> The same application ran well in previous AppEngine version. It seems that 
>> the AppEngine security control has been changes.
>>
>>
>> Anyone can explain the reason? Also, the difference between AppEngine 
>> Eclipse testing env and the real Java running env in the cloud would be 
>> appreciated.
>>
>>
>> Thanks, Mike
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-java@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] java.lang.SecurityException

2011-03-03 Thread Toby Reyelts
The jar file containing the class, org.eclipse.emf.ecore.EObject has been
signed.
App Engine doesn't currently support signed jar files. One simple way to
work around this is to yank the manifest out of the jar.
(META-INF/MANIFEST.MF)


On Wed, Mar 2, 2011 at 11:25 PM, Mike Zhou  wrote:

> Hi,
>
> I have an Eclipse EMF based application. It runs well in may AppEngine 
> Eclipse testing env. However, when it is deployed to the cloud, I get the 
> following error:
>
> Caused by: java.lang.SecurityException: SHA1 digest error for 
> org/eclipse/emf/ecore/EObject.class
>
>   at 
> com.google.appengine.runtime.Request.process-9015283aec833f7d(Request.java)
>   at 
> sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:210)
>   at java.util.jar.JarVerifier.processEntry(JarVerifier.java:218)
>   at java.util.jar.JarVerifier.update(JarVerifier.java:205)
>   at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:428)
>   at sun.misc.Resource.getBytes(Resource.java:114)
>   at java.net.URLClassLoader.defineClass(URLClassLoader.java:273)
>   at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
>   ... 44 more
>
>
> The same application ran well in previous AppEngine version. It seems that 
> the AppEngine security control has been changes.
>
> Anyone can explain the reason? Also, the difference between AppEngine Eclipse 
> testing env and the real Java running env in the cloud would be appreciated.
>
> Thanks, Mike
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



[appengine-java] Re: Getting error when passing the object to client side please help me..

2011-03-03 Thread Didier Durand
Hi,

As said in the message StreamingQueryResult (the result of your query)
doesn't itself implement the the Serializable interface that you have
for your own classes.

What you should do: defining your own class based on any Collection
your prefer (List, Vector, Map, etc.), make it implement Serializable
as you did for your other classes.

Then when you get a QueryResult, you loop into it to extract your own
object, put them in an instance of your collection class above and
ship it to client. That should work.

Anyway, it's better not to send instances of typical server side
objects like StreamingQueryResult to the client side.

regards

didier

On Mar 3, 10:36 am, andy  wrote:
> My code here:
> Employee Class:
> @PersistenceCapable(identityType =
> IdentityType.APPLICATION,detachable="true")
> public class Employee implements Serializable {
>     private static final long serialVersionUID = 1L;
>
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     @Extension(vendorName="datanucleus", key="gae.encoded-pk",
>     value="true")
>     private String id;
>     @Persistent
>     private String ename;
>
>     @Persistent
>     private String designation;
>     @Persistent(mappedBy="parentEmployee",defaultFetchGroup="true")
>     private List leaves;
>
>     @Persistent
>     @Embedded
>     private EmployeeManager employeeManager;
>
> }
>
> Leave Class:
> @PersistenceCapable(identityType =
> IdentityType.APPLICATION,detachable="true")
> public class Leave implements Serializable{
>
>     private static final long serialVersionUID = 1L;
>
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     @Extension(vendorName="datanucleus", key="gae.encoded-pk",
>     value="true")
>     private String leaveid;
>
>     @Persistent
>     private String reason;
>
>     @Persistent
>     private String status;
>
> //    @OneToMany(fetch=FetchType.EAGER)
>     public Employee parentEmployee;
>
> }
>
> EmployeeManager:
>
> @PersistenceCapable
> @EmbeddedOnly
> public class EmployeeManager implements Serializable {
>     private static final long serialVersionUID = 1L;
>
>     @Persistent
>     public String managerId;
>
> }
>
> when i covert the result into String and then send to client then it is
> accepting but when i am sending object it giving me error like:
>  Type 'org.datanucleus.store.appengine.query.StreamingQueryResult' was not
> included in the set of types which can be serialized by this
> SerializationPolicy or its Class object could not be loaded. For security
> purposes, this type will not be serialized.: instance =
> [parentemp.client.Employee@1988799, parentemp.client.Employee@ee738e,
> parentemp.client.Employee@e48ee2]
>
> What should i do...???

-- 
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] Getting error when passing the object to client side please help me..

2011-03-03 Thread andy
My code here:
Employee Class:
@PersistenceCapable(identityType = 
IdentityType.APPLICATION,detachable="true")
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
private String id;
@Persistent
private String ename;

@Persistent
private String designation;
@Persistent(mappedBy="parentEmployee",defaultFetchGroup="true")
private List leaves;

@Persistent
@Embedded
private EmployeeManager employeeManager;
}

Leave Class:
@PersistenceCapable(identityType = 
IdentityType.APPLICATION,detachable="true")
public class Leave implements Serializable{

private static final long serialVersionUID = 1L;

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
private String leaveid;

@Persistent
private String reason;

@Persistent
private String status;

//@OneToMany(fetch=FetchType.EAGER)
public Employee parentEmployee;
}

EmployeeManager:

@PersistenceCapable
@EmbeddedOnly
public class EmployeeManager implements Serializable {
private static final long serialVersionUID = 1L;

@Persistent
public String managerId;
}

when i covert the result into String and then send to client then it is 
accepting but when i am sending object it giving me error like:
 Type 'org.datanucleus.store.appengine.query.StreamingQueryResult' was not 
included in the set of types which can be serialized by this 
SerializationPolicy or its Class object could not be loaded. For security 
purposes, this type will not be serialized.: instance = 
[parentemp.client.Employee@1988799, parentemp.client.Employee@ee738e, 
parentemp.client.Employee@e48ee2]

What should i do...???

-- 
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: Can't get .gif image to show in app engine

2011-03-03 Thread Charms Styler
try something like this inside static files

  

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