[appengine-java] Server Error

2011-06-28 Thread rama krishna
Hi All,

I developed a project using spring roo and spring tool suite STS using
the following commands

persistence setup --database GOOGLE_APP_ENGINE --provider DATANUCLEUS
--applicationId trialdeck
entity --class ~.domain.Speaker --testAutomatically
field string --fieldName fullName --notNull
field string --fieldName email --notNull --regexp ^([0-9a-zA-Z]([-.
\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
field string --fieldName city
field date --fieldName birthDate --type java.util.Date --notNull
field string --fieldName bio
entity --class ~.domain.Presentation --testAutomatically
field string --fieldName title --notNull
field string --fieldName description --notNull
field string --fieldName speaker --notNull
gwt setup
controller all --package ~.web
security setup

after compliation and before deployment .. i got an error saying that
appengine-web.xml and web.xml files are not found in target.

I copies those files and the deployment was done sucessfull


When i started the application i got an erro

Could not instantiate listener
org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException:
org.springframework.web.context.ContextLoaderListener
at com.google.appengine.runtime.Request.process-
cdd6144170db76f4(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)



EXCEPTION
java.lang.ClassNotFoundException:
org.springframework.web.filter.CharacterEncodingFilter
at com.google.appengine.runtime.Request.process-
cdd6144170db76f4(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)



If anyone have solution . .please let me know


thank you all


-- 
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] @Nick - ClassCastException on dev server when using ApiProxy to implement Multi tenancy

2010-04-23 Thread Krishna
Nick (and others who may be able to help),

When I tried to implement multi tenancy in my application by following
what was described at 
http://blog.notdot.net/2009/11/App-Engine-Java-API-call-hooks,
I got the following exception on my dev server while trying to access
localhost/_ah/admin:

java.lang.ClassCastException:
com.sshrin.playground.server.ApiProxyHook cannot be cast to
com.google.appengine.tools.development.ApiProxyLocal
at
com.google.apphosting.utils.servlet.DatastoreViewerServlet.getSchema(DatastoreViewerServlet.java:
146)
at
com.google.apphosting.utils.servlet.DatastoreViewerServlet.doGetDatastoreViewer(DatastoreViewerServlet.java:
207)
at
com.google.apphosting.utils.servlet.DatastoreViewerServlet.doGet(DatastoreViewerServlet.java:
194)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.sshrin.playground.server.MultiTenantFilter.doFilter(MultiTenantFilter.java:
32)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:349)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
Apr 23, 2010 7:20:14 PM
com.google.appengine.tools.development.LocalResourceFileServlet doGet


Now, from the stack trace, it looks like this is a dev server specific
issue and I've actually confirmed that my code works correctly in
production. However, I'd really like to be able to browse the local
datastore on the dev server and am wondering if there is a workaround
for this?

Thanks,

Krishna

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



[appengine-java] Re: Eclipse plugin - prevent auto-copy of jars

2010-04-08 Thread Krishna
Thanks Scott, Miguel.

For now I am deploying manually and that seems to work.

Miguel - thanks for the link to the FAQ. I overlooked the eclipse
plugin googlecode website which, retrospectively thinking, should have
been the most logical place to look for an answer :-).

Krishna

