[appengine-java] Re: Problems in Connecting to Mysql database using Hibernate

2009-08-31 Thread Raji

A big thanks to you all for quick response...i will try to implement
what you said,but can u explain me in more detail.



cheers
Raji

On Aug 31, 5:07 pm, Maciej Machulak  wrote:
> You may connect to a database from a Google App Engine application.
> Your data must simply reside outside of the App Engine. You can also
> get data from inside a private network (consider using Google Secure
> Data Connector)http://code.google.com/securedataconnector/.
>
> Cheers,
> Maciej
>
> 2009/8/31 leszek :
>
>
>
> > "DataNucleus JPA"
>
> --
> Maciej Machulak
> email: maciej.machu...@gmail.com
> tel: +48 602 45 31 44
> tel: +44 7999 606 767
--~--~-~--~~~---~--~~
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] java.lang.NoClassDefFoundError

2009-08-31 Thread g

I use freemarker as my template engine.
I have the freemarker.jar under the \war\WEB-INFO\lib
from this morning all my pages return 500 error:
java.lang.NoClassDefFoundError: Could not initialize class
freemarker.template.Configuration

but the localhost is fine.

Is there anything wrong with appengine-java?

--~--~-~--~~~---~--~~
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] live feed

2009-08-31 Thread asianCoolz

since comet not supported, may i know what workaround you folks do to
create live feed ? any such example on gwt?
--~--~-~--~~~---~--~~
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 use Multi-parameter in Query

2009-08-31 Thread tom

I have a problem with javax.jdo.Query ,how to use Multi-parameter in
Query ,think you!
--~--~-~--~~~---~--~~
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] Command-line java client created Key.appIdNamespace = null

2009-08-31 Thread davekor

Hi,

I use a command-line java client to generate data that is submitted to
my AppEngine application for storage.

It was working fine in a prior version of AppEngine, but with the
recent upgrade to 1.2.2, I find that all keys
(com.google.appengine.api.datastore.Key) generated by my command-line
app causes NullPointerExceptions when I call KeyFactory.keyToString
(key) within my app. When I debug further, I discover that the
difference between keys generated by my command-line client and keys
generated directly within my appengine app is a field called
appIdNamespace.

All keys created by my command-line client have Key.appIdNamespace =
null. In comparison, keys created within the appengine app have a non-
null appIdNamespace.

appIdNamespace seem to be a private/protected field which I have no
direct access to. How do I create a key with a non-null
appIdNamespace?

--~--~-~--~~~---~--~~
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: http duration 30seconds

2009-08-31 Thread CoolDude

what if my avi is binary stream stored in bigtable can i retrieve it
through servlet and return to user?
--~--~-~--~~~---~--~~
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: Log4J vs. java.util.logging in App Engine projects

2009-08-31 Thread Rajeev Dayal
+[tobyr]

Hi Bill,

We include both logging files due to the implementation of Datanucleus. If
you have log4j on your classpath (or if you have any jars which bundle the
log4j classes), then Datanucleus will use the log4j logging system. If you
don't have a configuration file for log4j, then none of the information will
be displayed. That is why we include one by default. If you do not have
log4j on your classpath, then the log4j system is not used, and neither is
the log4j.properties file which we include.

If you are sure that you do not have any log4j classes on your classpath,
then you can safely remove the log4j.properties file, and control all of
your logging via the logging.properties file. If you're using log4j, you can
get rid of the logging.properties file.

My recommendation would be to keep both files, and only update the one for
the logging system that you're using. You don't need to keep both of them in
sync unless you adjust the Datanucleus logging levels.

Let me know if you have any questions - I know that this is somewhat
confusing.


Rajeev


On Sun, Aug 30, 2009 at 7:51 AM, Bill Higgins  wrote:

>
> Hi, I'm new to App Engine development, and am a bit confused by the
> logging configuration files that the Google Eclipse project produces
> in a new web application project.
>
> When you create a new web app project, the new project includes two
> logging configuration files:
>
> /src/log4j.properties
> /war/WEB-INF/logging.properties
>
> I understand that the first is for log4j and the second for
> java.util.logging but I'm not sure why one would need both and how
> each affect logging determinations. If I make changes to one should I
> make changes to another? Is there a safe way to delete one and simply
> use the other? If so which one is the keeper?
>
> Thanks in advance.
> >
>

--~--~-~--~~~---~--~~
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] [Solve]Re: Problem with a query and index

2009-08-31 Thread loudo

The problem is solved.

The auto generate index file was not generate because i have not
launch on local my application.

I try to make my own index file but i seems not to be the right way.

On 31 août, 20:45, loudo  wrote:
> I try to alter the entity column in long format and i have the same
> problem.
>
> On 31 août, 12:12, leszek  wrote:
>
>
>
> > Query is ok. But what Date are you using. java.sql.Date or
> > java.util.Date ? If java.util.Date please consider also the hour/min/
> > sec part of the date: the field persisted and 'mdatedispo' parameter.
> > May be the problem is hidden there ?
--~--~-~--~~~---~--~~
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: Unowned relationships

2009-08-31 Thread Albert Attard
Hi:

Let say we have two classes with a many-to-many relation: Item and Category.
Only the Item owns the relation, while the Category is not aware of the Item
(unidirectional). Both entities use a Key as their primary key which is
generated in a naive way.

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Item {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;
  @Persistent
  private String name;
  @Persistent
  private Set categories;
}

And the category class

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Category {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;
  @Persistent
  private String name;
}



Now, in the DAO class, there are two methods: one that saves the items and
categories and one that lists them. Note that I’m first checking if this
object exists by catching the JDOObjectNotFoundException exception which may
not be the best choice.

public String save(String itemName, String categryName) {
PersistenceManager pm = PMF_INSTANCE.getPersistenceManager();
try {
  KeyFactory.Builder keyBuilder = new KeyFactory.Builder(Item.class
  .getSimpleName(), itemName);
  keyBuilder.addChild(Category.class.getSimpleName(), categryName);
  Key categoryKey = keyBuilder.getKey();

  Category category = null;
  try {
category = pm.getObjectById(Category.class, categoryKey);
  } catch (JDOObjectNotFoundException e) {
category = new Category();
category.setKey(categoryKey);
  }
  category.setName(categryName);
  pm.makePersistent(category);
  System.out.println("Category Key: " + categoryKey);

  Key itemKey = KeyFactory.createKey(Item.class.getSimpleName(),
  itemName);
  Item item = null;
  try {
item = pm.getObjectById(Item.class, itemKey);
  } catch (JDOObjectNotFoundException e) {
item = new Item();
item.setKey(itemKey);
  }
  item.setName(itemName);
  item.addCategory(categoryKey);
  pm.makePersistent(item);
} catch (Exception e) {
  e.printStackTrace();
  return "Failed";
} finally {
  pm.close();
}


return "Done";
  }



The list method is very simple:



@SuppressWarnings("unchecked")
  public List list() {
PersistenceManager pm = PMF_INSTANCE.getPersistenceManager();
List list = new ArrayList();
try {
  Query query = pm.newQuery(Item.class);
  List results = (List) query.execute();
  for (Item i : results) {
list.add(String.valueOf(i));
  }
} catch (Exception e) {
  e.printStackTrace();
} finally {
  pm.close();
}


return list;
  }





Will try to elaborate on this example tomorrow if I manage some time.



Hope this helps,

Albert Attard

Charles de 
Gaulle
- "The better I get to know men, the more I find myself loving dogs."

2009/8/31 objectuser 

>
> I think it depends on the queries you want to support.  In GAE it's
> usually important to know that up-front.  Also, the specific trouble
> you're having might help.  Is it a modeling issue, a querying issue,
> just an issue with the APIs ...?
>
> I have some stuff here (the "querying" posts) that might be relevant
> to you (it's JPA, but the models should be the same):
>
> http://objectuser.wordpress.com/google-app-engine/
>
> Without knowing the queries though, something like this should cover
> the basic relationships:
>
> class Beverage {
>  Long id;
>  Key packaging;
>  Key district;
>  List materials;
> }
>
> On Aug 31, 10:46 am, funkforce  wrote:
> > Hi,
> >
> > No it doesnt really help me. I understand that I have to manage the
> > relationships myself but I cant really get it working. So an example
> > would be nice.
> >
> > Thanks
> >
> > FF
> >
> > On Aug 31, 5:31 pm, Albert Attard  wrote:
> >
> > > Hi:
> > > Quote from the page:
> http://code.google.com/appengine/docs/java/datastore/relationships.ht...
> >
> > > "The App Engine implementation of JDO does not yet implement this
> facility,
> > > but don't worry, you can still manage these relationships using Key
> values
> > > in place of instances (or Collections of instances) of your model
> objects."
> >
> > > Hope this helps, even though it's not much
> > > Albert Attard
> >
> > > Ogden Nash <
> http://www.brainyquote.com/quotes/authors/o/ogden_nash.html>  -
> > > "The trouble with a kitten is that when it grows up, it's always a
> cat."
> >
> > > 2009/8/31 funkforce 
> >
> > > > Hi
> >
> > > > Can someone post a full example of working code with unowned
> > > > relationships? It semas that several pople are havning problems with
> > > > this on I cant find any solution posted in this group yet.
> >
> > > > I think that I must use unowned relationships in my code. If I am
> > > > mistaken please correct me.
> >
> > > > I have a beverage class t

[appengine-java] Re: Google Maps API Key not working with URL fetch (for HTTP geocode request)

2009-08-31 Thread Jason (Google)
Hi Mike. I have this set up for my personal application and it works using
the same key for the client and server. Hopefully someone in the Maps API
group can explain what's happening with your app in particular. The only
issue I've run into is when adding a custom domain -- your requests will
fail until you register a new key for the custom domain.
http://groups.google.com/group/Google-Maps-API

- Jason

On Sat, Aug 29, 2009 at 12:42 PM, Michael Ring wrote:

>
> I have the key registered at the *.appspot domain, and the map on the
> page loads fine.
>
> URL fetches from the server do not like the API key---different server
> domain?  Any insight or workaround appreciated.
>
> Thanks,
>
> Mike
> >
>

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



[appengine-java] Re: jdo & date

2009-08-31 Thread Jason (Google)
You could always store the Long variant (number of milliseconds since
1/1/1970) and compare against that.
http://java.sun.com/javase/6/docs/api/java/util/Date.html#getTime%28%29

- Jason

On Sat, Aug 29, 2009 at 12:09 PM, leszek  wrote:

>
> You are right, but 'midomarocain'' wants to keep full date (with hours/
> min/secs) and in one context compare the full date and in the another
> context compare the same date but using the year/month/day part only.
> But, of course, it is possible to split the date to java.sql.Date and
> java.sql.Time and once compare the java.sqlDate  only and else compare
> java.sql.Date and java.sql.Time.
>
> But unfortunately GAE does not support that:
>
>
> http://code.google.com/intl/pl/appengine/docs/java/datastore/queriesandindexes.html
>
> -
> Due to the way the App Engine datastore executes queries, a single
> query cannot use inequality filters (< <= >= >) on more than one
> property. Multiple inequality filters on the same property (such as
> querying for a range of values) are permitted. See Restrictions on
> Queries.
> -
>
> I hope that we are on the same page now.
>
>
> >
>

--~--~-~--~~~---~--~~
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: Warning message about junit plugin from datanucleus in my logs when running Junit tests

2009-08-31 Thread Rajeev Dayal
Hi,

Is this a normal JUnit Launch Configuration, or is there a special plugin
that you're using?

Can you navigate to the launch configuration's classpath tab and list out
the entries?


Thanks,
Rajeev


On Wed, Aug 26, 2009 at 4:58 PM, Amendmen7  wrote:

>
> I'm having the same issues. I have tried turning off all known loggers
> in the setUp methods of my LocalDatastoreTestCase superclass, but it
> has no effect re: this logspam!
>
> Has anyone found an answer?
>
> On Aug 5, 8:41 am, Stephan  wrote:
> > I'm having the same problem here. Using a fresh eclipse install and a
> > simple test-application, I get the same messages. They only appear
> > when I use JDO in my unit tests.
> > Except for the error log messages, everything seems to work fine. But
> > starting each unit-test with more then 30 warnings and errors doesn't
> > seem like a clean way to test an application.
> >
> > Did you find a solution yet? I'd think there would be a much larger
> > group with the same problem, or isn't anyone unit-testing here? :)
> >
> > On 27 jun, 15:57, Peter Recore  wrote:
> >
> > > I have a warning message showing up in my logs when I run my unit
> > > tests in Eclipse, using the junit plugin.
> > > I have the google plugin installed.
> > > The messages seem to be coming from the DataNucleus logger.
> >
> > > Here is one line.  There are about 30 more all referencing  different
> > > extension points.
> > > Jun 27, 2009 8:42:40 AM
> > > org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
> > > WARNING: Extension Point "org.eclipse.ui.views" not registered, but
> > > plugin "org.eclipse.jdt.junit" defined in file:/C:/Documents%20and
> > > %20Settings/peter/Desktop/eclipse/configuration/org.eclipse.osgi/
> > > bundles/307/1/.cp/META-INF/MANIFEST.MF refers to it.
> >
> > > Then there are some that look like this:
> >
> > > Jun 27, 2009 8:42:40 AM
> > > org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
> > > SEVERE: Bundle "org.eclipse.jdt.junit4.runtime" requires "org.junit4"
> > > but it cannot be resolved.
> >
> > > I'm hoping someone can give me a hint as to whether this is an eclipse
> > > issue, a junit issue, a datanucleus issue, or something else.
> > > 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: Problem with a query and index

2009-08-31 Thread loudo

I try to alter the entity column in long format and i have the same
problem.

