[appengine-java] Re: HttpServletRequest.getLocalPort() returns 0

2009-08-25 Thread Filipe AlvesFerreira
Thank you Gabriel. Obrigado/FilipeAlvesFerreira#4(1942)

2009/8/25 Gabriel Moreira gabrielmore...@gmail.com


 Im trying this on google appengine:

 public class MyFilter implements  javax.servlet.Filter {

   public void doFilter(ServletRequest servletRequest, ServletResponse
 response, FilterChain filterChain) throws IOException,
 ServletException {
 response.getWriter().print(port  + ((HttpServletRequest)
 servletRequest).getLocalPort() );
   }
 }


 Testing this local url:  http://localhost:8080/test.servlet

 AppEngine is returning 8080 on HttpServletRequest.getLocalPort().


 Testing this remote url:  http://myapp.appspot.com/test.servlet

 AppEngine is returning 0 on HttpServletRequest.getLocalPort().


 Anyone can test this?

 



-- 
FilipeAlvesFerreira#4(1942)

--~--~-~--~~~---~--~~
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] Not able to upload application after adding com.google.gdata.DisableCookieHandler in appengine-web.xml file

2009-08-25 Thread Partha

I am using contact api in my application. According to google
documents I have to add the following property in appengine-web.xml
file
see the link http://code.google.com/intl/zh-HK/appengine/kb/java.html#googledata


system-properties
property name=com.google.gdata.DisableCookieHandler value=true /

/system-properties

When I try to upload I get the following error
An internal error occurred during: Deploying application to Google.
XML error validating D:\opt\MyWorkSpace\CordysContact\war\WEB-INF
\appengine-web.xml against D:\opt\Eclipse33\plugins
\com.google.appengine.eclipse.sdkbundle_1.2.2.v200907131018\appengine-
java-sdk-1.2.2\docs\appengine-web.xsd

--~--~-~--~~~---~--~~
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] Accept-Encoding doesn't seem to get passed to the application

2009-08-25 Thread Philippe Marschall

Hi

I'm getting really strange behavior here where it looks as if the
Accept-Encoding wouldn't get passed to the application. My request
looks like this:

GET /the/url HTTP/1.1
Accept-Encoding: gzip
User-Agent: Jakarta Commons-HttpClient/3.1
Host: myapp.appspot.com
Cookie: the cookie

However the only headers I see are User-Agent, Host and Cookie.

Cheers
Philippe
--~--~-~--~~~---~--~~
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: Probleme with Relationships managed by JDO

2009-08-25 Thread midomarocain

any help please


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



[appengine-java] Getting Started: Using JSPs

2009-08-25 Thread Valentino Hankypants

hello together,

i'm starting with development of google AppEngine. i tried to go
through the getting started in the user doc. but i come to a problem.
Up to this point i do not have problems with the getting started
tutorial.
my problem:

in the tutorial is mentioned that the guestbook app will use JSP
pages. if i add the *.jsp into the eclipse framework at the
recommended position (in the war directory) eclipse marks the JSP as
corrupted (with this nice red icon) without any suggestion why this
file is not wanted at the current position.

any ideas what there is the problem??? would be great...

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



[appengine-java] Re: Getting Started: Using JSPs

2009-08-25 Thread Alexander Arendar
Make sure you are using JDK, not just a JRE so your jsps can be compiled.
Also JSP editor in Eclipse is not very clever :) Sometimes it marks valid
jsps as corrupted. Closing and reopening editor sometimes helps.

On Tue, Aug 25, 2009 at 12:30 PM, Valentino Hankypants f.hirs...@gmx.atwrote:


 hello together,

 i'm starting with development of google AppEngine. i tried to go
 through the getting started in the user doc. but i come to a problem.
 Up to this point i do not have problems with the getting started
 tutorial.
 my problem:

 in the tutorial is mentioned that the guestbook app will use JSP
 pages. if i add the *.jsp into the eclipse framework at the
 recommended position (in the war directory) eclipse marks the JSP as
 corrupted (with this nice red icon) without any suggestion why this
 file is not wanted at the current position.

 any ideas what there is the problem??? would be great...

 greatz
 valentino
 


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



[appengine-java] Re: Getting Started: Using JSPs

2009-08-25 Thread Valentino Hankypants

no changes.
i copied the file javac.exe from C:\Program Files\Java\jdk1.6.0_14\bin
to C:\Program Files\Java\jre6\bin. then i closed eclipse opened it,
nothing changed

On 25 Aug., 11:38, Thanasis t.deleni...@gmail.com wrote:
 Hi,

 Copy file javac.exe from your jdk/bin directory to the jre/bin
 directory and recompile.

 On Aug 25, 12:30 pm, Valentino Hankypants f.hirs...@gmx.at wrote:

  hello together,

  i'm starting with development of google AppEngine. i tried to go
  through the getting started in the user doc. but i come to a problem.
  Up to this point i do not have problems with the getting started
  tutorial.
  my problem:

  in the tutorial is mentioned that the guestbook app will use JSP
  pages. if i add the *.jsp into the eclipse framework at the
  recommended position (in the war directory) eclipse marks the JSP as
  corrupted (with this nice red icon) without any suggestion why this
  file is not wanted at the current position.

  any ideas what there is the problem??? would be great...

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



[appengine-java] Re: Getting Started: Using JSPs

2009-08-25 Thread Thanasis

Hmm... I had the same problem with you - I got this solution from
other threads reporting the same error and it worked for me. I don't
remember doing anything else...

On Aug 25, 12:48 pm, Valentino Hankypants f.hirs...@gmx.at wrote:
 no changes.
 i copied the file javac.exe from C:\Program Files\Java\jdk1.6.0_14\bin
 to C:\Program Files\Java\jre6\bin. then i closed eclipse opened it,
 nothing changed

 On 25 Aug., 11:38, Thanasis t.deleni...@gmail.com wrote:



  Hi,

  Copy file javac.exe from your jdk/bin directory to the jre/bin
  directory and recompile.

  On Aug 25, 12:30 pm, Valentino Hankypants f.hirs...@gmx.at wrote:

   hello together,

   i'm starting with development of google AppEngine. i tried to go
   through the getting started in the user doc. but i come to a problem.
   Up to this point i do not have problems with the getting started
   tutorial.
   my problem:

   in the tutorial is mentioned that the guestbook app will use JSP
   pages. if i add the *.jsp into the eclipse framework at the
   recommended position (in the war directory) eclipse marks the JSP as
   corrupted (with this nice red icon) without any suggestion why this
   file is not wanted at the current position.

   any ideas what there is the problem??? would be great...

   greatz
   valentino
--~--~-~--~~~---~--~~
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: Compile and execute at runtime

2009-08-25 Thread Albert Attard
Hi  Toby:
Thanks for you feedback.

I've did a small prototype: http://ask-me.appspot.com/ . It's working fine
locally, but it's throwing the following exception when executed on the
app-engine:

javax.servlet.ServletContext log: Exception while dispatching incoming RPC
call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract com.albertattard.askme.client.utils.AssessmentTO
com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
threw an unexpected exception: java.lang.VerifyError: (class:
org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
(Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
at
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
at
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
at
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
at com.google.net.rpc.impl.Server$2.run(Server.java:820)
at
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
at
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
at
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:436)
at
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
at
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:428)
at
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
at
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
at
com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:374)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.VerifyError: (class:
org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
(Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
at
org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at
com.albertattard.askme.server.DemoSwapAssessor.assess(DemoSwapAssessor.java:21)
at
com.albertattard.askme.server.AssessorServiceImpl.assessCode(AssessorServiceImpl.java:15)
at 

[appengine-java] Re: Getting Started: Using JSPs

2009-08-25 Thread Valentino Hankypants

thx a lot albert, your description in the blog solved my problem!!!

On 25 Aug., 12:13, Albert Attard albertatt...@gmail.com wrote:
 Hi:
 All you need to do is configure eclipse to use the JDK instead of the
 default jre.

 See this blog for 
 details:http://albertattard.blogspot.com/2009/08/jsp-compile-error-in-eclipse...

 http://albertattard.blogspot.com/2009/08/jsp-compile-error-in-eclipse...Hope
 this helps,
 Albert Attard

 Stephen 
 Leacockhttp://www.brainyquote.com/quotes/authors/s/stephen_leacock.html
 - I detest life-insurance agents: they always argue that I shall some
 day
 die, which is not so.

 2009/8/25 Thanasis t.deleni...@gmail.com



  Hmm... I had the same problem with you - I got this solution from
  other threads reporting the same error and it worked for me. I don't
  remember doing anything else...

  On Aug 25, 12:48 pm, Valentino Hankypants f.hirs...@gmx.at wrote:
   no changes.
   i copied the file javac.exe from C:\Program Files\Java\jdk1.6.0_14\bin
   to C:\Program Files\Java\jre6\bin. then i closed eclipse opened it,
   nothing changed

   On 25 Aug., 11:38, Thanasis t.deleni...@gmail.com wrote:

Hi,

Copy file javac.exe from your jdk/bin directory to the jre/bin
directory and recompile.

On Aug 25, 12:30 pm, Valentino Hankypants f.hirs...@gmx.at wrote:

 hello together,

 i'm starting with development of google AppEngine. i tried to go
 through the getting started in the user doc. but i come to a problem.
 Up to this point i do not have problems with the getting started
 tutorial.
 my problem:

 in the tutorial is mentioned that the guestbook app will use JSP
 pages. if i add the *.jsp into the eclipse framework at the
 recommended position (in the war directory) eclipse marks the JSP as
 corrupted (with this nice red icon) without any suggestion why this
 file is not wanted at the current position.

 any ideas what there is the problem??? would be great...

 greatz
 valentino
--~--~-~--~~~---~--~~
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] Differences AppEngine Datastore and Azure Storage

2009-08-25 Thread Valentino Hankypants

Helll,

i allready worked with azure and deployed some apps using storage and
other technologies from windwos azure services platform. so my
question, can anybody give me a short overview (or a link) where the
differences between azure storage and AppEngine Datastore is clearly
explained?

greatz
valentino
--~--~-~--~~~---~--~~
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] Unicode to ASCII equivalence (java.text.Normalizer not supported by app-engine VM)

