[appengine-java] Re: How to use Python Bulk uploader to import data in local_db.bin ?

2010-11-07 Thread Sam E.
I've found another posting with the same problem here:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/984c1b4747c1a44e/5e258e269f208444

Regards,
-Sam Edwards
http://handstandsam.com

On Nov 7, 1:50 am, "Sam E."  wrote:
> I've been getting the same problems when trying to import my csv
> backup to my local development datastore.  I've had success with using
> a live app engine instance, but am having errors with my development
> datastore.
>
> I've been running the following command:
> appcfg.pyupload_data--url=http://localhost:/remote_api--
> kind=Deal  --filename=Deal.csv --config_file=dealsconfig.yml --
> application=dealsexample
>
> I end up with this error:
> /usr/local/bin/appcfg.py:42: DeprecationWarning: the sha module is
> deprecated; use the hashlib module instead
>   os.path.join(DIR_PATH, 'lib', 'django'),
> /Users/ssaammee/Desktop/data/GoogleAppEngineLauncher.app/Contents/
> Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> google_appengine/google/appengine/tools/dev_appserver_login.py:33:
> DeprecationWarning: the md5 module is deprecated; use hashlib instead
>   import md5
> Uploading data records.
> [INFO    ] Logging to bulkloader-log-20101107.012940
> [INFO    ] Throttling transfers:
> [INFO    ] Bandwidth: 25 bytes/second
> [INFO    ] HTTP connections: 8/second
> [INFO    ] Entities inserted/fetched/modified: 20/second
> [INFO    ] Batch Size: 10
> [INFO    ] Opening database: bulkloader-progress-20101107.012940.sql3
> Please enter login credentials forlocalhost
> Email: t...@example.com
> Password for t...@example.com:
> [INFO    ] Connecting tolocalhost:/remote_api
> [ERROR   ] Exception during authentication
> Traceback (most recent call last):
>   File "/Users/ssaammee/Desktop/data/GoogleAppEngineLauncher.app/
> Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> google_appengine/google/appengine/tools/bulkloader.py", line 3175, in
> Run
>     self.request_manager.Authenticate()
>   File "/Users/ssaammee/Desktop/data/GoogleAppEngineLauncher.app/
> Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> google_appengine/google/appengine/tools/bulkloader.py", line 1187, in
> Authenticate
>     remote_api_stub.MaybeInvokeAuthentication()
>   File "/Users/ssaammee/Desktop/data/GoogleAppEngineLauncher.app/
> Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> google_appengine/google/appengine/ext/remote_api/remote_api_stub.py",
> line 539, in MaybeInvokeAuthentication
>     datastore_stub._server.Send(datastore_stub._path, payload=None)
>   File "/Users/ssaammee/Desktop/data/GoogleAppEngineLauncher.app/
> Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> google_appengine/google/appengine/tools/appengine_rpc.py", line 341,
> in Send
>     f = self.opener.open(req)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/urllib2.py", line 389, in open
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/urllib2.py", line 502, in http_response
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/urllib2.py", line 427, in error
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/urllib2.py", line 361, in _call_chain
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/urllib2.py", line 510, in http_error_default
> HTTPError: HTTP Error 404: Not Found
> [INFO    ] Authentication Failed
>
> I am on a Mac with App Engine SDK 1.3.8.  I've been messing around
> with this for hours to no avail.  I've tried tips 
> fromhttp://stackoverflow.com/questions/1260835/which-credentials-should-i...
> but no luck.
>
> Any suggestions for loading into the local datastore using java and
> the remote_api servlet?  This would be really helpful for testing.
>
> Thank you!
> -Sam Edwardshttp://handstandsam.com
>
> On Oct 21, 4:13 am, cYr4X  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Currently, I successfully download and upload data into my Java
> > Application on Google App Engine in production environment using the
> > python BulkUploader (I followed this nice tutorial 
> > :http://ikaisays.com/2010/06/10/using-the-bulkloader-with-java-app-eng...)
>
> > But I'm facing a problem using the same process to import data in my
> > local environment.
>
> > The Google App Engine's documentation says that we need to run the
> > following command in order to upload data inlocalhost:
>
> > appcfg.pyupload_data--config_file=album_loader.py --
> > filename=album_data.csv --kind=Album --url=http://localhost:8080/
> > remote_api 
>
> > where  contains my app.yaml.
>
> > But when i ran this command, appcfg.py has returned the following
> > error :
>
> > Unable to assign value 'java' to attribute 'runtime':
> > Value 'java' for key runtime does not match expression '^python$'
>
> > Is it possible to bulkupload data in Local Database of a Java
> > Application u

[appengine-java] Re: Task Queue on other App Servers

2010-11-07 Thread andrew
We use JDO on top of datastore and also on MySQL (for Tomcat for
example).

Had to work through a few limitations for complete JDO portability
across both, but it works and we release and test same cide on mysql/
Tomcat also.

Have to work on JMail setup on Linux when we get time for email
sending portability, but don't expect problems.

TaskQueue and XMPP are only services we don't have a portable solution
to yet.

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



Re: [appengine-java] Re: parent object reference is null when using owned one-to-many relationships

2010-11-07 Thread Ian Murdock
[ I got this directly, and I'm responding back to the
  list, so I've removed the sender's contact details.
  Thanks! ]

I'm not sure I understand. Parent.child is set properly
when I persist Parent, and persisting Parent persists its
Children (they are indeed in the data store, it's
just that the parent field of each Child is always null).
In addition to calling makePersistent on Parent,
I also need to call makePersistentAll on Parent.children?

-ian

> I beleive, you might need to explictly set the parent in child by calling
> setParent in child and call makePersistentAll. Since the ID is set, it maps
> accordingly and maintains consistency.
>
> 2010/11/5 Ian Murdock 
>>
>> On Fri, Nov 5, 2010 at 12:14 PM, Ian Murdock 
>> wrote:
>> >   �...@persistencecapable
>> >    public class Child {
>> >       �...@persistent
>> >        private Parent parent;
>> >       �...@persistent
>> >        private String field;
>> >
>> >        public Child(String field) {
>> >            this.field = field;
>> >        }
>> >
>> >        public Parent getParent() {
>> >            return parent;
>> >        }
>> >
>> >        public void setParent(Parent parent) {
>> >            this.parent = parent;
>> >        }
>> >    }
>>
>> Cut and paste error.. Child has a key too:
>>
>>   �...@persistencecapable
>>    public class Child() {
>>       �...@primarykey
>>       �...@persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
>>       �...@extension(vendorName="datanucleus", key="gae.encoded-pk",
>> value="true")
>>        private String key;
>>
>>        // ...
>>    }
>>
>> -ian
>> --
>> Ian Murdock
>> http://ianmurdock.com/
>>
>> "Don't look back--something might be gaining on you." --Satchel Paige
>>
>> --
>> 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.
>>

-- 
Ian Murdock
http://ianmurdock.com/

"Don't look back--something might be gaining on you." --Satchel Paige

-- 
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] mapreduce - passing filters

