[appengine-java] implementing GAE XMPP service as an external component to an existing XMPP server (e.g. ejabberd or OpenFire)

2009-10-28 Thread asianCoolz

may i know what integration technique that you folks use to implement
external component to an existing XMPP server (e.g. ejabberd or
OpenFire) . Is it through sending xmpp message to another
u...@externaldomain directly or using mechanism like urlfetch?
--~--~-~--~~~---~--~~
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 Problem with Multiple Owned One to One relationships to same type

2009-10-28 Thread lent

Hello,

I'm using JPA with SDK 1.2.5 and I'm having a problem with multiple
owned One To One relationships where the relationships are to the same
type.  The code is as below and Contributor class has three owned One
to One relationships to ContentValue.

What I'm finding is that when I set one of the One to One properties
in one transaction (e.g. picutre) in one request and then later on in
a different request and transaction I retrieve another of the One to
One properties (e.g. tagData), I get back the ContentValue I set for
the first property (picture).

I'm doing the following to set the property:

Contributor contributor = ;
ContentValue picture = contributor.getPicture();
if ( picture == null ) {
picture = new ContentValue();
contributor.setPicture( picture );
pictureContent.setContentValueType( ContentValueType.PICTURE );
}
...


If anyone knows why I'm having this problem, please let me know.

Regards,
Len


Contributor.java


package abc;

//import com.google.appengine.api.datastore.Key;
//import com.google.appengine.api.datastore.KeyFactory;
import org.datanucleus.jpa.annotations.Extension;

import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Embedded;
import javax.persistence.FetchType;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Date;

