[appengine-java] Re: Problem with exception on server startup when GAE sdk is in svn

2012-03-01 Thread dilbert
Not sure what you mean by make your .svn directories writable. I develop on 
linux and all the .svn folders have rwx for the user under which I develop. 
The development server runs as the same user. Should I make the adjustments 
for group and others? What about the subfolders inside the .svn folder? 
Should I mess with them too?

This is the exception I get:
Exception in thread main java.lang.ExceptionInInitializerError
at 
com.google.appengine.tools.util.Logging.initializeLogging(Logging.java:35)
at 
com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:77)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NullPointerException
at com.google.appengine.tools.info.SdkInfo.getLibs(SdkInfo.java:77)
at 
com.google.appengine.tools.info.SdkInfo.determineOptionalLibs(SdkInfo.java:284)
at 
com.google.appengine.tools.info.SdkInfo.determineOptionalUserLibs(SdkInfo.java:254)
at com.google.appengine.tools.info.SdkInfo.init(SdkInfo.java:233)
at com.google.appengine.tools.info.SdkInfo.getSdkRoot(SdkInfo.java:182)
at 
com.google.appengine.tools.info.SdkImplInfo.clinit(SdkImplInfo.java:19)
... 11 more

I think this is the relevant issue on the issue tracker:
http://code.google.com/p/googleappengine/issues/detail?id=6936

This is still an issue in 1.6.3.
Please fix this ASAP.

On Thursday, February 23, 2012 3:06:32 AM UTC+1, Max Ross (Google) wrote:

 It's a bug triggered by the fact that the .svn directories are read-only. 
 If you make those directories writable the problem *should* go away. 
 Please try that out and let me know.

 Thanks,
 Max


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/TzYeqGszpiMJ.
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 exception on server startup when GAE sdk is in svn

2012-03-01 Thread dilbert
Thanks Rick for the valuable information. I do not like the idea of mixing 
jars from different versions just for svn's sake. For now I'll remove GAE 
SDK from svn and handle things manually which is a real pain. Hope they fix 
this issue soon.

On Thursday, March 1, 2012 3:25:39 PM UTC+1, Rick Mangi wrote:

 Dilbert, see my reply on the ticket.

 Max - that comment about svn being writable is nonsense. I wish you guys 
 would talk to your own support engineers. I tried that solution with my 
 premier support contact and it doesn't even make sense. svn directories are 
 always writable. This is a bug, it's reproducible and it's going to be 
 fixed in 1.6.4 (supposedly). The workaround is posted in my comment on the 
 ticket. It took me weeks of back and forth to get the google engineers to 
 see the problem. If someone had just tried it out I'm sure they would have 
 seen the problem right away.

 On Thursday, February 2, 2012 4:05:43 AM UTC-5, dilbert wrote:

 We keep the GAE sdk (together with the project) in svn. Yesterday we 
 upgraded to GAE sdk 1.6.2. It worked fine until we checked it into the svn 
 repo. After that when the server is started it dies with the following 
 message:

 Exception in thread main java.lang.ExceptionInInitializerError
at com.google.appengine.tools.util.Logging.initializeLogging(Lo
 gging.java:35)
at com.google.appengine.tools.development.gwt.AppEngineLauncher
 .start(AppEngineLauncher.java:77)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
 ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
 thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.j
 ava:120)
 Caused by: java.lang.NullPointerException
at com.google.appengine.tools.info.SdkInfo.getLibs(SdkInfo.java
 :77)
at com.google.appengine.tools.info.SdkInfo.determineOptionalLib
 s(SdkInfo.java:284)
at com.google.appengine.tools.info.SdkInfo.determineOptionalUse
 rLibs(SdkInfo.java:254)
at com.google.appengine.tools.info.SdkInfo.init(SdkInfo.java:233)
at com.google.appengine.tools.info.SdkInfo.getSdkRoot(SdkInfo.j
 ava:182)
at com.google.appengine.tools.info.SdkImplInfo.clinit(SdkImpl
 Info.java:19)
... 11 more

 We keep the sdk in svn since version 1.3.1 and this has never happened 
 before. Any ideas on why this is happening? Any solution?
 Thanks.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/0ZZxdfFmAQAJ.
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] com.google.appengine.api.datastore.Key serialization issues

2011-05-02 Thread dilbert
I use an application on a non-GAE server to backup some data (via a 
Hessian-service implemented on GAE) from my APP engine application 
datastore. The data is loaded from the datastore as objects which are then 
serialized by Hessian and sent to the non-GAE service. The data is then 
stored in an object database. The data is restored (read from the local 
objecd database sent to the GAE application and stored to the datastore) the 
storing step fails with the message:
java.lang.NullPointerException
at 
com.google.appengine.api.datastore.KeyTranslator.convertToPb(KeyTranslator.java:55)
at 
com.google.appengine.api.datastore.EntityTranslator.convertToPb(EntityTranslator.java:34)
at 
com.google.appengine.api.datastore.AsyncDatastoreServiceImpl.put(AsyncDatastoreServiceImpl.java:429)
at 
com.googlecode.objectify.impl.AsyncObjectifyImpl.put(AsyncObjectifyImpl.java:255)

I analized the decompiled Key code and came to the conclusion that the 
problem lies in the fact that the appId private variable is not properly 
retrieved from the server when the Key instance is serialized by Hessian. In 
fact the appId variable is only set upon Java serialization (the writeObject 
method). So I need to rely on a side effect of the serialization procedure 
to properly send the Key instance to and from the GAE Application.

Another issue is that Java serialization of Key relies on a static object 
being previously initialized. For example you cannot write this:

Key key = KeyFactory.createKey(banana, (5L));

in a non-GAE application if you have not initialized a 
LocalServiceTestHelper instance. It dies in the following manner:
java.lang.NullPointerException: No API environment is registered for this 
thread.
at 
com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:108)
at 
com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:118)
at com.google.appengine.api.datastore.Key.init(Key.java:51)
at com.google.appengine.api.datastore.Key.init(Key.java:37)
at 
com.google.appengine.api.datastore.KeyFactory.createKey(KeyFactory.java:46)
at 
com.google.appengine.api.datastore.KeyFactory.createKey(KeyFactory.java:31)

