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

Reply via email to