On 31 août, 12:12, leszek  wrote:
> Query is ok. But what Date are you using. java.sql.Date or
> java.util.Date ? If java.util.Date please consider also the hour/min/
> sec part of the date: the field persisted and 'mdatedispo' parameter.
> May be the problem is hidden there ?
--~--~-~--~~~---~--~~
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: Redeployment/Reloading of Java classes in SDK

2009-08-31 Thread Jason (Google)
Please file a new feature request:
http://code.google.com/p/googleappengine/issues/list

- Jason

On Sat, Aug 29, 2009 at 10:38 AM, Klaus  wrote:

>
> Ok, it works fine. But now I need to touch "appengine-web.xml" for a
> redeploy... This is about the same "effort" as stopping and restarting
> the dev servlet engine... :-)
>
>
> On 29 Aug., 00:09, Toby Reyelts  wrote:
> > Try either touching your appengine-web.xml file or hitting
> > /_ah/reloadwebapp. Either of those should do a hot reload of your webapp.
> We
> > haven't seen a lot of requests for webapp hot reloading, because the
> > dev_appserver is usually very fast to boot. What is it that you're doing
> > that would save a lot of time with a webapp reload but not be fast from a
> > server boot? Can you let us know if this does indeed work and save you
> > significant time?
> >
> > On Fri, Aug 28, 2009 at 5:54 PM, Klaro  wrote:
> >
> > > The Servlet Engine in the SDK translates JSPs right after they were
> > > changed - fine!
> >
> > > When changing Java code (such as a Servlet), the changes are not
> > > redeployed - bad!
> >
> > > So I have to stop and start the local Servlet Engine to see the
> > > effects of the changes in my classes. This leads to hardly acceptable
> > > turn around times.
> >
> > > My question: Is there a trick or even an official configuration option
> > > to deploy/reload classes immediately without restarting the server? (I
> > > was using Tomcat previously, and there is some configurtaion option in
> > > the server.xml.)
> >
> > > Regards,
> > > Klaro
> >
> >
> >
>

--~--~-~--~~~---~--~~
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: cant create temporary file

2009-08-31 Thread Jason (Google)
You're correct that App Engine's filesystem is not writable. This is not
likely to change soon, so any libraries that you depend on which assume a
writable file system will have to be updated to use a supported mechanism.
As you can see from the following wiki page, a growing number of libraries
and frameworks are compatible with App Engine, Hibernate notwithstanding.
http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine

Regarding your third point, App Engine does include a URL Fetch service
which should allow you to issue HTTP requests (including POSTs) to other
websites running on ports 80 or 443. In addition to the low-level API, a
java.net-based wrapper is available:

http://code.google.com/appengine/docs/java/urlfetch/

- Jason

On Sat, Aug 29, 2009 at 4:15 AM, sandeep  wrote:

>
> Google app engine is good but it has limitations like:
> 1. You cant create temporary files. Most java libraries rely on a
> temporary folder for scratchpad. As GAE doesnt support filesystem
> operations, all these go for a toss?
>
> You cant upload files on to a file system. How does one expect to
> manage static content then?
>
> Any plans for temp files support atleast??
>
> 2. Also had GAE supported hibernate it would have been a super boost
> as most apps run today with spring + hibernate.
>
> 3. Also you cant crawl other websites as http port is blocked that
> means you can't do anything like HTTP post?.
>
>
> Any suggestions on these esp point 1 ?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: http duration 30seconds

2009-08-31 Thread Jason (Google)
I am assuming here that your .avi file is a static resource. Let me know if
this assumption is incorrect.

App Engine responses are bounded by the 10 Megabyte response size upper
limit. If your file is smaller than this, then yes, you will be able to
return it, even if the user has a slow connection -- as long as the download
begins in under 30 seconds, you'll be fine.

- Jason

On Sat, Aug 29, 2009 at 1:01 AM, asianCoolz  wrote:

>
> may i know if i upload an avi file into app engine, can it be played
> by user since there is limit of http duration of 30seconds?
> >
>

--~--~-~--~~~---~--~~
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: Cron scheduling and versions

2009-08-31 Thread Jason (Google)
Thanks for the docs suggestion, Hans. I'll try to get the page updated with
this info.
- Jason

On Fri, Aug 28, 2009 at 11:15 PM, Hans DeBano  wrote:

> I had the same question today and testing verified for me that it only runs
> for the default version.
>
> I wonder if the documentation at:
>
> http://code.google.com/appengine/docs/java/config/cron.html
>
> could be modified from:
>
> *A cron job will invoke a URL at a given time of day. A URL invoked by
> cron is subject to the same limits and quotas as a normal HTTP request,
> including the request time limit.*
>
> to:
>
> *A cron job will invoke a URL at a given time of day. A URL invoked by
> cron is subject to the same limits and quotas as a normal HTTP request,
> including the request time limit. A cron job runs only for the default
> version of your application.*
>
> That'd be quick documentation note that would clarify things.
>
> (I love the admin console; however, the version dropdown that appears on
> upper left with app selector almost implies that on the "Quota Details" ,
> "Cron Jobs" screens you might change (just) the version in the dropdown and
> see something different which isn't the case. On "Logs" you will though...)
>
> Hans
>
> On Fri, Aug 28, 2009 at 10:43 AM, Jason (Google) wrote:
>
>> I fairly certain that cron will only hit the defined handler for the
>> default version.
>>
>>
>>
>> On Thu, Aug 27, 2009 at 1:35 AM, Martyn wrote:
>>
>>>
>>> 
>>>
>>> Can anyone tell me (without me bothering to test!) whether the cron
>>> tasks run for all versions or only for the default version?
>>>
>>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: is not persistable

2009-08-31 Thread datanucleus

> The class "The class "x.Category" is not persistable. This means that
> it either hasnt been enhanced,
> or that the enhanced version of the file is not in the CLASSPATH (or is 
> hidden by an unenhanced version),
> or the Meta-Data/annotations for the class are not found.

And when you've checked those 3 things ... you can conclude that one
of them is the cause.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Problem with a query and index

2009-08-31 Thread loudo

Hello

I use java.util.Date in the entity and in my query. You think i must
use java.sql.Date ?

Here is a screenshot of my dataviewer.

You can see the date with hour/min/sec but when i want to add an
entity (with form) you can see number choice only. Is it a right way ?

http://img178.yfrog.com/i/gae.jpg/

Thanls for your help.

On 31 août, 12:12, leszek  wrote:
> Query is ok. But what Date are you using. java.sql.Date or
> java.util.Date ? If java.util.Date please consider also the hour/min/
> sec part of the date: the field persisted and 'mdatedispo' parameter.
> May be the problem is hidden there ?
--~--~-~--~~~---~--~~
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: "is not that of an entity but needs to be for this operation" when persist entity

2009-08-31 Thread Jason (Google)
Can you post some more context? I'm specifically interested in seeing how
you're building your oggetto object (assuming it's of class Log) and how
you're getting a reference to your entityManagerSession.

Also, since you're using JPA, you shouldn't be calling flush outside of a
transaction.