2010-11-07 Thread aswath satrasala
Hello,
I want to perform few aggregations on entities of a kind that are filtered
by the property.
The entities I want to perform the aggregation is small compared to the
complete entity set.
Is there any way to pass the filters to the mapper, so that only those
entities are retrieved and aggregation is performed

*Regards
-Aswath
http://vs-accounting.appspot.com
Accounting for Indian markets.*

-- 
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] No API environment is registered for this thread

2010-11-07 Thread Eyal
Hi all,

I'm trying to use JDO in an app engine application on Eclipse. When I
use a web interface I'm able to make it work just fine. But I need to
be able to run it as a java application and when I try I get the
following exception:

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.Query.(Query.java:87)
at
org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuery.java:
649)
at
org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:
215)
at
org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:
89)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
at org.datanucleus.store.query.Query.executeWithArray(Query.java:
1371)
at org.datanucleus.store.query.Query.execute(Query.java:1344)
at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
at com.eyes.manager.UpdateManager.main(UpdateManager.java:39)


This is my jdeoconfig.xml, which is generated by the Eclipse plugin:


http://java.sun.com/xml/ns/jdo/jdoconfig";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/
jdoconfig">

   
   
   
   
   
   
   
   


Any idea how can I solve this? How do I register the "API
Environment?"

Thanks!
Eyal

-- 
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: Remote database access.

2010-11-07 Thread jesbox
You could try to use the URL Fetch API, and access the database with
http or https. The database needs to be dressed as a SOA service, but
would not be the first one to do that:)

Cheers, jesboxx

On Nov 4, 6:46 pm, Caram  wrote:
> Hello!
>
> Using GAE, is it possible to my application access a remote SqlServer
> database?
> Searching, I only discover that GAE can access a host or a file with
> Secure Data Connector (SDC). This tutorial (http://code.google.com/
> intl/pt-BR/securedataconnector/docs/1.3/tutorials/appengine.html)
> shows it, I understand that it wouldn't solve my need, am I right?
> I'm using the GWT plugin for Eclipse, my application is Java based and
> uses GWT (2.1.0) and GAE (1.3.8).
>
> Thanks!
> Caram.:

-- 
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: Memcache: can't get it working

2010-11-07 Thread Slaine
Found a solution by using a different API:

MemcacheService  cache = MemcacheServiceFactory.getMemcacheService();

Rest of the code is the same.

Actually documentation of app engine has some shortcomings on this
topic. I have passed 2 days trying to find a solution and finaly found
it in O'Reilly's book on app engine.

BR,
Lennart



On 5 nov, 16:52, Lennart Benoot  wrote:
> Just to be clear, this is already happening after 1 minute. Should I fill in
> an expiration date? Documentation says that if no default is given, cache is
> heald in memory as long as possible. Amount of data in cache is limited
> also...
>
> BRL
>
> On 5 November 2010 16:31, alesj  wrote:
>
>
>
>
>
>
>
> >http://code.google.com/appengine/docs/java/memcache/overview.html
>
> > >> Values can expire from the memcache at any time, and may be expired
> > prior to the expiration deadline set for the value.
>
> > All looks fine, but like it says, cached value can go away at any
> > time.
> > Which is probably what's happening in your case.
>
> > On Nov 5, 1:45 pm, Lennart Benoot  wrote:
> > > Hi all,
>
> > > I'm trying to implement Memcache but without success so far. I have
> > > difficulties finding examples containing fully working code so I tried
> > > to construct based on what I could find. Here's the code to get a
> > > reference to the cache:
>
> > > cache= CacheManager.getInstance().getCache("fourturemark");
> > > if (cache == null) {
> > > cache =
>
> > CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyM 
> > ap());
> > > CacheManager.getInstance().registerCache("fourturemark", cache);
>
> > > }
>
> > > If I'm right, this code should return the cache in case it already
> > > exists. However, based on performance, I see that data stored in cache
> > > is reloaded from resource instead of cache.
>
> > > Any idea what I'm doing wrong here?
>
> > > BR,
> > > Lennart
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

-- 
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: Problem with JSF 2.0

2010-11-07 Thread Daniel
Try adding  implements Serializable to the problematic bean
(br.com.controlecartao.web.managed.EmpresaMBean)

and add the private static final long serialVersionUID .. variable
as eclipse suggests

also make sure you got this entry in appengine-web.xml : true


this should solve the issue


Regards


Daniel

On Nov 5, 9:12 pm, vaninh0  wrote:
> Hello,
>
> I have an application running on EclipsePlugin (JSF2.0), but when I
> deploy it got the following error:
> (it's started when I used the templates)
>
> Anyone can help me?
>
> java.lang.RuntimeException: java.io.NotSerializableException:
> br.com.controlecartao.web.managed.EmpresaMBean
>         at
> com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:
> 387)
>         at
> com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession(SessionManager.java:
> 364)
>         at com.google.apphosting.runtime.jetty.SessionManager
> $AppEngineSession.save(SessionManager.java:164)
>         at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
> 41)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> 43)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> 388)
>         at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> 216)
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> 182)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> 765)
>         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 418)
>         at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
> 238)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>         at org.mortbay.jetty.Server.handle(Server.java:326)
>         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> 542)
>         at org.mortbay.jetty.HttpConnection
> $RequestHandler.headerComplete(HttpConnection.java:923)
>         at
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
> 76)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>         at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
> 135)
>         at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
> 261)
>         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:8486)
>         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:8484)
>         at
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
> 24)
>         at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> 418)
>         at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:
> 572)
>         at com.google.tracing.TraceContext$TraceContextRunnable
> $1.run(TraceContext.java:448)
>         at com.google.tracing.TraceContext.runInContext(TraceContext.java:
> 688)
>         at com.google.tracing.TraceContext
> $AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:
> 326)
>         at com.google.tracing.TraceContext
> $AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:
> 318)
>         at com.google.tracing.TraceContext
> $TraceContextRunnable.run(TraceContext.java:446)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
> 1110)
>         at java.util.concurrent.ThreadPoolExecutor
> $Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:636)
> Caused by: java.io.NotSerializableException:
> br.com.controlecartao.web.managed.EmpresaMBean
>         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
> 1173)
>         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:
> 343)
>         at java.util.HashMap.writeObject(HashMap.java:1018)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 43)
>         at java.lang.reflect.Method.invoke(Method.java:616)
>         at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:
> 962)
>         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:
> 1478)
>         at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:
> 1409)
>       