On Apr 5, 5:36 pm, Miguel Méndez  wrote:
> By default the eclipse plugin will copy the default set of SDK jars that
> most applications will need into YOUR_WAR_DIRECTORY/WEB-INF/lib under the
> assumption that you will want to launch and deploy from it directly.  If you
> want tighter control, you can navigate to the project properties and select
> Google > Web Application and uncheck the "Launch and deploy from this
> directory".  This will treat the directory as input only (won't copy any
> jars into YOUR_WAR_DIRECTORY/WEB-INF/lib), but you will need to provide a
> staging war directory for launching and debugging.
>
> The feature was intended to facilitate integration with Eclipse J2EE
> projects and Maven -- perhaps it will be useful in this case.  The
> FAQs<http://code.google.com/eclipse/docs/faq.html>go into more detail.
>
> On Sun, Apr 4, 2010 at 2:35 PM, Scott Hernandez 
> wrote:
>
>
>
>
>
> > There was  recent discussion about dependencies (valid for Objectify or any
> > datastore based impl.)  but the eclipse plugin question has not been
> > answered well.
>
> >http://groups.google.com/group/objectify-appengine/browse_thread/thre...
>
> > I suspect that if you enable the plugin, it will always copy the files into
> > your lib dir :(
>
> > You can disable it and use ant/command-line to deploy, as a last ditch
> > option.
>
> > On Sun, Apr 4, 2010 at 11:25 AM, Krishna wrote:
>
> >> Hi,
>
> >> I'm using Objectify for persistence and I'd really like to remove all
> >> jdo /  jpa related jars from my lib directory but eclipse keeps
> >> transferring them back. I also tried modifying the contents of the
> >> com.google.appengine.eclipse.core file under the .setting directory
> >> but I guess eclipse overwrites my changes on startup and then copies
> >> over the jars anyway. I've seen discussions where people have used the
> >> appcfg tool to manually deploy instead of doing so from within eclipse
> >> but I'm hoping a better solution  exists.
>
> >> This blogpost
> >>http://www.answercow.com/2010/03/google-app-engine-cold-start-guide-f...
> >> claims that startup times reduce by ~400ms by removing these jars and
> >> I really love speedups especially when they are free :-).
>
> >> Perhaps someone from Google can comment on whether removing these jars
> >> will actually speedup apps even if the app does not directly use
> >> them.
>
> >> Also, I am not sure which jars need to be retained for sure and I'd
> >> really appreciate it if someone could could give me a pointer
> >> regarding this. I am pretty new to Java so apologies if this is a
> >> naive question.
>
> >> Thanks so much,
>
> >> Krishna
>
> >> --
> >> 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 > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Miguel

-- 
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] Eclipse plugin - prevent auto-copy of jars

2010-04-04 Thread Krishna
Hi,

I'm using Objectify for persistence and I'd really like to remove all
jdo /  jpa related jars from my lib directory but eclipse keeps
transferring them back. I also tried modifying the contents of the
com.google.appengine.eclipse.core file under the .setting directory
but I guess eclipse overwrites my changes on startup and then copies
over the jars anyway. I've seen discussions where people have used the
appcfg tool to manually deploy instead of doing so from within eclipse
but I'm hoping a better solution  exists.

This blogpost 
http://www.answercow.com/2010/03/google-app-engine-cold-start-guide-for.html
claims that startup times reduce by ~400ms by removing these jars and
I really love speedups especially when they are free :-).

Perhaps someone from Google can comment on whether removing these jars
will actually speedup apps even if the app does not directly use
them.

Also, I am not sure which jars need to be retained for sure and I'd
really appreciate it if someone could could give me a pointer
regarding this. I am pretty new to Java so apologies if this is a
naive question.

Thanks so much,

Krishna

-- 
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: Persisting polymorphic classes using the low level API or Objectify

2010-02-13 Thread Krishna
John,

Thank you very much for pointing me to Twig. I'll play around with it
this weekend and get back to you if I have any questions.

Thanks,
Shrikrishna