@Entity
public class Contributor {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
private String id;

@Enumerated
private String firstName;

@Enumerated
private String lastName;

@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
private ContentValue picture;

@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
private ContentValue thumbnailPicture;

@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
private ContentValue tagData;

public void setId(String id) {
this.id = id;
}

public String getId() {
return id;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public String getFirstName() {
return firstName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}

public String getLastName() {
return lastName;
}

public void setPicture(ContentValue picture) {
this.picture = picture;
}

public ContentValue getPicture() {
return picture;
}

public void setThumbnailPicture(ContentValue thumbnailPicture) {
this.thumbnailPicture = thumbnailPicture;
}

public ContentValue getThumbnailPicture() {
return thumbnailPicture;
}

public void setTagData(ContentValue tagData) {
this.tagData = tagData;
}

public ContentValue getTagData() {
return tagData;
}

}


ContentValue.java
-
package abc;

import org.datanucleus.jpa.annotations.Extension;

import com.google.appengine.api.datastore.Blob;

import javax.persistence.AttributeOverrides;
import javax.persistence.Entity;
import javax.persistence.CascadeType;
import javax.persistence.Enumerated;
import javax.persistence.Embedded;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;

@Entity
public class ContentValue {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
private String id;

@Enumerated
@Extension(vendorName="datanucleus", key="gae.parent-pk",
value="true")
private String parentId;

@Enumerated
private ContentValueType contentValueType;

@Enumerated
private Blob content;

@Enumerated
private String contentType;

public void setId(String id) {
this.id = id;
}

public String getId() {
return id;
}

public void setParentId(String parentId) {
this.parentId = parentId;
}

public String getParentId() {
return parentId;
}

public void setContentValueType(ContentValueType contentValueType) {
this.contentValueType = conte

[appengine-java] Re: Need help on how to enhance the data classes with netbeans

2009-10-28 Thread Jorge

I am using NetBeans to develop a GAE application. There is a beta
plugin available here: 
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=18493
and using it, I have no problems at all with the JDO classes
enhancement.

The files tree structure in NB is a bit different than in Eclipse, but
once you have a map, it is easy to follow the documentation,  the
hints and the discussions.

Jorge Gonzalez


On Oct 28, 3:01 am, leszek  wrote:
> I'm using NetBeans but only for GWT application. I don't know if there
> is anybody who uses NetBeans for Google App Engine application.
>
> May be ask the question here:
>
> https://gwt4nb.dev.java.net/
>
> if are there any plans to extend existing plugin and support also
> Google App Engine.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: An internal error occurred during deployment

2009-10-28 Thread Pion

Per http://code.google.com/appengine/docs/java/gettingstarted/uploading.html,
I did use the command prompt by typing "..\appengine-java-sdk\bin
\appcfg.cmd update war". It produces the same error - expected I
guess.

On Oct 28, 10:14 am, Pion  wrote:
> I have been developing my app in the hosted mode for the past few
> months. It works fine on the hosted mode.
>
> Today, I got an internal error below when I tried to deploy it for the
> first time using Eclipse.
>
> My environments: GAE Java 1.2.6, GWT 1.7.1, Eclipse(Galileo), Windows
> Vista (32-bit).
>
> Any help is is appreciated.
> Thanks in advance for your help.
>
> ERROR LOGS
> eclipse.buildId=M20090917-0800
> java.version=1.6.0_15
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments:  -product org.eclipse.epp.package.jee.product
> Command-line arguments:  -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.jee.product
>
> Error
> Wed Oct 28 09:41:50 PDT 2009
> An internal error occurred during: "Deploying col to Google".
>
> com.google.apphosting.utils.config.AppEngineConfigException: XML error
> validating D:\workspace\google\col\war\WEB-INF\appengine-web.xml
> against D:\download\eclipse-galileo\plugins
> \com.google.appengine.eclipse.sdkbundle_1.2.6.v200910131704\appengine-
> java-sdk-1.2.6\docs\appengine-web.xsd
>         at com.google.appengine.tools.admin.Application.validateXml
> (Application.java:321)
>         at com.google.appengine.tools.admin.Application.
> (Application.java:87)
>         at com.google.appengine.tools.admin.Application.readApplication
> (Application.java:120)
>         at
> com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.createAppAdmin
> (AppEngineBridgeImpl.java:204)
>         at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy
> (AppEngineBridgeImpl.java:265)
>         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)
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:
> Invalid content was found starting with element 'system-properties'.
> One of '{"http://appengine.google.com/ns/1.0":static-files, "http://
> appengine.google.com/ns/1.0":resource-files, "http://
> appengine.google.com/ns/1.0":env-variables, "http://
> appengine.google.com/ns/1.0":ssl-enabled, "http://appengine.google.com/
> ns/1.0":sessions-enabled, "http://appengine.google.com/ns/1.0":user-
> permissions, "http://appengine.google.com/ns/1.0":public-root, "http://
> appengine.google.com/ns/1.0":inbound-services, "http://
> appengine.google.com/ns/1.0":precompilation-enabled}' is expected.
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
> (Unknown Source)
>         at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
> (Unknown Source)
>         at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator
> $XSIErrorReporter.reportError(Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
> $FragmentContentDriver.next(Unknown Source)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
> (Unknown Source)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
> (Unknown Source)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.validate
> (Unknown Source)
>         at
> com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate
> (Unknown Source)
>         at javax.xml.validation.Validator.validate(Unknown Source)
>         at com.google.appengine.tools.admin.Application.validateXml
> (Application.java:318)
>         ... 7 more
--~--~-~--~~~---~--~~
You received this message becau

[appengine-java] Re: Error upon deploying to Google AppEngine through Eclipse plugin

2009-10-28 Thread bizkut

Sorry, I hadn't checked this in a while. Upon using the command line
utility:

C:\Users\Kyle>C:\Users\Kyle\charts\eclipse\plugins
\com.google.appengine.eclipse.
sdkbundle_1.2.6.v200910131704\appengine-java-sdk-1.2.6\bin\appcfg
update C:\User
s\Kyle\workspace\WaveTest1\war
Reading application configuration data...
2009-10-28 18:54:08.610::INFO:  Logging to STDERR via
org.mortbay.log.StdErrLog
Beginning server interaction for bizkuttest...
0% Creating staging directory
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Initiating update.
Email: mcgroga...@gmail.com
Password for mcgroga...@gmail.com:

javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected
error: java.s
ecurity.InvalidAlgorithmParameterException: the trustAnchors parameter
must be n
on-empty
Unable to update app: java.lang.RuntimeException: Unexpected error:
java.securit
y.InvalidAlgorithmParameterException: the trustAnchors parameter must
be non-emp
ty
Please see the logs [C:\Users\Kyle\AppData\Local\Temp
\appcfg3749747841551147441.
log] for further information.

Contents of the log file are the same:
Unable to update:
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected
error: java.security.InvalidAlgorithmParameterException: the
trustAnchors parameter must be non-empty
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown
Source)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream
(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream
(Unknown Source)
at com.google.appengine.tools.admin.ServerConnection.connect
(ServerConnection.java:333)
at com.google.appengine.tools.admin.ServerConnection.getAuthToken
(ServerConnection.java:250)
at com.google.appengine.tools.admin.ServerConnection.authenticate
(ServerConnection.java:218)
at com.google.appengine.tools.admin.ServerConnection.send
(ServerConnection.java:145)
at com.google.appengine.tools.admin.ServerConnection.post
(ServerConnection.java:81)
at com.google.appengine.tools.admin.AppVersionUpload.send
(AppVersionUpload.java:427)
at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction
(AppVersionUpload.java:241)
at com.google.appengine.tools.admin.AppVersionUpload.doUpload
(AppVersionUpload.java:98)
at com.google.appengine.tools.admin.AppAdminImpl.update
(AppAdminImpl.java:56)
at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute
(AppCfg.java:521)
at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:130)
at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:58)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:54)
Caused by: java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
at sun.security.validator.PKIXValidator.(Unknown Source)
at sun.security.validator.Validator.getInstance(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.getValidator
(Unknown Source)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted
(Unknown Source)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted
(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate
(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage
(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake
(Unknown Source)
... 19 more
Caused by: java.security.InvalidAlgorithmParameterException: the
trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(Unknown Source)
at java.security.cert.PKIXParameters.(Unknown Source)
at java.security.cert.PKIXBuilderParameters.(Unknown Source)
... 30 more
com.google.appengine.tools.admin.AdminException: Unable to update app:
java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
at com.google.appeng

[appengine-java] any plans for deferred.defer in Java?

2009-10-28 Thread David Chandler

Re: http://code.google.com/appengine/articles/deferred.html

Will this be coming to AppEngine for Java?

David Chandler
http://turbomanage.wordpress.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] Django/Jython doesn't work on Google App Engine

2009-10-28 Thread Olli Wang

Hi, I successfully created a WAR file which was able to run on Apache
Tomcat with no problem. But when I uploaded it to the Google App
Engine, it shows me a error message like this:
Could not initialize class org.python.modules.thread.thread
RequestURI=/
Caused by:
java.lang.NoClassDefFoundError: Could not initialize class
org.python.modules.thread.thread
at java.lang.Class.forName0(Native Method)
...
...
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run
(BoundedThreadPool.java:442)
I thought this happened because GAE disables threads as it said "A
Java application cannot create a new java.lang.ThreadGroup nor a new
java.lang.Thread. These restrictions also apply to JRE classes that
make use of threads."
Is there any way to remedy this situation? Any help would be
appreciated.


FULL TRACEBACK:
HTTP ERROR: 500

Could not initialize class org.python.modules.thread.thread
RequestURI=/

Caused by:

java.lang.NoClassDefFoundError: Could not initialize class
org.python.modules.thread.thread
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.python.core.SyspathJavaLoader.loadClass(SyspathJavaLoader.java:
107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at org.python.core.Py.findClassEx(Py.java:817)
at org.python.core.imp.loadBuiltin(imp.java:431)
at org.python.core.imp.find_module(imp.java:393)
at org.python.core.imp.import_next(imp.java:635)
at org.python.core.imp.import_name(imp.java:746)
at org.python.core.imp.importName(imp.java:806)
at org.python.core.ImportFunction.__call__(__builtin__.java:1232)
at org.python.core.PyObject.__call__(PyObject.java:367)
at org.python.core.__builtin__.__import__(__builtin__.java:1202)
at org.python.core.imp.importFromAs(imp.java:884)
at org.python.core.imp.importFrom(imp.java:860)
at threading$py.f$0(__pyclasspath__/threading.py:375)
at threading$py.call_function(__pyclasspath__/threading.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.imp.createFromCode(imp.java:326)
at org.python.core.util.importer.importer_load_module(importer.java:
109)
at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module
(ClasspathPyImporter.java:63)
at org.python.core.ClasspathPyImporter
$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source)
at org.python.core.PyBuiltinMethodNarrow.__call__
(PyBuiltinMethodNarrow.java:47)
at org.python.core.imp.loadFromLoader(imp.java:451)
at org.python.core.imp.find_module(imp.java:408)
at org.python.core.imp.import_next(imp.java:635)
at org.python.core.imp.import_first(imp.java:665)
at org.python.core.imp.import_name(imp.java:756)
at org.python.core.imp.importName(imp.java:806)
at org.python.core.ImportFunction.__call__(__builtin__.java:1232)
at org.python.core.PyObject.__call__(PyObject.java:367)
at org.python.core.__builtin__.__import__(__builtin__.java:1202)
at org.python.core.imp.importFromAs(imp.java:884)
at org.python.core.imp.importFrom(imp.java:860)
at django.core.handlers.wsgi$py.f$0(/Users/olliwang/workspace/
jython2.5.1/Lib/site-packages/Django-1.1.1-py2.5.egg/django/core/
handlers/wsgi.py:217)
at django.core.handlers.wsgi$py.call_function(/Users/olliwang/
workspace/jython2.5.1/Lib/site-packages/Django-1.1.1-py2.5.egg/django/
core/handlers/wsgi.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.imp.createFromCode(imp.java:326)
at org.python.core.util.importer.importer_load_module(importer.java:
109)
at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module
(ClasspathPyImporter.java:63)
at org.python.core.ClasspathPyImporter
$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source)
at org.python.core.PyBuiltinMethodNarrow.__call__
(PyBuiltinMethodNarrow.java:47)
at org.python.core.imp.loadFromLoader(imp.java:451)
at org.python.core.imp.find_module(imp.java:408)
at org.python.core.PyModule.impAttr(PyModule.java:109)
at org.python.core.imp.import_next(imp.java:637)
at org.python.core.imp.import_name(imp.java:776)
at org.python.core.imp.importName(imp.java:806)
at org.python.core.ImportFunction.__call__(__builtin__.java:1232)
at org.python.core.PyObject.__call__(PyObject.java:367)
at org.python.core.__builtin__.__import__(__builtin__.java:1202)
at org.python.core.imp.importFromAs(imp.java:884)
at org.python.core.imp.importFrom(imp.java:860)
at application$py.f$0(/Users/olliwang/w

[appengine-java] JDO Unowned Relationship Issue

2009-10-28 Thread Jeffrey Goetsch
I have a one-to-many unowned relationship (Code shown at the end).  When I
try to make the association, it fails to actually store the relationship.  I
thought I found a workaround, which is commented out in the code below.  How
do I make this unowned relationship work?

This might be related to this thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/a44cb049f40d6bab/f9047e0a25e3453f?lnk=gst&q=JDO+collection+null#f9047e0a25e3453f

If it is, this should be a very high priority bug, because this seems like
required functionality.

Thanks,
Jeffrey

public void test() {
PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-optional");
PersistenceManager pm = pmfInstance.getPersistenceManager();

Employee employee = new Employee();
pm.makePersistent(employee);

Computer computer = new Computer();
computer.setOwner(employee);
pm.makePersistent(computer);

// Thought this was a work around, but it doesn't work either
//pm.close();
//pm = pmfInstance.getPersistenceManager();
//employee = pm.getObjectById(Employee.class, employee.key);
//computer = pm.getObjectById(Computer.class, computer.key);

employee.addComputer(computer);
pm.close();

pm = pmfInstance.getPersistenceManager();

Employee employeeCheck = pm.getObjectById(Employee.class,
employee.key);
if (employeeCheck == null || employeeCheck.computerKeys == null ||
employeeCheck.computerKeys.isEmpty()) {
System.out.println("Error: employee didn't save computer
relationship");
} else {
System.out.println("Success: employee saved computer
relationship");
}
pm.close();
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Employee {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
public Long key; //public to simplify example

@Persistent
private String name;

@Persistent
public Set computerKeys = new HashSet();

public void addComputer(Computer computer) {
if (computerKeys == null) {
computerKeys = new HashSet();
}
computerKeys.add(computer.key);
}
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Computer {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
public Long key; //public to simplify example

@Persistent
private String name;
@Persistent
private Long ownerEmployeeKey;

public void setOwner(Employee owner) {
this.ownerEmployeeKey = owner.key;
}
}

--~--~-~--~~~---~--~~
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 Collection Load Issue

2009-10-28 Thread Jeffrey Goetsch
Jason,

Thanks for the reply and checking the code.  It is the null issue that is
causing this issue, but I had a second issue that I will start a new thread
for.

Thanks,
Jeff

On Fri, Oct 23, 2009 at 4:01 PM, Jason (Google)  wrote:

> Hi Jeff. I'm having trouble reproducing this. I kept everything uncommented
> so the constructor adds a new object to each List/Set, then queried for the
> persisted Player2 object and inspected the size of each List/Set and saw 1
> for each (expected). I then commented out foo1 and foo2 but left the
> Lists/Sets uncommented and saw the same result.
>
> There is a known issue where empty Lists (Lists which have been
> instantiated but don't have any objects in them) are returned as null. Does
> this sound like what you're running into when you leave the constructor
> commented out?
>
> - Jason
>
> On Thu, Oct 22, 2009 at 12:05 PM, jeffgnpc  wrote:
>
>>
>> I am having an issue loading Collections after they have been stored
>> in the datastore.  I have simplified this issue down to a simple
>> example listed below.  If I run with the current comments, everything
>> works fine, and the Collections are loaded.  If I uncomment "foo1" or
>> "foo2", the Collections no longer load (they are null).  If I
>> uncomment the constructor where I add values to the list, everything
>> works fine again.
>>
>> @PersistenceCapable(identityType = IdentityType.APPLICATION)
>> public class Player2 {
>>@PrimaryKey
>>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>>public Long key;
>>
>>//@Persistent
>>//private Long foo1; //Cause Collection issue
>>//@Persistent
>>//private String foo2; //Causes Collection issue
>>@Persistent
>>private Key foo3; // This works
>>
>>@Persistent(defaultFetchGroup = "true")
>>private Set longSet = new HashSet();
>>@Persistent(defaultFetchGroup = "true")
>>private List longList = new ArrayList();
>>@Persistent(defaultFetchGroup = "true")
>>private Set stringSet = new HashSet();
>>@Persistent(defaultFetchGroup = "true")
>>private List stringList = new LinkedList();
>>@Persistent(defaultFetchGroup = "true")
>>private Set keySet = new HashSet();
>>@Persistent(defaultFetchGroup = "true")
>>private List keyList = new LinkedList();
>>
>>public Player2() {
>>//Adding to the List Fixes Collection issue
>>//longSet.add(1234l);
>>//longList.add(1234l);
>>//stringSet.add("1234l");
>>//stringList.add("1234l");
>>//keySet.add(KeyFactory.createKey(Player2.class.getSimpleName
>> (), "alfred.sm...@example.com"));
>>//keyList.add(KeyFactory.createKey(Player2.class.getSimpleName
>> (), "alfred.sm...@example.com"));
>>}
>> }
>>
>>
>> I believe this might be a similar issue to this thread:
>>
>> http://groups.google.com/group/google-appengine-java/browse_thread/thread/a44cb049f40d6bab/f9047e0a25e3453f?lnk=gst&q=JDO+collection+null#f9047e0a25e3453f
>>
>> But when I run with in either of the successful ways, the Collections
>> don't seem to be SCO fields.  I will also post in that thread in case
>> it helps with the ticket.
>>
>> Thanks,
>> Jeff
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Robot deployment failure

2009-10-28 Thread Jason (Google)
Do you see the same paring error when you use the "default" web.xml header
that the Eclipse plugin generates?


http://www.w3.org/2001/XMLSchema-instance";
xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5">

- Jason

On Mon, Oct 26, 2009 at 4:15 AM, harrydou  wrote:

>
> Hi,
> I have finished the tutorial for robot, but when I tried to deploy it
> on App
> engine it failed. I have checked the codes many times...
> The error detail is "receive IOException when parsing web.xml"
> and my application ID is robot-harrydou
> Pls. contact me by harry...@gmail.com
> Thanks a lot!
>
> hi!
> this is my web.xml...
>
> 
>   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>  "http://java.sun.com/dtd/web-app_2_3.dtd";>
>
> http://java.sun.com/xml/ns/javaee"; version="2.5">
>
>Robot
>robot.RobotServlet
>
>
>Robot
>/_wave/robot/jsonrpc
>
> 
>
> can you guys find the error?
> 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: Grails/Java poor performance

2009-10-28 Thread Jason (Google)
Hi JT. We have seen that Grails-based applications can take up to 30 seconds
to spin up on App Engine. We have back-end enhancements coming in the next
few releases that should improve this considerably, but Grails itself is
partly responsible for the long initialization time, which our back-end
enhancements can't improve.

- Jason

On Mon, Oct 26, 2009 at 3:15 PM, Johnnie Walker  wrote:

>
> Hi,
>
> I just deployed a very simple app onto App Engine using Grails
> (tregoning-app.appspot.com)... the problem is that it take 30 seconds
> for a very basic page to respond, is this "normal" behavior of a
> Grails apps running on GAE or are there some temporary issues going on
> at the moment (I couldn't see anything on "Google App Engine Downtime
> Notify")
>
> Eventually I noticed that all Grails apps on GAE take roughly 30
> seconds to load, even the sample/reference Pet Clinic app (http://
> petclinic-grails.appspot.com/)
>
> 30 seconds is millenia in Internet time.
>
> Thanks
>
> JT.
>
> >
>

--~--~-~--~~~---~--~~
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: Time zones implementation is broken in Java AppEngine

2009-10-28 Thread Alexander Kolesnikov
Thanks Jason. Issue 2330. Time zones worked for a few days but today most of
the world is GMT again...

Alex

On Tue, Oct 27, 2009 at 6:55 PM, Jason (Google)  wrote:

> At the very least, the local and production environments should have
> identical behavior, and I agree that App Engine should not be returning GMT
> for well-established time zones. Please file a new issue in the tracker:
>
> http://code.google.com/p/googleappengine/issues/list
>
> - Jason
>
>
> On Sat, Oct 24, 2009 at 10:14 AM, Alexander Kolesnikov <
> otry.it...@gmail.com> wrote:
>
>> I have just found that, while everything works fine locally, the real
>> AppEngine returns GMT for most time zones. I wonder if this is going to be
>> fixed. Below see the local output and then the one I am having after
>> uploading the app.
>>
>> Thanks,
>>
>> Alex
>>
>> LOCAL:
>>
>> Asia/Aden3false0Arabia Standard Time
>> Asia/Almaty6false0Alma-Ata Time
>> Asia/Amman3true1Eastern European Time
>> Asia/Anadyr12false1Anadyr Time
>> Asia/Aqtau5false0Aqtau Time
>> Asia/Aqtobe5false0Aqtobe Time
>> Asia/Ashgabat5false0Turkmenistan Time
>> Asia/Ashkhabad5false0Turkmenistan Time
>> Asia/Baghdad3false0Arabia Standard Time
>> Asia/Bahrain3false0Arabia Standard Time
>> Asia/Baku5true1Azerbaijan Time
>> Asia/Bangkok7false0Indochina Time
>>
>> ONLINE:
>>
>> Asia/Aden3false0Arabia Standard Time
>> Asia/Almaty0false0Greenwich Mean Time
>> Asia/Amman0false0Greenwich Mean Time
>> Asia/Anadyr0false0Greenwich Mean Time
>> Asia/Aqtau0false0Greenwich Mean Time
>> Asia/Aqtobe0false0Greenwich Mean Time
>> Asia/Ashgabat0false0Greenwich Mean Time
>> Asia/Ashkhabad0false0Greenwich Mean Time
>> Asia/Baghdad0false0Greenwich Mean Time
>> Asia/Bahrain0false0Greenwich Mean Time
>> Asia/Baku5true1Azerbaijan Time
>> Asia/Bangkok0false0Greenwich Mean Time
>>
>>
>>
>
> >
>

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



[appengine-java] Re: The weirdest problem ever!

2009-10-28 Thread Jason (Google)
Hi Marc. Please try not to double post in the future. Are you certain you're
setting the correct application ID in appengine-web.xml? Is  a
placeholder for something else? If so, are you sure your system clock is set
correctly?

- Jason

On Mon, Oct 26, 2009 at 1:50 PM, MarcGl  wrote:

>
> Very strange... I have 3 applications. They were all deploying ok.
> Suddenly, all of them stopped deploying. Eclipse gave me this error:
>
>   Deploying  to Google has encountered a problem.
>   Unable to update app: Error posting to URL:
>   http://appengine.google.com/api/appversion/create?app_id=version=1
>   403 Forbidden
>   You do not have permission to modify this app
>   (app_id=u'').
>
> I went to the Dashboard/Versions, and clicked the "Make Default"
> button. Gae said said: "Unauthorized - You are not authorized to
> access this application."
>
> When I returned to the application screen, the application
> disappeared! I could only see the two remaining applications, as if
> the application has been deleted. But it told me "You have 7
> applications remaining." When I went back to Eclipse, it succeeded
> with deployment.
>
> I then repeated the above procedure for the two remaining
> applications, and now I can deploy all of them. But they have all
> disappeared from my account, and so I cannot access the dashboard
> anymore.
>
> Please help me see my applications under my account again.
>
> Thanks,
> Marc.
>
> >
>

--~--~-~--~~~---~--~~
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: Get jdoGetManagedFieldCount() exception when trying to init a persistent class

2009-10-28 Thread Jason (Google)
Up until recently, using abstract classes and persistent subclasses usually
failed to work, but the latest preview release for the JDO/JPA layer
includes support for inheritance. More information here:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/c4208f960d05d11a

- Jason

On Tue, Oct 27, 2009 at 11:16 AM, RSN  wrote:

>
> Hi,
>
> I am new to AppEngine, and I am getting an exception when I try to
> initialize a persistent class.
>
> First, I have two questions:
>
> 1) Can we use abstract classes for persistent objects? My code looks
> very simple:
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class StudentImpl extends StudentAbstract implements Student {
>@Persistent
>private String name;
>
>public StudentImpl(Key studentKey, String name){
> super(studentKey);
> this.name = name;
>}
>
>   .etc, etc
> }
>
> Notice that the primary Key is held in the abstract super class. Is
> this ok?
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public abstract class StudentAbstract{
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key objectKey;
>public StudentAbstract(Key objectId){
>  this.objectKey = objectId;
>}
>..etc, etc
> }
>
> Is this design feasible?
>
> 2) If my declarations are correct, then Why do I get the following
> exception when I try to create an object.
>
> Caused by: java.lang.NoSuchMethodError:
>
> edu.isi.tie21.star.server.db.objects.STARDBObjectAbstract.jdoGetManagedFieldCount
> ()I
>at
>
> edu.isi.tie21.star.server.db.objects.StudentImpl.__jdoGetInheritedFieldCount
> (StudentImpl.java)
>at edu.isi.tie21.star.server.db.objects.StudentImpl.
> (StudentImpl.java)
>at edu.isi.tie21.star.server.StudentServiceImpl.addStudent
> (StudentServiceImpl.java:150)
>
> The code that generates the error is:
> pm.makePersistent(
>new StudentImpl(
>
>  KeyFactory.createKey(
>
>  StudentImpl.class.getSimpleName(), s.getName()),
>
>  s.getName()));
>
> I have searched the web, and it seems the error is related to the way
> the VM initializes objects with super classes (in my case I have an
> abstract class). The problem is that the VM is trying to access the
> abstract class with the jdoGetManagedFieldCount() method before it is
> created. is this really the problem? Is there a way around it?
>
> Thanks a lot, I appreciate any help on this issue.
>
> RSN
>
>
>
> >
>

--~--~-~--~~~---~--~~
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.lang.NoClassDefFoundError: com/google/appengine/api/xmpp/JID

2009-10-28 Thread lallafa

> Are you still seeing this error?

Yes, I still see this error.

> If so, which version of the SDK are you using?

This is the SDK version:

Release: 1.2.6
Timestamp: Wed Oct 07 19:34:04 CEST 2009
API versions: [1.0]

java.vm.vendor: Sun Microsystems Inc.
java.vm.version: 14.1-b02
java.version: 1.6.0_15
os.name: Windows XP
os.version: 5.1

> Did you change your SDK settings or update your SDK between the time when 
> XMPP was working and when it started failing?

No, I don't think so. It only worked with the very first version (a
fresh application). After the first update it started failing.

I started development in an old application (since i only have 3
applications left...). That application was created with an older SDK.
But that application failed with the same Exception from the
beginning. So I created a new application.

> Also, can you list the JARs in your war/WEB-INF/lib directory?

There are no JARs, lib is empty.

This is my appengine-web.xml:

http://appengine.google.com/ns/1.0";>
plapperbot
9







xmpp_message




>
> - Jason
>
> On Sat, Oct 24, 2009 at 12:56 PM, lallafa  wrote:
>
> > I wrote a test servlet "SendServlet" that sends invitations and
> > messages.
>
> > Calling the servlet works fine with with the runtime. It also worked
> > when it was uploaded to app engine the first time. But after uploading
> > new versions the following exception is thrown:
>
> > java.lang.NoClassDefFoundError: com/google/appengine/api/xmpp/JID
> >        at plapperbot.SendServlet.doPost(SendServlet.java:29)
> >        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:238)
> >        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:239)
> >        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:5135)
> >        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:5133)
> >        at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
> > (BlockingApplicationHandler.java:24)
> >        at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> > 363)
> >        at com.google.net.rpc.impl.Server$2.run(Server.java:814)
> >        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:769)
> >        at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
> >        at com.google.net.rpc.impl.ServerConnection.messageReceived
> > (ServerConnection.java:437)
> >        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

