[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Vik
hie
any updates on this please?

yeah I did what you suggested by putting a log statement..

and what I get are two different values from this block

At first time of app startup
vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

and in another flow
vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


So, it means it is trying to load it in two different class loaders. So, how
should I fix it?

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the static
 block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular servlet
 depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping the
 PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized error for
 PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.com wrote:

 Thanks for the code. I have three suggestions (mostly from my previous
 post):
 1)  Are you maybe loading that singleton class in different classloaders?
 Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory. You can add a static initializer ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for duplicate
 PMF creations to log a stacktrace first thing every time it's called. Then
 you'll know for sure which code paths are causing this to happen.

 3) Disable the check if you're sure you're only creating the PMF a small
 number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory pmfInstance =
 JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private static final Compass compass;
 private static final CompassGps compassGps;

 static {
  compass = new CompassConfiguration().setConnection(gae://index)
  .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
 disabled)
  .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
  .buildCompass();

  compassGps = new SingleCompassGps(compass);
  compassGps.addGpsDevice(new Jdo2GpsDevice(appenine,
 pmfInstance));
  compassGps.start();

  compassGps.index();

 }

 private PMF() {}

 public static PersistenceManagerFactory get() {
  return pmfInstance;
 }

 public static Compass getCompass(){
  return compass;
 }
 }

 any clues?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 12:34 AM, Toby Reyelts to...@google.com wrote:

 Vik,

 Do you have some sample code to reproduce this? By default, we throw an
 exception if you try to create more than one PersistenceManagerFactory. Are
 you using a singleton class to prevent more than one from being created? If
 so, are you maybe loading that singleton class in different classloaders?
 (Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory).

 Lastly, you can disable the exception if you want (details should be in
 the exception message), but it will be a performance problem for you if
 you're creating more than a few PersistenceManagerFactory's.


 On Tue, Sep 1, 2009 at 1:51 PM, Vik vik@gmail.com wrote:

 anyone any updates on this please?
 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Sun, Aug 30, 2009 at 8:51 PM, Vik vik@gmail.com wrote:

 Hie
 Any one using compass on his GAE app?

 I am frequently getting error cannot initialize PMF where there is
 static code to initialize compass apis.
 Any idea how to resolve?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com












 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 

[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Don Schwarz
To be clear, you're getting these two log statements in the same request?
 Or subsequent requests?

On Thu, Sep 17, 2009 at 1:48 AM, Vik vik@gmail.com wrote:

 hie
 any updates on this please?

 yeah I did what you suggested by putting a log statement..

 and what I get are two different values from this block

 At first time of app startup
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

 and in another flow
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


  So, it means it is trying to load it in two different class loaders. So,
 how should I fix it?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the
 static block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular servlet
 depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping the
 PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized error for
 PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.com wrote:

 Thanks for the code. I have three suggestions (mostly from my previous
 post):
 1)  Are you maybe loading that singleton class in different
 classloaders? Try logging the classloader object reference that tries to
 create the PersistenceManagerFactory. You can add a static initializer ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for duplicate
 PMF creations to log a stacktrace first thing every time it's called. Then
 you'll know for sure which code paths are causing this to happen.

 3) Disable the check if you're sure you're only creating the PMF a small
 number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory pmfInstance =
 JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private static final Compass compass;
 private static final CompassGps compassGps;

 static {
  compass = new CompassConfiguration().setConnection(gae://index)
  .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
 disabled)
  .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
  .buildCompass();

  compassGps = new SingleCompassGps(compass);
  compassGps.addGpsDevice(new Jdo2GpsDevice(appenine,
 pmfInstance));
  compassGps.start();

  compassGps.index();

 }

 private PMF() {}

 public static PersistenceManagerFactory get() {
  return pmfInstance;
 }

 public static Compass getCompass(){
  return compass;
 }
 }

 any clues?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 12:34 AM, Toby Reyelts to...@google.com wrote:

 Vik,

 Do you have some sample code to reproduce this? By default, we throw an
 exception if you try to create more than one PersistenceManagerFactory. 
 Are
 you using a singleton class to prevent more than one from being created? 
 If
 so, are you maybe loading that singleton class in different classloaders?
 (Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory).

 Lastly, you can disable the exception if you want (details should be in
 the exception message), but it will be a performance problem for you if
 you're creating more than a few PersistenceManagerFactory's.


 On Tue, Sep 1, 2009 at 1:51 PM, Vik vik@gmail.com wrote:

 anyone any updates on this please?
 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Sun, Aug 30, 2009 at 8:51 PM, Vik vik@gmail.com wrote:

 Hie
 Any one using compass on his GAE app?

 I am frequently getting error cannot initialize PMF where there is
 static code to initialize compass apis.
 Any idea how to resolve?

 Thankx and Regards

 Vik
 Founder
 