2009-08-25 Thread Cornel

Hello!

I need to save unicode strings and also create a ascii version of
them (to make a keyword list for searching purposes) such as:
Animale, cu excepţia peştelui = [ANIMALE, EXCEPTIA, PESTELUI]

For that i need the following conversions: ţ - t, ş - s and so on.
My first approach was the following:

orig = Normalizer.normalize(field, Form.NFKD).toCharArray();
ascii = new byte[orig.length];
count = 0;
for (int i = 0; i  orig.length; i++) {
if (orig[i]  128) {
ascii[count++] = (byte) orig[i];
}
}
try {
field = new String(ascii, UTF-8);
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}

This works very well in java generally, but when i tried it in an app-
engine project i got a compiler error:

java.text.Normalizer.Form is not supported by Google App Engine's
Java runtime environment

What workaround do you suggest?

Thank you,
Cornel
--~--~-~--~~~---~--~~
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: Retrieving child records using entity group parent's primary key.

2009-08-25 Thread java

Hello

we have similar type of problem and code is

there is company class model.
public class Company implements ICompany {
private static final long serialVersionUID = 1L;

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

@Persistent
private String name;

@Persistent
private Category catId;
}


this is my category class model
public class Category extends BaseObject implements ICategory {

private static final long serialVersionUID = 1L;

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

@Persistent
private String name;

@Persistent
private Key parent;
}

catId of company is foreign key.

I want to retrieve company info with category details in single object
how implement in jdo  . because in hibernate it joined automatically
and get details in single object.

I am trying to get the details of both in single object , but only
company info. is coming and category id is coming , not coming
category full details .


On Jul 28, 2:47 am, Jason (Google) apija...@google.com wrote:
 Hi Shishir. Given that you mention annotations, I'm assuming that you're
 using JDO. Please let me know if I'm incorrect.
 If you're using JDO, this becomes very easy. You shouldn't have to manually
 create the Key objects for your AccountInfo instances since App Engine will
 create this for you when you persist your Customer entities (assuming you're
 modeling an owned relationship between Customer and AccountInfo). To fetch
 all AccountInfo entities associated with a given Customer, just create an
 accessor for the accounts field in your Customer class that you used to
 persist the AccountInfo entities in the first place.

 See the documentation on Relationships for more information, and please let
 me know if you have any more questions, and please feel free to paste your
 JDO classes inline.

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

 Thanks,
 - Jason

 On Sat, Jul 25, 2009 at 9:49 PM, shishirm...@gmail.com 

 shishirm...@gmail.com wrote:

  I have two classes; one is Customer and one is AccountInfo. A customer
  can have multiple account numbers. I use the KeyBuilder.addChild()
  method to create the AccountInfo keys. Now for each customer i wish to
  retrieve all the accounts. How can this be achieved if there is no
  foreign key reference in AccountInfo.

  Secondly, if i have to create a foreign key reference of customerId in
  AccountInfo, how can it be done using annotations?

  Regards,
  Shishir.
--~--~-~--~~~---~--~~
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: java.rmi.server.UID Error

2009-08-25 Thread Icarus

Hi Jason,

 Sorry about the delay... I didn't get a mail regarding response to
this thread.

 The fix I made was :

 1. Within the Jena distribution, cd to src/com/hp/hpl/jena/rdf/model,
modify the constructor so that it does not use the offending rmi UID
generator

  public AnonId() {
if (JenaParameters.disableBNodeUIDGeneration) {
synchronized (AnonId.class) {
id = A + idCount++; // + rand.nextLong();
}
} else {
id = java.util.UUID.randomUUID().toString();
}
}

 You would need to import java.util.UUID for this.

There is another change as well ( attributed to Taylor Cowan)... both
of these can be found on the link here :
http://tech.groups.yahoo.com/group/jena-dev/message/39575

-Ic

On Aug 12, 5:19 am, Jason (Google) apija...@google.com wrote:
 Can you detail the fix? I'd love to add your pointer(s) to the Will it play
 in App Engine wiki 
 page:http://groups.google.com/group/google-appengine-java/web/will-it-play...

 - Jason

 On Mon, Aug 10, 2009 at 3:16 PM, Icarus pr.a...@gmail.com wrote:

  The issue was with the Jena Framework source code and fixing that made
  it possible to run the app.

  On Aug 11, 2:21 am, Icarus pr.a...@gmail.com wrote:
   Hi,

    While using the Jena Semantic Framework for extracting RDF based
   data, I come across the following error on GAE :

   Uncaught exception from servlet
   java.lang.NoClassDefFoundError: java.rmi.server.UID is a restricted
   class. Please see the Google App Engine developer's guide for more
   details.
          at

  com.google.apphosting.runtime.security.shared.stub.java.rmi.server.UID.clinit
   (UID.java)
          at com.hp.hpl.jena.rdf.model.AnonId.init(AnonId.java:78)
          at com.hp.hpl.jena.rdf.model.AnonId.create(AnonId.java:60)
          at com.hp.hpl.jena.graph.Node.createAnon(Node.java:45)
          at com.hp.hpl.jena.rdf.arp.JenaReader.convert(JenaReader.java:
   116)
          at com.hp.hpl.jena.rdf.arp.JenaReader.convert(JenaReader.java:
   128)
          at com.hp.hpl.jena.rdf.arp.JenaHandler.statement
   (JenaHandler.java:73)
          at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.triple
   (XMLHandler.java:
   100)
          at com.hp.hpl.jena.rdf.arp.impl.ParserSupport.triple
   (ParserSupport.java:240)
          at
   com.hp.hpl.jena.rdf.arp.states.WantPropertyElement.aPredAndObj
   (WantPropertyElement.java:187)
          at
   com.hp.hpl.jena.rdf.arp.states.Frame.processPropertyAttributes
   (Frame.java:112)
          at
   com.hp.hpl.jena.rdf.arp.states.WantPropertyElement.startElement
   (WantPropertyElement.java:116)
          at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.startElement
   (XMLHandler.java:137)
          at org.apache.xerces.parsers.AbstractSAXParser.startElement
   (Unknown
   Source)
          at
   org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement
   (Unknown Source)
          at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement
   (Unknown Source)
          at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement
   (Unknown
   Source)
          at
   org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement
   (Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
   $FragmentContentDispatcher.dispatch(Unknown Source)
          at
   org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
   (Unknown Source)
          at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
   Source)
          at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
   Source)
          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
   Source)
          at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse
   (RDFXMLParser.java:
   107)
          at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158)
          at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145)
          at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215)
          at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:
   188)

   This runs in dev mode on my local machine but gives problem from the
   deployment on GAE server.

   Any suggestions would be highly appreciated.

   -Ic
--~--~-~--~~~---~--~~
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] Tutorial Java em Português

2009-08-25 Thread Almir F. Rivas Jr
Pessoal,

Alguém pode me ajudar indicando um tutorial onde mostre como trabalhar com o
Google App Engine usando Java em português.

Atenciosamente,
Almir F. Rivas Jr
Sincro Tecnologia
(34) 9944-5791

--~--~-~--~~~---~--~~
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: JDO request IN

2009-08-25 Thread datanucleus

 Right, you won't be able to do that.  The underlying datastore doesn't
 support OR queries (and IN - OR).

Yes you *can* do that. I already pointed out the query above, which
the user seems to ignore for some reason.
IN in Java equates to collParam.contains(theField)
i.e this value is IN this collection.

--~--~-~--~~~---~--~~
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: JDO request IN

2009-08-25 Thread datanucleus

 Yes you *can* do that. I already pointed out the query above, which
 the user seems to ignore for some reason.
 IN in Java equates to collParam.contains(theField)
 i.e this value is IN this collection.

Obviously that assumes that Google have implemented such a thing,
though they could easily enough with the DataNucleus in-memory
evaluator.
--~--~-~--~~~---~--~~
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: Any example for JPA One-To-Many relationship

2009-08-25 Thread objectuser

It's not really any different in JPA and JDO, so the docs should cover
what you want.

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

I also wrote a few things that used JPA if it's useful (under the
Modeling section):

http://objectuser.wordpress.com/google-app-engine/

On Aug 24, 10:32 pm, niuy michael...@gmail.com wrote:
 Hi there,

 I am struggling to   implements   one-to-many relationship ,but  I
 never  make it work.  Does any body  make  any   relationship  based
 on  JPA? or  it  is impossible  on   GAE / J ?

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



[appengine-java] How to query multivalued properties in low-level Datastore API?

2009-08-25 Thread ted stockwell

Hi All,

I am using the low-level Datastore API in my application.
Suppose I store a bunch of 'Recipe' entities, where each entity has a
multivalued property named 'ingredients, and the ingredients property
is a set of Strings.
For instance:
Entity recipe= new Entity(recipe, tater tot casserole);
recipe.setProperty(ingredients, new HashSet() {{
 add(Tater Tots);
 add(peas);
 add(Cream of Celery Soup);
 add(hamburger);
}});