[appengine-java] Re: using contains(Key) in JDO query

2009-10-28 Thread Jason (Google)
This approach may present other problems; for one thing, App Engine's index
generation is not dynamic, so you will have to manually build index entries
(or let the development server generate them for you during testing) for
each combination of potential query inputs. Once the indexes are built, you
will have to do more work at query time since having a boolean for each
combination of inputs isn't realistic. In general, App Engine works best
with well-defined queries though depending on the number of inputs and
possible combinations, it's likely that you could get something working with
App Engine.

OR isn't supported due to the way Bigtable, which App Engine's datastore is
built on top of, works, and this isn't going to change soon. For more
low-level details, check out the video from this I/O session:

https://sites.google.com/site/io/under-the-covers-of-the-google-app-engine-datastore

- Jason

On Tue, Oct 27, 2009 at 3:50 PM, king  wrote:

>
> Jason, thanks for the feedback.  The issue with this boolean approach
> is that the queries are all dynamically generated, depending on the
> options selected in the search configurator.  So there is no way to
> know at record write time what flags to set unless I work out
> thousands of possible boolean flags in advance (full permutation of
> all the ever expanding filter values available, such as in the
> schoolPreference ArrayList, we keep adding new schools, which can be
> an infinite set).  Any other workaround is greatly welcome.
>
> Is the OR query operator on the roadmap for GAE?  If so, what time
> frame would that be?
>
>
>
> On Oct 27, 2:41 pm, "Jason (Google)"  wrote:
> > While App Engine's datastore does limit which queries you're able to
> > execute, there are various workarounds, which, while not ideal from a
> > development point of view, do ensure that query execution time is
> minimized
> > so your app can achieve the best possible scalability. One common pattern
> is
> > determining whether an entity meets the conditions of a certain query at
> > write time, then setting a boolean flag on that entity. When you need to
> run
> > the query, instead of managing multiple sub-queries and merging, you only
> > need to filter on this boolean field. When new queries are added, you can
> > run a task to re-process all existing entities and set their flags
> > accordingly. This is quite different from executing your query on
> runtime,
> > but should be much more efficient.
> >
> > - Jason
> >
> >
> >
> > On Mon, Oct 26, 2009 at 10:22 AM, king  wrote:
> >
> > > Hi there, can anyone from Google shines some light on the issue I
> > > posted last week?  I just need to find out if it is a major limitation
> > > on google's part with no workaround so that I can move forward
> > > accordingly. Thanks a lot.
> >
> > > On Oct 23, 11:01 am, king  wrote:
> > > > Thanks so much for the feedback.  I actually tried to extend the Key
> > > > CONTAINS concept to other fields but ran into a big wall right away.
> > > > It would be great to get your 2 cents.  Here is the root of my
> > > > problem:
> >
> > > > I have a student object, it has a number of qualifying attributes,
> for
> > > > example:
> > > > int gpa: 1 = 0 to 2.0, 2 = 2.0 to 3.0, 3 = 3.0 to 4.0
> > > > int ageGroup: 1 = 0 to 17, 2 = 18 to 30, 3 = 30 to 65, 4 = 65+
> > > > ArrayList schoolPreference: [0] = 'MIT', [1] = 'Stanford', [2] =
> > > > 'Harvard', [3] = 'Yale'
> >
> > > > Now, I need to create a query to find out all the students where (gpa
> > > > = 2 or gpa = 3) AND (age group = 3 or age group = 4) AND
> > > > (schoolPreference contains MIT or Yale, or both)
> >
> > > > As far as I know, GAE doesn't support OR operator in a query, so the
> > > > only way I can get the query above to work is to have multiple sub-
> > > > queries and do a manual join on all the datastore resultsets to
> > > > artificially create a union. If so, big problem arises:
> >
> > > > Since I have so many OR sub-conditions, if every OR translates into a
> > > > separate sub-query, literally speaking, I need to do a full
> > > > permutation of all the conditions (full product of all the OR and AND
> > > > conditions)  in all my sub-queries to achieve my goal, which doesn't
> > > > make any sense if I keep adding more value types (such as more
> schools
> > > > being selected in the student preference criteria) into my
> attributes,
> > > > not to mention adding more attributes to my student object.  Is there
> > > > any way to accomplish this query in GAE?  Your help is greatly
> > > > appreciated because this can be the deal breaker of whether my whole
> > > > project can migrate to GAE or not.  Thanks a lot in advance.
> >
> > > > On Oct 23, 1:51 am, Yasuo Higa  wrote:
> >
> > > > > Hi Andy,
> >
> > > > > >> query.setFilter("key == :keyList");
> > > > > >> List list = (List) query.execute(keyList);
> >
> > > > > > I'd like to know if that works with GAE/J, because it is illegal
> > > JDOQL
> > > > > > syntax and would be a 

[appengine-java] Re: Task queue concurrency

2009-10-28 Thread James Cooper

aha!  I missed that.  I wonder if "task invocations/second" means
"dequeues/second".

If it means dequeues/second then in theory you could write a request
handler that burns through a queue of work items in the datastore, re-
queueing itself and exiting after 25 seconds and achieve 250 CPU
seconds/second of concurrency.

Is that crazy talk?

I hope these limits go up when Tasks Queues exits beta.  Google is
selling us computer time but is setting some fairly low limits on what
we're allowed to buy.  10 cores of 1.2ghz CPU time is roughly
equivalent to a modern 4 core desktop machine right?