This serialization issue is significant on Android applications that use 
classes containing Key instances which are shared between Activities since 
the transfer of objects between Activities uses Java Serialization. 
In my opinion Key should be refactored so the serialization is made less 
painful. 
I filed an issue here:
http://code.google.com/p/googleappengine/issues/detail?id=4966

Best regards

-- 
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] Source Code?

2011-04-04 Thread dilbert
Just to clarify. Are You talking about the code for the development server 
or the real thing?

-- 
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] Source Code?

2011-04-04 Thread dilbert
OK. Thanks for the info.

-- 
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] GAE implementation of java.util.concurrent....

2011-03-31 Thread dilbert
I see that the java.util.concurrent... classes are on the whitelist (
http://code.google.com/intl/hr/appengine/docs/java/jrewhitelist.html). Are 
they implemented properly or as empty (do nothing) implementations. With the 
new *Concurrent Requests* feature I might need some locking classes.

Thanks for Your time.

-- 
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: GAE implementation of java.util.concurrent....

2011-03-31 Thread dilbert
Thanks Don for the quick answer. I was also wandering about the GAE servlet 
container implementation. If two requests arrive to the same JVM instance 
will they be processed by the same servlet (object) or will the runtime 
spawn two servlet objects? This is important because in the first case I 
need to secure the servlet's member variables.

Thank You for your time.

-- 
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: Are Java static initializers thread safe on GAE ?

2011-03-31 Thread dilbert
Thanks Simon and Didier for the answer. I am aware of the singleton issue. 
Also I'd like someone from Google to confirm (no offence Simon and Didier) 
what Simon and Didier are saying because Googlers are the only ones that can 
see the code :(.

-- 
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: GAE implementation of java.util.concurrent....

2011-03-31 Thread dilbert
I do not think You are wrong. However, sometimes You do not need 
application-wide but instance-wide locking. For example let's assume this:

class SomeClass{
  static SomeObject someObject = null;
  SomeObject getSomeObject(){
if(someObject == null){
  //Long Initialization
  someObject = ...;
}
return someObject;
  }
}
If the initialization is long it is possible that many threads will enter 
the if(someObject == null) block. I'd like to avoid that. After all long 
processing can cost me money.

-- 
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: GAE implementation of java.util.concurrent....

2011-03-31 Thread dilbert
Thank you Don for sharing valuable information.

-- 
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: Are Java static initializers thread safe on GAE ?

2011-03-31 Thread dilbert
Toby, thank You very much for Your help.

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



[appengine-java] The JRE Class White List suggestion

2011-03-31 Thread dilbert
It would be useful if developers could see if the whitelist class (
http://code.google.com/intl/hr/appengine/docs/java/jrewhitelist.html) is 
really implemented or just faked so that we know which we can use and which 
are only for show. e.g.

java.lang.String - implemented
java.util.concurrent.ThreadPoolExecutor - fake

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



[google-appengine] Re: Channel API encoding problem

2011-03-05 Thread dilbert
Yes Moishe I found the problem on the dev appserver. I will try to reproduce 
it on the production servers later and let You know. BTW I reported the 
issue here:
http://code.google.com/p/googleappengine/issues/detail?id=4675 

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



[google-appengine] Channel API encoding problem

2011-03-04 Thread dilbert
When using the Channel API and sending messages with Croatian letters (e.g. 
message šđžčćŠĐŽČĆ) the message received on the client gets mangled. The 
message I receive on the client looks like this: message ??. Has 
anyone had a similar issue. Is there a way to configure the Channel API so I 
get the proper message on the client side?

Thanks for your help.

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



Re: [google-appengine] Channel API encoding problem

2011-03-04 Thread dilbert
Not really sure what you mean. I use the following to send the message:
https://groups.google.com/forum/?show_docid=074d568de0a59f7a#%21topic/google-appengine/3u2eW0xgLpU
  
ChannelServiceFactory.getChannelService().sendMessage(new 
ChannelMessage(key, message šđžčćŠĐŽČĆ));

Thanks for the help.

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



[google-appengine] Re: Using the Channel API with a desktop app: possible?

2011-02-11 Thread dilbert
You can vote(star) for this issue:
http://code.google.com/p/googleappengine/issues/detail?id=4189

It is essentially about a Java client library that you could include in your 
desktop app.

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



[google-appengine] Re: android application communicating with google app engine

2011-01-13 Thread dilbert
You could try with this:
http://monkeyboy-code.blogspot.com/2010/07/using-hessian-in-your-android.html
and this:
http://monkeyboy-code.blogspot.com/2010/07/using-gae-as-backend-for-android.html

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



Re: [google-appengine] Re: Channel API from mobile

2011-01-04 Thread dilbert
There is an issue requesting a Java client Channel API library here:

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

You can star it if you are interested.

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



[appengine-java] Re: Chanel API Java Client

2010-12-07 Thread dilbert
AFAIK You cannot use the Channel API from Android unless you write the
Java Client library yourself. There is a relevant issue opened here:

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

You can star it if you are interested. It has already 36 votes.


On Dec 7, 2:26 pm, Christian Kosmowski ksm...@googlemail.com wrote:
 Hi!

 I was wondering if there is a way to use the channels API directly
 through java. I'd like to use it in Android and i thought it would be a
 bit heavyweight to use a JavaScript Implementation just for
 communication with the channels API.

-- 
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: Any idea on channel api without javascript?

2010-12-03 Thread dilbert
Well You could star one of this issues:

-for Java
http://code.google.com/p/googleappengine/issues/detail?id=4189
-for Flash
http://code.google.com/p/googleappengine/issues/detail?id=4182

or You can submit Your own feature request.

Cheers,
D

On Dec 3, 7:40 am, Benjamin yuhui.w...@gmail.com wrote:
 Hi there,
 I am currently using GAE as our game's server, we are not using
 javascript as the frontend, but channel api is quite a useful stuff
 for us.
 Is there any way we can use the channel api without javascript?

-- 
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] GWT wrapper for the client side (javascript) Channel API

2010-12-03 Thread dilbert
It would be a nice feature to have in our GWT arsenal so I submitted
an issue here:
http://code.google.com/p/googleappengine/issues/detail?id=4192

Please star it if You are interested.

-- 
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: GWT wrapper for the client side (javascript) Channel API

2010-12-03 Thread dilbert
Wow. That was fast. Thanks Ikai.

On Dec 3, 8:00 pm, Ikai Lan (Google) ikai.l+gro...@google.com
wrote:
 Here's the official code project:

 http://code.google.com/p/gwt-gae-channel/

 It's currently identical (or pretty similar) to the code used in Dance,
 Dance Robot, but we expect to be updating the project as needed.

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

 On Fri, Dec 3, 2010 at 10:47 AM, Ikai Lan (Google)
 ikai.l+gro...@google.comikai.l%2bgro...@google.com

  wrote:
  In the meantime, you guys can check out what we did in Dance Dance Robot:

 http://code.google.com/p/dance-dance-robot/

  The code uses JSNI to integrate with the Channel API. It's pretty
  straightfoward (maybe 20 lines of code tops):

 http://code.google.com/p/dance-dance-robot/source/browse/#svn/trunk/s...

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

  On Fri, Dec 3, 2010 at 10:40 AM, George Moschovitis 
  george.moschovi...@gmail.com wrote:

  Indeed, would be very useful!

  -g.

  On Dec 3, 6:18 pm, Ice13ill andrei.fifi...@gmail.com wrote:
   Would be very very nice

   On Dec 3, 11:00 am, dilbert dilbert.elbo...@gmail.com wrote:

It would be a nice feature to have in our GWT arsenal so I submitted
an issue here:
 http://code.google.com/p/googleappengine/issues/detail?id=4192

Please star it if You are interested.

  --
  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.comgoogle-appengine-java%2bunsubscr...@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.



[google-appengine] Re: Channel API outside browsers

2010-12-03 Thread dilbert
I submitted an issue regarding the Java client library here:
http://code.google.com/p/googleappengine/issues/detail?id=4189

so if anyone is interested please star it.

On Nov 6, 3:50 pm, Michael m...@mzlab.net wrote:
 I'd like to have a port of Channel API for ActionScript.
 If it uses XMPP under the hood, then it should be pretty
 simple to emulate as there are ready to use XMPP
 libraries. Maybe Google should release the underlying
 protocol specification?

 Currently i'm using polling from my flash app, and it
 eats around 30% of my CPU quota.

 On Nov 2, 2:41 pm, Tomas Alaeus tala...@gmail.com wrote:

  I for one thought directly of games when I heard that the Channel API
  were coming to AppEngine. However, all discussions and articles only
  mentions a Javascript client running in a web browser. Will it come
  ports to other languages as well? Maybe the actual communication is so
  simple that it is trivial to do oneself (considering that the API is
  somewhat similar to websockets if I understood it correctly)?

  Thanks, Tomas



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



[google-appengine] Re: Channel API outside browsers

2010-11-04 Thread dilbert
The Java (or Python) client library could connect to the XMPP layer
directly and on the other side provide developers with an interface
similar to the interface provided to Javascript users on the browser.
This would effectively hide the XMPP and related XML messages Robert
is talking about. Of course Google would have to provide such a
library as it provides the Channel API Javascript in the browser.
Maybe this approach is not implementable but I can not see why because
I have so little information about the internal workings of the
Channel API system. I was hoping someone from Google could enlighten
us and settle once and for all if we could use the Channel API on
clients other than browsers.

On Nov 4, 5:27 am, Robert Kluin robert.kl...@gmail.com wrote:
 My understanding is that the Channel API uses XMPP on the back end to
 'connect' to Google's internal 'comet servers.'  One of the big
 advantages this approach is that your app's client does not need to
 know about XMPP, or be able to process the related XML messages.
 Instead you can use HTPP and JSON;  that _potentially_ lets you build
 a simpler client.

 Unfortunately, from Peter's comments it sounds like the underlying
 mechanism is still complex.

 Robert

 On Wed, Nov 3, 2010 at 13:19, dilbert dilbert.elbo...@gmail.com wrote:
  Peter already answered some of the questions in my previous post. It
  was posted about half a day ago but since it was my first post in this
  group it got stuck in the approval process.

  On Nov 3, 8:24 am, dilbert dilbert.elbo...@gmail.com wrote:
  I think that the Channel API uses XMPP under the hood (as mentioned
  here:http://www.youtube.com/watch?v=oMXe-xK0BWAatabout 13:20).
  I do not see why we could not have a Java or Python client library for
  Channel API. There is some information about it in this thread (http://
  groups.google.com/group/google-appengine-java/browse_thread/thread/
  d0401a784d4171c8). Posts 9 and 10 are relevant. It would be nice if we
  could use the Channel API on Android. Maybe an issue (feature request)
  should be raised.

  @Peter - are You saying that a Java client library to use with the
  Channel API would be impractical/impossible to implement. Could You
  elaborate a bit.

  On Nov 3, 5:37 am, Robert Kluin robert.kl...@gmail.com wrote:

   Are the data-exchanges overly complicated?

   I have used XMPP for an app, I was hoping the channel API would let me 
   simplify.

   Robert

   On Wed, Nov 3, 2010 at 00:29, Peter Petrov onest...@gmail.com wrote:
Forget about emulating it outside of a browser. Your best bet is using 
a
separate mechanism for sending messages to non-browser clients - for 
example
make a HTTP postback, or send a XMPP message.

On Wed, Nov 3, 2010 at 6:20 AM, Robert Kluin robert.kl...@gmail.com 
wrote:

Have you look at the communications at all?  I the javascript file is
included in the SDK.  It is a little heavy, but you could probably
use firebug (or chrome/safari dev console) to figure out what is going
on.

   http://code.google.com/p/googleappengine/source/browse/trunk/python/g...

Robert

On Tue, Nov 2, 2010 at 08:41, Tomas Alaeus tala...@gmail.com wrote:
 I for one thought directly of games when I heard that the Channel 
 API
 were coming to AppEngine. However, all discussions and articles only
 mentions a Javascript client running in a web browser. Will it come
 ports to other languages as well? Maybe the actual communication is 
 so
 simple that it is trivial to do oneself (considering that the API is
 somewhat similar to websockets if I understood it correctly)?

 Thanks, Tomas

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

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

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

  --
  You received this message because you are subscribed to the Google Groups 
  Google App Engine

[google-appengine] Re: Channel API outside browsers

2010-11-03 Thread dilbert
I think that the Channel API uses XMPP under the hood (as mentioned
here: http://www.youtube.com/watch?v=oMXe-xK0BWA at about 13:20).
I do not see why we could not have a Java or Python client library for
Channel API. There is some information about it in this thread (http://
groups.google.com/group/google-appengine-java/browse_thread/thread/
d0401a784d4171c8). Posts 9 and 10 are relevant. It would be nice if we
could use the Channel API on Android. Maybe an issue (feature request)
should be raised.

@Peter - are You saying that a Java client library to use with the
Channel API would be impractical/impossible to implement. Could You
elaborate a bit.


On Nov 3, 5:37 am, Robert Kluin robert.kl...@gmail.com wrote:
 Are the data-exchanges overly complicated?

 I have used XMPP for an app, I was hoping the channel API would let me 
 simplify.

 Robert

 On Wed, Nov 3, 2010 at 00:29, Peter Petrov onest...@gmail.com wrote:
  Forget about emulating it outside of a browser. Your best bet is using a
  separate mechanism for sending messages to non-browser clients - for example
  make a HTTP postback, or send a XMPP message.

  On Wed, Nov 3, 2010 at 6:20 AM, Robert Kluin robert.kl...@gmail.com wrote:

  Have you look at the communications at all?  I the javascript file is
  included in the SDK.  It is a little heavy, but you could probably
  use firebug (or chrome/safari dev console) to figure out what is going
  on.

 http://code.google.com/p/googleappengine/source/browse/trunk/python/g...

  Robert

  On Tue, Nov 2, 2010 at 08:41, Tomas Alaeus tala...@gmail.com wrote:
   I for one thought directly of games when I heard that the Channel API
   were coming to AppEngine. However, all discussions and articles only
   mentions a Javascript client running in a web browser. Will it come
   ports to other languages as well? Maybe the actual communication is so
   simple that it is trivial to do oneself (considering that the API is
   somewhat similar to websockets if I understood it correctly)?

   Thanks, Tomas

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

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

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



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



[google-appengine] Re: Channel API outside browsers

2010-11-03 Thread dilbert
Peter already answered some of the questions in my previous post. It
was posted about half a day ago but since it was my first post in this
group it got stuck in the approval process.

On Nov 3, 8:24 am, dilbert dilbert.elbo...@gmail.com wrote:
 I think that the Channel API uses XMPP under the hood (as mentioned
 here:http://www.youtube.com/watch?v=oMXe-xK0BWAat about 13:20).
 I do not see why we could not have a Java or Python client library for
 Channel API. There is some information about it in this thread (http://
 groups.google.com/group/google-appengine-java/browse_thread/thread/
 d0401a784d4171c8). Posts 9 and 10 are relevant. It would be nice if we
 could use the Channel API on Android. Maybe an issue (feature request)
 should be raised.

 @Peter - are You saying that a Java client library to use with the
 Channel API would be impractical/impossible to implement. Could You
 elaborate a bit.

 On Nov 3, 5:37 am, Robert Kluin robert.kl...@gmail.com wrote:

  Are the data-exchanges overly complicated?

  I have used XMPP for an app, I was hoping the channel API would let me 
  simplify.

  Robert

  On Wed, Nov 3, 2010 at 00:29, Peter Petrov onest...@gmail.com wrote:
   Forget about emulating it outside of a browser. Your best bet is using a
   separate mechanism for sending messages to non-browser clients - for 
   example
   make a HTTP postback, or send a XMPP message.

   On Wed, Nov 3, 2010 at 6:20 AM, Robert Kluin robert.kl...@gmail.com 
   wrote:

   Have you look at the communications at all?  I the javascript file is
   included in the SDK.  It is a little heavy, but you could probably
   use firebug (or chrome/safari dev console) to figure out what is going
   on.

  http://code.google.com/p/googleappengine/source/browse/trunk/python/g...

   Robert

   On Tue, Nov 2, 2010 at 08:41, Tomas Alaeus tala...@gmail.com wrote:
I for one thought directly of games when I heard that the Channel API
were coming to AppEngine. However, all discussions and articles only
mentions a Javascript client running in a web browser. Will it come
ports to other languages as well? Maybe the actual communication is so
simple that it is trivial to do oneself (considering that the API is
somewhat similar to websockets if I understood it correctly)?

Thanks, Tomas

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

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

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



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



[appengine-java] Re: Newly deployed app doesn’t se em always reflected on the server.

2010-10-30 Thread dilbert
It is not about a change of version and it is not just about hitting
F5.

On Oct 30, 9:59 am, andrew aute...@gmail.com wrote:
 As mentioned, IF you are changing version number you will need to set
 latest as default. Check versions page in dashboard.

 I have seen some slight delays after default is changed for switchover
 to new version to occur. A minute maybe.

 Also, on browser, while on your app page, hit Control F5 to force
 refresh.

-- 
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: Newly deployed app doesn’t se em always reflected on the server.

2010-10-29 Thread dilbert
I have similar issues. Sometimes I have to deploy twice in order for
the changes to be visible on the production server. It is really
annoying since it takes a lot of time if the project is large. I'm
using Idea to deploy so maybe it is an Idea issue. What are You using
to deploy?

On Oct 29, 2:17 am, nnhobbit nnclou...@gmail.com wrote:
 Is version number change necessary? If I deploy it with the same
 version number, shouldn’t the old one simply be replaced?

 The page is not cached and I’m not behind any proxy. I’m now thinking
 it’s more likely there’s a zombie process running?

 On Oct 16, 10:12 am, Benjamin bsaut...@gmail.com wrote:

  are you changing the version number? You'd need to go to the console
  and change the version that's being served.

  Maybe you're caching behind a proxy or viewing a cached version on
  your end? try loading the url in a browser and hit F5

  On Oct 15, 4:21 pm, nnhobbit nnclou...@gmail.com wrote:

   I deployed an app, in which an URL was originally serving simply a
   “hello”. Later I changed the content served from that URL to something
   else and deployed it again. However the new content did not show up
   and the page still showed the original “hello”.

   Another (possibly related) issue I'm experiencing is that an URL that
   was removed from my code remained accessible for about a day or so
   after the new code was deployed. (The issue could be either from the
   delayed deployment or some sort of cache?)

   p.s. everything is working as expected on devel environment.
   p.s. admin console shows successful deployment.

   Anyone encountered similar issues? Any suggestions?

   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] Re: allocateIds performance

2010-10-04 Thread dilbert
I have two classes. The first class contains a reference to the
second. One service request might generate several such pairs. So I
figured that I can batch store them at the end of the service request.
To do that I need to generate ID-s for all the second classes. I
thought that allocateIds was what I needed but from the tests I made
(it sometimes took much longer to execute than other times) I
suspected that it sometimes goes to the datastore. Ideally I would
like to avoid going to the datastore just to generate the Id-s. What
is the best way to accomplish this?

To answer Your second question I haven't had time to play with
AppStats yet. I measured time using System.nanoTime().
Thanks for Your time.

On Oct 1, 10:59 pm, Ikai Lan (Google) ikai.l+gro...@google.com
wrote:
 They're a function of the datastore itself, but they don't create indexes or
 any of the things that are usually associated with entity writes. The worst
 case performance has allocateIds doing a write to a hard disk, but most of
 the time they retrieve data from in-memory caches.

 What are you trying to do? Have you benchmarked this using AppStats?

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

 On Tue, Sep 28, 2010 at 4:19 AM, dilbert dilbert.elbo...@gmail.com wrote:
  How fast are the allocateIds methods from the DatastoreService
  interface? I mean do they hit the datastore?

  --
  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.comgoogle-appengine-java%2bunsubscr...@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] allocateIds performance

2010-09-28 Thread dilbert
How fast are the allocateIds methods from the DatastoreService
interface? I mean do they hit the datastore?

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



[appengine-java] Re: What is the best option for RPC (web services) on App engine?

2010-07-15 Thread dilbert
This may be a new shiny valid alternative:
http://googlewebtoolkit.blogspot.com/2010/07/gwtrpccommlayer-extending-gwt-rpc-to-do.html?utm_source=feedburnerutm_medium=feedutm_campaign=Feed:+blogspot/NWLT+(Google+Web+Toolkit+Blog)utm_content=Google+Reader

I wonder if it will work on Android.

On Jun 16, 10:44 am, dilbert dilbert.elbo...@gmail.com wrote:
 I posted a new bug report:http://bugs.caucho.com/view.php?id=4080
 I would like to move further discussion about this issue to the proper
 place:http://groups.google.com/group/google-appengine-java/browse_thread/th...
 D.

 On Jun 16, 12:12 am, Jeff Schnitzer j...@infohazard.org wrote:

  I would close the old issue and create a new one cut down to just the
  exception issue.

  *Are* there any serious RPC alternatives right now?  Sounds like
  gwt-syncproxy isn't quite ready for prime time (and makes me nervous
  since it's not using a published protocol), the *-WS stuff is a
  trainwreck, and *-RS is not really convenient as an RPC layer.  I
  would like alternatives.

  Jeff

  On Tue, Jun 15, 2010 at 2:41 PM, dilbert dilbert.elbo...@gmail.com wrote:
   At the time I thought the issues were connected since they threw the
   same exception so I posted them together. So should I post the issue
   with exceptions again on the Caucho bug tracker? If this issue is
   solved I would recommend Hessian as the best RPC mechanism for GAE at
   this time.
   Apologies to other readers for the offtopic with bugs.
   D.

   On Jun 15, 11:24 pm, Jeff Schnitzer j...@infohazard.org wrote:
   I think you did yourself a disservice by wrapping these two issues
   into a single message - it ends up being way too much text to read and
   otherwise eager volunteers just skip it.

   The first issue looks like you're not detaching your entities before
   serializing them.  This is a JDO issue.  I suggest dropping JDO and
   using something simpler like Objectify ;-)

   The issue with exceptions looks more serious.  This is something that
   will need to be fixed in Hessian (or your custom serializer).  If you
   cut down your issue to just this, you might get better results from
   Caucho.

   Jeff

   On Tue, Jun 15, 2010 at 1:55 PM, dilbert dilbert.elbo...@gmail.com 
   wrote:
Hi Jeff. I was hoping to hear from You since I saw that You solved
some GAE issues on the hessian-interest list. I already posted the
issue on the hessian-interest list here:
   http://maillist.caucho.com/pipermail/hessian-interest/2010-June/00090...
I also posted several forum questions:
   http://forum.caucho.com/showthread.php?t=
   http://groups.google.com/group/google-appengine-java/browse_thread/th...
And a few bug reports:
   http://bugs.caucho.com/view.php?id=4061
   http://code.google.com/p/googleappengine/issues/detail?id=3305
The posts actually describe two issues one with arraylist
serialization and the other with exception serialization. The posts
also include test projects with code that reproduces the issues. I
also managed to solve the issue today by using a custom serializer.
Here is how. First the Serializer:

public class ThrowableSerializer extends AbstractSerializer {
  �...@override
   public void writeObject(Object obj, AbstractHessianOutput out)
throws IOException {
       if (obj != null) {
           final Class cl = obj.getClass();
           if (out.addRef(obj))
               return;
           int ref = out.writeObjectBegin(cl.getName());
           Throwable tr = (Throwable) obj;
           ByteArrayOutputStream bos = new ByteArrayOutputStream();
           ObjectOutputStream oos = new ObjectOutputStream(bos);
           try {
               oos.writeObject(tr);

               if (ref  -1) {
                   out.writeString(value);
                   out.writeBytes(bos.toByteArray());
                   out.writeMapEnd();
               } else {
                   if (ref == -1) {
                       out.writeInt(1);
                       out.writeString(value);
                       out.writeObjectBegin(cl.getName());
                   }
                   out.writeBytes(bos.toByteArray());
               }
           } finally {
               oos.close();
               bos.close();
           }
       } else
           out.writeNull();
   }
}

The other class we need is the Deserializer:
public class ThrowableDeserializer extends AbstractDeserializer {
   //private static final Logger l =
Logger.getLogger(ThrowableDeserializer.class.getName());

  �...@override
   public Class getType() {
       return Throwable.class;
   }

  �...@override
   public Object readMap(AbstractHessianInput in) throws IOException
{
       int ref = in.addRef(null);
       byte[] initValue = null;
       while (!in.isEnd()) {
           String

[appengine-java] Re: SecurityException with Hessian on google app engine

2010-06-16 Thread dilbert
I posted a new bug report to the Hessian people: 
http://bugs.caucho.com/view.php?id=4080
There is also some information about this bug here:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/ccb9d0ff6b88545/

On Jun 8, 10:31 am, Matija matija.jerko...@gmail.com wrote:
 Any news about this SecurityException ?

 Matija.

 On Jun 5, 4:46 pm, dilbert dilbert.elbo...@gmail.com wrote:

  I am having trouble with Hessian on Google App Engine. First I will
  describe the setup. I have a persistent class MessageDb declared as
  (It contains a String and an arraylist of strings):

  @PersistenceCapable
  public class MessageDb {
      @PrimaryKey
      private String user;

      @Persistent
      private ArrayListString words = new ArrayListString();
      /* getters and setters ...*/

  }

  I have the following service interface:
  public interface IService {
      ArrayListString testMessage();
      /* Some other methods ... */
   }

  The Service is implemented on App engine in the following way:
  public class Service extends HessianServlet implements IService {
      private static final PersistenceManagerFactory pmfInstance =
  JDOHelper.getPersistenceManagerFactory(transactions-optional);

      @Override
      public ArrayListString testMessage() {
          PersistenceManager pm = null;
          try {
              pm = pmfInstance.getPersistenceManager();

              MessageDb messageDb;
              try {
                  messageDb = pm.getObjectById(MessageDb.class,
  testMessage);
              } catch (JDOObjectNotFoundException e) {
                  return null;
              }
              return messageDb.getWords();
              //return new ArrayListString(messageDb.getWords());
          } finally {
              if (pm != null)
                  pm.close();
          }
      }

  }

  The service simply retrieves an MessageDb object by key and returns
  the object's ArrayListString. This code works fine on the local
  development server but it fails when deployed on remote Google servers
  with the following exception:

  java.lang.SecurityException: java.lang.IllegalAccessException:
  Reflection is not allowed on private int java.util.ArrayList.size
          at
  com.google.appengine.runtime.Request.process-0c4ab611241850c6(Request.java)
          at java.lang.reflect.Field.setAccessible(Field.java:166)
          at
  com.caucho.hessian.io.JavaSerializer.introspect(JavaSerializer.java:
  122)
          at com.caucho.hessian.io.JavaSerializer.init(JavaSerializer.java:
  81)
          at com.caucho.hessian.io.JavaSerializer.create(JavaSerializer.java:
  95)
          at
  com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFact 
  ory.java:
  348)
          at
  com.caucho.hessian.io.SerializerFactory.loadSerializer(SerializerFactory.ja 
  va:
  278)
          at
  com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.jav 
  a:
  224)
          at
  com.caucho.hessian.io.SerializerFactory.getObjectSerializer(SerializerFacto 
  ry.java:
  197)
          at
  com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:
  418)
          at
  com.caucho.hessian.io.AbstractHessianOutput.writeReply(AbstractHessianOutpu 
  t.java:
  558)
          at
  com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:
  323)
          at
  com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:
  202)
          at
  com.caucho.hessian.server.HessianServlet.invoke(HessianServlet.java:
  389)
          at
  com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:
  369)
          at 
  org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
  511)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1166)
          at
  com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo 
  bUploadFilter.java:
  97)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1157)
          at
  com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF 
  ilter.java:
  35)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1157)
          at
  com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans 
  actionCleanupFilter.java:
  43)
          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