Can I create a Query in the low-level API that will select all recipes
that include 'hamburger in the ingredients???

I'm thinking that it's possible since it's supported in the JDO API,
but I cannot see how it should be done.

Thanks in advance,
-ted stockwell


--~--~-~--~~~---~--~~
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: Issue to retrieve the data

2009-08-25 Thread rohit jain
Hello

can you give me some idea how can I do this.

On Tue, Aug 25, 2009 at 6:07 PM, datanucleus andy_jeffer...@yahoo.comwrote:


  I want to retrieve company info with category details in single object
  how implement in jdo  . because in hibernate it joined automatically
  and get details in single object.

 How can it be a single object when you would have an object of type
 Company, with an internal Category object ? No, Hibernate will use
 lazy loading just like JDO does. Perhaps you ought to familiarise
 yourself with fetch groups, as per the DataNucleus docs.
 



-- 
Rohit Jain
9313239880

--~--~-~--~~~---~--~~
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: Datanucleus + Eclipse problems

2009-08-25 Thread Jason Parekh
Hi,
Would you be able to post a quick sample code snippet that shows your
behavior?

Thanks,
jason

On Mon, Aug 24, 2009 at 11:22 PM, linhares linha...@gmail.com wrote:


 I have the same problem. And in my case it´s related to the use of the
 @PersistenceAware annotation. If I don´t use it, it works fine,
 otherwise eclipse starts an infinite loop with the enhancer.

 On Jul 7, 12:25 pm, Alex Rudnick a...@google.com wrote:
  Alright, thanks for the detailed report!
 
  I'll try to reproduce the problem and figure out what's going on.
 
 
 
  On Tue, Jul 7, 2009 at 4:07 AM, Rolandrol...@mbiproductions.com wrote:
 
   Well, I only have one project at the time:
   I have used an Eclipse JEE Ganymede SR1 installation on Windows XP
   (SP3) I use for another project (in C:\eclipse\) and just installed
   the Google
   Plugin for Eclipse 3.4 via Software Updates - Available Software -
   Add Site
   (http://dl.google.com/eclipse/plugin/3.4).
 
   Then I followed the GAE Guestbook tutorial and it worked fine.
   Then I switched on the GWT in the plugin and enhanced the GUI to use
   GWT
   (the result is onhttp://mbi-t1.appspot.com/).
 
   During development I shared the project in my SVN repository and
   worked
   additionally on my home PC (Windows Vista SP2). There I have several
   Eclipse versions installed and for this project I used Eclipse
   Ganymede SR2
   for plain Java (not JEE) that was installed in C:\eclipse34.
 
   In the Preferences - Google Section I found that the Google plugin
   did not
   recognize the included SDKs for GAE and GWT as valid. Therefore I
   downloaded
   both SDKs separately and put them into the SVN in parallel to the
   project
   folder. I also ensured that the SVN checkout folder was the same on
   both PCs:
   D:\JAVA. Also I configured the Google Plugin to use the separate
   SDKs on both PCs. This worked so far..
 
   In the course of the project I configured the Java compiler to use
   project specific
   settings, as such my standard Code templates, code formatter settings,
   and
   some slightly more restrictive compiler warning settings.
 
   I'm not sure when it began that the Enhancer Builder ran in an endless
   loop,
   but now it is the case and I have to disable it in the project
   settings to stop
   this behavior.
 
   I also had the impression that when I edit some file and store it, the
   Enhancer
   Builder did not find the class to enhance, because the edited file was
   in a
   subpackage: for example:
edited file: src/guestbook/client/Guestbook.java
file to be enhanced: src/guestbook/Greeting.java
 
   Actually I completed the project by using ANT and used Eclipse as an
   editor only.
 
   BTW: You can find the Sources on my Site:
  http://roland.blochberger.us/dl/guestbook_20090706.zip
 
  --
  Alex Rudnick
  swe, gwt, atl
 


--~--~-~--~~~---~--~~
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: JDO usage of setRange

2009-08-25 Thread Toby

Hello Ennio,

I am hiting the same problem.  I have only 9000 records.  As you said
I can retrieve them in a single call.  But since I do processing which
each of them I need to split it up in order not to use to much time.
So I thought it would be good to use the setRange.  But at a certain
point it hits this magic border that you describe.
I can not believe that this has been implemented so poorly.
Did you find any solution to this?

Thanks,
Tobias


On Aug 7, 9:55 am, ennio piovesan ennio.piove...@gmail.com wrote:
 It is not really true that queries can return at most 1000 results. I didn't
 say to you that in my test application, if I setRange(0,5000) I get 5000
 entities! You can try this athttp://unaprovadiennio.appspot.com/ writing
 DISPLAY0Z5000 in the text box (you have to wait a bit). If you try
 DISPLAY1050Z1060 you get the error.

 Here the pieces of code used (it's a pie from StockWatcher sample
 application):

 [when you clic the Add button]

 ...
 if(symbol.startsWith(DISPLAY)){
 int posSep=symbol.indexOf(Z);
 int daOffset = Integer.parseInt(symbol.substring(7,posSep));
 int topLimit = Integer.parseInt(symbol.substring(posSep+1));
 getAllLimited(daOffset, topLimit);
 return;

 }

 ...

 [ the method called getAllLimited]

 private void getAllLimited(int daOffset, int quanti) {
 prodottoBaseService = GWT.create(ProdottoBaseService.class);
 prodottoBaseService.getAll(Integer.valueOf(daOffset),
 Integer.valueOf(quanti), new AsyncCallbackListProdottoBaseI() {
 public void onFailure(Throwable error) {
 Window.alert(failure  + error.getMessage());

 }

 public void onSuccess(ListProdottoBaseI async) {
 StringBuffer sb = new StringBuffer();
 for(ProdottoBaseI pbi:async){
 sb.append(pbi.toString()+\n);}

 Window.alert(Totale  + async.size()+  + sb.toString());

 }
 });
 }

 

 [ the method called getAll]
 public ListProdottoBaseI getAll(Integer offset, Integer topLimit) {
 PersistenceManager pm = PMF.get().getPersistenceManager();
    ListProdottoBase prodotti = new ArrayListProdottoBase();
    ListProdottoBaseI prodottiDTO = new ArrayListProdottoBaseI();
    try {
      Query q = pm.newQuery(SELECT FROM
 com.google.gwt.sample.stockwatcher.server.ProdottoBase);
      q.setOrdering(codice);
      *q.setRange(offset.longValue(), topLimit.longValue());*
      prodotti = (ListProdottoBase) q.execute();
      for(ProdottoBase pb:prodotti){
      prodottiDTO.add(getDTOProdottoBase(pb));
      }
    }finally {
      pm.close();
    }
    return prodottiDTO;

 }

 ...

 I read the article you suggested on paging. I can hardly speak of best
 practice. It is an (awesome) workaround. The final result is that I can't
 use setRange to obtain 10 records when I look past the 1000th.

 It is promising the item in the roadmap you recall.
 Let's hope the road won't be long ...
 Thanx again.
 Ennio.

 2009/8/6 Jason (Google) apija...@google.com:

  Hi. Queries can return at most 1000 results, so I believe this is the
 issue
  you're experiencing -- results 1050-1060 don't exist. At most, you can use
  setRange(989, 999).

  This is a known restriction, and there is an item in the roadmap to
 address
  it: Cursors for continuing results of Datastore queries past the 1000
  entity limit. In the meantime, if you need paging support, the following
  article lays out the best practices that doesn't involve ranges/offsets.
 The
  code in the article is Python-based, but the principle is the same.
 http://code.google.com/appengine/articles/paging.html
  Also, Extent is a part of the JDO spec so I don't know what you mean by
  saying you won't be able to use the JDO features.
  - Jason
  On Wed, Aug 5, 2009 at 12:31 AM, ennio1958 ennio.piove...@gmail.com
 wrote:

  I have some problem with the usage of setRange.
  If I  setRange(0,10) all works fine, and also if I setRange(400,700),
  but if I setRange(1050, 1060) I get a server error probably due to
  limit/quota problems. I read some comments on this in this group, but
  not a great sequel. If the implementation of setRange involve limit/
  quota even if what I expect is a 10 record list, I think it must be
  rethinked.
  The workaround I read (putting a limit on a property in the where
  clause) is poor and not always applicable because if the range is,
  say, of 10 records and there are more than 10 entities with the same
  value for that property, I can't paginate because of an infinite
  loop...
  So I think it is a serious problem, because pagination is often and
  widely used in applications and it is mandatory a general solution,
  not workarounds.
  I hope someone will give a positive answer to this.
  Thank you.
  Ennio.
--~--~-~--~~~---~--~~
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 

[appengine-java] Re: How to query multivalued properties in low-level Datastore API?

2009-08-25 Thread ted stockwell


Thanks much.
One more question...
If I want to select recipes that have both hamburger and olives should
I just add two filters???
   Query query = new Query(recipe);
   query.addFilter(ingredients, Query.FilterOperator.EQUAL,
hamburger);
   query.addFilter(ingredients, Query.FilterOperator.EQUAL,
olives);





--~--~-~--~~~---~--~~
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] Request to update jars in http://google-maven-repository.googlecode.com

2009-08-25 Thread David

Hi,

1.2.2 had been released more than a month ago but was not uploaded on
the repository.
The latest in there is 1.2.1

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-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: Performance optimization of insert into datastore (cpu_ms/api_cpu_ms showing red)

2009-08-25 Thread Juraj Vitko

Just curious - are the writes cheaper now, or is it still the same?

On Aug 25, 8:09 am, sree sraj...@gmail.com wrote:
 Thanks for your reply.

 My app id is my-sree.appspot.com. I have only 1 index defined on a
 date property.

 We get 6.5 hours of cpu time each reset on a daily basis. Do both
 cpu_ms and api_cpu_ms gets counted for this? My app requires a lot of
 writes and hence I want to optimize for best performance. I have very
 few indexes created as well. And on a average my entity has around 10
 properties.

 On Aug 21, 8:39 pm, Don Schwarz schwa...@google.com wrote:

  What is your app id?  Do you have a large number of indexes defined for this
  entity kind?

  FYI, it's certainly a good idea to optimize for performance, but I wouldn't
  worry too much about the particular point at which warnings appear in the
  request logs.  These are just guidelines to let you know which requests are
  consuming the most CPU.  If you're only planning to update these entities on
  a fraction of your requests then the overall CPU cost should not be too
  high.  However, if your application is doing a lot of writes then by all
  means, try to optimize this (e.g. by reducing the number of indexes, or
  perhaps by reducing the number of columns if you don't query them
  independently).

  On Fri, Aug 21, 2009 at 6:55 AM, sree sraj...@gmail.com wrote:

   In a test app I have created, I am able to insert only 2 rows per
   request (for 1 entity with 10 properties only) into the datastore by
   using low-level api without getting any warnings for cpu_ms /
   api_cpu_ms usage.

   However if I try to insert 3 rows or more (again only 1 entity being
   inserted), the cpu gets used for more than 1s thereby generating a
   warning or error from GAE.

   Stats from GAE log:

   For inserting 2 records - /insert.do 200 77ms 655cpu_ms 643api_cpu_ms
   (everything ok)

   For inserting 3 records - /insert.do 200 134ms 979cpu_ms
   964api_cpu_ms (yellow warning)

   For inserting 10 records - /insert.do 200 178ms 3249cpu_ms
   3216api_cpu_ms (red warning)

   How to optimize the ‘cpu_ms and api_cpu_ms’ usage? Can GAE perform
   only as many operations as 2 inserts into datastore if we want to keep
   within the warning levels?

   Can you please provide some feedback as to whether I am doing anything
   wrong in code or have not used a good practice to achieve better
   performance. Thanks in advance.

   Code in servlet (parsing and split operations have been benchmarked
   and they are not causing any adverse impact on performance):

   Pattern p1 = Pattern.compile(,);  // created as servlet instance
   variable

   public void doPost(HttpServletRequest req, HttpServletResponse res)
   throws ServletException, IOException
   {
                  try {

                          DatastoreService datastore =
   DatastoreServiceFactory.getDatastoreService();
                          ListEntity entity = new ArrayListEntity();

                          for (int i = 0; i  n; i++) {

                                  String[] record =
   p1.split(1,tester,1.0,1.0,1.0,1.0,1.0,1.0);

                                  data1 = Long.parseLong(record[0]);
                                  data2 = record[1];
                                  data3 = Double.parseDouble(record[2]);
                                  data4 = Double.parseDouble(record[3]);
                                  data5 = Double.parseDouble(record[4]);
                                  data6 = Double.parseDouble(record[5]);
                                  data7 = Double.parseDouble(record[6]);
                                  data8 = Float.parseFloat(record[7]);

                                  Entity e = new
   Entity(DetailsBean.class.getSimpleName());
                                  e.setProperty(column1, i);
                                  e.setProperty(column2, data2);
                                  e.setProperty(column3, i + data3);
                                  e.setProperty(column4, i + data4);
                                  e.setProperty(column5, i + data5);
                                  e.setProperty(column6, i + data6);
                                  e.setProperty(column7, i + data7);
                                  e.setProperty(column8, i + data8);
                                  e.setProperty(crDate, new Date());
                                  e.setProperty(modDate, new Date());

                                  entity.add(e);

                          }

                          datastore.put(entity);

                  } catch (Exception e) {
                          e.printStackTrace();
                  } finally {
                          persistenceManager.close();
                  }
   }

   Entity bean code:

   package com.pojo;

   import java.io.Serializable;
   import java.util.Date;
   import java.util.List;

   import javax.jdo.annotations.IdGeneratorStrategy;
   import 

[appengine-java] Re: How to query multivalued properties in low-level Datastore API?

2009-08-25 Thread Vince Bonfanti

Yes, adding multiple filters (with any FilterOperator) does an AND operation.

Vince

On Tue, Aug 25, 2009 at 10:51 AM, ted stockwellemorn...@gmail.com wrote:


 Thanks much.
 One more question...
 If I want to select recipes that have both hamburger and olives should
 I just add two filters???
   Query query = new Query(recipe);
   query.addFilter(ingredients, Query.FilterOperator.EQUAL,
 hamburger);
   query.addFilter(ingredients, Query.FilterOperator.EQUAL,
 olives);


--~--~-~--~~~---~--~~
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] datastore request returning the previous result...