-- James

On Oct 28, 12:27 pm, Scott Hernandez  wrote:
> The docs here seem to indicate that dequeuing happens at 5/sec
> (default and 10 
> max).http://code.google.com/appengine/docs/java/taskqueue/overview.html
>
> On Oct 27, 8:41 am, James Cooper  wrote:
>
> > Hi there,
>
> > Last night I experimented with task queues to see what level of
> > concurrency I could achieve when running on the live environment.
>
> > Summary of the test app:
> >   - Bulk load 30,000 entities of a given type (3 properties / entity
> > object).
> >   - Command line job I ran from my PC that hit an URL to queue the
> > entries
> >      - This program was multi-threaded so I could simulate a bit of
> > load (10 concurrent threads)
> >   - Queueing URL created a task queue entry within the same app
> >   - 2nd URL handled the task queue request and stored entity to the
> > Datastore
>
> > I watched the task queue dashboard for a few minutes and observed a
> > few things:
> >   - Enqueue rate quickly outpaced dequeue rate
> >       - I was enqueing at about 12 requests / second, but dequeuing at
> > 4 requests / second
> >   - GAE did not appear to increase the dequeue rate over time in
> > response to my queue depth
>
> > Result: It took a very long time to dequeue 30,000 tasks (over 2
> > hours).  It seemed that GAE was running one instance of my app.
>
> > Expected: Much higher throughput.
>
> > Is this expected behavior?  It seems that given the 30 second request
> > limit that task queues are an important way to increase throughput
> > (ala MapReduce).  But the "swarm" of app instances never seemed to
> > arrive.
>
> > thanks
>
> > -- James
--~--~-~--~~~---~--~~
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: task queue limit >30 sec?

2009-10-28 Thread Toby Reyelts
The  limits on tasks queues recently
changed.
For example, the new total limit is 100K tasks/day for free apps and 1M
default for billing enabled.

On Wed, Oct 28, 2009 at 2:38 PM, Jason (Google)  wrote:

> All task queue quotas and limits are listed at
> http://code.google.com/appengine/docs/java/taskqueue/overview.html#Quotas_and_Limits.
> Note that you can currently insert up to 10,000 tasks per day, although
> billed applications may have a higher upper limit.
>
> - Jason
>
> On Tue, Oct 27, 2009 at 12:21 PM, James Cooper wrote:
>
>>
>> Related question:
>>
>> Is there a limit to the number of pending tasks in a queue?  Can you
>> have a million items in there?
>>
>> thanks
>>
>> -- James
>>
>> On Oct 27, 12:07 pm, "Jason (Google)"  wrote:
>> > No, all individual tasks must complete in 30 seconds or less. For larger
>> > jobs, such as processing millions of entities, the recommended approach
>> is
>> > to split these jobs and run them as multiple tasks. At the end of the
>> > current task, you can determine if more work needs to be accomplished
>> and
>> > dynamically add new tasks to the queue until the job is completely
>> finished.
>> >
>> > - Jason
>> >
>> > On Sun, Oct 25, 2009 at 1:59 PM, sproz > >wrote:
>> >
>> >
>> >
>> > > Is the limit duration of a task in a queue superior to 30 seconds?
>> > > I receive a DeadlineExceededException all the time
>>
>>
>
> >
>

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



[appengine-java] JDO multi-dimensional array support

2009-10-28 Thread king

Hi there, does GAE JDO support something like:

@Persistent
private int [][][] 3d_grid;

--~--~-~--~~~---~--~~
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: Task queue concurrency

2009-10-28 Thread Scott Hernandez

The docs here seem to indicate that dequeuing happens at 5/sec
(default and 10 max). 
http://code.google.com/appengine/docs/java/taskqueue/overview.html

On Oct 27, 8:41 am, James Cooper  wrote:
> Hi there,
>
> Last night I experimented with task queues to see what level of
> concurrency I could achieve when running on the live environment.
>
> Summary of the test app:
>   - Bulk load 30,000 entities of a given type (3 properties / entity
> object).
>   - Command line job I ran from my PC that hit an URL to queue the
> entries
>      - This program was multi-threaded so I could simulate a bit of
> load (10 concurrent threads)
>   - Queueing URL created a task queue entry within the same app
>   - 2nd URL handled the task queue request and stored entity to the
> Datastore
>
> I watched the task queue dashboard for a few minutes and observed a
> few things:
>   - Enqueue rate quickly outpaced dequeue rate
>       - I was enqueing at about 12 requests / second, but dequeuing at
> 4 requests / second
>   - GAE did not appear to increase the dequeue rate over time in
> response to my queue depth
>
> Result: It took a very long time to dequeue 30,000 tasks (over 2
> hours).  It seemed that GAE was running one instance of my app.
>
> Expected: Much higher throughput.
>
> Is this expected behavior?  It seems that given the 30 second request
> limit that task queues are an important way to increase throughput
> (ala MapReduce).  But the "swarm" of app instances never seemed to
> arrive.
>
> thanks
>
> -- James
--~--~-~--~~~---~--~~
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: ServerError (500) after bulk upload

2009-10-28 Thread Mark Stephens
It's doing it again now because I maxxed out the cpu trying to load more
data.   Is it possible to get more resources so I can load the rest of my
data?  It's a list of upc symbols and their description, it's 1.2 million
rows.

Thanks,
Mark

On Wed, Oct 28, 2009 at 1:57 PM, Jason (Google)  wrote:

> What is your application ID?
>
> - Jason
>
> On Tue, Oct 27, 2009 at 8:56 AM, fence  wrote:
>
>>
>> I used the python bulk uploader ( appcfg.py upload_data ) to upload
>> data last night.  Eventually I ran out of CPU trying to load 66 megs,
>> 1.2 million rows.  Now when I try and click on anything under
>> Datastore in the dashboard I get a 500 error.
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: task queue limit >30 sec?

2009-10-28 Thread Jason (Google)
All task queue quotas and limits are listed at
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Quotas_and_Limits.
Note that you can currently insert up to 10,000 tasks per day, although
billed applications may have a higher upper limit.

- Jason

On Tue, Oct 27, 2009 at 12:21 PM, James Cooper wrote:

>
> Related question:
>
> Is there a limit to the number of pending tasks in a queue?  Can you
> have a million items in there?
>
> thanks
>
> -- James
>
> On Oct 27, 12:07 pm, "Jason (Google)"  wrote:
> > No, all individual tasks must complete in 30 seconds or less. For larger
> > jobs, such as processing millions of entities, the recommended approach
> is
> > to split these jobs and run them as multiple tasks. At the end of the
> > current task, you can determine if more work needs to be accomplished and
> > dynamically add new tasks to the queue until the job is completely
> finished.
> >
> > - Jason
> >
> > On Sun, Oct 25, 2009 at 1:59 PM, sproz  >wrote:
> >
> >
> >
> > > Is the limit duration of a task in a queue superior to 30 seconds?
> > > I receive a DeadlineExceededException all the time
> >
>

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



[appengine-java] Re: ServerError (500) after bulk upload

2009-10-28 Thread Mark Stephens
suprcoupon

It's back now.  I figured it would happen when my limits got reset.

Thanks,
Mark


On Wed, Oct 28, 2009 at 1:57 PM, Jason (Google)  wrote:

> What is your application ID?
>
> - Jason
>
> On Tue, Oct 27, 2009 at 8:56 AM, fence  wrote:
>
>>
>> I used the python bulk uploader ( appcfg.py upload_data ) to upload
>> data last night.  Eventually I ran out of CPU trying to load 66 megs,
>> 1.2 million rows.  Now when I try and click on anything under
>> Datastore in the dashboard I get a 500 error.
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Poor performance while deserializing a resource file (JTS spatial index)

2009-10-28 Thread Jason (Google)
Hi Stuart. The latency after deployment and after several minutes of
inactivity is the time needed to initialize a new JVM and spin up a new
instance of your application. App Engine automatically spins down your
applications based on traffic -- if no requests are arriving, then App
Engine will spin down all of your instances -- likewise, if traffic
increases, more instances will be added.

We are working on reducing this latency, but it will always be longer than
the milliseconds needed when hitting a warm instance.

- Jason

On Tue, Oct 27, 2009 at 9:15 AM, Stuart Moffatt wrote:

>
> All,
>
> Beta 0.9 of "GIS in the Cloud" is now a little faster.
>
> 1) The app now uses Memcache to store the spatial index. We check to
> see if it is there before performing the spatial query with it. If it
> is not there, we create it from the serialized version on disk, then
> drop it in the cache. See
>
> http://code.google.com/p/giscloud/source/browse/trunk/giscloud/src/org/emcode/samples/giscloud/server/GisCloudServiceImpl.java#55
>
> 2) The load-on-startup option for the servlet is in web.xml, which
> inits() the servlet that handles the app, during which time the
> spatial index is created and put in the cache if not already there.
> These actions are logged so I can see when App Engine is spinning up
> my app. See
> http://code.google.com/p/giscloud/source/browse/trunk/giscloud/war/WEB-INF/web.xml#60
> and the link above to the servlet.
>
> Toby, I am still getting that initial latency (less than 2 seconds) on
> my initial click -- not only after first going to the app after
> deployment (expected) but  even coming to it after a few minutes of
> application inactivity. It seems App Engine is thinking about
> something -- like maybe where my app is. Subsequent clicks are
> milliseconds.
>
> Can you comment or offer any suggestions?
>
> On Sep 26, 11:04 pm, Stuart Moffatt  wrote:
> > Toby,
> >
> > I should have thought of it earlier, but you were exactly right in
> > suggesting the static var for the spatial index. First hit was 9760
> > milliseconds (as App Engine was spinning up). Many subsequent hits were
> sub
> > 25 milliseconds. Some climbed up a little, but were still less than 3/4
> > second.
> >
> > Will take a look at the load-on-startup option next, and figure out the
> best
> > way to share the index across different servlets.
> >
> > Stuart
> >
> > On Sat, Sep 26, 2009 at 9:39 PM, Stuart Moffatt  >wrote:
> >
> > > Toby,
> >
> > > Thanks for those tips. I will look into the load-on-startup option for
> the
> > > servlet, as well as caching the index locally on servlet init. And,
> allow
> > > for the spin up to handle new versions for a few tests.
> >
> > > Stuart
> >
> > > On Sat, Sep 26, 2009 at 9:34 PM, Toby Reyelts 
> wrote:
> >
> > >> Stuart,
> > >> When you were trying to get benchmarking numbers, are you sure you
> were
> > >> factoring out cases in which App Engine was creating new application
> > >> instances?
> >
> > >> In general, you have to be very careful about ensuring that you're
> making
> > >> apples-to-apples comparisons. For example, if you run the test several
> times
> > >> from your local box, your operating system will have surely cached
> your
> > >> files off of disk. If you run the test several times against App
> Engine, you
> > >> may end up hitting several different physical machines, all of which
> are
> > >> spinning up new instances of your aplication.
> >
> > >> One piece of advice I have been giving is to log from a servlet
> registered
> > >> as load-on-startup. In this way, you can see which requests involve a
> new
> > >> instance of your application. Every time you upload a new version of
> your
> > >> app, should expect this to happen several times, as App Engine has to
> spin
> > >> up new application instances to support your new version.
> >
> > >> Another question for you is if you really need to do this on every
> single
> > >> request. I assume your index is read-only, and it sounds relatively
> small.
> > >> Given that, it sounds like a perfect candidate for being read upon
> > >> initialization and cached locally, for example, in a static variable.
> >
> > >> On Sat, Sep 26, 2009 at 9:06 PM, Stuart Moffatt <
> stuartmoff...@gmail.com>wrote:
> >
> > >>> All,
> >
> > >>> I am trying to implement spatial indexes via JTS on App Engine and
> > >>> have had some success. But, in order to make my spatial queries
> > >>> perform better, I should be using a spatial index. In an offline
> > >>> application, these indexes could be created once at runtime and used
> > >>> for the duration of the application. However, in an stateless online
> > >>> setting I would be recreating indexes every request. To circumvent
> > >>> that overhead, I decided to test how well App Engine would handle
> > >>> deserializing a spatial JTS index from the filesystem, and found
> > >>> performance to be pretty sad.
> >
> > >>> A description of the steps I took can be found here:
> > >>>http:

[appengine-java] Re: ServerError (500) after bulk upload

2009-10-28 Thread Jason (Google)
What is your application ID?

- Jason

On Tue, Oct 27, 2009 at 8:56 AM, fence  wrote:

>
> I used the python bulk uploader ( appcfg.py upload_data ) to upload
> data last night.  Eventually I ran out of CPU trying to load 66 megs,
> 1.2 million rows.  Now when I try and click on anything under
> Datastore in the dashboard I get a 500 error.
>
>
> >
>

--~--~-~--~~~---~--~~
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: trouble with SDK 1.2.6

2009-10-28 Thread Vince Bonfanti

No, that didn't help. Again, just to make sure I'm being clear:

 - The only reason appengine-api-stubs.jar and
appengine-local-runtime.jar are in my project classpath is to be able
to compile my junit tests. They're not needed for debugging my
project. However...

 - When creating a debug configuration, Eclipse automatically uses the
project classpath by default, which causes the exceptions I showed
earlier when trying to debug. Adding appengine-agent.jar to the top of
the project and debug classpaths did not solve the problem.

 - By manually editing my debug configuration to remove
appengine-api-stubs.jar and appengine-local-runtime.jar from the debug
classpath, everything works fine.

At this point I'm happy.

Vince

On Fri, Oct 23, 2009 at 3:55 PM, Toby Reyelts  wrote:
> Vince,
>
> You should be able to workaround the problem you're having with your unit
> tests by adding $SDK/lib/agent/appengine-agent.jar to the very top of your
> system classpath. Please let me know if that does not work for you.
>
> On Fri, Oct 23, 2009 at 3:23 PM, Vince Bonfanti  wrote:
>>
>> It looks like the Eclipse debug configuration automatically picks up
>> the complete build path for the project as its classpath. Manually
>> editing the debug configuration to remove appengine-api-stubs.jar and
>> appengine-local-runtime.jar from the classpath fixes the problem.
>>
>> Vince
>>
>> On Fri, Oct 23, 2009 at 3:01 PM, Vince Bonfanti 
>> wrote:
>> >
>> > I just figured out the problem. I had added appengine-api-stubs.jar
>> > and appengine-local-runtime.jar to my project build path to support
>> > junit testing. Upgrading to the 1.2.6 versions only changed the error
>> > message, but removing them from the build path solved the problem. Now
>> > I just have to figure out how to configure things properly to support
>> > junit testing...
>> >
>> > Thanks.
>> >
>> > Vince
>> >
>> > 2009/10/23 Miguel Méndez :
>> >> I'm going to check and see if I can reproduce this using your project.
>> >>
>>
>>
>
>
> >
>

--~--~-~--~~~---~--~~
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] An internal error occurred during deployment

2009-10-28 Thread Pion

I have been developing my app in the hosted mode for the past few
months. It works fine on the hosted mode.

Today, I got an internal error below when I tried to deploy it for the
first time using Eclipse.

My environments: GAE Java 1.2.6, GWT 1.7.1, Eclipse(Galileo), Windows
Vista (32-bit).

Any help is is appreciated.
Thanks in advance for your help.


ERROR LOGS
eclipse.buildId=M20090917-0800
java.version=1.6.0_15
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product
org.eclipse.epp.package.jee.product


Error
Wed Oct 28 09:41:50 PDT 2009
An internal error occurred during: "Deploying col to Google".

com.google.apphosting.utils.config.AppEngineConfigException: XML error
validating D:\workspace\google\col\war\WEB-INF\appengine-web.xml
against D:\download\eclipse-galileo\plugins
\com.google.appengine.eclipse.sdkbundle_1.2.6.v200910131704\appengine-
java-sdk-1.2.6\docs\appengine-web.xsd
at com.google.appengine.tools.admin.Application.validateXml
(Application.java:321)
at com.google.appengine.tools.admin.Application.
(Application.java:87)
at com.google.appengine.tools.admin.Application.readApplication
(Application.java:120)
at
com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.createAppAdmin
(AppEngineBridgeImpl.java:204)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy
(AppEngineBridgeImpl.java:265)
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)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:
Invalid content was found starting with element 'system-properties'.
One of '{"http://appengine.google.com/ns/1.0":static-files, "http://
appengine.google.com/ns/1.0":resource-files, "http://
appengine.google.com/ns/1.0":env-variables, "http://
appengine.google.com/ns/1.0":ssl-enabled, "http://appengine.google.com/
ns/1.0":sessions-enabled, "http://appengine.google.com/ns/1.0":user-
permissions, "http://appengine.google.com/ns/1.0":public-root, "http://
appengine.google.com/ns/1.0":inbound-services, "http://
appengine.google.com/ns/1.0":precompilation-enabled}' is expected.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator
$XSIErrorReporter.reportError(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at
com.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.validate
(Unknown Source)
at
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate
(Unknown Source)
at javax.xml.validation.Validator.validate(Unknown Source)
at com.google.appengine.tools.admin.Application.validateXml
(Application.java:318)
... 7 more


--~--~-~--~~~---~--~~
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.lang.OutOfMemoryError when reading inbound mail on production

2009-10-28 Thread m seleron

Hi

It examined it a little.
I think that there is a part where [MimeMultipart#getCount] is used in
places other than this source.

How compatible.
--
System.setProperty("mail.mime.multipart.ignoremissingendboundary",
"true");
--

This setting allows you to be tolerant and think MimeMultipart
rigorous checks

Sorry
Details are not examined. what influence you exist

Please try.
--~--~-~--~~~---~--~~
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: 500 error due to reaching "simulataneous active request limit" - but they all appear to be within limits

2009-10-28 Thread James Cooper

I'm seeing this same error as well.  It appears to happen during a
cold start.  10sec timeout:

10-27 08:54PM 13.522 / 500 10193ms 0cpu_ms 0kb Mozilla/5.0 (Macintosh;
U; Intel Mac OS X 10_6_1; en-us) AppleWebKit/531.9 (KHTML, like Gecko)
10-27 08:54PM 23.715
Request was aborted after waiting too long to attempt to service your
request. Most likely, this indicates that you have reached your
simultaneous active request limit. This is almost always due to
excessively high latency in your app. Please see
http://code.google.com/appengine/docs/quotas.html for more details.

App id: bitmech-test

I have a small paid quota on this app, but there is zero traffic to
it, so it can't be due to quota issues (this is an experimental app
for trying out GAE).

I've seen this error 3-4 times in the last 3 days.  Doing a reload in
my browser a 2nd time always results in a success.

I see a flurry of traffic in Oct on the forum regarding this issue.
Can Google confirm/deny whether this is a GAE platform issue, or
whether there is a new 10 second cold start timeout we need to be
aware of.  I'm experimenting with GAE to determine suitability for
production projects and I'm trying to get a grasp on all the time
limits.  This 10sec one is unfamiliar.

thanks

-- James

On Oct 16, 10:53 am, "Jason (Google)"  wrote:
> Hi Alok. I received it, and I'll be looking into it shortly.
>
> - Jason
--~--~-~--~~~---~--~~
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: Uncaught exception from servlet java.lang.NoClassDefFoundError: java.rmi.server.UID is a restricted class.

2009-10-28 Thread Toby Reyelts
Are you running the latest 1.2.6 SDK? It should be implementing the same
whitelisting as the production servers.

On Tue, Oct 27, 2009 at 7:00 AM, Srinivas Inf
wrote:

>
> I am getting this error message on the server and its working fine in
> my local Eclipse platform.Please help me on this issue.
>
> >
>

--~--~-~--~~~---~--~~
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] TaskQueue API don't work in Unit Tests

2009-10-28 Thread Patrizio Munzi

Hi all,

I'm getting the following exception using Task Queues in Unit Tests:

--
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API 
package 'taskqueue' or call 'Add()' was not found.
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:77)
at 
com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:23)
at 
com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:188)
at 
com.eris4.warp4.callfriends.server.taskqueue.MultiOperationsTask.enqueue(MultiOperationsTask.java:73)
at 
com.eris4.warp4.callfriends.server.taskqueue.MultiOperationsTask.enqueue(MultiOperationsTask.java:66)
at 
com.eris4.warp4.callfriends.server.taskqueue.MultiOperationsTask.enqueue(MultiOperationsTask.java:66)
at 
com.eris4.warp4.callfriends.unittest.server.taskqueue.MultiOperationsTaskTest.testOver1BytesTaskSize(MultiOperationsTaskTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
-

My classpath already contains the jars:
- appengine-local-runtime.jar
- appengine-api-stubs.jar
- appengine-api-labs.jar


Regards,
Patrizio

--~--~-~--~~~---~--~~
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: Not sure I'm using Memcache properly

2009-10-28 Thread Don Schwarz
On Tue, Oct 27, 2009 at 6:17 PM, kousen  wrote:

>
> I'm using the Java API.  In my app, I store (only) the ISBN's of a
> series of books.  When I load the books, my service goes to Amazon and
> retrieves the rest of the information about the book from their web
> service.  Then I display all the books on a page.
>
> My service uses the JCache API, with a static attribute to represent
> the cache.  The (pseudo) code below is roughly analogous to what I
> actually do:
>
> public class AmazonBookService {
>  private static Cache cache;
>
>  static {
> int secs = // expiration limit
> cache = // get the factory, initialize the cache with expiration
> limit
>  }
>
>  public Book[] getBooks() {
>  // use a DAO to get the ISBNs from the datastore -- happens
> every request
>  // initialize results array
>  // for each ISBN:
>  // if book is in cache, add it to results
>  // if not, fetch data from Amazon, build book, and add it to
> cache and the results
>  // }
>  // return all the books
>  }
> }
>
> When I deploy the service, it seems to work, but most of the time when
> I refresh a web page it still take a long time.
>
> My questions are:
>
> 1. Is this the right way to use the cache?
>

Yes.  (And yes, the underlying cache is shared across all JVMs.  Static
variables are not.)


> 2. How can I check to see if it's working?
>

You can examine your cache hit rate and other details by calling
getCacheStatistics() on your JCache and converting the result to a string.


> 3. Is there a way I can send all the book requests to Amazon
> simultaneously?
>
>
Not yet.  Asynchronous API's are definitely planned, and URLFetch is mos
likely the first API that we will support.

--~--~-~--~~~---~--~~
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: Not sure I'm using Memcache properly

2009-10-28 Thread kousen

Unfortunately, part of the whole point of my system is that all I
store is the ISBN (and my own recommendation).  I get everything else
from Amazon daily, which includes the price info, etc.  Maybe I have
to save all of that in persistent storage and just refresh it every
day, but I was hoping to avoid all that.

If you're curious about the site, it's at http://recommended-books.kousenit.com
.  Its purpose is to be a simple illustration of how to use Java and
Groovy on GAE.

I'm more concerned, though, that I'm misunderstanding what the cache
is for.  If there's a separate cache on each instance of the cluster,
then it's much less useful for this particular application.

Ken

On Oct 28, 11:24 am, Nick  wrote:
> So this boils down to JCache (google memory) vs Persistent storage
> (google disks), right?
>
> Does this pattern work instead?
>
> 1. Query Amazon for what you need
> 2. Store results using a persistent 
> storagehttp://code.google.com/appengine/docs/java/datastore/
>
> Example:http://code.google.com/appengine/docs/java/datastore/creatinggettinga...)
>
>         PersistenceManager pm = PMF.get().getPersistenceManager();
>
>         Employee e = new Employee("Alfred", "Smith", new Date());
>
>         try {
>             pm.makePersistent(e);
>         } finally {
>             pm.close();
>         }
>
> 3. Read from the persistent storage. If this is slow (I have no idea)
> you could then use JCache to cache (on each google server instance
> hosting an instance of your class) the persistent storage result the
> same way you do now
>
> On Oct 28, 10:37 am, kousen  wrote:
>
>
>
> > I'll definitely turn on logging and try to see what's going on.
>
> > Thanks,
>
> > Ken
>
> > On Oct 28, 4:18 am, leszek  wrote:
>
> > > It looks ok, the only problem I can see that something can happen
> > > between storing book in cache and getting book from cache.
> > > Scenario like:
> > > 1) fetch book from Amazon and store in cache.
> > > 2)  book expires in Amazon (or any other event happens)
> > > 3) next request - get data from cache - you return status of the book
> > > at the point 1), not the point 2).
>
> > > But maybe this problem does not matter very much.
>
> > > If you want to see if it is working simply use logging and watch the
> > > log 
> > > entries.http://code.google.com/intl/pl/appengine/docs/java/runtime.html
>
> > > I don't know if there is any method of sending request simultaneously
> > > - maybe Amazon API supports some king of "batch requests" - but I'm
> > > guessing only.- 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] images over http