On Feb 6, 12:12 am, John Patterson  wrote:
> Hi Shrikrishna ,
>
> Im not sure about Objectify but Twig supports storing and retrieving  
> Polymorphic references.  Your example could be persisted out-of-the-
> box with no extra configuration.
>
> Also Twig does handle querying on VehicleType - although you say that  
> this is not yet a requirement.
>
> Currently to query across all vehicle types you would need to issue  
> multiple queries and join them.  But this is simple even when your  
> results are sorted using the support class SortedMergeIterator.
>
> BTW, to fully support polymorphic queries is actually quite a simple  
> extension that I just haven't had the need for yet and so haven't  
> written.  If you were willing to hack a patch I would be happy to give  
> you some pointers where to start.
>
> http://code.google.com/p/twig-persist/
>
> John
>
> On 5 Feb 2010, at 18:45, Shrikrishna Shrin wrote:
>
>
>
> > Hi,
>
> > I am developing an application that requires persisting of different  
> > object categories that are all subclasses of a specific type. Say I  
> > have a super class Vehicle and two subclasses Car extends Vehicle  
> > and Ship extends Vehicle. Ideally what I would like to do is to be  
> > able to query across all Vehicle objects as well as Car and Ship  
> > objects separately.
>
> > It looks like the PolyModel class  from the app engine Python API  
> > does this 
> > (http://code.google.com/appengine/docs/python/datastore/polymodelclass...
> >    orhttp://code.google.com/appengine/articles/polymodel.html)
>
> > However, from the following thread it seems like this is not (yet?)  
> > supported in the Java API:
> >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > To get around this *limitation* I do something like this
>
> > class Vehicle {
>
> >     String id;
> >     
> >     
>
> >     String vehicleType; // indicates what the vehicle type is, eg:  
> > Car / Ship.
> >     Text vehicleData; // a blob of text that is a String  
> > representation of a JSONObject that contains info specific to a  
> > vehicle type.
> > }
>
> > I am aware that one immediate flaw in my approach is that you cannot  
> > query by vehicleType specific fields contained in the vehicleData  
> > blob. This is *NOT* important for my current app (I only need to  
> > query across vehicle properties but the view on the client side  
> > depends on the vehicleType). However, I am interested in knowing if  
> > it is possible to get around this?
>
> > The front end for my app uses GWT and basically what it does is it  
> > gets Vehicle objects via RPC and triggers the corresponding  
> > presenter & view based on the vehicleType. Each presenter in turn  
> > knows what to do with the corresponding vehicleData JSON blob.
>
> > Am currently using Objectify (http://code.google.com/p/objectify-appengine/
> > )  for persistence but there doesn't seem to be any built-in support  
> > for polymorphism as yet.
>
> > Thanks,
>
> > Krishna
>
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com
> > .
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en
> > .

-- 
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: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
Yes, I missed that method.
Maybe add this little trick on tutorial for now!?

Krishna

2010/2/11 Max Ross (Google) :
> Great, glad to hear it!  I forgot to add a method to LocalServiceTestHelper
> to set a custom app id.  My mistake.  I'll make sure this gets added for the
> next release so you don't need to provide your own Environment
> implementation.
>
> Max
>
> On Thu, Feb 11, 2010 at 10:30 AM, Krishna Caldas 
> wrote:
>>
>> You're right!
>> I refactored my code and forget to annotate the new setUp method with
>> @Before.
>> Sorry for taking your time! It works now.
>>
>> Thanks,
>> Krishna
>>
>>
>> 2010/2/11 Max Ross (Google) :
>> > Your code looks fine.  Are you sure you're calling setUp() on the
>> > LocalServiceTestHelper?
>> >
>> > On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas
>> > 
>> > wrote:
>> >>
>> >> Ooops.. missed your question!
>> >> It's just:
>> >>@Override
>> >>protected Environment newEnvironment() {
>> >>return new TestEnvironment();
>> >>}
>> >>
>> >> Thanks,
>> >> Krishna
>> >>
>> >> 2010/2/11 Max Ross (Google) :
>> >> > Subclassing LocalServiceTestHelper and overriding newEnvironment()
>> >> > should
>> >> > work fine.  What does your implementation of newEnvironment() look
>> >> > like?
>> >> >
>> >> > On Wed, Feb 10, 2010 at 7:35 PM, Krishna 
>> >> > wrote:
>> >> >>
>> >> >> Ok!
>> >> >>
>> >> >> But when I'm using transactions I'm getting:
>> >> >>
>> >> >> java.lang.NullPointerException: No API environment is registered for
>> >> >> this thread.
>> >> >>at
>> >> >>
>> >> >>
>> >> >>
>> >> >> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
>> >> >> 67)
>> >> >>at
>> >> >>
>> >> >>
>> >> >>
>> >> >> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
>> >> >> 270)
>> >> >>
>> >> >> I've tried to extend LocalServiceTestHelper and overwrite
>> >> >> newEnvironment()  with my Environment (who returns appId) but it
>> >> >> didn't work...
>> >> >>
>> >> >> What's wrong?
>> >> >>
>> >> >> Thanks,
>> >> >> Krishna
>> >> >>
>> >> >> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
>> >> >> > We've got a more simple interface for you now. Take a look:
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > http://code.google.com/appengine/docs/java/tools/localunittesting.html
>> >> >> >
>> >> >> > 2010/2/10 时空之蕊 
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > > I found the class
>> >> >> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
>> >> >> > > public,but before 1.3.1 it's public!
>> >> >> > > In the JUnit document:
>> >> >> >
>> >> >> > > import java.io.File;
>> >> >> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
>> >> >> > > import com.google.apphosting.api.ApiProxy;
>> >> >> >
>> >> >> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>> >> >> >
>> >> >> > > So I can't new a ApiProxyLocalImpl instance!
>> >> >> > > Any body know how to use JUnit?
>> >> >> > > Thanks :)
>> >> >> >
>> >> >> > > --
>> >> >> > > You received this message because you are subscribed to the
>> >> >> > > Google
>> >> >> > > Groups
>> >> >> > > "Google App Engine for Java&q

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
You're right!
I refactored my code and forget to annotate the new setUp method with @Before.
Sorry for taking your time! It works now.