2009-08-25 Thread John V Denley

Ive implemented the stockwatcher application and have adjusted it so
that it stores names and phone numbers. That all seems to be working
ok, however Ive now implemented a get function which looks for a
name, and returns a phone number. However, whats happening is that the
first search i do returns nothing, then if i search for the same name
again, then it returns the correct phone number, then if i search for
another name, it returns the first name's phone instead.

eg I have the following data in the datastore:

john 
paul 

i request the phone number for john and i get back 
I request the phone number for paul and i get back 
I request the phone number for john and i get back 

Client side Java file contains:

private String GetOneContact(String Name) {
ContactService = GWT.create(ContactService.class);
ContactService.getoneContact(Name,new AsyncCallbackString()
{
public void onFailure(Throwable error) {
PhoneResult=ERROR;
}
public void onSuccess(String Phone) {
PhoneResult=Phone;
}
});
return (PhoneResult);
}

Server side (ContactServiceImpl.java) contains:

  public String getoneContact(String Name) throws NotLoggedInException
{
checkLoggedIn();
String Phone=x;
PersistenceManager pm = getPersistenceManager();
try {
//Query q = pm.newQuery(Contact.class, user == u 
Name==n);
Query q = pm.newQuery(Contact.class, user == u);
q.declareParameters(com.google.appengine.api.users.User u);
//q.declareParameters(John n);
ListContact Contacts = (ListContact) q.execute(getUser
());
  for (Contact contact : Contacts) {
if (Name.equals(contact.getName())) 
{Phone=contact.getPhone
();}
  }

} finally {
pm.close();
  }
return (Phone);
  }
--~--~-~--~~~---~--~~
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] Developing JPA app - data not persisting

2009-08-25 Thread hg

Hi,
I am developing on my local computer using EclipseEE. I created a
persistent class following the instructions in the how to. When I run
the code to persist the object em.persist(this);, I don't get any
errors, but I don't see any data anywhere. When I try to query, I do
not find any objects with the data that I just set.
Do I have to set up a database/datastore on my local computer in order
for this to work? How would I go about doing so?
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-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: Request to update jars in http://google-maven-repository.googlecode.com

2009-08-25 Thread Philippe Marschall



On Aug 25, 6:37 pm, David david.yu@gmail.com wrote:
 Hi,

 1.2.2 had been released more than a month ago but was not uploaded on
 the repository.
 The latest in there is 1.2.1

+1
--~--~-~--~~~---~--~~
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: Request to update jars in http://google-maven-repository.googlecode.com

2009-08-25 Thread Marcel Overdijk

+1

On Aug 25, 8:00 pm, Philippe Marschall philippe.marsch...@gmail.com
wrote:
 On Aug 25, 6:37 pm, David david.yu@gmail.com wrote:

  Hi,

  1.2.2 had been released more than a month ago but was not uploaded on
  the repository.
  The latest in there is 1.2.1

 +1
--~--~-~--~~~---~--~~
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: datastore request returning the previous result...

2009-08-25 Thread John V Denley

OK, after a little further investigation Ive confirmed now that the
client side function is taking in the correct search name, the problem
is certainly that the server side appears to be receiving the previous
request.

Ive changed the returns in both functions such that i now get the
following:

john:null
paul:(john)john:
john:(paul)paul:

where the format is:
input to client function : (input to server function):name of found
contact from query:phone of found contact from query

Thanks,
John

On Aug 25, 6:23 pm, John V Denley johnvden...@googlemail.com wrote:
 Ive implemented the stockwatcher application and have adjusted it so
 that it stores names and phone numbers. That all seems to be working
 ok, however Ive now implemented a get function which looks for a
 name, and returns a phone number. However, whats happening is that the
 first search i do returns nothing, then if i search for the same name
 again, then it returns the correct phone number, then if i search for
 another name, it returns the first name's phone instead.

 eg I have the following data in the datastore:

 john 
 paul 

 i request the phone number for john and i get back 
 I request the phone number for paul and i get back 
 I request the phone number for john and i get back 

 Client side Java file contains:

     private String GetOneContact(String Name) {
         ContactService = GWT.create(ContactService.class);
         ContactService.getoneContact(Name,new AsyncCallbackString()
 {
             public void onFailure(Throwable error) {
                 PhoneResult=ERROR;
             }
             public void onSuccess(String Phone) {
                 PhoneResult=Phone;
             }
         });
         return (PhoneResult);
     }

 Server side (ContactServiceImpl.java) contains:

   public String getoneContact(String Name) throws NotLoggedInException
 {
             checkLoggedIn();
             String Phone=x;
             PersistenceManager pm = getPersistenceManager();
             try {
                 //Query q = pm.newQuery(Contact.class, user == u 
 Name==n);
                 Query q = pm.newQuery(Contact.class, user == u);
                 q.declareParameters(com.google.appengine.api.users.User u);
                 //q.declareParameters(John n);
                 ListContact Contacts = (ListContact) q.execute(getUser
 ());
                       for (Contact contact : Contacts) {
                                 if (Name.equals(contact.getName())) 
 {Phone=contact.getPhone
 ();}
                               }

             } finally {
                 pm.close();
               }
             return (Phone);
           }