[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Vik
hie
in two different requests.

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Thu, Sep 17, 2009 at 8:16 PM, Don Schwarz schwa...@google.com wrote:

 To be clear, you're getting these two log statements in the same request?
  Or subsequent requests?


 On Thu, Sep 17, 2009 at 1:48 AM, Vik vik@gmail.com wrote:

 hie
 any updates on this please?

 yeah I did what you suggested by putting a log statement..

 and what I get are two different values from this block

 At first time of app startup
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

 and in another flow
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


  So, it means it is trying to load it in two different class loaders. So,
 how should I fix it?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the
 static block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular servlet
 depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping the
 PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized error
 for PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.com wrote:

 Thanks for the code. I have three suggestions (mostly from my previous
 post):
 1)  Are you maybe loading that singleton class in different
 classloaders? Try logging the classloader object reference that tries to
 create the PersistenceManagerFactory. You can add a static initializer 
 ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for duplicate
 PMF creations to log a stacktrace first thing every time it's called. Then
 you'll know for sure which code paths are causing this to happen.

 3) Disable the check if you're sure you're only creating the PMF a small
 number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory pmfInstance =

  JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private static final Compass compass;
 private static final CompassGps compassGps;

 static {
  compass = new CompassConfiguration().setConnection(gae://index)
  .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
 disabled)
  .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
  .buildCompass();

  compassGps = new SingleCompassGps(compass);
  compassGps.addGpsDevice(new Jdo2GpsDevice(appenine,
 pmfInstance));
  compassGps.start();

  compassGps.index();

 }

 private PMF() {}

 public static PersistenceManagerFactory get() {
  return pmfInstance;
 }

 public static Compass getCompass(){
  return compass;
 }
 }

 any clues?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 12:34 AM, Toby Reyelts to...@google.comwrote:

 Vik,

 Do you have some sample code to reproduce this? By default, we throw
 an exception if you try to create more than one 
 PersistenceManagerFactory.
 Are you using a singleton class to prevent more than one from being 
 created?
 If so, are you maybe loading that singleton class in different 
 classloaders?
 (Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory).

 Lastly, you can disable the exception if you want (details should be
 in the exception message), but it will be a performance problem for you 
 if
 you're creating more than a few PersistenceManagerFactory's.


 On Tue, Sep 1, 2009 at 1:51 PM, Vik vik@gmail.com wrote:

 anyone any updates on this please?
 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Sun, Aug 30, 2009 at 8:51 PM, Vik vik@gmail.com wrote:

 Hie
 Any one using compass on his 