2009-10-28 Thread nicanor.babula

Hello everyone,

I have somewhere on the net a servlet that serves jpeg images. In
order to verify that it works I made a html page with:
http://myurl/servlet?id=123"; />
and the image is displayed well.

Now, I am trying to create an GAE image object from the data arriving
from that servlet. How can I do?
So far I tried this code*[1], with a lot of variations, and I keep
getting timeouts and "The API call urlfetch.Fetch() took too long to
respond and was cancelled." error message in my application's logs.

Locally, in the development server, it works.

I also tried storing this images in the datastore and serving them
directly from GAE.
Example of image url: http://almaoffice0.appspot.com/GetImage?id=24001


Any ideas?

*[1]: the code:

   ImagesService imagesService =
ImagesServiceFactory.getImagesService();
try {
URL url = new URL(stringUrl);
HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
connection.setRequestMethod("GET");
connection.setReadTimeout(0);
connection.setRequestProperty("ContentType", "image/
jpeg");
connection.setDoInput(true);

if(connection.getResponseCode() ==
HttpURLConnection.HTTP_OK){
InputStream in = connection.getInputStream();
byte[] imgData = new byte[in.available()];
in.read(imgData);
Image oldImg = ImagesServiceFactory.makeImage
(imgData);
Transform resize = ImagesServiceFactory.makeResize
(oldImg.getWidth(), oldImg.getHeight());
 // I do an useless transformation, in order to force
the conversion to jpeg
return imagesService.applyTransform(resize, oldImg,
ImagesService.OutputEncoding.JPEG);
} else {
throw new Exception("cannot retrieve image @ " +
stringUrl);
}


--~--~-~--~~~---~--~~
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] Simulating MapReduce with task queues

2009-10-28 Thread James Cooper

Hi there,

I asked a similar question a couple of days ago, but I'll try
different wording and see if it generates any interest.

Has anyone successfully simulated MapReduce using task queues?  If so,
how much parallelism have you achieved in the GAE production
environment?  Are there tricks to convince GAE to increase parallelism
for your app?

I know Google has MapReduce on the roadmap, but it sounds like it's
behind full text search on the schedule, so it may be a while before
we see anything real.  We may need to come up with an interim
solution.  I'm looking at solving a OLAP problem in GAE, and MapReduce
seems to be the way to do that given the Datastore architecture.

thoughts?

-- James
--~--~-~--~~~---~--~~
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: Not sure I'm using Memcache properly

2009-10-28 Thread Nick

So this boils down to JCache (google memory) vs Persistent storage
(google disks), right?

Does this pattern work instead?

1. Query Amazon for what you need
2. Store results using a persistent storage 
http://code.google.com/appengine/docs/java/datastore/

Example: 
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Making_Objects_Persistent)

PersistenceManager pm = PMF.get().getPersistenceManager();

Employee e = new Employee("Alfred", "Smith", new Date());

try {
pm.makePersistent(e);
} finally {
pm.close();
}

3. Read from the persistent storage. If this is slow (I have no idea)
you could then use JCache to cache (on each google server instance
hosting an instance of your class) the persistent storage result the
same way you do now

On Oct 28, 10:37 am, kousen  wrote:
> I'll definitely turn on logging and try to see what's going on.
>
> Thanks,
>
> Ken
>
> On Oct 28, 4:18 am, leszek  wrote:
>
>
>
> > It looks ok, the only problem I can see that something can happen
> > between storing book in cache and getting book from cache.
> > Scenario like:
> > 1) fetch book from Amazon and store in cache.
> > 2)  book expires in Amazon (or any other event happens)
> > 3) next request - get data from cache - you return status of the book
> > at the point 1), not the point 2).
>
> > But maybe this problem does not matter very much.
>
> > If you want to see if it is working simply use logging and watch the
> > log entries.http://code.google.com/intl/pl/appengine/docs/java/runtime.html
>
> > I don't know if there is any method of sending request simultaneously
> > - maybe Amazon API supports some king of "batch requests" - but I'm
> > guessing only.- 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: Java vs. Python X-AppEngine-Estimated-CPM-US-Dollars

2009-10-28 Thread Toby

Hello Jason,

I am also using spring and I experience the same issue. Initializing
Spring FrameworkServlet takes about 15 seconds.  Going back to plain
old servlets sounds like a bad idea to me.
Isn't there any other way to speed this up?  Maybe using memcache?

Cheers,
Tobias


On Oct 23, 5:53 pm, "Jason (Google)"  wrote:
> Hi David. What is your application's ID?
>
> - Jason
>
> On Wed, Oct 21, 2009 at 3:46 PM, david.zverina wrote:
>
>
>
> > Keeping steady HTTP traffic does not work either. I have a script
> > which 'http pings' my application every 30 seconds. Yet my app-engine
> > instance experienced 70 spin downs yesterday alone!
>
> > I am REALLY looking to this update - until then I'd highly recommend
> > staying away from Spring!
>
> > On Oct 21, 6:59 pm, "Jason (Google)"  wrote:
> > > Aside from keeping steady HTTP traffic to your site, I'm afraid not. But
> > as
> > > I wrote in my last post, we're making updates over the next few releases
> > to
> > > drive this startup time lower.
>
> > > - Jason
>
> > > On Tue, Oct 20, 2009 at 2:06 AM, Marcel Overdijk
> > > wrote:
>
> > > > Is there any other way to keep an instance "warm"?
>
> > > > Startup of instance just takes to much time to have an effective GAE/J
> > > > application...
>
> > > > On 19 okt, 22:58, "Jason (Google)"  wrote:
> > > > > To answer your question, no, having a cron job run every minute to
> > keep
> > > > an
> > > > > instance warm will not work. If all application instances have spun
> > down,
> > > > > then a fresh HTTP request will require a new instance to be created,
> > > > which
> > > > > will incur the startup costs.
>
> > > > > - Jason
>
> > > > > On Fri, Oct 16, 2009 at 6:45 AM, Toby 
> > > > wrote:
>
> > > > > > That is an interesting thread.  I was asking myself the same
> > question.
> > > > > > My problem is, that I have some expensive initialization that is
> > done
> > > > > > when the webapp is initialized.  I recognized that the very first
> > > > > > request (after a longer time of idle) takes a lot of time. And as
> > you
> > > > > > say is expensive.
> > > > > > I wonder if it would make sense to have a cron job that runs every
> > > > > > minute to prevent this?
>
> > > > > > On Oct 15, 10:52 pm, Timwillhack  wrote:
> > > > > > > I should probably point out that when I say 'Timed out' I really
> > > > mean,
> > > > > > > clean start after waiting say 10 minutes to refresh a page, its
> > not a
> > > > > > > 30 second endless while loop or anything, its actually just
> > > > outputting
> > > > > > > one character from a string array.
>
> > > > > > > On Oct 15, 2:46 pm, Timwillhack  wrote:
>
> > > > > > > > I was just curious if the initialization of the Java VM is
> > actually
> > > > > > > > charged a client?  Here are some sample headers from Java vs.
> > > > Python
> > > > > > > > after letting the server timeout:
>
> > > > > > > > VERY EXPENSIVE JAVA (timed out - guessing restarting VM):
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.149171
> > > > > > > > X-AppEngine-Resource-Usage: ms=4152 cpu_ms=6440 api_cpu_ms=0
>
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.145377
> > > > > > > > X-AppEngine-Resource-Usage: ms=3890 cpu_ms=6276 api_cpu_ms=0
>
> > > > > > > > Cheap JAVA (quick refresh):
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.000168
> > > > > > > > X-AppEngine-Resource-Usage: ms=41 cpu_ms=3 api_cpu_ms=0
>
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.000189
> > > > > > > > X-AppEngine-Resource-Usage: ms=19 cpu_ms=4 api_cpu_ms=0
>
> > > > > > > > CHEAP PYTHON FRESH START (waited about 10 mins before
> > connecting):
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.002778
> > > > > > > > X-AppEngine-Resource-Usage: ms=103 cpu_ms=116 api_cpu_ms=0
>
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.002778
> > > > > > > > X-AppEngine-Resource-Usage: ms=106 cpu_ms=116 api_cpu_ms=0
>
> > > > > > > > PYTHON RECONNECT QUICKLY:
> > > > > > > > X-AppEngine-Estimated-CPM-US-Dollars: $0.000231
> > > > > > > > X-AppEngine-Resource-Usage: ms=7 cpu_ms=6 api_cpu_ms=0
>
> > > > > > > > Python is reporting very very very cheaper pricing per 1000.
> >  Is
> > > > this
> > > > > > > > the case or does google not really charge for the
> > initialization
> > > > for
> > > > > > > > java?  I sat here refreshing a page with a friend doing the
> > same,
> > > > out
> > > > > > > > of the 40 or so requests about 4 were skyrocketed in price.
> >  This
> > > > > > > > makes me very wary about making something that is hit
> > excessively,
> > > > > > > > since it seems like each instance is only taking 10 requests
> > each
> > > > per
> > > > > > > > minute or whatver
>
> > > > > > > > Yuck, are my numbers flawed or something?  Or is Python just so
> > > > much
> > > > > > > > more efficient to use on app engine?
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engin

[appengine-java] Re: Not sure I'm using Memcache properly

2009-10-28 Thread Nick

Sounds like you want a persistent storage. 
http://code.google.com/appengine/docs/java/datastore/

On Oct 28, 10:37 am, kousen  wrote:
> I'll definitely turn on logging and try to see what's going on.
>
> Thanks,
>
> Ken
>
> On Oct 28, 4:18 am, leszek  wrote:
>
>
>
> > It looks ok, the only problem I can see that something can happen
> > between storing book in cache and getting book from cache.
> > Scenario like:
> > 1) fetch book from Amazon and store in cache.
> > 2)  book expires in Amazon (or any other event happens)
> > 3) next request - get data from cache - you return status of the book
> > at the point 1), not the point 2).
>
> > But maybe this problem does not matter very much.
>
> > If you want to see if it is working simply use logging and watch the
> > log entries.http://code.google.com/intl/pl/appengine/docs/java/runtime.html
>
> > I don't know if there is any method of sending request simultaneously
> > - maybe Amazon API supports some king of "batch requests" - but I'm
> > guessing only.- 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] GAE with external openfire jabber server?

2009-10-28 Thread asianCoolz

how to use java GAE with external jabber server like openfire? any
guide?
--~--~-~--~~~---~--~~
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: Weird Life Cycle of Servlet in GAE

2009-10-28 Thread Jim McCabe