Thanks,
Krishna


2010/2/11 Max Ross (Google) :
> Your code looks fine.  Are you sure you're calling setUp() on the
> LocalServiceTestHelper?
>
> On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas 
> wrote:
>>
>> Ooops.. missed your question!
>> It's just:
>>@Override
>>protected Environment newEnvironment() {
>>    return new TestEnvironment();
>>}
>>
>> Thanks,
>> Krishna
>>
>> 2010/2/11 Max Ross (Google) :
>> > Subclassing LocalServiceTestHelper and overriding newEnvironment()
>> > should
>> > work fine.  What does your implementation of newEnvironment() look like?
>> >
>> > On Wed, Feb 10, 2010 at 7:35 PM, Krishna 
>> > wrote:
>> >>
>> >> Ok!
>> >>
>> >> But when I'm using transactions I'm getting:
>> >>
>> >> java.lang.NullPointerException: No API environment is registered for
>> >> this thread.
>> >>at
>> >>
>> >>
>> >> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
>> >> 67)
>> >>at
>> >>
>> >>
>> >> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
>> >> 270)
>> >>
>> >> I've tried to extend LocalServiceTestHelper and overwrite
>> >> newEnvironment()  with my Environment (who returns appId) but it
>> >> didn't work...
>> >>
>> >> What's wrong?
>> >>
>> >> Thanks,
>> >> Krishna
>> >>
>> >> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
>> >> > We've got a more simple interface for you now. Take a look:
>> >> >
>> >> >
>> >> > http://code.google.com/appengine/docs/java/tools/localunittesting.html
>> >> >
>> >> > 2010/2/10 时空之蕊 
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > > I found the class
>> >> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
>> >> > > public,but before 1.3.1 it's public!
>> >> > > In the JUnit document:
>> >> >
>> >> > > import java.io.File;
>> >> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
>> >> > > import com.google.apphosting.api.ApiProxy;
>> >> >
>> >> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>> >> >
>> >> > > So I can't new a ApiProxyLocalImpl instance!
>> >> > > Any body know how to use JUnit?
>> >> > > 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> >> > > unsubscr...@googlegroups.com>
>> >> > > .
>> >> > > For more options, visit this group at
>> >> > >http://groups.google.com/group/google-appengine-java?hl=en.
>> >> >
>> >> > --
>> >> > Ikai Lan
>> >> > Developer Programs Engineer, Google App
>> >> >
>> >> > Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine
>> >>
>> >> --
>> >> 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: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
Ooops.. missed your question!
It's just:
@Override
protected Environment newEnvironment() {
return new TestEnvironment();
}

Thanks,
Krishna