--~--~-~--~~~---~--~~
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: Accept-Encoding doesn't seem to get passed to the application

2009-08-25 Thread Philippe Marschall



On Aug 25, 8:31 pm, Martin Caslavsky mcaslav...@gmail.com wrote:
 Hi,

 App Engine does automatic gzip compression, so that may be the reason
 why it removes the header before it passes request to an application.

That's a bit uncool, is there a way to disable this? I store my
content in gzip for space reasons, for my use case that's a factor six
to seven improvement. I store it in a Blob and need no indexing. If I
know that the client accepts gzip I can save the decompression which
saves CPU time. Uncompressing only that AppEngine compresses it again
is a bit schizophrenic.

Cheers
Philippe
--~--~-~--~~~---~--~~
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: Owned relationship with generated parent key

2009-08-25 Thread Jason (Google)
Hi John. No, you can persist both entities in a single transaction. Just
follow the example in the documentation:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned_One_to_One_Relationships

If you create new ContactInfo and Employee objects, then associate the
objects using the Employee class' setContactInfo method, calling
makePersistent(employee) will persist the ContactInfo object as well.

- Jason

On Fri, Aug 21, 2009 at 11:22 PM, jd jdpatter...@gmail.com wrote:


 Hi,

 I want to create an owned one to many relationship where the key for
 the parent is auto generated.

 Is this possible to to in a single transaction?  Or do I need to
 commit the parent first so I can then get its key and set the parent
 key on the child?

 Thanks,

 John
 


--~--~-~--~~~---~--~~
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: How to model this scenario

2009-08-25 Thread Jason (Google)
Hi Sam. It may be somewhat redundant, but if you include a list property
with the two endpoints (in addition to the from and to properties), you can
do a reasonably efficient query to find all edges connected to A. Or, if you
know in advance which nodes you are interested in, you can keep track of
these when new edges are added so you don't have to query at all. So there
are numerous ways to tackle this problem.
- Jason

On Sat, Aug 22, 2009 at 1:27 PM, Sam Walker am.sam.wal...@gmail.com wrote:

 Hi Jason,

 I want to do a query like: Find all relationships in which A is involved. I
 think I cannot do anything like filter(A.key in key). So the only way is to
 do something like: filter(from = A.key  fromAttribute = false) + filter(to
 = A.key  toAttribute = false) (1st model in original post) or filter(both =
 A.key) followed by filtering the attributes from the result (second model in
 original post). Is this the best way? Just felt a bit ugly thats why I
 wanted to double check.

 Constructing the key by concatenating keys of A and B will ensure that I
 dont have multiple of Relationships between A and B.

 Thanks.


 On Thu, Aug 20, 2009 at 12:17 PM, Jason (Google) apija...@google.comwrote:

 Hi Sam. Are you saying that, given two node names, you want to see if
 there's an edge between them? In that case, couldn't you concatenate the two
 node names, putting the smallest one first, and doing a direct get to see if
 an entity is returned? If you get a result, that means there is an edge from
 A-B, otherwise you'll get null (JPA) or trigger an exception (JDO).

 Or are you asking how you'll access the individual nodes given that the
 key is a concatenation. If this is your question, I'd recommend keeping A
 and B as separate entities and creating a new kind for edges. Then you can
 still get the individual nodes back and easily find whether any two nodes
 are connected or not using my suggestion from the first paragraph. Does this
 answer your question?

 - Jason

 On Wed, Aug 19, 2009 at 10:42 PM, Sam Walker am.sam.wal...@gmail.comwrote:

 I want to create a key for this relationship, lets say if A - B exists,
 B - A cannot exist together. I was thinking of concatenating key A and key
 B, sth like A-B. I make sure the smallest key is first, so that I dont have
 any B-As.

 But, how would I do a query for the two entitites? Is the only solution
 to have extra ArrayListKey or Key from, Key to attributes and put them in
 the criteria?


 On Mon, Aug 10, 2009 at 5:08 AM, objectuser kevin.k.le...@gmail.comwrote:


 If that's as complex as your queries get, I'd recommend just doing to
 queries and merging the results.

 Also, if the semantics of fromAttribute and toAttribute are different,
 then you've lost that in your second model.

 On Aug 9, 10:45 pm, Sam Walker am.sam.wal...@gmail.com wrote:
  I have a directed graph scenario and I want to model the relationship
 with
  App Engine data store.
 
  Relationship {
Key from;
Key to;
boolean fromAttribute;
boolean toAttribute;
 
  }
 
  I want to do this query: where (from = key and fromAttribute =
  attribute) or (to = key and toAttribute = attribute). Ors are
 not
  allowed. So, I am not sure how to do it. I am now thinking of doing:
 
  Relationship {
ArrayListKey both; // Will always have two keys
ArrayListboolean attributes;
 
  }
 
  Now, I could change the query to: where key in both, and then check
 for
  respective attributes, but that's kinda ugly.
 
  I am sure there will be a better way, please 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] Re: Are 1.2.2 sdk jars available in a public maven repository?

2009-08-25 Thread Jason (Google)
It looks like you already found this thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/6130b425d90e0e6a

In short, no, Google does not provide a Maven repository although there are
user-provided Maven descriptors available.

- Jason

On Sat, Aug 22, 2009 at 12:45 PM, Marcel Overdijk
marceloverd...@gmail.comwrote:


 Are 1.2.2 sdk jars available in a public maven repository?
 


--~--~-~--~~~---~--~~
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: DatastoreService.put(IterableEntity) success/failure indicators

2009-08-25 Thread Jason (Google)
Hi Vince. If the put completes, without throwing an exception, all entities
are guaranteed to be persisted to the datastore. But if you don't use
transactions and the put call fails, some entities may be written. Using
transactions allows you to rollback in case the call fails.

- Jason

On Fri, Aug 21, 2009 at 11:43 AM, Vince Bonfanti vbonfa...@gmail.comwrote:


 I think I've seen this question somewhere else, but I've searched and
 can't seem to find it, so I apologize in advance is this is a
 duplicate.

 I'm using the datastore low-level API to do a batch put via
 DatastoreService.put(IterableEntity). Some questions related to this
 method:

  1. If this method succeeds (does not throw an exception) does that
 guarantee that all entities were written to the datastore
 successfully?

  2. If this method fails (throws a DatastoreFailureException) does
 that mean that none of the entities were written, or that some were
 and some weren't? If the latter, is there any way to know which
 entities were successfully written and which weren't?

  3. If I invoke DatastoreService.put(Transaction, IterableEntity)
 and it throws a DatastoreFailureException, does invoking
 Transaction.rollback() guarantee that none of the entities are written
 to the datastore? (I'm pretty sure the answer to this one must be
 yes).

 When doing a batch put, I need to be able to guarantee that all
 entities are either written, or all not written. I think the best way
 is to use a transaction, but thought I'd ask to make sure my
 understanding of how this works is correct. 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-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] JPA support for enum's

2009-08-25 Thread Larry Cable

Has anyone managed to get an enum persisted via JPA?

I can't I get an exception from the runtime, no such method init()
V, which I take to mean that it cannot
locate a public no-args constructor for the enum ... go figure ...

:(
--~--~-~--~~~---~--~~
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] Performance implications of embedded classes

2009-08-25 Thread fx.mueller

Hello,

I just went through the getting started documents and have a question
regarding embedded classes, which I haven't found discussed elsewhere
(maybe because it is trivial ;-):

What are the performance implications of defining a class as embedded?

Is it the same as if the fields of the embedded class are directly
defined in the parent class? Or do I gain any performance benefits by
defining a class as embedded - maybe because the fields of the
embedded class become part of a different index? Or maybe because the
fields of the embedded class are lazily retrieved if the parent
class is retrieved?

thanks, franz
--~--~-~--~~~---~--~~
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: Bulk update throws exception

2009-08-25 Thread Larry Cable

I have exactly the same problem, I instantiate a number of @Entity
objects
(all of the same type) persist them, and flush them in the context of
the same
transaction.

Since they are all of the same type, and their are no relationships
(although there is
an @Embedded class/field) I would imagine that they are all modelled
as being in the
same entity group .. but apparently not.

The documentation is basically useless at this point ...