[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Toby Reyelts
Just to clarify what Jason is saying, the fact that you're seeing two
different UserClassLoader instances in those two requests:

userclassloa...@1f7cdc7 and
userclassloa...@1e6f0ef

means that you're actually looking at two requests for two different
isolated application instances, with each one undergoing its own
initialization.

On Thu, Sep 17, 2009 at 1:19 PM, Jason (Google) apija...@google.com wrote:

 Hi Vik. At most a single UserClassLoader is loaded per application
 instance. Since you're seeing two output lines in your logs, these two
 requests must have hit separate running instances of your application.

 In your benchmarking, you need to account for this initialization, i.e.
 ignoring requests that are loading requests per application instance, and
 keep in mind that you're likely to see several loading requests every time
 you upload a change to your application, as new instances are spun up.

 - Jason


 On Thu, Sep 17, 2009 at 8:33 AM, Vik vik@gmail.com wrote:

 hie
 in two different requests.

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 17, 2009 at 8:16 PM, Don Schwarz schwa...@google.com wrote:

 To be clear, you're getting these two log statements in the same request?
  Or subsequent requests?


 On Thu, Sep 17, 2009 at 1:48 AM, Vik vik@gmail.com wrote:

 hie
 any updates on this please?

 yeah I did what you suggested by putting a log statement..

 and what I get are two different values from this block

 At first time of app startup
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

 and in another flow
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


  So, it means it is trying to load it in two different class loaders.
 So, how should I fix it?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the
 static block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular
 servlet depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping
 the PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized error
 for PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.com wrote:

 Thanks for the code. I have three suggestions (mostly from my previous
 post):
 1)  Are you maybe loading that singleton class in different
 classloaders? Try logging the classloader object reference that tries to
 create the PersistenceManagerFactory. You can add a static initializer 
 ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for
 duplicate PMF creations to log a stacktrace first thing every time it's
 called. Then you'll know for sure which code paths are causing this to
 happen.

 3) Disable the check if you're sure you're only creating the PMF a
 small number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory pmfInstance =

  JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private static final Compass compass;
 private static final CompassGps compassGps;

 static {
  compass = new
 CompassConfiguration().setConnection(gae://index)
  
 .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
 disabled)
  .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
  .buildCompass();

  compassGps = new SingleCompassGps(compass);
  compassGps.addGpsDevice(new Jdo2GpsDevice(appenine,
 pmfInstance));
  compassGps.start();

  compassGps.index();

 }

 private PMF() {}

 public static PersistenceManagerFactory get() {
  return pmfInstance;
 }

 public static Compass getCompass(){
  return compass;
 }
 }

 any clues?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 

[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Vik
Hie
you guys put me in doubt then.
I opened the browser and logged in to my app which created a request to pull
authentication info. and once i logged in i queried a page and this was
another request.

In this process i got the two different UserClassLoader. So, does your
statement holds good?


Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Thu, Sep 17, 2009 at 11:19 PM, Toby Reyelts to...@google.com wrote:

 Just to clarify what Jason is saying, the fact that you're seeing two
 different UserClassLoader instances in those two requests:

 userclassloa...@1f7cdc7 and
 userclassloa...@1e6f0ef

 means that you're actually looking at two requests for two different
 isolated application instances, with each one undergoing its own
 initialization.

 On Thu, Sep 17, 2009 at 1:19 PM, Jason (Google) apija...@google.comwrote:

 Hi Vik. At most a single UserClassLoader is loaded per application
 instance. Since you're seeing two output lines in your logs, these two
 requests must have hit separate running instances of your application.

 In your benchmarking, you need to account for this initialization, i.e.
 ignoring requests that are loading requests per application instance, and
 keep in mind that you're likely to see several loading requests every time
 you upload a change to your application, as new instances are spun up.

 - Jason


 On Thu, Sep 17, 2009 at 8:33 AM, Vik vik@gmail.com wrote:

 hie
 in two different requests.

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 17, 2009 at 8:16 PM, Don Schwarz schwa...@google.comwrote:

 To be clear, you're getting these two log statements in the same
 request?  Or subsequent requests?


 On Thu, Sep 17, 2009 at 1:48 AM, Vik vik@gmail.com wrote:

 hie
 any updates on this please?

 yeah I did what you suggested by putting a log statement..

 and what I get are two different values from this block

 At first time of app startup
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

 and in another flow
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


  So, it means it is trying to load it in two different class loaders.
 So, how should I fix it?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the
 static block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular
 servlet depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping
 the PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized error
 for PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.comwrote:

 Thanks for the code. I have three suggestions (mostly from my
 previous post):
 1)  Are you maybe loading that singleton class in different
 classloaders? Try logging the classloader object reference that tries to
 create the PersistenceManagerFactory. You can add a static initializer 
 ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for
 duplicate PMF creations to log a stacktrace first thing every time it's
 called. Then you'll know for sure which code paths are causing this to
 happen.

 3) Disable the check if you're sure you're only creating the PMF a
 small number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory pmfInstance =

  JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private static final Compass compass;
 private static final CompassGps compassGps;

 static {
  compass = new
 CompassConfiguration().setConnection(gae://index)
  
 .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
 disabled)
  .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
  

[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Toby Reyelts
Yes, it's quite trivial for two different http requests to land on two
different application instances. You can see if it's an initializing request
for an application instance by logging from an appropriate servlet's init()
method (for example, one that is in the path of the request or is registered
as load-on-startup).

On Thu, Sep 17, 2009 at 2:20 PM, Vik vik@gmail.com wrote:

 Hie
 you guys put me in doubt then.
 I opened the browser and logged in to my app which created a request to
 pull authentication info. and once i logged in i queried a page and this was
 another request.

 In this process i got the two different UserClassLoader. So, does your
 statement holds good?


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 17, 2009 at 11:19 PM, Toby Reyelts to...@google.com wrote:

 Just to clarify what Jason is saying, the fact that you're seeing two
 different UserClassLoader instances in those two requests:

 userclassloa...@1f7cdc7 and
 userclassloa...@1e6f0ef

 means that you're actually looking at two requests for two different
 isolated application instances, with each one undergoing its own
 initialization.

 On Thu, Sep 17, 2009 at 1:19 PM, Jason (Google) apija...@google.comwrote:

 Hi Vik. At most a single UserClassLoader is loaded per application
 instance. Since you're seeing two output lines in your logs, these two
 requests must have hit separate running instances of your application.

 In your benchmarking, you need to account for this initialization, i.e.
 ignoring requests that are loading requests per application instance, and
 keep in mind that you're likely to see several loading requests every time
 you upload a change to your application, as new instances are spun up.

 - Jason


 On Thu, Sep 17, 2009 at 8:33 AM, Vik vik@gmail.com wrote:

 hie
 in two different requests.

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 17, 2009 at 8:16 PM, Don Schwarz schwa...@google.comwrote:

 To be clear, you're getting these two log statements in the same
 request?  Or subsequent requests?


 On Thu, Sep 17, 2009 at 1:48 AM, Vik vik@gmail.com wrote:

 hie
 any updates on this please?

 yeah I did what you suggested by putting a log statement..

 and what I get are two different values from this block

 At first time of app startup
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

 and in another flow
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


  So, it means it is trying to load it in two different class loaders.
 So, how should I fix it?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the
 static block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular
 servlet depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping
 the PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized
 error for PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.comwrote:

 Thanks for the code. I have three suggestions (mostly from my
 previous post):
 1)  Are you maybe loading that singleton class in different
 classloaders? Try logging the classloader object reference that tries 
 to
 create the PersistenceManagerFactory. You can add a static initializer 
 ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for
 duplicate PMF creations to log a stacktrace first thing every time it's
 called. Then you'll know for sure which code paths are causing this to
 happen.

 3) Disable the check if you're sure you're only creating the PMF a
 small number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory 