[appengine-java] Re: SecurityException with Hessian on google app engine

2010-06-16 Thread dilbert
I posted a new bug report to the Hessian people: 
http://bugs.caucho.com/view.php?id=4080
There is also some information about this bug here:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/ccb9d0ff6b88545/

On Jun 8, 10:31 am, Matija matija.jerko...@gmail.com wrote:
 Any news about this SecurityException ?

 Matija.

 On Jun 5, 4:46 pm, dilbert dilbert.elbo...@gmail.com wrote:

  I am having trouble with Hessian on Google App Engine. First I will
  describe the setup. I have a persistent class MessageDb declared as
  (It contains a String and an arraylist of strings):

  @PersistenceCapable
  public class MessageDb {
      @PrimaryKey
      private String user;

      @Persistent
      private ArrayListString words = new ArrayListString();
      /* getters and setters ...*/

  }

  I have the following service interface:
  public interface IService {
      ArrayListString testMessage();
      /* Some other methods ... */
   }

  The Service is implemented on App engine in the following way:
  public class Service extends HessianServlet implements IService {
      private static final PersistenceManagerFactory pmfInstance =
  JDOHelper.getPersistenceManagerFactory(transactions-optional);

      @Override
      public ArrayListString testMessage() {
          PersistenceManager pm = null;
          try {
              pm = pmfInstance.getPersistenceManager();

              MessageDb messageDb;
              try {
                  messageDb = pm.getObjectById(MessageDb.class,
  testMessage);
              } catch (JDOObjectNotFoundException e) {
                  return null;
              }
              return messageDb.getWords();
              //return new ArrayListString(messageDb.getWords());
          } finally {
              if (pm != null)
                  pm.close();
          }
      }

  }

  The service simply retrieves an MessageDb object by key and returns
  the object's ArrayListString. This code works fine on the local
  development server but it fails when deployed on remote Google servers
  with the following exception:

  java.lang.SecurityException: java.lang.IllegalAccessException:
  Reflection is not allowed on private int java.util.ArrayList.size
          at
  com.google.appengine.runtime.Request.process-0c4ab611241850c6(Request.java)
          at java.lang.reflect.Field.setAccessible(Field.java:166)
          at
  com.caucho.hessian.io.JavaSerializer.introspect(JavaSerializer.java:
  122)
          at com.caucho.hessian.io.JavaSerializer.init(JavaSerializer.java:
  81)
          at com.caucho.hessian.io.JavaSerializer.create(JavaSerializer.java:
  95)
          at
  com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFact 
  ory.java:
  348)
          at
  com.caucho.hessian.io.SerializerFactory.loadSerializer(SerializerFactory.ja 
  va:
  278)
          at
  com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.jav 
  a:
  224)
          at
  com.caucho.hessian.io.SerializerFactory.getObjectSerializer(SerializerFacto 
  ry.java:
  197)
          at
  com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:
  418)
          at
  com.caucho.hessian.io.AbstractHessianOutput.writeReply(AbstractHessianOutpu 
  t.java:
  558)
          at
  com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:
  323)
          at
  com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:
  202)
          at
  com.caucho.hessian.server.HessianServlet.invoke(HessianServlet.java:
  389)
          at
  com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:
  369)
          at 
  org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
  511)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1166)
          at
  com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo 
  bUploadFilter.java:
  97)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1157)
          at
  com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF 
  ilter.java:
  35)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1157)
          at
  com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans 
  actionCleanupFilter.java:
  43)
          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