On Aug 15, 1:09 pm, Foreigner foreigne...@gmail.com wrote:
 While trying to do a bulk update on my entities using JPA I get the
 exception bellow.
 I understand that you can't do a bulk update on different entity groups in
 the same transaction but I guess I don't quite understand what an entity
 group is and how I go about making all entities part of the same group I
 want.

 Thanks for the help.

 fbr

 Illegal argument
 org.datanucleus.exceptions.NucleusUserException: Illegal argument
         at 
 org.datanucleus.store.appengine.DatastoreExceptionTranslator.wrapIllegalArg­umentException(DatastoreExceptionTranslator.java:42)
         at 
 org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.pu­t(RuntimeExceptionWrappingDatastoreService.java:106)
         at 
 org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePe­rsistenceHandler.java:125)
         at 
 org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePe­rsistenceHandler.java:94)
         at 
 org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(Da­tastorePersistenceHandler.java:398)
         at 
 org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:44­58)
         at 
 org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2807­)
         at 
 org.datanucleus.ObjectManagerImpl.markDirty(ObjectManagerImpl.java:2617)
         at 
 org.datanucleus.state.JDOStateManagerImpl.postWriteField(JDOStateManagerImp­l.java:4241)
         at 
 org.datanucleus.state.JDOStateManagerImpl.setObjectField(JDOStateManagerImp­l.java:2287)
         at 
 com.yicook.entities.TwitterDailyTip.jdoSetlastSet(TwitterDailyTip.java)
         at 
 com.yicook.entities.TwitterDailyTip.setLastSet(TwitterDailyTip.java:36)
         at 
 com.yicook.control.bco.TwitterStatusSetterBCO.resetTDT(TwitterStatusSetterB­CO.java:60)
         at 
 com.yicook.control.bco.TwitterStatusSetterBCO.execute(TwitterStatusSetterBC­O.java:40)
         at 
 com.yicook.control.ApplicationController.executeControllers(ApplicationCont­roller.java:61)
         at 
 com.yicook.control.ApplicationController.dispatch(ApplicationController.jav­a:41)
         at com.yicook.servlets.FrontController.doPost(FrontController.java:31)
         at com.yicook.servlets.FrontController.doGet(FrontController.java:25)
         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:487)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandle­r.java:1093)
         at 
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans­actionCleanupFilter.java:43)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandle­r.java:1084)
         at 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
         at 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
         at 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
         at 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
         at 
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
         at 
 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn­gineWebAppContext.java:54)
         at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
         at 
 com.google.appengine.tools.development.JettyContainerService$ApiProxyHandle­r.handle(JettyContainerService.java:306)
         at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
         at org.mortbay.jetty.Server.handle(Server.java:313)
         at 
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
         at 
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnecti­on.java:830)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
         at 
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396­)
         at 
 org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:­442)
 Caused by: java.lang.IllegalArgumentException: can't operate on
 multiple entity groups in a single transaction. found both 

[appengine-java] Re: datastore request returning the previous result...

2009-08-25 Thread John V Denley

A, after some investigation, looks like what im doing is
initiating an asynchronous request to the server, and then not waiting
long enough for the reply, hence why im getting the reply whenever i
make the second request

Can anyone tell me how i can make sure i get the reply ive asked for?
what am i missing here?

Thanks,
John

On Aug 25, 7:30 pm, John V Denley johnvden...@googlemail.com wrote:
 OK, after a little further investigation Ive confirmed now that the
 client side function is taking in the correct search name, the problem
 is certainly that the server side appears to be receiving the previous
 request.

 Ive changed the returns in both functions such that i now get the
 following:

 john:null
 paul:(john)john:
 john:(paul)paul:

 where the format is:
 input to client function : (input to server function):name of found
 contact from query:phone of found contact from query

 Thanks,
 John

 On Aug 25, 6:23 pm, John V Denley johnvden...@googlemail.com wrote:

  Ive implemented the stockwatcher application and have adjusted it so
  that it stores names and phone numbers. That all seems to be working
  ok, however Ive now implemented a get function which looks for a
  name, and returns a phone number. However, whats happening is that the
  first search i do returns nothing, then if i search for the same name
  again, then it returns the correct phone number, then if i search for
  another name, it returns the first name's phone instead.

  eg I have the following data in the datastore:

  john 
  paul 

  i request the phone number for john and i get back 
  I request the phone number for paul and i get back 
  I request the phone number for john and i get back 

  Client side Java file contains:

      private String GetOneContact(String Name) {
          ContactService = GWT.create(ContactService.class);
          ContactService.getoneContact(Name,new AsyncCallbackString()
  {
              public void onFailure(Throwable error) {
                  PhoneResult=ERROR;
              }
              public void onSuccess(String Phone) {
                  PhoneResult=Phone;
              }
          });
          return (PhoneResult);
      }

  Server side (ContactServiceImpl.java) contains:

    public String getoneContact(String Name) throws NotLoggedInException
  {
              checkLoggedIn();
              String Phone=x;
              PersistenceManager pm = getPersistenceManager();
              try {
                  //Query q = pm.newQuery(Contact.class, user == u 
  Name==n);
                  Query q = pm.newQuery(Contact.class, user == u);
                  q.declareParameters(com.google.appengine.api.users.User 
  u);
                  //q.declareParameters(John n);
                  ListContact Contacts = (ListContact) q.execute(getUser
  ());
                        for (Contact contact : Contacts) {
                                  if (Name.equals(contact.getName())) 
  {Phone=contact.getPhone
  ();}
                                }

              } finally {
                  pm.close();
                }
              return (Phone);
            }
--~--~-~--~~~---~--~~
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: Compile and execute at runtime

2009-08-25 Thread Toby Reyelts
Hey Albert,

That code should actually work ok, but you've managed to tickle a bug in our
runtime. I've filed an
issuehttp://code.google.com/p/googleappengine/issues/detail?id=2028for
you here. The fix for this probably won't make the next release, but
it
should come shortly thereafter.

On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard albertatt...@gmail.comwrote:

 Hi  Toby:
 Thanks for you feedback.

 I've did a small prototype: http://ask-me.appspot.com/ . It's working fine
 locally, but it's throwing the following exception when executed on the
 app-engine:

 javax.servlet.ServletContext log: Exception while dispatching incoming RPC
 call
 com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
 abstract com.albertattard.askme.client.utils.AssessmentTO
 com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
 threw an unexpected exception: java.lang.VerifyError: (class:
 org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
 (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
  at
 com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
 at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
  at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
 at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
  at
 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
 at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
 at
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
  at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:313)
  at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
 at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
  at
 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
  at
 com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
 at
 com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
  at
 com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
 at
 com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
  at
 com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
 at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
  at com.google.net.rpc.impl.Server$2.run(Server.java:820)
 at
 com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
  at
 com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
 at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
  at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
 at
 com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:436)
  at
 com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
 at
 com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
  at com.google.net.async.Connection.handleReadEvent(Connection.java:428)
 at
 com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
  at
 com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
 at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
  at
 com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
 at
 com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:374)
  at java.lang.Thread.run(Unknown Source)
 Caused by: java.lang.VerifyError: (class:
 org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
 (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
 

[appengine-java] why is my asynccallback not working?

2009-08-25 Thread John V Denley

The following code returns null the first time it is run, and then
returns the previous request on the second time it is called can
anyone see whats going wrong? Surely it should wait until it gets the
server response before returning a value? or am I missing the point
here?

private String GetOneContact(String Name) {
//ContactService = GWT.create(ContactService.class);
ContactService.getoneContact(Name,new AsyncCallbackString()
{

public void onFailure(Throwable error) {
PhoneResult=ERROR;
}
public void onSuccess(String Phone) {
PhoneResult=Phone;
}
});
return (Phone);
}
--~--~-~--~~~---~--~~
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: Bulk update throws exception

2009-08-25 Thread Larry Cable

h' ... so it would seem that 2 or more entity (instances)
persisted in the same tx cause this error ...

this cannot be so ... how is the mapping from instance to entity
(group) made?

On Aug 25, 2:33 pm, Larry Cable larry.ca...@gmail.com wrote:
 I have exactly the same problem, I instantiate a number of @Entity
 objects
 (all of the same type) persist them, and flush them in the context of
 the same
 transaction.

 Since they are all of the same type, and their are no relationships
 (although there is
 an @Embedded class/field) I would imagine that they are all modelled
 as being in the
 sameentitygroup.. but apparently not.

 The documentation is basically useless at this point ...

 On Aug 15, 1:09 pm, Foreigner foreigne...@gmail.com wrote:



  While trying to do a bulk update on my entities using JPA I get the
  exception bellow.
  I understand that you can't do a bulk update on differententitygroups in
  the same transaction but I guess I don't quite understand what anentity
 groupis and how I go about making all entities part of the samegroupI
  want.

  Thanks for the help.

  fbr

  Illegal argument
  org.datanucleus.exceptions.NucleusUserException: Illegal argument
          at 
  org.datanucleus.store.appengine.DatastoreExceptionTranslator.wrapIllegalArg­­umentException(DatastoreExceptionTranslator.java:42)
          at 
  org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.pu­­t(RuntimeExceptionWrappingDatastoreService.java:106)
          at 
  org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePe­­rsistenceHandler.java:125)
          at 
  org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePe­­rsistenceHandler.java:94)
          at 
  org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(Da­­tastorePersistenceHandler.java:398)
          at 
  org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:44­­58)
          at 
  org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2807­­)
          at 
  org.datanucleus.ObjectManagerImpl.markDirty(ObjectManagerImpl.java:2617)
          at 
  org.datanucleus.state.JDOStateManagerImpl.postWriteField(JDOStateManagerImp­­l.java:4241)
          at 
  org.datanucleus.state.JDOStateManagerImpl.setObjectField(JDOStateManagerImp­­l.java:2287)
          at 
  com.yicook.entities.TwitterDailyTip.jdoSetlastSet(TwitterDailyTip.java)
          at 
  com.yicook.entities.TwitterDailyTip.setLastSet(TwitterDailyTip.java:36)
          at 
  com.yicook.control.bco.TwitterStatusSetterBCO.resetTDT(TwitterStatusSetterB­­CO.java:60)
          at 
  com.yicook.control.bco.TwitterStatusSetterBCO.execute(TwitterStatusSetterBC­­O.java:40)
          at 
  com.yicook.control.ApplicationController.executeControllers(ApplicationCont­­roller.java:61)
          at 
  com.yicook.control.ApplicationController.dispatch(ApplicationController.jav­­a:41)
          at 
  com.yicook.servlets.FrontController.doPost(FrontController.java:31)
          at 
  com.yicook.servlets.FrontController.doGet(FrontController.java:25)
          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:487)
          at 
  org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandle­­r.java:1093)
          at 
  com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans­­actionCleanupFilter.java:43)
          at 
  org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandle­­r.java:1084)
          at 
  org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
          at 
  org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
          at 
  org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
          at 
  org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
          at 
  org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
          at 
  com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn­­gineWebAppContext.java:54)
          at 
  org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
          at 
  com.google.appengine.tools.development.JettyContainerService$ApiProxyHandle­­r.handle(JettyContainerService.java:306)
          at 
  org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
          at org.mortbay.jetty.Server.handle(Server.java:313)
          at 
  org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
          at 
  org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnecti­­on.java:830)
          at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
          at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
          at 