To clarify some of the responses - static variables are only shared
among instances of your servlet on that one server.  In GAE, your code
might run on different servers at different times - Google tries to
load-balance your site among its server farm.  So your website might
be running on multiple servers at once, or it might be moving from
machine to machine throughout the day, etc.

You have to think a little differently in an environment like that.
Instead of using static variables, use the memcache services.  It is
fast and the data is shared among all your instances.  Even better, it
can live longer than your individual web server instances.

- Jim
--~--~-~--~~~---~--~~
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: Uncaught exception from servlet java.lang.NoClassDefFoundError: java.rmi.server.UID is a restricted class.

2009-10-28 Thread Dominik Steiner

it might not be in the jre white list

http://code.google.com/intl/de/appengine/docs/java/jrewhitelist.html

HTH

Dominik

On Oct 27, 5:00 am, Srinivas Inf  wrote:
> I am getting this error message on the server and its working fine in
> my local Eclipse platform.Please help me on this issue.
--~--~-~--~~~---~--~~
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: Not sure I'm using Memcache properly

2009-10-28 Thread kousen

I'll definitely turn on logging and try to see what's going on.

Thanks,

Ken

On Oct 28, 4:18 am, leszek  wrote:
> It looks ok, the only problem I can see that something can happen
> between storing book in cache and getting book from cache.
> Scenario like:
> 1) fetch book from Amazon and store in cache.
> 2)  book expires in Amazon (or any other event happens)
> 3) next request - get data from cache - you return status of the book
> at the point 1), not the point 2).
>
> But maybe this problem does not matter very much.
>
> If you want to see if it is working simply use logging and watch the
> log entries.http://code.google.com/intl/pl/appengine/docs/java/runtime.html
>
> I don't know if there is any method of sending request simultaneously
> - maybe Amazon API supports some king of "batch requests" - 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: Not sure I'm using Memcache properly

2009-10-28 Thread kousen

That's a very interesting point.  If my cache isn't shared, what good
is it?  How do I ensure that my cached values really are shared among
all instances?

Ken

On Oct 28, 4:34 am, yccheok  wrote:
> My guess is that, the "static" variable in GAE context is not actually
> "static" as what we experience previously.
>
> See some of the simple test scenario I encountered too.
>
> http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> Let me know if you are having same problem.
--~--~-~--~~~---~--~~
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] Google HOSTED Account Auth Help! w/ Code

2009-10-28 Thread Bourke Floyd IV

Code in reference to:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/47306a917b8e1628

I'm not getting back the ACSID Cookie. The comments in the Servlet
Code below explain everything. I hope this helps someone else getting
started because I had a ton of sifting to get to this point.


package com.google.lavards;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.jdo.PersistenceManager;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.net.*;
import javax.jdo.Query;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

@SuppressWarnings("serial")
public class MyGoogleAppServlet extends HttpServlet {

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
try {
/*
 * Example Request from a browser:
 * 
http://localhost:8080/api/v1/merchant?merchant_id=someu...@mygoogleapp.com&merchant_key=TheirPassword
 *
 * Goal:
 *  1. to have user != null and to access 
getCurrentUser()'s email
 *
 * Steps:
 *  1. Use merchant_id and merchant_key to 
login to the HOSTED
Google account and get an authentication Key
 *  Http POST to
 *
https://www.google.com/accounts/ClientLogin?accountType=HOSTED&service=ah&email=someu...@mygoogleapp.com&Passwd=TheirPassword&source=MyGoogleApp
 *
 *  2. Use the authentication Key from Step 
2. to get an ACSID
cookie from Google
 *  Http GET to
 *  
http://mygoogleapp.appspot.com/_ah/login?auth=TheResultingAuthKeyFromStep1
 *
 *  3. Use the resulting ACSID cookie for 
the initial request
Redirect to
 *  (strip off merchant_id and 
merchant_key) with Http Header 'Set-
Cookie' = ResultingCookieFromStep2
 *  
http://localhost:8080/api/v1/merchant
 *
 * Problem:
 *  1. The ACSID cookie is never present, 
however a PREF
 *  Cookie is?? 2. Can't get user 
!= null, thus I can't get their
email
 *
 * Things that work:
 *  1. I receive the Auth token from Step 1 
Http status 200 (ok)
 *  2. I receive a Http status 204 (no 
content) for step 2
 *
 * Future Goals:
 *  1. Save the resulting cookie in the 
session and reuse it for
future requests over the same session
 *
 * Comments:
 *  1. I know that the Google app 
documentation on  ClientLogin
says to use the Auth token
 *  for future requests, but from 
all the examples that exclaim
their code is working they had
 *  to use the Auth token to get 
the ACSID Cookie, then they used
that Cookie for future requests.
 *  2. I havn't received much help on this 
issue. I really hope
posting this code will help others
 *  suffering from this same 
problem. I feel like I could have
been  working on things more
 *  interesting then basic 
Authentication problems. Maybe Google
will write a good example
 *  of proper app Engine 
Authentication at some point and include
all of the normal
 *  path's that are NOT supports. 
IE. using the Authentication
Http  header, and simply
 *  getting the Auth token and 
passing it in future requests.
 */

UserService userService = 
UserServiceFactory.getUserService();
User user = userService.getCurrentUser();

if (user == null) {
// need to authenticate the user
// we don't have our GoogleLogin auth token

[appengine-java] Re: Failed to compile jsp files when tagdir is included

2009-10-28 Thread Rajeev Dayal
As an FYI , there is no issue in the tracker for this exact problem. I'll
write up a bug for this and post the link back on this thread (unless
someone would be kind enough to do it for me ;).

On Thu, May 7, 2009 at 11:40 AM, barabaka  wrote:

>
> Great thanks for this topic! Copying tools.jar into the AppEngine lib/
> shared directory did solve the problem for me! Deploying now works
> from MyEclipse (MyEclipse 6.5, WinXP).
>
> On Apr 21, 3:01 am, Jim McCabe  wrote:
> >
> > 1. Copy tools.jar into the AppEngine lib/shared directory.
> > 2. Modify appcfg.cmd so it fully-qualifies the reference to java.exe
> > in the JDK/bin directory.
> >
>
> >
>

--~--~-~--~~~---~--~~
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: I'm getting a already connected exception when I setRequestMethod("GET") on my HttpURLConnection

2009-10-28 Thread Bourke Floyd IV

I think I figured it out. While I was debugging I would break before
the disconnect was called in my finally block, then resend a new
request (thus the connection was already connected). Being able to Set
the RequestMethod is important to me, despite the fact that get is the
default.


On Oct 26, 7:47 pm, Nick  wrote:
> For an http GET I didn't need to call setRequestMethod or cast to
> HttpURLConnection
>
> String response = null;
> int timeoutmili = 5000;
> URL url = new URL(urlStr);
> URLConnection conn = url.openConnection();
> conn.setConnectTimeout(timeoutmili);
> conn.setReadTimeout(timeoutmili);
> rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
> StringBuffer sb = new StringBuffer();
> String line;
> while ((line = rd.readLine()) != null) {
>     sb.append(line);}
>
> response = sb.toString();
>
> On Oct 26, 6:56 pm, Bourke Floyd IV  wrote:
>
>
>
> > URL authUrl = new URL(url);
> > connection = (HttpURLConnection) authUrl.openConnection();
> > connection.setRequestMethod("GET"); //<- already connected exception.
>
> > The documentation indicates that I supposed to use openConnection,
> > then set my params, then use connect.
>
> > Inspecting the connection object in the debugger indicates that
> > connection is already connected before the setRequestMethod is called,
> > dispite the fact that I haven't called connect yet. Also, I'm not
> > calling any other functions. This is my code, not an example. This is
> > also inside of my HttpServlet doGet override
--~--~-~--~~~---~--~~
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 and Sets and Quotas

2009-10-28 Thread Raphael André Bauer

On Wed, Oct 28, 2009 at 2:01 PM, leszek  wrote:
>
> But you can accomplish it in more simple way. It is many-to-many
> relationships.
> Simple have entity USER and ITEM and USER-ITEM entity keeping both
> keys. If there exists USER-ITEM entity having both keys than user read
> this item, if not than opposite. This way you can avoid this
> limitation.
okay... the good old cross tables ;) in fact that's how I implement it
now, but imho the Sets thing would be much cleaner.

But: Brett Slatkin talks in http://www.youtube.com/watch?v=AgaL6NGpkB8
about Sets (or Lists) that contain all recepients to deal with the "I
can solve the Twitter scaling problem". Does this mean that everything
explained in Brett's talk about this issue is nice in theory, but in
reality not really possible due to quotas and such?

Would be not really cool

Thanks,


Raphael




> >
>

--~--~-~--~~~---~--~~
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 and Sets and Quotas

2009-10-28 Thread leszek

But you can accomplish it in more simple way. It is many-to-many
relationships.
Simple have entity USER and ITEM and USER-ITEM entity keeping both
keys. If there exists USER-ITEM entity having both keys than user read
this item, if not than opposite. This way you can avoid this
limitation.
--~--~-~--~~~---~--~~
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/JPA Snippets That Work - Updating a bidirectional, owned, one-to-many relationship with a new child

2009-10-28 Thread stanlick

One more thing Max -

Can you show the code that created the arguments passed into your
method?

public void addChapterToBook(PersistenceManager pm, Key bookKey,
Chapter
chapter) {

Peace,
Scott

On Oct 27, 12:25 pm, "Max Ross (Google)" 
wrote:
> At what point are you checking to see if the parent property of the child is
> populated?  I see that the newly created Chapter's Book property is
> populated when addChapterToBook() completes.
>
> Max
>
> On Tue, Oct 27, 2009 at 8:31 AM, stanlick  wrote:
>
> > This code saves the child for me, however, the parent property of the
> > child (in your case "book") is null in the child.  I have tried
> > deliberately setting this child "parent" property myself to the parent
> > prior to commit, but nothing seems to work.
>
> > On Sep 28, 6:45 pm, Max Ross 
> > >
> > wrote:
> > > Hello again and welcome to Episode 3 of JDO/JPA Snippets That Work.
> >  Today's
> > > episode is called..
>
> > > Updating A Bidrectional Owned One-To-Many With A New Child
>
> > > All the way back in episode one we demonstrated how to create both a
> > parent
> > > and a child of a bidirectional, owned, one-to-many relationship
> > > at the same time.  This week we're going to see how to add a child to an
> > > existing parent.  We'll use the same model objects we used in episode
> > one:
>
> > > JPA:
> > > @Entity
> > > public class Book {
> > >     @Id
> > >     @GeneratedValue(strategy=GenerationType.IDENTITY)
> > >     private Key id;
>
> > >     private String title;
>
> > >     @OneToMany(mappedBy = "book", cascade = CascadeType.ALL)
> > >     private List chapters = new ArrayList();
>
> > >     // getters and setters
>
> > > }
>
> > > @Entity
> > > public class Chapter {
> > >     @Id
> > >     @GeneratedValue(strategy=GenerationType.IDENTITY)
> > >     private Key id;
>
> > >     private String title;
> > >     private int numPages;
>
> > >     @ManyToOne(fetch = FetchType.LAZY)
> > >     private Book book;
>
> > >     // getters and setters
>
> > > }
>
> > > Now let's assume we've already created a book with a few chapters in the
> > > datastore and we want to add a brand new chapter to a Book with a given
> > id
> > > (we'll assume someone else is creating and closing an EntityManager named
> > > 'em' for us):
>
> > > public void addChapterToBook(EntityManager em, Key bookKey, Chapter
> > chapter)
> > > {
> > >     em.getTransaction().begin();
> > >     try {
> > >         Book b = em.find(Book.class, bookKey);
> > >         if (b == null) {
> > >             throw new RuntimeException("Book " + bookKey + " not
> > found!");
> > >         }
> > >         b.getChapters().add(chapter);
> > >         em.getTransaction().commit();
> > >     } finally {
> > >         if (em.getTransaction().isActive()) {
> > >             em.getTransaction().rollback();
> > >         }
> > >     }
>
> > > }
>
> > > JDO:
>
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable =
> > > "true")
> > > public class Book {
>
> > >     @PrimaryKey
> > >     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >     private Key id;
>
> > >     private String title;
>
> > >     @Persistent(mappedBy = "book")
> > >     @Element(dependent = "true")
> > >     @Order(extensions = @Extension(vendorName="datanucleus", key=
> > > "list-ordering", value="id asc"))
> > >     private List chapters = new ArrayList();
>
> > >     // getters and setters
>
> > > }
>
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable =
> > > "true")
> > > public class Chapter {
> > >     @PrimaryKey
> > >     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >     private Key id;
>
> > >     private String title;
> > >     private int numPages;
>
> > >     @Persistent
> > >     private Book book;
>
> > >     // getters and setters
>
> > > }
>
> > > Now let's assume we've already created a book with a few chapters in the
> > > datastore and we want to add a brand new chapter to a Book with a given
> > id
> > > (we'll assume someone else is creating and closing a PersistenceManager
> > > named 'pm' for us):
>
> > > public void addChapterToBook(PersistenceManager pm, Key bookKey, Chapter
> > > chapter) {
> > >     pm.currentTransaction().begin();
> > >     try {
> > >         // throws a runtime exception if book is not found
> > >         Book b = pm.getObjectById(Book.class, bookKey);
> > >         b.getChapters().add(chapter);
> > >         pm.currentTransaction().commit();
> > >     } finally {
> > >         if (pm.currentTransaction().isActive()) {
> > >             pm.currentTransaction().rollback();
> > >         }
> > >     }}
>
> > > 
>
> > > The interesting thing about both of these examples is that we're not
> > making
> > > any explicit calls to save the new Chapter.  We look up the Book
> > identified
> > > by the Key that was passed into the function and then we manipulate the
> > > persistent state of the object by manipulati

[appengine-java] Re: DeadlineExceededException not correctly thrown during a transaction

2009-10-28 Thread Prashant
code snippet :



...
...
   query = pm.newQuery(Link.class);
try{
count = query.deletePersistentAll(); // getting
HardDeadlineExceededError here
}catch (Exception ex) {}
query.closeAll();
...
...

--~--~-~--~~~---~--~~
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: DeadlineExceededException not correctly thrown during a transaction

2009-10-28 Thread Prashant
facing similar problem. i tried catching the exception but it didn't work,
so the tried catching *Exception* and that didn't work either. any idea
what's going on???

--~--~-~--~~~---~--~~
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] JDO and Sets and Quotas

2009-10-28 Thread Raphael André Bauer

Hi,


I got a question regarding how to implement a specific problem (and
make it scale without reaching any hard quotas implied by GAE).


my problem: Think of a Google Reader like application - there must be
a mechanism that stores items read by a user.

I would implement it as:

- object USER with an ID (say, Long)
- object ITEM with Set idsOfUserThatReadThatItem.

then I have millions of USER objects and millions of ITEM objects, and
every time a user read an ITEM I would add the id to the set of the
respective ITEM.
I could also easily query the ITEMS read by a user using JDO syntax
and setFilter("idsOfUserThatReadThatArticle==id_user").

On the other hand I know that there are hard quotas such as the 1MB
quota on entities. Does this affect the Set
idsOfUserThatReadThatItem saved along with my object ITEM?
Because then I could only save a very limited amount of Users that
read an ITEM (I would guess 200 Longs in a Set).


Thanks!

Raphael

--~--~-~--~~~---~--~~
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: Weird Life Cycle of Servlet in GAE

2009-10-28 Thread leszek

It is a clustered environment. So it is expected that the next request
is run on a different machine, JVM and all statics are reinitialized.
--~--~-~--~~~---~--~~
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 the number of entities into the DS

2009-10-28 Thread Patrizio Munzi




Hi Jason,

Thanks for your answer.
However I forgot to specify that I'd like to know the number of
entities of a specific kind which have a specific value in one of its
field (for example number of Student which attend a specific course).
It looks like Statistics don't fit this aim, not that they should
though.

BR,
    Patrizio

Jason (Google) wrote:
You can also use the new datastore statistics API, which
is probably faster although I haven't timed this myself:
  
  
  http://code.google.com/appengine/docs/java/datastore/stats.html
  
  
  - Jason
  