[appengine-java] Re: issues with compass for GAE apps

2009-09-17 Thread Vik
So, that concludes
I may expect such request time outs in GAE any time without being able to
fix it?


Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Fri, Sep 18, 2009 at 12:56 AM, Toby Reyelts to...@google.com wrote:

 Yes, it's quite trivial for two different http requests to land on two
 different application instances. You can see if it's an initializing request
 for an application instance by logging from an appropriate servlet's init()
 method (for example, one that is in the path of the request or is registered
 as load-on-startup).


 On Thu, Sep 17, 2009 at 2:20 PM, Vik vik@gmail.com wrote:

 Hie
 you guys put me in doubt then.
 I opened the browser and logged in to my app which created a request to
 pull authentication info. and once i logged in i queried a page and this was
 another request.

 In this process i got the two different UserClassLoader. So, does your
 statement holds good?


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 17, 2009 at 11:19 PM, Toby Reyelts to...@google.com wrote:

 Just to clarify what Jason is saying, the fact that you're seeing two
 different UserClassLoader instances in those two requests:

 userclassloa...@1f7cdc7 and
 userclassloa...@1e6f0ef

 means that you're actually looking at two requests for two different
 isolated application instances, with each one undergoing its own
 initialization.

 On Thu, Sep 17, 2009 at 1:19 PM, Jason (Google) apija...@google.comwrote:

 Hi Vik. At most a single UserClassLoader is loaded per application
 instance. Since you're seeing two output lines in your logs, these two
 requests must have hit separate running instances of your application.

 In your benchmarking, you need to account for this initialization, i.e.
 ignoring requests that are loading requests per application instance, and
 keep in mind that you're likely to see several loading requests every time
 you upload a change to your application, as new instances are spun up.

 - Jason


 On Thu, Sep 17, 2009 at 8:33 AM, Vik vik@gmail.com wrote:

 hie
 in two different requests.

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 17, 2009 at 8:16 PM, Don Schwarz schwa...@google.comwrote:

 To be clear, you're getting these two log statements in the same
 request?  Or subsequent requests?


 On Thu, Sep 17, 2009 at 1:48 AM, Vik vik@gmail.com wrote:

 hie
 any updates on this please?

 yeah I did what you suggested by putting a log statement..

 and what I get are two different values from this block

 At first time of app startup
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1f7cdc7

 and in another flow
 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in
 com.google.apphosting.runtime.security.userclassloa...@1e6f0ef


  So, it means it is trying to load it in two different class loaders.
 So, how should I fix it?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Thu, Sep 3, 2009 at 9:01 PM, Vik vik@gmail.com wrote:

 Hie
 Thankx for taking time...

 I just adding the static block u mentioned in point 1 just after the
 static block i have (in the above mail)

 I am sorry I did not get your point 2.
 Right now what I do is: every time a request goes to a particular
 servlet depending upon application flow and i call
  PersistentManager  pm = PMF.get().getPersistenceManager();

 and then do jdo stuff with GAE.

 So, i m not checking any kind of duplicate or anything. I was hoping
 the PMF class getInstance which is implemented as a singleton pattern
 takes care of all.

 Please guide.. my app right now sucks coz of this not intialized
 error for PMF.


 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.comwrote:

 Thanks for the code. I have three suggestions (mostly from my
 previous post):
 1)  Are you maybe loading that singleton class in different
 classloaders? Try logging the classloader object reference that tries 
 to
 create the PersistenceManagerFactory. You can add a static 
 initializer ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for
 duplicate PMF creations to log a stacktrace first thing every time 
 it's
 called. Then you'll know for sure which code paths are causing this to
 happen.

 3) Disable the check if you're sure you're only creating the PMF a
 small number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import 