2010/2/11 Max Ross (Google) :
> Subclassing LocalServiceTestHelper and overriding newEnvironment() should
> work fine.  What does your implementation of newEnvironment() look like?
>
> On Wed, Feb 10, 2010 at 7:35 PM, Krishna  wrote:
>>
>> Ok!
>>
>> But when I'm using transactions I'm getting:
>>
>> java.lang.NullPointerException: No API environment is registered for
>> this thread.
>>at
>>
>> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
>> 67)
>>at
>>
>> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
>> 270)
>>
>> I've tried to extend LocalServiceTestHelper and overwrite
>> newEnvironment()  with my Environment (who returns appId) but it
>> didn't work...
>>
>> What's wrong?
>>
>> Thanks,
>> Krishna
>>
>> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
>> > We've got a more simple interface for you now. Take a look:
>> >
>> > http://code.google.com/appengine/docs/java/tools/localunittesting.html
>> >
>> > 2010/2/10 时空之蕊 
>> >
>> >
>> >
>> >
>> >
>> > > I found the class
>> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
>> > > public,but before 1.3.1 it's public!
>> > > In the JUnit document:
>> >
>> > > import java.io.File;
>> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
>> > > import com.google.apphosting.api.ApiProxy;
>> >
>> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>> >
>> > > So I can't new a ApiProxyLocalImpl instance!
>> > > Any body know how to use JUnit?
>> > > 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> > > unsubscr...@googlegroups.com>
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/google-appengine-java?hl=en.
>> >
>> > --
>> > Ikai Lan
>> > Developer Programs Engineer, Google App
>> > Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

-- 
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: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
It's the same (attached) I used before update to 1.3.1.

Thanks,
Krishna

2010/2/11 Max Ross (Google) :
> Subclassing LocalServiceTestHelper and overriding newEnvironment() should
> work fine.  What does your implementation of newEnvironment() look like?
>
> On Wed, Feb 10, 2010 at 7:35 PM, Krishna  wrote:
>>
>> Ok!
>>
>> But when I'm using transactions I'm getting:
>>
>> java.lang.NullPointerException: No API environment is registered for
>> this thread.
>>at
>>
>> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
>> 67)
>>at
>>
>> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
>> 270)
>>
>> I've tried to extend LocalServiceTestHelper and overwrite
>> newEnvironment()  with my Environment (who returns appId) but it
>> didn't work...
>>
>> What's wrong?
>>
>> Thanks,
>> Krishna
>>
>> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
>> > We've got a more simple interface for you now. Take a look:
>> >
>> > http://code.google.com/appengine/docs/java/tools/localunittesting.html
>> >
>> > 2010/2/10 时空之蕊 
>> >
>> >
>> >
>> >
>> >
>> > > I found the class
>> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
>> > > public,but before 1.3.1 it's public!
>> > > In the JUnit document:
>> >
>> > > import java.io.File;
>> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
>> > > import com.google.apphosting.api.ApiProxy;
>> >
>> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>> >
>> > > So I can't new a ApiProxyLocalImpl instance!
>> > > Any body know how to use JUnit?
>> > > 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> > > unsubscr...@googlegroups.com>
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/google-appengine-java?hl=en.
>> >
>> > --
>> > Ikai Lan
>> > Developer Programs Engineer, Google App
>> > Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



TestEnvironment.java
Description: Binary data


[appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-10 Thread Krishna
Ok!

But when I'm using transactions I'm getting:

java.lang.NullPointerException: No API environment is registered for
this thread.
at
com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
67)
at
com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
270)

I've tried to extend LocalServiceTestHelper and overwrite
newEnvironment()  with my Environment (who returns appId) but it
didn't work...

What's wrong?

Thanks,
Krishna

On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
> We've got a more simple interface for you now. Take a look:
>
> http://code.google.com/appengine/docs/java/tools/localunittesting.html
>
> 2010/2/10 时空之蕊 
>
>
>
>
>
> > I found the class
> > com.google.appengine.tools.development.ApiProxyLocalImpl is not
> > public,but before 1.3.1 it's public!
> > In the JUnit document:
>
> > import java.io.File;
> > import com.google.appengine.tools.development.ApiProxyLocalImpl;
> > import com.google.apphosting.api.ApiProxy;
>
> > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>
> > So I can't new a ApiProxyLocalImpl instance!
> > Any body know how to use JUnit?
> > 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 > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

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