[appengine-java] Re: datastore request returning the previous result...

2009-08-25 Thread John V Denley

I have had a reply to another thread which indicated that I had
misunderstood how the coding for ths async call was working... I
include the explaination below for completeness, incase anyone else
has the same problem. and finds this thread rather than my other
thread!!

   private String GetOneContact(String Name) {
   ContactService = GWT.create(ContactService.class);
   ContactService.getoneContact(Name,new AsyncCallbackString()
   {
   public void onFailure(Throwable error) {
   PhoneResult=ERROR;
   }
   public void onSuccess(String Phone) {
   PhoneResult=Phone;
***This area of the code is what happens immediately after the
asynccallback completes successfully
   }
   });
   return (PhoneResult);
***This area of the code actually gets executed immediately
after the AsyncCallback is initiated, and as such can happen before
the code above!!
   }


On Aug 25, 10:35 pm, John V Denley johnvden...@googlemail.com wrote:
 A, after some investigation, looks like what im doing is
 initiating an asynchronous request to the server, and then not waiting
 long enough for the reply, hence why im getting the reply whenever i
 make the second request

 Can anyone tell me how i can make sure i get the reply ive asked for?
 what am i missing here?

 Thanks,
 John

 On Aug 25, 7:30 pm, John V Denley johnvden...@googlemail.com wrote:

  OK, after a little further investigation Ive confirmed now that the
  client side function is taking in the correct search name, the problem
  is certainly that the server side appears to be receiving the previous
  request.

  Ive changed the returns in both functions such that i now get the
  following:

  john:null
  paul:(john)john:
  john:(paul)paul:

  where the format is:
  input to client function : (input to server function):name of found
  contact from query:phone of found contact from query

  Thanks,
  John

  On Aug 25, 6:23 pm, John V Denley johnvden...@googlemail.com wrote:

   Ive implemented the stockwatcher application and have adjusted it so
   that it stores names and phone numbers. That all seems to be working
   ok, however Ive now implemented a get function which looks for a
   name, and returns a phone number. However, whats happening is that the
   first search i do returns nothing, then if i search for the same name
   again, then it returns the correct phone number, then if i search for
   another name, it returns the first name's phone instead.

   eg I have the following data in the datastore:

   john 
   paul 

   i request the phone number for john and i get back 
   I request the phone number for paul and i get back 
   I request the phone number for john and i get back 

   Client side Java file contains:

       private String GetOneContact(String Name) {
           ContactService = GWT.create(ContactService.class);
           ContactService.getoneContact(Name,new AsyncCallbackString()
   {
               public void onFailure(Throwable error) {
                   PhoneResult=ERROR;
               }
               public void onSuccess(String Phone) {
                   PhoneResult=Phone;
               }
           });
           return (PhoneResult);
       }

   Server side (ContactServiceImpl.java) contains:

     public String getoneContact(String Name) throws NotLoggedInException
   {
               checkLoggedIn();
               String Phone=x;
               PersistenceManager pm = getPersistenceManager();
               try {
                   //Query q = pm.newQuery(Contact.class, user == u 
   Name==n);
                   Query q = pm.newQuery(Contact.class, user == u);
                   q.declareParameters(com.google.appengine.api.users.User 
   u);
                   //q.declareParameters(John n);
                   ListContact Contacts = (ListContact) q.execute(getUser
   ());
                         for (Contact contact : Contacts) {
                                   if (Name.equals(contact.getName())) 
   {Phone=contact.getPhone
   ();}
                                 }

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



[appengine-java] Re: Can't persist objects -- impossible method is called

2009-08-25 Thread Abe Parvand

Hey I'm still getting this error. Here is my entity code. This is very
frustrating and I have no idea how to resolve. Please help me out.

package com.todoroo.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;

@SuppressWarnings(serial)
@Entity
public class Message extends BaseObject implements TDRIdentifiable {
public enum Medium {
EMAIL, SMS, ANDROID, IPHONE
}

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key = null;

/** The subject is optional, and not even applicable for SMS. */
private String subject = null;

@Enumerated
private Text body = null;

private Medium medium = Medium.EMAIL;

private Long user = null;

@Enumerated
private Key actionPlan = null;

/** Denormalize the coach name to send via API quicker. */
private String coachName = null;

/** Denormalize the coach ID to send via API quicker. */
@Enumerated
private Key coach = null;

/** When the message was created (i.e. enqueued) */
private Date created = null;

/** Has the user acknowledged this message yet? */
private Boolean acknowledged = false;

/**
 * @return the key
 */
public Key getKey() {
return key;
}

/**
 * @param key
 *the key to set
 */
public void setKey(Key key) {
this.key = key;
}

/**
 * @return the subject
 */
public String getSubject() {
return subject;
}

/**
 * @param subject
 *the subject to set
 */
public void setSubject(String subject) {
this.subject = subject;
}

/**
 * @return the body
 */
public Text getBody() {
return body;
}

/**
 * @param body
 *the body to set
 */
public void setBody(Text body) {
this.body = body;
}

/**
 * @return the medium
 */
public Medium getMedium() {
return medium;
}

/**
 * @param medium the medium to set
 */
public void setMedium(Medium medium) {
this.medium = medium;
}

/**
 * @return the user
 */
public Long getUser() {
return user;
}

/**
 * @param user the user to set
 */
public void setUser(Long user) {
this.user = user;
}

/**
 * @return the actionPlan
 */
public Key getActionPlan() {
return actionPlan;
}

/**
 * @param actionPlan the actionPlan to set
 */
public void setActionPlan(Key actionPlan) {
this.actionPlan = actionPlan;
}

/**
 * @return the created
 */
public Date getCreated() {
return created;
}

/**
 * @param created the created to set
 */
public void setCreated(Date created) {
this.created = created;
}

/**
 * @return the acknowledged
 */
public Boolean getAcknowledged() {
return acknowledged;
}

/**
 * @param acknowledged the acknowledged to set
 */
public void setAcknowledged(Boolean acknowledged) {
this.acknowledged = acknowledged;
}

/**
 * @return the coachName
 */
public String getCoachName() {
return coachName;
}

/**
 * @param coachName the coachName to set
 */
public void setCoachName(String coachName) {
this.coachName = coachName;
}

/**
 * @return the coach
 */
public Key getCoach() {
return coach;
}

/**
 * @param coach the coach to set
 */
public void setCoach(Key coach) {
this.coach = coach;
}

@Transient
public boolean wasAcknowledged() {
return getAcknowledged();
}

@Transient
public boolean isAcknowledged() {
return getAcknowledged();
}

@Transient
public Object getIdOrKey() {
return key;
}
}


On Aug 24, 2:55 am, Abe Parvand eparv...@gmail.com wrote:
 All I'm doing is 

[appengine-java] Re: Performance implications of embedded classes

2009-08-25 Thread Iain

Embedding is the same as defining the fields on the parent.

Assuming you need the embedded data most of the time, and it is small,
I think you gain a performance boost as to load the data you only load
one entity, not two. This assumes the embedded class is small in size,
and you require its data. The data would not be lazily loaded.

If you hardly use its data, or it is large and you only sometimes need
it, you will loose performance as it is loaded each time.

Also using embedded means you can search the parent via the embedded
fields. Otherwise you cannot.

On Aug 26, 7:25 am, Larry Cable larry.ca...@gmail.com wrote:
 I'd be surprised if you can even get them to work!!! I am having no
 end of trouble
 getting a pretyt basic @Embedded scenarios to work ...

 good luck!

 On Aug 25, 2:19 pm, fx.mueller fr.x.muel...@gmail.com wrote:



  Hello,

  I just went through the getting started documents and have a question
  regarding embedded classes, which I haven't found discussed elsewhere
  (maybe because it is trivial ;-):

  What are the performance implications of defining a class as embedded?

  Is it the same as if the fields of the embedded class are directly
  defined in the parent class? Or do I gain any performance benefits by
  defining a class as embedded - maybe because the fields of the
  embedded class become part of a different index? Or maybe because the
  fields of the embedded class are lazily retrieved if the parent
  class is retrieved?

  thanks, franz- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Unable to upload

2009-08-25 Thread Randall

This could be complicated.  My ISP (mstar) recently partnered with
google and so I ended up with a google account and gmail with the
account name randalljohn...@mstar.net (my email account name).  Last
week I signed up for an App Engine account using the same username but
a different password.  I have logged into appengine.google.com and
created two applications.  I know that they are created because their
names (optasst and optionassistant) changed from being available to
unavailable after I created them.  However they do not show up on the
app engine start page.  When I deploy to app engine, the applications
fail to upload with indicated message (username and password do not
match) even though I use the same username and password I use to log
into appengine.google.com.  The apps work as expected when run
locally.

I am not aware of having a Google Apps account, but I'm not sure what
my ISP did when they partnered with Google.

Thanks for the help.

Randall Johnson

On Aug 25, 2:39 pm, Jason (Google) apija...@google.com wrote:
 Hi Randall. What is your application's ID and which email address are you
 using during deployment? Are you using an account on a Google Apps domain by
 any chance? If so, have you tried signing in 
 tohttp://appengine.google.com/a/DOMAIN to see if your apps appear there?
 Thanks,
 - Jason



 On Fri, Aug 21, 2009 at 3:05 PM, Randall randalljohn...@mstar.net wrote:

  I get the message Email xx and password do not match when I
  try to deploy to AppEngine.  However I use the same username and
  password to log into the appengine website successfully.  I get the
  same error message whether I deploy using the Netbeans plug-in or
  appcfg from the command line.

  Also, I have created two applications but they do not appear when I
  log into appengine.google.com.  I have verified that the application
  names were really created by checking their (non)availibility.

  Does anyone know why my username/password won't work for upload when
  it works for log in?- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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] Local server works, Appspot fails with java.lang.StackOverflowError when Spring AOP is enabled