  On Mon, Oct 26, 2009 at 6:42 AM, Patrizio
Munzi 
wrote:
  
Hi all,

what's the best way to know the number of entities of a specific kind
saved into the DS?
Of course I'd like to know the optimized way, without retrieving all the
objects.

Thanks





  
  
  
  
  
  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi



--~--~-~--~~~---~--~~
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: Weird Life Cycle of Servlet in GAE

2009-10-28 Thread yccheok

http://yancheng-cheok.appspot.com/helloappengine

Production environment.

On Oct 28, 5:45 pm, leszek  wrote:
> Is it production or local (development) environment ?
--~--~-~--~~~---~--~~
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: Weird Life Cycle of Servlet in GAE

2009-10-28 Thread leszek

Is it production or local (development) environment ?
--~--~-~--~~~---~--~~
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: Dev server datastore deadlock

2009-10-28 Thread stumpy

The thread dump is a bit cryptic so I reduced the problem down to a
small servlet that fails.

Use the servlet below in the development environment and set up aync
requests to it and a deadline will occur e.g. using 2 or more looped
curls from the terminal.

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Transaction t = ds.beginTransaction();
try {
Key key = KeyFactory.createKey("entity_kind", 1);
Entity e = new Entity(key);
e.setProperty("property_bytes", new Blob(new byte[100]));
ds.put(t, e);
t.commit();
} catch (Throwable th) {
if (t.isActive()) {
t.rollback();
}
}
}

On Oct 27, 6:12 pm, stumpy  wrote:
> http://docs.google.com/Doc?docid=0AV6jRtzB1ZNYZGNtNWdxemZfNjNkYjVkajl...
--~--~-~--~~~---~--~~
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: Need help on how to enhance the data classes with netbeans

2009-10-28 Thread leszek

I'm using NetBeans but only for GWT application. I don't know if there
is anybody who uses NetBeans for Google App Engine application.

May be ask the question here:

https://gwt4nb.dev.java.net/

if are there any plans to extend existing plugin and support also
Google App Engine.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: Concurrency In Transaction

2009-10-28 Thread leszek

http://code.google.com/intl/pl/appengine/docs/java/datastore/transactions.html

Look at the next code snippet

===
   for (int i = 0; i < NUM_RETRIES; i++) {
pm.currentTransaction().begin();

ClubMembers members = pm.getObjectById(ClubMembers.class,
"k12345");
members.incrementCounterBy(1);

try {
pm.currentTransaction().commit();
break;

} catch (JDOCanRetryException ex) {
if (i == (NUM_RETRIES - 1)) {
throw ex;
}
}
}


In Google App Engine "optimistic" transaction model is applied. There
is no any "global block", every request starts transaction but only
one is allowed to run through it, the second and next get and
exception and should run some logic to handle this exception. Here it
tries to rerun the transaction (hoping that the first already has
finished it)  You can also return error message to the client and
enable switch "try again" or any other rescue plan.
--~--~-~--~~~---~--~~
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: Not sure I'm using Memcache properly

2009-10-28 Thread yccheok

My guess is that, the "static" variable in GAE context is not actually
"static" as what we experience previously.

See some of the simple test scenario I encountered too.

http://groups.google.com/group/google-appengine-java/browse_thread/thread/c478f64082f3e212

Let me know if you are having same problem.
--~--~-~--~~~---~--~~
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/JPA Snippets That Work - Optimistic Locking With @Version

2009-10-28 Thread Patrizio Munzi




Hi Max,
thanks for the answer.

By the way, I tried to post on the blog but I didn't find a way to do
it.
Could be strange but I've never commented on blogspot and had problem
to do it.
I'd be graceful if you could instruct me.

BR,
    Patrizio

Max Ross (Google) wrote:

  
  On Thu, Oct 22, 2009 at 12:44 AM, Patrizio
Munzi 
wrote:
  
Hi Max,

I've just read your new post and I've got two questions.
1) should we discuss your new posts in this mailing list or in the blog?

Since you haven't answer my first question yet, :-P, I'm going to ask
my second question in both ways.

  
  I'd rather have these discussions on the blog, but since I don't
see your question posted on the blog I'll answer it here. 
  
  

2) Before your new post the only way I knew for transaction isolation
was using the JDOCanRetryException (or at least we'll use it as soon as
the bug fix about it will be released), now we've got also this
JDOOptimisticVerificationException. Now, I can imagine the difference
between them but I'd like to know what's the best way to deal with both
of them. I mean, should we use both of them? Using the
JDOCanRetryException mechanism shouldn't be need of the
JDOOptimisticVerificationException.


  
  A ConcurrentModificationException wrapped in a
JDOCanRetryException is the result of 2 concurrent updates to the same
entity group.  A JDOOptimisticVerificationException is the result of
interleaved updates to the same entity.  It's entirely up to you to
decide how you want to handle these.  If you're not concerned about
users making updates based on out-of-date information then you probably
don't want to use @Version (in which case you'll never get
JDOOptimisticVerificationException) and you probably want to
automatically retry when you get a JDOCanRetryException whose cause is
ConcurrentModificationException.  If you always want to ensure that
users are making updates based on up to date info then you probably
want to use @Version and you probably want to let both
JDOOptimisticVerificationException and ConcurrentModificationException
propagate back to the user.  I'm hard-pressed to think of a scenario
where you would be interested in one but not the other, but if such a
scenario exists then the flexibility is there.
  
I admit it would have been nice if we threw
JDOOptimisticVerificationException in both cases, but
JDOOptimisticVerificationException extends JDOFatalDataStoreException,
and a ConcurrentModificationException is decidedly not a fatal error.
  
Hope this helps,
Max
 
  
We'd be very grateful if you
could clarify this out.

Thanks


Max Ross wrote:
http://gae-java-persistence.blogspot.com/2009/10/optimistic-locking-with-version.html
  
  



-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi





  
  
  
  
  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi



--~--~-~--~~~---~--~~
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] Weird Life Cycle of Servlet in GAE

2009-10-28 Thread yccheok

I have the following code.

package org.example;

import java.io.IOException;
import javax.servlet.http.*;

public class HelloAppEngineServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
static_counter++; member_counter++;
resp.getWriter().println("static_counter = " + static_counter + 
"
member_counter = " + member_counter);
}
private static int static_counter = 0;
private static int member_counter = 0;
}

I am expecting static_counter will always live, and never reset back
to 0 once it start to increment, as long as I do not perform any new
upload (Hence, the JVM of the server will not be restarted, I guess)

For member_counter, I expect it can be reset to 0 sometimes, as
servlet container may choose to create another new instance due to
certain situation.

However, my observation is that, after I am getting

static_counter = 3 member_counter = 3

If I let my web browser idle for says an hour, I will get

static_counter = 1 member_counter = 1

Seems the JVM had been restarted?

Can anyone explain why this happen?


--~--~-~--~~~---~--~~
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: Not sure I'm using Memcache properly

2009-10-28 Thread leszek

It looks ok, the only problem I can see that something can happen
between storing book in cache and getting book from cache.
Scenario like:
1) fetch book from Amazon and store in cache.
2)  book expires in Amazon (or any other event happens)
3) next request - get data from cache - you return status of the book
at the point 1), not the point 2).

But maybe this problem does not matter very much.

If you want to see if it is working simply use logging and watch the
log entries.
http://code.google.com/intl/pl/appengine/docs/java/runtime.html

I don't know if there is any method of sending request simultaneously
- maybe Amazon API supports some king of "batch requests" - 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
-~--~~~~--~~--~--~---