[appengine-java] Re: issues with compass for GAE apps

2009-09-03 Thread Vik
Hie
Thankx for taking time...

I just adding the static block u mentioned in point 1 just after the static
block i have (in the above mail)

I am sorry I did not get your point 2.
Right now what I do is: every time a request goes to a particular servlet
depending upon application flow and i call
 PersistentManager  pm = PMF.get().getPersistenceManager();

and then do jdo stuff with GAE.

So, i m not checking any kind of duplicate or anything. I was hoping the PMF
class getInstance which is implemented as a singleton pattern
takes care of all.

Please guide.. my app right now sucks coz of this not intialized error for
PMF.


Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Wed, Sep 2, 2009 at 8:42 PM, Toby Reyelts to...@google.com wrote:

 Thanks for the code. I have three suggestions (mostly from my previous
 post):
 1)  Are you maybe loading that singleton class in different classloaders?
 Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory. You can add a static initializer ABOVE
 pmfInstance.

 static {
   logger.log(Level.SEVERE, Loading PMF in  +
 PMF.class.getClassLoader());
 }

 2) Patch the datanucleus plugin code that makes the check for duplicate PMF
 creations to log a stacktrace first thing every time it's called. Then
 you'll know for sure which code paths are causing this to happen.

 3) Disable the check if you're sure you're only creating the PMF a small
 number of times.

 On Wed, Sep 2, 2009 at 2:45 AM, Vik vik@gmail.com wrote:

 Hie
 here is the code I am using:
 package vik.sakshum.sakshumweb.jsp.model.jdo;

 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;

 import org.compass.core.Compass;
 import org.compass.core.config.CompassConfiguration;
 import org.compass.core.config.CompassEnvironment;
 import org.compass.gps.CompassGps;
 import org.compass.gps.device.jdo.Jdo2GpsDevice;
 import org.compass.gps.impl.SingleCompassGps;

 public final class PMF {
 private static final PersistenceManagerFactory pmfInstance =
 JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private static final Compass compass;
 private static final CompassGps compassGps;

 static {
  compass = new CompassConfiguration().setConnection(gae://index)
  .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
 disabled)
  .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
  .buildCompass();

  compassGps = new SingleCompassGps(compass);
  compassGps.addGpsDevice(new Jdo2GpsDevice(appenine, pmfInstance));
  compassGps.start();

  compassGps.index();

 }

 private PMF() {}

 public static PersistenceManagerFactory get() {
  return pmfInstance;
 }

 public static Compass getCompass(){
  return compass;
 }
 }

 any clues?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Wed, Sep 2, 2009 at 12:34 AM, Toby Reyelts to...@google.com wrote:

 Vik,

 Do you have some sample code to reproduce this? By default, we throw an
 exception if you try to create more than one PersistenceManagerFactory. Are
 you using a singleton class to prevent more than one from being created? If
 so, are you maybe loading that singleton class in different classloaders?
 (Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory).

 Lastly, you can disable the exception if you want (details should be in
 the exception message), but it will be a performance problem for you if
 you're creating more than a few PersistenceManagerFactory's.


 On Tue, Sep 1, 2009 at 1:51 PM, Vik vik@gmail.com wrote:

 anyone any updates on this please?
 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Sun, Aug 30, 2009 at 8:51 PM, Vik vik@gmail.com wrote:

 Hie
 Any one using compass on his GAE app?

 I am frequently getting error cannot initialize PMF where there is
 static code to initialize compass apis.
 Any idea how to resolve?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com












 


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