- Jason

On Fri, Aug 28, 2009 at 2:56 AM, infrarosso  wrote:

>
> Hi,
>
>  I have a web application on GAE with JPA persistence and one entity
> enhanced with datanucleos tool
>
> This entity compiled and jar in extra library was on WEB-INF/lib of my
> web application
>
> when I try to persist my Object like this code ...
>
> try
>{
>entityManagerSession.persist(oggetto);
>entityManagerSession.flush();
>}
>catch (Throwable e)
>{
>throw new PersistenceException(e);
>}
>finally
>{
>
>}
>
>
> I get this error (only on GAE enviroment, because on my local
> development IDE work ok)...
>
>
>
>
> java.lang.IllegalArgumentException: Type ("it.irex.stats.beans.Log")
> is not that of an entity but needs to be for this operation >
>  it.irex.stats.StatsHandlerGaeImpl.logStats(StatsHandlerGaeImpl.java:
> 41) >
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >
>  sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >
>  sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >
>  java.lang.reflect.Method.invoke(Unknown Source) >
>
>
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_
> $3.run(Method_.java:149) >
>  java.security.AccessController.doPrivileged(Native Method) >
>
>
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.privilegedInvoke
> (Method_.java:147) >
>
>
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.invoke
> (Method_.java:120) >
>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection
> (AopUtils.java:307) >
>  
>
>
>
> My entity bean is this:
>
>
> import java.io.Serializable;
> import java.util.Date;
>
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
>
> @Entity
> public class Log implements Serializable {
>
>/**
> *   Entity bean JPA for persistence of log bean
> */
>private static final long serialVersionUID = 5776764707008905528L;
>
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Long logId;
>
>
>
>/**
> * url view (URI)
> */
>private String uriView;
>
>/**
> *  query string view
> */
>private String urlParamView;
>
>
>
>
>public Long getLogId() {
>return logId;
>}
>
>public void setLogId(Long logId) {
>this.logId = logId;
>}
>
>
>public String getUriView() {
>return uriView;
>}
>
>public void setUriView(String uriView) {
>this.uriView = uriView;
>}
>
>public String getUrlParamView() {
>return urlParamView;
>}
>
>public void setUrlParamView(String urlParamView) {
>this.urlParamView = urlParamView;
>}
>
>
>
>
> }
>
>
> Why I get "is not that of an entity but needs to be for this
> operation" ?
>
>
>
> >
>

--~--~-~--~~~---~--~~
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 a child from it's parent

2009-08-31 Thread Jason (Google)
Two quick points to add:

   - You can verify whether an entity has been persisted using the local
   data viewer. If your application is running on port 8080, then you can load
   the data viewer at http://localhost:8080/_ah/admin -- this should help
   you determine whether the issue is your persistence layer or query.
   - If you don't want to "touch" every field before returning your object,
   you should be able to add it to the default fetch group:

@Persistent(defaultFetchGroup = "true")
private ContactInfo contactInfo;

- Jason

On Fri, Aug 28, 2009 at 2:43 AM, B Jansen  wrote:

>
> Thank you!!
>
> That solved it.
> I think I overlooked (or mis understood) that one line in the
> documentation. But an example code like you showed would be nice in
> the doc
>
> Thanks again!
> >
>

--~--~-~--~~~---~--~~
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: deployment issues

2009-08-31 Thread Jason (Google)
Can you try re-deploying your application with your updated index files?
There was an issue with indexing tasks for a short period on Friday, but
these were resolved later that same day.

- Jason

On Thu, Aug 27, 2009 at 10:56 PM, Vik  wrote:

> Hie
> When i am trying to deploy my app.. it went fine till it says deployed but
> after that it keep hanging on uploading indexes step.
>
> and finally gives following error (tried 4-5 times)
> Unable to upload:
> java.io.IOException: Error posting to URL:
> http://appengine.google.com/api/datastore/index/add?app_id=sakshumweb&version=1&;
> 500 Internal Server Error
>
> Server Error (500)
> A server error has occurred.
>
> at
> com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:143)
>  at
> com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:81)
> at
> com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:415)
>  at
> com.google.appengine.tools.admin.AppVersionUpload.updateIndexes(AppVersionUpload.java:143)
> at
> com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:120)
>  at
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:53)
> at
> com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:271)
>  at
> com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:148)
> at
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
>  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>
> Thankx and Regards
>
> Vik
> Founder
> www.sakshum.com
> www.sakshum.blogspot.com
>
> >
>

--~--~-~--~~~---~--~~
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: Unowned relationships

2009-08-31 Thread objectuser

I think it depends on the queries you want to support.  In GAE it's
usually important to know that up-front.  Also, the specific trouble
you're having might help.  Is it a modeling issue, a querying issue,
just an issue with the APIs ...?