[appengine-java] Two apps hitting the same datastore

2010-11-07 Thread Eyal
Hi all,

I need to have two separate applications hitting the same datastore.
One updates it daily, and the other (app engine and GWT) reading from
it on a regular basis. How is this done? Is there a way in the API to
specify a specific datastore?

Thanks,
Eyal

-- 
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: Two apps hitting the same datastore

2010-11-07 Thread Robert Lancer
create a rest api and use urlfetch

On Nov 7, 5:23 pm, Eyal  wrote:
> Hi all,
>
> I need to have two separate applications hitting the same datastore.
> One updates it daily, and the other (app engine and GWT) reading from
> it on a regular basis. How is this done? Is there a way in the API to
> specify a specific datastore?
>
> Thanks,
> Eyal

-- 
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: Two apps hitting the same datastore

2010-11-07 Thread Starman
As you know, you can deploy many versions of an app for the same app
id. There is nothing that says it has to be the same app. Just deploy
another app that does your weekly updates using another version
string. Each version, even though it may not be the default one, gets
its own url. You just need to trigger it one a week thereafter.

On Nov 7, 5:23 pm, Eyal  wrote:
> Hi all,
>
> I need to have two separate applications hitting the same datastore.
> One updates it daily, and the other (app engine and GWT) reading from
> it on a regular basis. How is this done? Is there a way in the API to
> specify a specific datastore?
>
> Thanks,
> Eyal

-- 
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: No API environment is registered for this thread

2010-11-07 Thread lp
what do u mean by 'run it as a java application'?

do u mean run as unit test?

if so try this
http://code.google.com/appengine/docs/java/tools/localunittesting.html
-lp

-- 
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: Problem with JSF 2.0

2010-11-07 Thread vaninh0
Oh my god!
I had implemented a serialization of the managed bean, but had not
seen that the exception had changed to another class to serialize
(EmpresaMBean first, and Empresa the entity after), serialize all
requested now and it worked.

Thank you.

On 7 nov, 20:19, Daniel  wrote:
> Try adding  implements Serializable to the problematic bean
> (br.com.controlecartao.web.managed.EmpresaMBean)
>
> and add the private static final long serialVersionUID .. variable
> as eclipse suggests
>
> also make sure you got this entry in appengine-web.xml :  enabled>true
>
> this should solve the issue
>
> Regards
>
> Daniel
>
> On Nov 5, 9:12 pm, vaninh0  wrote:
>
> > Hello,
>
> > I have an application running on EclipsePlugin (JSF2.0), but when I
> > deploy it got the following error:
> > (it's started when I used the templates)
>
> > Anyone can help me?
>
> > java.lang.RuntimeException: java.io.NotSerializableException:
> > br.com.controlecartao.web.managed.EmpresaMBean
> >         at
> > com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:
> > 387)
> >         at
> > com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession(SessionManager.java:
> > 364)
> >         at com.google.apphosting.runtime.jetty.SessionManager
> > $AppEngineSession.save(SessionManager.java:164)
> >         at
> > com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
> > 41)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1157)
> >         at
> > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> > 43)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1157)
> >         at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> > 388)
> >         at
> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> > 216)
> >         at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> > 182)
> >         at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> > 765)
> >         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> > 418)
> >         at
> > com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
> > 238)
> >         at
> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> > 152)
> >         at org.mortbay.jetty.Server.handle(Server.java:326)
> >         at 
> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> > 542)
> >         at org.mortbay.jetty.HttpConnection
> > $RequestHandler.headerComplete(HttpConnection.java:923)
> >         at
> > com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
> > 76)
> >         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> >         at
> > com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
> > 135)
> >         at
> > com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
> > 261)
> >         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:8486)
> >         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:8484)
> >         at
> > com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
> > 24)
> >         at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> > 418)
> >         at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:
> > 572)
> >         at com.google.tracing.TraceContext$TraceContextRunnable
> > $1.run(TraceContext.java:448)
> >         at com.google.tracing.TraceContext.runInContext(TraceContext.java:
> > 688)
> >         at com.google.tracing.TraceContext
> > $AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:
> > 326)
> >         at com.google.tracing.TraceContext
> > $AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:
> > 318)
> >         at com.google.tracing.TraceContext
> > $TraceContextRunnable.run(TraceContext.java:446)
> >         at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
> > 1110)
> >         at java.util.concurrent.ThreadPoolExecutor
> > $Worker.run(ThreadPoolExecutor.java:603)
> >         at java.lang.Thread.run(Thread.java:636)
> > Caused by: java.io.NotSerializableException:
> > br.com.controlecartao.web.managed.EmpresaMBean
> >         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
> > 1173)
> >         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:
> > 343)
> >         at java.util.HashMap.writeObject(HashMap.java:1018)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> > sun.refl