[appengine-java] Re: issues with compass for GAE apps

2009-09-02 Thread Vik
Hie
here is the code I am using:
package vik.sakshum.sakshumweb.jsp.model.jdo;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

import org.compass.core.Compass;
import org.compass.core.config.CompassConfiguration;
import org.compass.core.config.CompassEnvironment;
import org.compass.gps.CompassGps;
import org.compass.gps.device.jdo.Jdo2GpsDevice;
import org.compass.gps.impl.SingleCompassGps;

public final class PMF {
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory(transactions-optional);

private static final Compass compass;
private static final CompassGps compassGps;

static {
 compass = new CompassConfiguration().setConnection(gae://index)
 .setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE,
disabled)
 .addScan(vik.sakshum.sakshumweb.jsp.model.jdo)
 .buildCompass();

 compassGps = new SingleCompassGps(compass);
 compassGps.addGpsDevice(new Jdo2GpsDevice(appenine, pmfInstance));
 compassGps.start();

 compassGps.index();

}

private PMF() {}

public static PersistenceManagerFactory get() {
 return pmfInstance;
}

public static Compass getCompass(){
 return compass;
}
}

any clues?

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Wed, Sep 2, 2009 at 12:34 AM, Toby Reyelts to...@google.com wrote:

 Vik,

 Do you have some sample code to reproduce this? By default, we throw an
 exception if you try to create more than one PersistenceManagerFactory. Are
 you using a singleton class to prevent more than one from being created? If
 so, are you maybe loading that singleton class in different classloaders?
 (Try logging the classloader object reference that tries to create the
 PersistenceManagerFactory).

 Lastly, you can disable the exception if you want (details should be in the
 exception message), but it will be a performance problem for you if you're
 creating more than a few PersistenceManagerFactory's.


 On Tue, Sep 1, 2009 at 1:51 PM, Vik vik@gmail.com wrote:

 anyone any updates on this please?
 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Sun, Aug 30, 2009 at 8:51 PM, Vik vik@gmail.com wrote:

 Hie
 Any one using compass on his GAE app?

 I am frequently getting error cannot initialize PMF where there is static
 code to initialize compass apis.
 Any idea how to resolve?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com






 


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



[appengine-java] Re: issues with compass for GAE apps

2009-09-01 Thread Toby Reyelts
Vik,

Do you have some sample code to reproduce this? By default, we throw an
exception if you try to create more than one PersistenceManagerFactory. Are
you using a singleton class to prevent more than one from being created? If
so, are you maybe loading that singleton class in different classloaders?
(Try logging the classloader object reference that tries to create the
PersistenceManagerFactory).

Lastly, you can disable the exception if you want (details should be in the
exception message), but it will be a performance problem for you if you're
creating more than a few PersistenceManagerFactory's.

On Tue, Sep 1, 2009 at 1:51 PM, Vik vik@gmail.com wrote:

 anyone any updates on this please?
 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com


 On Sun, Aug 30, 2009 at 8:51 PM, Vik vik@gmail.com wrote:

 Hie
 Any one using compass on his GAE app?

 I am frequently getting error cannot initialize PMF where there is static
 code to initialize compass apis.
 Any idea how to resolve?

 Thankx and Regards

 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com



 


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