[appengine-java] Re: What is the best option for RPC (web services) on App engine?

2010-06-16 Thread dilbert
I posted a new bug report: http://bugs.caucho.com/view.php?id=4080
I would like to move further discussion about this issue to the proper
place:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/c4fb4f414c425ca1
D.

On Jun 16, 12:12 am, Jeff Schnitzer j...@infohazard.org wrote:
 I would close the old issue and create a new one cut down to just the
 exception issue.

 *Are* there any serious RPC alternatives right now?  Sounds like
 gwt-syncproxy isn't quite ready for prime time (and makes me nervous
 since it's not using a published protocol), the *-WS stuff is a
 trainwreck, and *-RS is not really convenient as an RPC layer.  I
 would like alternatives.

 Jeff

 On Tue, Jun 15, 2010 at 2:41 PM, dilbert dilbert.elbo...@gmail.com wrote:
  At the time I thought the issues were connected since they threw the
  same exception so I posted them together. So should I post the issue
  with exceptions again on the Caucho bug tracker? If this issue is
  solved I would recommend Hessian as the best RPC mechanism for GAE at
  this time.
  Apologies to other readers for the offtopic with bugs.
  D.

  On Jun 15, 11:24 pm, Jeff Schnitzer j...@infohazard.org wrote:
  I think you did yourself a disservice by wrapping these two issues
  into a single message - it ends up being way too much text to read and
  otherwise eager volunteers just skip it.

  The first issue looks like you're not detaching your entities before
  serializing them.  This is a JDO issue.  I suggest dropping JDO and
  using something simpler like Objectify ;-)

  The issue with exceptions looks more serious.  This is something that
  will need to be fixed in Hessian (or your custom serializer).  If you
  cut down your issue to just this, you might get better results from
  Caucho.

  Jeff

  On Tue, Jun 15, 2010 at 1:55 PM, dilbert dilbert.elbo...@gmail.com wrote:
   Hi Jeff. I was hoping to hear from You since I saw that You solved
   some GAE issues on the hessian-interest list. I already posted the
   issue on the hessian-interest list here:
  http://maillist.caucho.com/pipermail/hessian-interest/2010-June/00090...
   I also posted several forum questions:
  http://forum.caucho.com/showthread.php?t=
  http://groups.google.com/group/google-appengine-java/browse_thread/th...
   And a few bug reports:
  http://bugs.caucho.com/view.php?id=4061
  http://code.google.com/p/googleappengine/issues/detail?id=3305
   The posts actually describe two issues one with arraylist
   serialization and the other with exception serialization. The posts
   also include test projects with code that reproduces the issues. I
   also managed to solve the issue today by using a custom serializer.
   Here is how. First the Serializer:

   public class ThrowableSerializer extends AbstractSerializer {
     �...@override
      public void writeObject(Object obj, AbstractHessianOutput out)
   throws IOException {
          if (obj != null) {
              final Class cl = obj.getClass();
              if (out.addRef(obj))
                  return;
              int ref = out.writeObjectBegin(cl.getName());
              Throwable tr = (Throwable) obj;
              ByteArrayOutputStream bos = new ByteArrayOutputStream();
              ObjectOutputStream oos = new ObjectOutputStream(bos);
              try {
                  oos.writeObject(tr);

                  if (ref  -1) {
                      out.writeString(value);
                      out.writeBytes(bos.toByteArray());
                      out.writeMapEnd();
                  } else {
                      if (ref == -1) {
                          out.writeInt(1);
                          out.writeString(value);
                          out.writeObjectBegin(cl.getName());
                      }
                      out.writeBytes(bos.toByteArray());
                  }
              } finally {
                  oos.close();
                  bos.close();
              }
          } else
              out.writeNull();
      }
   }

   The other class we need is the Deserializer:
   public class ThrowableDeserializer extends AbstractDeserializer {
      //private static final Logger l =
   Logger.getLogger(ThrowableDeserializer.class.getName());

     �...@override
      public Class getType() {
          return Throwable.class;
      }

     �...@override
      public Object readMap(AbstractHessianInput in) throws IOException
   {
          int ref = in.addRef(null);
          byte[] initValue = null;
          while (!in.isEnd()) {
              String key = in.readString();

              if (key.equals(value))
                  initValue = in.readBytes();
              else
                  in.readString();
          }

          in.readMapEnd();
          ByteArrayInputStream bis = new
   ByteArrayInputStream(initValue);
          ObjectInputStream ois = new ObjectInputStream(bis);
          try {
              Object value = ois.readObject();
              in.setRef(ref, value

[appengine-java] Re: What is the best option for RPC (web services) on App engine?

2010-06-15 Thread dilbert
At the time I thought the issues were connected since they threw the
same exception so I posted them together. So should I post the issue
with exceptions again on the Caucho bug tracker? If this issue is
solved I would recommend Hessian as the best RPC mechanism for GAE at
this time.
Apologies to other readers for the offtopic with bugs.
D.

On Jun 15, 11:24 pm, Jeff Schnitzer j...@infohazard.org wrote:
 I think you did yourself a disservice by wrapping these two issues
 into a single message - it ends up being way too much text to read and
 otherwise eager volunteers just skip it.

 The first issue looks like you're not detaching your entities before
 serializing them.  This is a JDO issue.  I suggest dropping JDO and
 using something simpler like Objectify ;-)

 The issue with exceptions looks more serious.  This is something that
 will need to be fixed in Hessian (or your custom serializer).  If you
 cut down your issue to just this, you might get better results from
 Caucho.

 Jeff

 On Tue, Jun 15, 2010 at 1:55 PM, dilbert dilbert.elbo...@gmail.com wrote:
  Hi Jeff. I was hoping to hear from You since I saw that You solved
  some GAE issues on the hessian-interest list. I already posted the
  issue on the hessian-interest list here:
 http://maillist.caucho.com/pipermail/hessian-interest/2010-June/00090...
  I also posted several forum questions:
 http://forum.caucho.com/showthread.php?t=
 http://groups.google.com/group/google-appengine-java/browse_thread/th...
  And a few bug reports:
 http://bugs.caucho.com/view.php?id=4061
 http://code.google.com/p/googleappengine/issues/detail?id=3305
  The posts actually describe two issues one with arraylist
  serialization and the other with exception serialization. The posts
  also include test projects with code that reproduces the issues. I
  also managed to solve the issue today by using a custom serializer.
  Here is how. First the Serializer:

  public class ThrowableSerializer extends AbstractSerializer {
    �...@override
     public void writeObject(Object obj, AbstractHessianOutput out)
  throws IOException {
         if (obj != null) {
             final Class cl = obj.getClass();
             if (out.addRef(obj))
                 return;
             int ref = out.writeObjectBegin(cl.getName());
             Throwable tr = (Throwable) obj;
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
             ObjectOutputStream oos = new ObjectOutputStream(bos);
             try {
                 oos.writeObject(tr);

                 if (ref  -1) {
                     out.writeString(value);
                     out.writeBytes(bos.toByteArray());
                     out.writeMapEnd();
                 } else {
                     if (ref == -1) {
                         out.writeInt(1);
                         out.writeString(value);
                         out.writeObjectBegin(cl.getName());
                     }
                     out.writeBytes(bos.toByteArray());
                 }
             } finally {
                 oos.close();
                 bos.close();
             }
         } else
             out.writeNull();
     }
  }

  The other class we need is the Deserializer:
  public class ThrowableDeserializer extends AbstractDeserializer {
     //private static final Logger l =
  Logger.getLogger(ThrowableDeserializer.class.getName());

    �...@override
     public Class getType() {
         return Throwable.class;
     }

    �...@override
     public Object readMap(AbstractHessianInput in) throws IOException
  {
         int ref = in.addRef(null);
         byte[] initValue = null;
         while (!in.isEnd()) {
             String key = in.readString();

             if (key.equals(value))
                 initValue = in.readBytes();
             else
                 in.readString();
         }

         in.readMapEnd();
         ByteArrayInputStream bis = new
  ByteArrayInputStream(initValue);
         ObjectInputStream ois = new ObjectInputStream(bis);
         try {
             Object value = ois.readObject();
             in.setRef(ref, value);
             return value;
         } catch (ClassNotFoundException e) {
             throw new RuntimeException(e);
         } finally {
             ois.close();
             bis.close();
         }
     }

    �...@override
     public Object readObject(AbstractHessianInput in, Object[]
  fieldNames)
             throws IOException {
         int ref = in.addRef(null);
         byte[] initValue = null;
         for (Object o : fieldNames) {
             if (o instanceof String) {
                 final String key = (String) o;
                 if (key.equals(value))
                     initValue = in.readBytes();
                 else
                     in.readObject();
             }
         }
         ByteArrayInputStream bis = new
  ByteArrayInputStream(initValue);
         ObjectInputStream ois = new ObjectInputStream(bis);
         try

[appengine-java] What is the best option for RPC (web services) on App engine?

2010-06-10 Thread dilbert
First I'd like to explain what I mean by RPC. I'd like to be able to
write interfaces like this (simple Java interface):

public interface EchoService {
  String echo(String message);
}

The framework would allow the creation of client classes that would
handle the serialization from/to the RPC service. Of course the
framework should support the serialization of ArrayLists, HashMaps and
other collections and should also support the serialization of objects
marked with the java.io.Serializable interface (or some other
interface).
We would create the RPC Client this way:

EchoService echoService =
RpcClientFactory.createInstance(EchoService.class,http://bla.com/
smartApp/echo);

And of course use it this way:

String echoMessage = echoService.echo(The message !!!);

The server side servlet would implement the previously mentioned
interface.
public class Service extends WhateverServlet implements EchoService {
@Override
String echo(String message) {
return server sends: + message;
}
}

A few additional nice features to have would be:
-support for asynchronous calls (where the developer would provide a
callback for handling the result, similar to GWT RPC)
-the developers should be able to access the RPC client somehow to be
able to handle Cookies or other http headers.
-the client side should be usable from Android.

After a long search I have found that the framework that most closely
matches these requirements is Hessian (http://hessian.caucho.com/). It
uses a binary protocol so it should be very fast and it works on
Android. AFAIK it does not support async calls. However, not all is
well. The current Hessian implementation does not handle exceptions
well. It throws a SecurityException like this:

java.lang.SecurityException: java.lang.IllegalAccessException:
Reflection is not allowed on private java.lang.Throwable
java.lang.Throwable.cause

I considered GWT RPC for a while but it does not have a proper Java
client or I could not find one. So I wanted to ask is there any other
library that could be used in this case? Could the App engine team
write such a library and add it to the SDK. Any suggestions?

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