I have some stuff here (the "querying" posts) that might be relevant
to you (it's JPA, but the models should be the same):

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

Without knowing the queries though, something like this should cover
the basic relationships:

class Beverage {
  Long id;
  Key packaging;
  Key district;
  List materials;
}

On Aug 31, 10:46 am, funkforce  wrote:
> Hi,
>
> No it doesnt really help me. I understand that I have to manage the
> relationships myself but I cant really get it working. So an example
> would be nice.
>
> Thanks
>
> FF
>
> On Aug 31, 5:31 pm, Albert Attard  wrote:
>
> > Hi:
> > Quote from the 
> > page:http://code.google.com/appengine/docs/java/datastore/relationships.ht...
>
> > "The App Engine implementation of JDO does not yet implement this facility,
> > but don't worry, you can still manage these relationships using Key values
> > in place of instances (or Collections of instances) of your model objects."
>
> > Hope this helps, even though it's not much
> > Albert Attard
>
> > Ogden Nash   -
> > "The trouble with a kitten is that when it grows up, it's always a cat."
>
> > 2009/8/31 funkforce 
>
> > > Hi
>
> > > Can someone post a full example of working code with unowned
> > > relationships? It semas that several pople are havning problems with
> > > this on I cant find any solution posted in this group yet.
>
> > > I think that I must use unowned relationships in my code. If I am
> > > mistaken please correct me.
>
> > > I have a beverage class that has a packaging class ,a district class
> > > and a Set of materials.
> > > A beverage can have one type of packaing, one type of district ans
> > > several materials.
> > > Packaing can belong to several beverages.
> > > District can belong to several beverages.
> > > Materials can belong to several beverages.
>
> > > Any thoughts?
>
> > > Thnkas
>
> > > FF- 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: Exception on creation of java.io.File in GAE

2009-08-31 Thread Toby Reyelts
It looks like compass is reading the System property, java.io.tmpdir and
eventually it gets passed into a File constructor call. App Engine doesn't
have a temp directory (we don't allow the writing of any files to disk), so
this system property is set to null. If you need to set this system property
for compass, you can configure it in your appengine-web.xml. For example,


  


On Mon, Aug 31, 2009 at 4:05 AM, barak  wrote:

>
> Hello all,
>
> I'm trying to upload an application that using Lucene and compass. The
> Lucene files are stored under the war directory and should be open to
> read access only. When booting the application, the files are opened
> by the lucene (wrapped with compass). All works ok in the developmemt
> server, when deployed in GAE, the following exception raised:
>
> java.lang.NullPointerException
>at java.io.File.(File.java:276)
>at
> org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:
> 139)
>at org.compass.core.lucene.engine.store.FSDirectoryStore.configure
> (FSDirectoryStore.java:55)
>at
> org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.
> (DefaultLuceneSearchEngineStore.java:144)
>at org.compass.core.lucene.engine.LuceneSearchEngineFactory.
> (LuceneSearchEngineFactory.java:122)
>at org.compass.core.impl.DefaultCompass.(DefaultCompass.java:
> 123)
>at org.compass.core.impl.DefaultCompass.(DefaultCompass.java:
> 116)
>at org.compass.core.config.CompassConfiguration.buildCompass
> (CompassConfiguration.java:288)
>at com.me.store.DataAccessObject.(DataAccessObject.java:76)
>at com.me.store.DataAccessObject.getInstance(DataAccessObject.java:
> 53)
>at com.me.jsf.LargeDataModelBeanSample$Model.fetchPage
> (LargeDataModelBeanSample.java:192)
>at com.me.jsf.PagedListDataModel.fetchPageInternal
> (PagedListDataModel.java:178)
>at
> com.me.jsf.PagedListDataModel.getPage(PagedListDataModel.java:107)
>at com.me.jsf.PagedListDataModel.isRowAvailable
> (PagedListDataModel.java:201)
>at
> org.apache.myfaces.component.html.ext.HtmlDataTableHack.isRowAvailable
> (HtmlDataTableHack.java:88)
>at
> org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex
> (HtmlDataTableHack.java:297)
>at
> org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.setRowIndex
> (AbstractHtmlDataTable.java:276)
>at javax.faces.component.UIData.processColumnChildren(UIData.java:
> 725)
>at javax.faces.component.UIData.processDecodes(UIData.java:613)
>at
> org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.processDecodes
> (AbstractHtmlDataTable.java:306)
>at javax.faces.component.UIForm.processDecodes(UIForm.java:61)
>at javax.faces.component.UIComponentBase.processDecodes
> (UIComponentBase.java:844)
>at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:
> 158)
>at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute
> (ApplyRequestValuesExecutor.java:32)
>at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase
> (LifecycleImpl.java:105)
>at org.apache.myfaces.lifecycle.LifecycleImpl.execute
> (LifecycleImpl.java:80)
>at javax.faces.webapp.FacesServlet.service(FacesServlet.java:143)
>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.HttpConnect

[appengine-java] Sign in to security constraint enabled page programmatically

2009-08-31 Thread Erdinc Yilmazel
Hi,

I have a servlet in my appengine java application which has an admin role
security constraint on it. When I try to access this servlet google asks me
to login using my google account and everything works fine. What I want to
do is to write a desktop application which interacts with this servlet
remotely over https. So instead of using a browser to communicate with the
servlet, I am going to implement an http client for my application (Using
commons httpclient). Since there is a security constraint on the servlet
running on appengine, my http client has to sign in to google somehow... If
I login using a browser and copy the cookies set by google to my own http
client, everything works as expected. What is the best way to implement a
login procedure for a desktop app like this? I want the user of the app (Me
in this case) to enter the google username and password and access the
password protected servlet remotely...

One thing I tried was simulating the exact browser and user behaviour
(Filling in the form for username and password, submitting it, following
redirects etc.) and this was working a couple of months ago, but when google
changes something, it fails. Is there an api for this?

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: question on redeploying from eclipse

2009-08-31 Thread Jason Parekh
Hi Arun,
I believe it uploads only the changed files.  Are you using GWT?  If so, the
delay you're seeing could be the GWT compile taking place.

jason

On Mon, Aug 31, 2009 at 11:30 AM, Arun  wrote:

>
> Hi,
> If i redeploy my google app from eclipse, without changing the version
> number of the app, does the plugin copy over only the changed files
> since last deployment or does it copy all the files?
>
> I just want to find out because i am using some 3rd party jars in my
> app http://flickrexplorer.appspot.com and it always takes quite some
> time to deploy even if i change only a jsp or a java file.
>
> Regards,
> Arun
> ps:
>
> http://flickrexplorer.appspot.com/
> My app lets you view the 500 best flickr photos of any day with their
> EXIF data
> >
>

--~--~-~--~~~---~--~~
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: Unowned relationships

2009-08-31 Thread funkforce

Hi,

No it doesnt really help me. I understand that I have to manage the
relationships myself but I cant really get it working. So an example
would be nice.

Thanks

FF

On Aug 31, 5:31 pm, Albert Attard  wrote:
> Hi:
> Quote from the 
> page:http://code.google.com/appengine/docs/java/datastore/relationships.ht...
>
> "The App Engine implementation of JDO does not yet implement this facility,
> but don't worry, you can still manage these relationships using Key values
> in place of instances (or Collections of instances) of your model objects."
>
> Hope this helps, even though it's not much
> Albert Attard
>
> Ogden Nash   -
> "The trouble with a kitten is that when it grows up, it's always a cat."
>
> 2009/8/31 funkforce 
>
>
>
>
>
> > Hi
>
> > Can someone post a full example of working code with unowned
> > relationships? It semas that several pople are havning problems with
> > this on I cant find any solution posted in this group yet.
>
> > I think that I must use unowned relationships in my code. If I am
> > mistaken please correct me.
>
> > I have a beverage class that has a packaging class ,a district class
> > and a Set of materials.
> > A beverage can have one type of packaing, one type of district ans
> > several materials.
> > Packaing can belong to several beverages.
> > District can belong to several beverages.
> > Materials can belong to several beverages.
>
> > Any thoughts?
>
> > Thnkas
>
> > FF- 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] question on redeploying from eclipse

2009-08-31 Thread Arun

Hi,
If i redeploy my google app from eclipse, without changing the version
number of the app, does the plugin copy over only the changed files
since last deployment or does it copy all the files?

I just want to find out because i am using some 3rd party jars in my
app http://flickrexplorer.appspot.com and it always takes quite some
time to deploy even if i change only a jsp or a java file.

Regards,
Arun
ps:

http://flickrexplorer.appspot.com/
My app lets you view the 500 best flickr photos of any day with their
EXIF data
--~--~-~--~~~---~--~~
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: Unowned relationships

2009-08-31 Thread Albert Attard
Hi:
Quote from the page:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned_Relationships

"The App Engine implementation of JDO does not yet implement this facility,
but don't worry, you can still manage these relationships using Key values
in place of instances (or Collections of instances) of your model objects."


Hope this helps, even though it's not much
Albert Attard

Ogden Nash   -
"The trouble with a kitten is that when it grows up, it's always a cat."

2009/8/31 funkforce 