[appengine-java] Re: No API environment is registered for this thread

2010-11-07 Thread Didier Durand
Hi,

This comes when you are trying to run code within Eclipse without
having starting properly the local runtime of App Engine: see
http://code.google.com/appengine/docs/java/tools/localunittesting.html
(parag Datastore tests)

I can also  supply my Junit init code when needed

regards
didier

On Nov 7, 5:45 pm, Eyal  wrote:
> Hi all,
>
> I'm trying to use JDO in an app engine application on Eclipse. When I
> use a web interface I'm able to make it work just fine. But I need to
> be able to run it as a java application and when I try I get the
> following exception:
>
> 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.Query.(Query.java:87)
>         at
> org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuery.java:
> 649)
>         at
> org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:
> 215)
>         at
> org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:
> 89)
>         at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
>         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
> 1371)
>         at org.datanucleus.store.query.Query.execute(Query.java:1344)
>         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
>         at com.eyes.manager.UpdateManager.main(UpdateManager.java:39)
>
> This is my jdeoconfig.xml, which is generated by the Eclipse plugin:
>
> 
> http://java.sun.com/xml/ns/jdo/jdoconfig";
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/
> jdoconfig">
>
>    
>        
> value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/
>
>         value="appengine"/>
>         value="true"/>
>         value="true"/>
>        
>         value="true"/>
>    
> 
>
> Any idea how can I solve this? How do I register the "API
> Environment?"
>
> Thanks!
> Eyal

-- 
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: No API environment is registered for this thread

2010-11-07 Thread Eyal
Thank you lp, and Didier.

Actually this application will need to run in production, and not only
in testing.

I need to be able to update the application's datastore with a feed
from Analytics. When I create a very simple GUI for it using GWT
(basically just a submit button,) I get a timeout exception because
the Analytics server takes too long to respond (it seems to be
unsolvable at this point.) So I thought I'll just run it as a simple
Java application -- and than I don't have the timeout problem and the
Analytics feed works beautifully.

But then -- this problem. When I create objects from the Analytics
feed, and try to insert them into the datastore, I get the exception
above.

What am I missing?

You help is greatly appreciated!

Eyal


On Nov 8, 6:21 am, Didier Durand  wrote:
> Hi,
>
> This comes when you are trying to run code within Eclipse without
> having starting properly the local runtime of App Engine: 
> seehttp://code.google.com/appengine/docs/java/tools/localunittesting.html
> (parag Datastore tests)
>
> I can also  supply my Junit init code when needed
>
> regards
> didier
>
> On Nov 7, 5:45 pm, Eyal  wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > I'm trying to use JDO in an app engine application on Eclipse. When I
> > use a web interface I'm able to make it work just fine. But I need to
> > be able to run it as a java application and when I try I get the
> > following exception:
>
> > java.lang.NullPointerException: No API environment is registered for
> > this thread.
> >         at
> > com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(Datas 
> > toreApiHelper.java:
> > 108)
> >         at
> > com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamesp 
> > ace(DatastoreApiHelper.java:
> > 118)
> >         at com.google.appengine.api.datastore.Query.(Query.java:87)
> >         at
> > org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuer 
> > y.java:
> > 649)
> >         at
> > org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(Datasto 
> > reQuery.java:
> > 215)
> >         at
> > org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery. 
> > java:
> > 89)
> >         at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
> >         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
> > 1371)
> >         at org.datanucleus.store.query.Query.execute(Query.java:1344)
> >         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
> >         at com.eyes.manager.UpdateManager.main(UpdateManager.java:39)
>
> > This is my jdeoconfig.xml, which is generated by the Eclipse plugin:
>
> > 
> > http://java.sun.com/xml/ns/jdo/jdoconfig";
> >    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/
> > jdoconfig">
>
> >    
> >        
> > value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFa 
> > ctory"/
>
> >         > value="appengine"/>
> >         > value="true"/>
> >         > value="true"/>
> >        
> >         > value="true"/>
> >    
> > 
>
> > Any idea how can I solve this? How do I register the "API
> > Environment?"
>
> > Thanks!
> > Eyal

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