2009-08-25 Thread Gabriel Moreira

My app is using Spring 3.0.

If i disable Spring AOP, my app runs fine both on local and appspot.

But when i enable Spring AOP (tested with advice or aspects), in local
runtime everything is fine and works, but in appspot im getting this
error:

java.lang.StackOverflowError
at java.lang.String.endsWith(Unknown Source)
at sun.security.provider.PolicyFile.canonPath(Unknown Source)
at java.io.FilePermission$1.run(Unknown Source)
at java.io.FilePermission$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.FilePermission.init(Unknown Source)
at java.io.FilePermission.init(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getPermission(Unknown
Source)
at sun.misc.URLClassPath.check(Unknown Source)
at sun.misc.URLClassPath$FileLoader.getResource(Unknown Source)
at sun.misc.URLClassPath$FileLoader.findResource(Unknown Source)
at sun.misc.URLClassPath.findResource(Unknown Source)
at java.net.URLClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(Unknown Source)
at com.google.apphosting.runtime.security.UserClassLoader.findResource
(UserClassLoader.java:631)
at java.lang.ClassLoader.getResource(Unknown Source)
at com.google.apphosting.runtime.security.UserClassLoader$4.run
(UserClassLoader.java:665)
at com.google.apphosting.runtime.security.UserClassLoader$4.run
(UserClassLoader.java:659)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.apphosting.runtime.security.UserClassLoader.findResource
(UserClassLoader.java:659)
at java.lang.ClassLoader.getResource(Unknown Source)
at com.google.apphosting.runtime.security.UserClassLoader$4.run
(UserClassLoader.java:665)
at com.google.apphosting.runtime.security.UserClassLoader$4.run
(UserClassLoader.java:659)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.apphosting.runtime.security.UserClassLoader.findResource
(UserClassLoader.java:659)
at java.lang.ClassLoader.getResource(Unknown Source)
at com.google.apphosting.runtime.security.UserClassLoader$4.run
(UserClassLoader.java:665)
at com.google.apphosting.runtime.security.UserClassLoader$4.run
(UserClassLoader.java:659)
at java.security.AccessController.doPrivileged(Native Method)
at
com.google.apphosting.runtime.security.UserClassLoader.findResour...




My applicationContext.xml:

?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:aop=http://www.springframework.org/schema/aop;
xmlns:context=http://www.springframework.org/schema/context;
xmlns:tx=http://www.springframework.org/schema/tx;
xsi:schemaLocation=http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx

http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-2.5.xsd;
!--
Habilita annotations para JPA
--
!--
VERIFICAR: bean
class=org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
 /

--

bean
class=org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
 /


context:property-placeholder
location=classpath:application.properties /

!--
JPA Entity Manager
--
bean id=entityManagerFactory
class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean
property name=persistenceUnitName 
value=transactions-optional /

/bean

!--
Activates spring transaction container
--
bean id=transactionManager
class=org.springframework.orm.jpa.JpaTransactionManager
property name=entityManagerFactory 
ref=entityManagerFactory /
/bean

!--
Cache configuration
 --
bean id=cacheManager
class=org.springframework.cache.ehcache.EhCacheManagerFactoryBean
property name=configLocation
valueclasspath:ehcache.xml/value
/property
/bean

!--
Activates annotations to be detected in bean classes: 
@Transaction
--
tx:annotation-driven transaction-manager=transactionManager /


[appengine-java] Re: Model to Optimize Queries

2009-08-25 Thread Sam Walker
Any ideas, anyone?

On Sun, Aug 23, 2009 at 11:18 PM, Sam Walker am.sam.wal...@gmail.comwrote:

 Also, I get this error: *Can only filter by properties of a sub-object if
 the sub-object is embedded.* when I tried to access article while setting
 a fitler: query.setFilter(reviewer == reviewerParam   article.status =
 articleStatusParam);

 What am I missing?


 On Sat, Aug 22, 2009 at 6:02 PM, Sam Walker am.sam.wal...@gmail.comwrote:

 In the second model, how will I find all Articles being reviewed by A and
 B?

 The only way I can think of is adding another derived field in Article:

 Article {
   HashSetReview reviews;
   HashSetReviewer reviewers; // keys of Reviewers to help the query
 find all articles reviewed by A and B
   HashSetString tags;
   int status; // derived from all Reviews' statuses.
 }

 Review {
   Article article;
   Reviewer reviewer;
   int status;
 }

 Now I should be able to do reviewers.contains(A.key) and
 reviewers.contains(B.key). Is that the best way?


 On Sat, Aug 22, 2009 at 2:02 PM, Sam Walker am.sam.wal...@gmail.comwrote:

 Oh sweet, I didn't know that.

 That's awesome! Thanks for the quick reply.


 On Sat, Aug 22, 2009 at 1:51 PM, datanucleus 
 andy_jeffer...@yahoo.comwrote:


  I dont think I can do sth like (I can't access article.tags,
 article.status
  as far as I know, correct?):

 Of course you can. JDO spec defines JDOQL, using Java syntax.

  query.setFilter(reviewer == reviewerParam  status == statusParam 
  article.tags == tagParam  article.status = articleStatusParam);

 What is tagParam ? an element of the hashSet?
 You can't do Collection == element in Java so you can't in JDOQL.
 You could do article.tags.contains(tagParam)
 





--~--~-~--~~~---~--~~
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: 401 Unauthorized Must authenticate first. I can't upload my project

2009-08-25 Thread Cyrano

I finally solved the problem. For some reason, the date/time setting
on my windows was incorectly set to a future point in time. Setting
the correct date/time solved the issue.

-Cyr

On 23 Aug., 18:35, Cyrano dirk_ehrh...@yahoo.de wrote:
 As I have the same problem, I take the freedon to respond wiht my
 details. I tred with both Eclipse and Ant. When I enter a wrong
 password, I get the error email and password do not match. If I
 enter them correctly, I get the 401Must authenticate first error.

 I am definetely not behind a proxy
 -Cyr

 On 22 Aug., 10:22, bb1987 bb1987 bbd1...@gmail.com wrote:

  Are you trying to deploy from Eclipse or using Ant? Have you
  tried both?
  Yes, I have tried both several times.

  And are you behind a proxy server by any chance?
  No, I don't think so.

  This is probably a given, but are you certain that you're entering the
  correct credentials at the username and password prompt?
  Yes,I'm entering correct credentials. I'm using credentials when I
  register application.

  On Aug 21, 11:56 am, Jason (Google) apija...@google.com wrote:

   This is probably a given, but are you certain that you're entering the
   correct credentials at the username and password prompt? The Google 
   account
   has to match the one that you used to register the application (the same 
   one
   that you're posting with).
   - Jason

   On Fri, Aug 21, 2009 at 11:53 AM, Jason (Google) 
   apija...@google.comwrote:

Your app configuration file looks good, so there must be something more
insidious. Are you trying to deploy from Eclipse or using Ant? Have you
tried both? And are you behind a proxy server by any chance?

- Jason

On Thu, Aug 20, 2009 at 1:10 AM, bb1987 bb1987 bbd1...@gmail.com 
wrote:

My web.xml file contains:
?xml version=1.0 encoding=utf-8?
appengine-web-app xmlns=http://appengine.google.com/ns/1.0;
       applicationbuildfunnyface/application
       version1/version
       !-- Configure java.util.logging --
       system-properties
               property name=java.util.logging.config.file
value=WEB-INF/
logging.properties/
       /system-properties
/appengine-web-app

And my application ID is : buildfunnyface

On Aug 19, 11:24 am, Jason apija...@google.com wrote:
 What is your application ID? Also, can you paste your appengine-
 web.xml file?

 Thanks,
 - Jason

 On Aug 18, 5:31 am, bb1987 bb1987 bbd1...@gmail.com wrote:

  Hello

  Today I have received Your Google App Engine Account has been
  enabled! email because I couldn't activated via sms.

  Then I registered my application. My project's application id and
  registered application is same.

  I read (Get 401Unauthorized on deploying ) discussion and checked
  all settings.
  But it always says 401Unauthorized

  I don't know what is wrong. Please give me hint.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---