>
> Hi
>
> Can someone post a full example of working code with unowned
> relationships? It semas that several pople are havning problems with
> this on I cant find any solution posted in this group yet.
>
> I think that I must use unowned relationships in my code. If I am
> mistaken please correct me.
>
> I have a beverage class that has a packaging class ,a district class
> and a Set of materials.
> A beverage can have one type of packaing, one type of district ans
> several materials.
> Packaing can belong to several beverages.
> District can belong to several beverages.
> Materials can belong to several beverages.
>
> Any thoughts?
>
> Thnkas
>
> FF
>
> >
>

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



[appengine-java] Re: GAE Eclipse plugin - "Uploading 0 files."

2009-08-31 Thread Jason Parekh
Hi Barak,
Could you verify the file has not been uploaded already?  I'm pretty sure
the uploader only uploads modified files.

I tried this in a new project "SimpleProject" with a file
/war/test/test.html.  The first deploy uploaded 22 files.  The second deploy
uploaded 0 files.  I hit the appspot URL, and my file was indeed uploaded
during the first deploy.

jason


On Sun, Aug 30, 2009 at 11:10 AM, barak  wrote:

>
> Hello,
>
> I'm trying to upload static files as part of my webapp, placed under
> war/myfolder/. I've copied some files to there, then tried to upload
> them to GAE, but nothing of these files uploaded. This is the pluging
> output:
>
> Creating staging directory
> Scanning for jsp files.
> Compiling jsp files.
> Compiling java files.
> Scanning files on local disk.
> Initiating update.
> Cloning 52 static files.
> Cloning 144 application files.
> Cloned 100 files.
> Uploading 0 files.
> Deploying new version.
> Will check again in 1 seconds
> Will check again in 2 seconds
> Closing update: new version is ready to start serving.
> Uploading index definitions.
> Deployment completed successfully.
>
> What should I do in order to upload these files?
>
> 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] Unowned relationships

2009-08-31 Thread funkforce

Hi

Can someone post a full example of working code with unowned
relationships? It semas that several pople are havning problems with
this on I cant find any solution posted in this group yet.

I think that I must use unowned relationships in my code. If I am
mistaken please correct me.

I have a beverage class that has a packaging class ,a district class
and a Set of materials.
A beverage can have one type of packaing, one type of district ans
several materials.
Packaing can belong to several beverages.
District can belong to several beverages.
Materials can belong to several beverages.

Any thoughts?

Thnkas

FF

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



[appengine-java] is not persistable

2009-08-31 Thread Bob L.

I created a very simple app to persist an object, but got
JDOUserException:

The class "The class "x.Category" is not persistable. This means that
it either hasnt been enhanced, or that the enhanced version of the
file is not in the CLASSPATH (or is hidden by an unenhanced version),
or the Meta-Data/annotations for the class are not found." is not
persistable. This means that it either hasnt been enhanced, or that
the enhanced version of the file is not in the CLASSPATH (or is hidden
by an unenhanced version), or the Meta-Data for the class is not
found.

I am using Eclipse + GAE & GWT plugins on Windows. Appreciate any 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: Problems in Connecting to Mysql database using Hibernate

2009-08-31 Thread Maciej Machulak

You may connect to a database from a Google App Engine application.
Your data must simply reside outside of the App Engine. You can also
get data from inside a private network (consider using Google Secure
Data Connector) http://code.google.com/securedataconnector/.

Cheers,
Maciej

2009/8/31 leszek :
>
> "DataNucleus JPA"
> >
>



-- 
Maciej Machulak
email: maciej.machu...@gmail.com
tel: +48 602 45 31 44
tel: +44 7999 606 767

--~--~-~--~~~---~--~~
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: Problems in Connecting to Mysql database using Hibernate

2009-08-31 Thread leszek

"DataNucleus JPA"
--~--~-~--~~~---~--~~
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: Problems in Connecting to Mysql database using Hibernate

2009-08-31 Thread leszek

No help is possible. There is no support for Hibernate and MySql in
Google App Engine. The only framework supported is DataNucleus/JPA/JDO
with GAE plugin and the only database available is datastore/Google
Big Table.
You have to refactor your application to make it possible. I think
that JPA is much more like Hibernate API than JDO, so may be migrating
from Hibernate API to DataNucleus API is the best solution.

--~--~-~--~~~---~--~~
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] Problems in Connecting to Mysql database using Hibernate

2009-08-31 Thread Raji

Hi All,

Currently im working with GWT,Hibernate and mysql and google apps
engibe in eclipse 3.4
When i run my application im getting the following errors:

09:19:29,812  WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState:
08001
09:19:29,812 ERROR JDBCExceptionReporter:78 - No suitable driver
org.hibernate.exception.JDBCConnectionException: Cannot open
connection
at org.hibernate.exception.SQLStateConverter.convert
(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert
(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert
(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection
(ConnectionManager.java:424)
at org.hibernate.jdbc.ConnectionManager.getConnection
(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at org.hibernate.transaction.JDBCTransaction.begin
(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:
1326)
at
com.kshetrateleventures.server.GoogleAppsEngineServiceImpl.checkLogin
(GoogleAppsEngineServiceImpl.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
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.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.utils.jetty.DevAppEngineWebAppContext.handle
(DevAppEngineWebAppContext.java:54)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.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.content
(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
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.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection
(DriverManagerConnectionProvider.java:110)
at org.hibernate.jdbc.ConnectionManager.openConnection
(ConnectionManager.java:421)
... 35 more
hibernate database connection failed






Any help will be appreciated.

Thanks in Advance
--~--~-~--~~~---~--~~
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.io.IOException: Unknown - using URLFetch

2009-08-31 Thread g

same problem.

url:
http://www.google.cn/rebang/clip?bid=1200


On Jul 17, 5:04 am, "Jason (Google)"  wrote:
> Typically, when you hit the URL Fetch timeout, you will see a more helpful
> and explanatory exception as opposed to "Unknown." The answer to your
> question is "not yet" -- the URL Fetch deadline is fixed at 5 seconds but
> will be configurable in a later release --- but I don't think this is the
> issue here. Can you share the URL that you're trying to fetch?
> - Jason
>
>
>
> On Wed, Jul 15, 2009 at 1:43 AM, BarberNet  wrote:
>
> > Looking more into this, I suspect it is the timeout of 5 seconds that
> > is preventing app engine receiving the response.
> > Can the timeout be made configuarable as in the Python SDK? (up to 10
> > sec)
>
> > On Jul 15, 12:13 am, BarberNet  wrote:
> > > Get following error ONLY when deployed to google apps not on local
> > > development server.
>
> > com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler
> > > $Connection.getHeaderField(URLFetchServiceStreamHandler.java:196)
> > >         at java.net.URLConnection.getContentType(Unknown Source)
> > >         at com.saucysounds.payment.MobilePayPalAPI.httpcall
> > > (MobilePayPalAPI.java:166)
> > >         ... 43 more
> > > Caused by: java.io.IOException: Unknown
> > >         at
>
> > > line producing error is:
> > >                         int rc = conn.getResponseCode();
>
> > > taken from the following code snippet:
>
> > > postURL = new URL(gv_APIEndpoint);
> > >                         conn = (HttpURLConnection)
> > postURL.openConnection();
> > >                         logger.info(postURL.toString());
> > >                         conn.setDoInput(true);
> > >                         conn.setDoOutput(true);
>
> > >                         conn.setRequestProperty("Content-Type",
> > "application/x-www-form-
> > > urlencoded");
> > >                         conn.setRequestProperty("User-Agent", agent);
> > >                         conn.setRequestProperty("Content-Length", String
> > >                                         .valueOf(encodedData.length()));
> > >                         conn.setRequestMethod("POST");
>
> > >                         output = new
> > DataOutputStream(conn.getOutputStream());
> > >                         logger.info(encodedData);
> > >                         output.writeBytes(encodedData);
> > >                         output.flush();
> > >                         output.close();
>
> > >                         int rc = conn.getResponseCode();
> > >                         logger.info("response code: "+rc);
> > >                         if (rc != -1) {
> > >                                 BufferedReader reader = new
> > BufferedReader(new InputStreamReader(
> > >                                                 conn.getInputStream()));
> > > 
--~--~-~--~~~---~--~~
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] data model mapping between GAE Python and GAE Java: one to many relationships

2009-08-31 Thread vincent rouilly

Hi,

when it comes to define relationships in the datastore, I have
problems to define a mapping between GAE python and GAE Java objects .
It is especially relevant as at the moment it is only possible to
upload data for a GAE Java application using GAE python script
'appcfg.py upload_data ...' ( 
http://code.google.com/appengine/docs/python/tools/uploadingdata.html
).

I'll take the example of an unowned one-to-many relationship between
an 'Ontology' object and 'Term' objects.

To upload the data, I define this GAE python classes (following
tutorial: http://code.google.com/appengine/articles/modeling.html)

class Ontology(db.Model):
name = db.StringProperty()

class Term(db.Model):
name = db.StringProperty()
ontology = db.ReferenceProperty(Ontology, collection_name='terms')

Once the upload is done, I want to access the data in a GAE Java
application.
According to the datastore viewer, it looks like the corresponding GAE
Java classes should be:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Ontology {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String name;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Term {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String name;

@Persistent
private Key ontology;
}


But according to the GAE Java relationship tutorial (
http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned_Relationships
), a one-to-many relationship should be modeled as:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Ontology {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String name;

@Persistent
private Set terms;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Term {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String name;
}


Are there any rules to insure consistency between a GAE Python and GAE
Java relationship models when using the datastore?

many thanks,

Vincent.

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



[appengine-java] Re: Problem with a query and index

2009-08-31 Thread leszek

Query is ok. But what Date are you using. java.sql.Date or
java.util.Date ? If java.util.Date please consider also the hour/min/
sec part of the date: the field persisted and 'mdatedispo' parameter.
May be the problem is hidden there ?
--~--~-~--~~~---~--~~
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.io.IOException: Unknown - using URLFetch

2009-08-31 Thread Spanishgringo

> Is Analytics the only Google Data API that you have this issue with?
Yes.

> Have you tried making requests from outside of App Engine (e.g. a local Tomcat
> server) to see if the responses come faster?

Yes and it works fine with tomcat locally.  I am positive the issue is
the AppEngine's short timeout limit for responses.  The problem in my
opinion is that Google Analytics cannot normally respond that quickly
to a request. It needs more time to crunch and prepare the numbers for
the response.

-Michael

On Aug 28, 7:28 pm, "Jason (Google)"  wrote:
> Hi. Sorry for the lapse. At present, your options are limited. The current
> release of the Java SDK does not support configurable deadlines, and I'll
> have to follow up to see when this will be available.
> Is Analytics the only Google Data API that you have this issue with? Have
> you tried making requests from outside of App Engine (e.g. a local Tomcat
> server) to see if the responses come faster?
>
> - Jason
>
>
>
> On Fri, Aug 28, 2009 at 5:00 AM, Spanishgringo  wrote:
>
> > ping
>
> > On Aug 18, 3:13 pm, Spanishgringo  wrote:
> > > I am having a problem using GData Client for Google Analytics because
> > > most queries take longer than 5 seconds for the servers to process.
> > > As is, I usually get a networktimeoutbecause App Engine URLFetch is
> > > capped at 5 seconds.
>
> > > Please coordinate with the GData team (Especially for Analytics) to
> > > work out a solution.  The apps should work well together but today it
> > > is impossible to support any meaningful application in App Engine
> > > using the Analytics API for Java.
>
> > > Thanks,
> > > Michael
>
> > > On Jul 16, 11:04 pm, "Jason (Google)"  wrote:
>
> > > > Typically, when you hit the URL Fetchtimeout, you will see a more
> > helpful
> > > > and explanatory exception as opposed to "Unknown." The answer to your
> > > > question is "not yet" -- the URL Fetch deadline is fixed at 5 seconds
> > but
> > > > will be configurable in a later release --- but I don't think this is
> > the
> > > > issue here. Can you share the URL that you're trying to fetch?
> > > > - Jason
>
> > > > On Wed, Jul 15, 2009 at 1:43 AM, BarberNet 
> > wrote:
>
> > > > > Looking more into this, I suspect it is thetimeoutof 5 seconds that
> > > > > is preventing app engine receiving the response.
> > > > > Can thetimeoutbe made configuarable as in the Python SDK? (up to 10
> > > > > sec)
>
> > > > > On Jul 15, 12:13 am, BarberNet  wrote:
> > > > > > Get following error ONLY when deployed to google apps not on local
> > > > > > development server.
>
> > com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler
> > > > > > $Connection.getHeaderField(URLFetchServiceStreamHandler.java:196)
> > > > > >         at java.net.URLConnection.getContentType(Unknown Source)
> > > > > >         at com.saucysounds.payment.MobilePayPalAPI.httpcall
> > > > > > (MobilePayPalAPI.java:166)
> > > > > >         ... 43 more
> > > > > > Caused by: java.io.IOException: Unknown
> > > > > >         at
>
> > > > > > line producing error is:
> > > > > >                         int rc = conn.getResponseCode();
>
> > > > > > taken from the following code snippet:
>
> > > > > > postURL = new URL(gv_APIEndpoint);
> > > > > >                         conn = (HttpURLConnection)
> > > > > postURL.openConnection();
> > > > > >                         logger.info(postURL.toString());
> > > > > >                         conn.setDoInput(true);
> > > > > >                         conn.setDoOutput(true);
>
> > > > > >                         conn.setRequestProperty("Content-Type",
> > > > > "application/x-www-form-
> > > > > > urlencoded");
> > > > > >                         conn.setRequestProperty("User-Agent",
> > agent);
> > > > > >                         conn.setRequestProperty("Content-Length",
> > String
>
> > .valueOf(encodedData.length()));
> > > > > >                         conn.setRequestMethod("POST");
>
> > > > > >                         output = new
> > > > > DataOutputStream(conn.getOutputStream());
> > > > > >                         logger.info(encodedData);
> > > > > >                         output.writeBytes(encodedData);
> > > > > >                         output.flush();
> > > > > >                         output.close();
>
> > > > > >                         int rc = conn.getResponseCode();
> > > > > >                         logger.info("response code: "+rc);
> > > > > >                         if (rc != -1) {
> > > > > >                                 BufferedReader reader = new
> > > > > BufferedReader(new InputStreamReader(
>
> > conn.getInputStream()));
> > > > > > 
--~--~-~--~~~---~--~~
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 mo

[appengine-java] Access to uploaded data on the development server with GAE Java

2009-08-31 Thread vincent rouilly

Hi,

Is there a way to access uploaded data  on the development server from
GAE Java ?

it seems that it is not possible to upload data to the datastore with
the python script 'appcfg.py upload_data ... ' ( following
http://code.google.com/appengine/docs/python/tools/uploadingdata.html),
and then access the data using the JAVA interface.

The local GAE Python database seems to be stored in a different file
form the local GAE Java database. Whatever I upload locally with
'appcfg.py upload_data ... ' (using option --url=http://localhost:8080/
remote_api ),  the datastore is empty from the GAE Java dataviewer
(http://localhost:8080/_ah/admin) . But the 'GAE Python server'
dataviewer would work fine.

any suggestions ?
many thanks,

Vincent.
--~--~-~--~~~---~--~~
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: Is there limitation of size of webapp uploaded to GAE?

2009-08-31 Thread leszek

http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Limits

(navigate to the bottom)
--~--~-~--~~~---~--~~
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: Exception on creation of java.io.File in GAE

2009-08-31 Thread leszek

http://code.google.com/appengine/docs/java/config/appconfig.html

May be you find there the solution, but I'm guessing only.
--~--~-~--~~~---~--~~
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: JPA on App Engine ... how hard can it be?

2009-08-31 Thread leszek

> the problem is simple:
>
> @Entity
> public class Company implements Serializable {
>     // ...
>     public Company(String irsEIN) {
>         ein = irsEIN;
>         // ...
>     }
>
>     @Id String ein; // the IRS EIN for the company ... this is a
> unique id and a good one to use for PK?
>
>    // ...
>
> }
>
> ... no it isn't because you get an exception when you commit one of
> these suckers:
>
> WARNING: java.lang.IllegalArgumentException: Name may not start with a
> digit.

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

>
> So, you think, "no problem I actually want it as a number anyway..."
> so you change the code like so:
>
> @Entity
> public class Company implements Serializable {
>     // ...
>     public Company(Long irsEIN) {
>         ein = irsEIN;
>         // ...
>     }
>
>     @Id Long ein; // the IRS EIN for the company ... this is a unique
> id and a good one to use for PK?
>
>    // ...
>
> }
>
> Problem solved? 
>
> WARNING: javax.persistence.PersistenceException: Attempt was made to
> manually set the id component of a Key primary key.  If you want to
> control the value of the primary key, set the name component instead.

It looks that 'Long' id is always generated automatically, you cannot
set it manually.

http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys

Long

A long integer (java.lang.Long), an entity ID automatically
generated by the datastore.
-

I suggest to read the link above carefully, it could save a lot of
your time.

>         at
> org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException
> (NucleusJPAHelper.java:264)
>         at org.datanucleus.jpa.EntityTransactionImpl.commit
> (EntityTransactionImpl.java:122)
>
> Nope! ...
>
> Now I want to use JPA because I want my code to be portable, so I
> really dont want to care about JDO,
> DataNucleus or the App Engine Datastore ...

@Entity and @Id is a part of JPA (not JDO).

>
> This exception error message is meaningless to me ... even after
> reading the App Engine and DataNucleus
> documentation ...
>
> Also, on a slightly related issue, should I have to obtain an
> EntityManager transaction for each instance
> of this class I wish to persist?
>
> I'd appreciate any suggestions anyone might have?

No need to get EntityManager for each class. It is a good practice to
have one EntityManager instance for each request. But it is up to you.
--~--~-~--~~~---~--~~
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] Exception on creation of java.io.File in GAE

2009-08-31 Thread barak

Hello all,

I'm trying to upload an application that using Lucene and compass. The
Lucene files are stored under the war directory and should be open to
read access only. When booting the application, the files are opened
by the lucene (wrapped with compass). All works ok in the developmemt
server, when deployed in GAE, the following exception raised:

java.lang.NullPointerException
at java.io.File.(File.java:276)
at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:
139)
at org.compass.core.lucene.engine.store.FSDirectoryStore.configure
(FSDirectoryStore.java:55)
at
org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.
(DefaultLuceneSearchEngineStore.java:144)
at org.compass.core.lucene.engine.LuceneSearchEngineFactory.
(LuceneSearchEngineFactory.java:122)
at org.compass.core.impl.DefaultCompass.(DefaultCompass.java:
123)
at org.compass.core.impl.DefaultCompass.(DefaultCompass.java:
116)
at org.compass.core.config.CompassConfiguration.buildCompass
(CompassConfiguration.java:288)
at com.me.store.DataAccessObject.(DataAccessObject.java:76)
at com.me.store.DataAccessObject.getInstance(DataAccessObject.java:
53)
at com.me.jsf.LargeDataModelBeanSample$Model.fetchPage
(LargeDataModelBeanSample.java:192)
at com.me.jsf.PagedListDataModel.fetchPageInternal
(PagedListDataModel.java:178)
at com.me.jsf.PagedListDataModel.getPage(PagedListDataModel.java:107)
at com.me.jsf.PagedListDataModel.isRowAvailable
(PagedListDataModel.java:201)
at
org.apache.myfaces.component.html.ext.HtmlDataTableHack.isRowAvailable
(HtmlDataTableHack.java:88)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex
(HtmlDataTableHack.java:297)
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.setRowIndex
(AbstractHtmlDataTable.java:276)
at javax.faces.component.UIData.processColumnChildren(UIData.java:
725)
at javax.faces.component.UIData.processDecodes(UIData.java:613)
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.processDecodes
(AbstractHtmlDataTable.java:306)
at javax.faces.component.UIForm.processDecodes(UIForm.java:61)
at javax.faces.component.UIComponentBase.processDecodes
(UIComponentBase.java:844)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:
158)
at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute
(ApplyRequestValuesExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase
(LifecycleImpl.java:105)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute
(LifecycleImpl.java:80)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:143)
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)

[appengine-java] Is there limitation of size of webapp uploaded to GAE?

2009-08-31 Thread barak

I was wondering - does GAE has some limitation regarding the size of
an applicatian uploaded to GAE? I know there is limitation regarding
single size upload, but can my application for example holds hundreds
of files (source, static, what ever)?

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