[Teneo] NPE trying to Initialize Datastore [message #123478] |
Wed, 28 May 2008 21:19 |
Eclipse User |
|
|
|
Originally posted by: tskaufma.gmail.com
Hey,
I've just downloaded the newest EMF SDK and Teneo SDK
(0.8.0.v200805211659-08--DUUEFDEsUMMz0tL) and I now get a null pointer
exception in my code (last tested with Teneo from about 3.4M4 time frame).
// Create the DataStore.
dataStore = HbHelper.INSTANCE.createRegisterDataStore(getDataStoreName() );
// Configure the EPackages used by this DataStore.
dataStore.setEPackages(packages);
dataStore.initialize(); // <-- This is the call that causes the null
pointer exception
It appears that an internal variable properties is null and being passed to
a Properties.putAll call which throws the null pointer exception.
Is there something else I should be doing before I initialize the datastore?
Hibernate is configured with a hibernate.properties file which also has not
changed.
Thanks,
Trevor
|
|
|
|
Re: [Teneo] NPE trying to Initialize Datastore [message #123505 is a reply to message #123492] |
Thu, 29 May 2008 02:14 |
Eclipse User |
|
|
|
Originally posted by: tskaufma.gmail.com
Hey,
Thank you for the response. The trace is below.
> I think if you call dataStore.setHibernateProperties(new Properties()) or
> dataStore.setProperties(new Properties()) before the initialize then you
> can workaround this.
I thought this too after posting to the newsgroup, but this appears to not
find the hibernate.properties file.
I get errors about setting the dialect, etc.
So I did the following,
/*
* temp fix
*/
Properties properties2 = new Properties();
properties2.load(new FileInputStream("hibernate.properties"));
dataStore.setProperties(properties2);
where "hibernate.properties" file was moved from the root of the plugin to
the root of the source folder. This worked for me.
Thanks,
Trevor
java.lang.NullPointerException
at java.util.Hashtable.putAll(Unknown Source)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.getProperties(Hb DataStore.java:338)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.setProper tiesInConfiguration(HbSessionDataStore.java:131)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:75)
at net.sf.depcon.core.Util$1.run(Util.java:151)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
"Martin Taal" <mtaal@elver.org> wrote in message
news:g1kk7g$gj$1@build.eclipse.org...
> Hi Trevor,
> I think if you call dataStore.setHibernateProperties(new Properties()) or
> dataStore.setProperties(new Properties()) before the initialize then you
> can workaround this.
>
> Can you also post the npe stacktrace?
> I will then change the code so that this does not happen anymore.
>
> After this fix the call with the new Properties() won't be needed anymore.
>
> gr. Martin
>
> Trevor Kaufman wrote:
>> Hey,
>>
>> I've just downloaded the newest EMF SDK and Teneo SDK
>> (0.8.0.v200805211659-08--DUUEFDEsUMMz0tL) and I now get a null pointer
>> exception in my code (last tested with Teneo from about 3.4M4 time
>> frame).
>>
>> // Create the DataStore.
>> dataStore =
>> HbHelper.INSTANCE.createRegisterDataStore(getDataStoreName() );
>>
>> // Configure the EPackages used by this DataStore.
>> dataStore.setEPackages(packages);
>> dataStore.initialize(); // <-- This is the call that causes the null
>> pointer exception
>>
>> It appears that an internal variable properties is null and being passed
>> to a Properties.putAll call which throws the null pointer exception.
>>
>> Is there something else I should be doing before I initialize the
>> datastore?
>>
>> Hibernate is configured with a hibernate.properties file which also has
>> not changed.
>>
>> Thanks,
>> Trevor
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Cell: +31 (0)6 288 48 943
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
|
|
|
|
Re: [Teneo] NPE trying to Initialize Datastore [message #619056 is a reply to message #123492] |
Thu, 29 May 2008 02:14 |
Eclipse User |
|
|
|
Originally posted by: tskaufma.gmail.com
Hey,
Thank you for the response. The trace is below.
> I think if you call dataStore.setHibernateProperties(new Properties()) or
> dataStore.setProperties(new Properties()) before the initialize then you
> can workaround this.
I thought this too after posting to the newsgroup, but this appears to not
find the hibernate.properties file.
I get errors about setting the dialect, etc.
So I did the following,
/*
* temp fix
*/
Properties properties2 = new Properties();
properties2.load(new FileInputStream("hibernate.properties"));
dataStore.setProperties(properties2);
where "hibernate.properties" file was moved from the root of the plugin to
the root of the source folder. This worked for me.
Thanks,
Trevor
java.lang.NullPointerException
at java.util.Hashtable.putAll(Unknown Source)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.getProperties(Hb DataStore.java:338)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.setProper tiesInConfiguration(HbSessionDataStore.java:131)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:75)
at net.sf.depcon.core.Util$1.run(Util.java:151)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
"Martin Taal" <mtaal@elver.org> wrote in message
news:g1kk7g$gj$1@build.eclipse.org...
> Hi Trevor,
> I think if you call dataStore.setHibernateProperties(new Properties()) or
> dataStore.setProperties(new Properties()) before the initialize then you
> can workaround this.
>
> Can you also post the npe stacktrace?
> I will then change the code so that this does not happen anymore.
>
> After this fix the call with the new Properties() won't be needed anymore.
>
> gr. Martin
>
> Trevor Kaufman wrote:
>> Hey,
>>
>> I've just downloaded the newest EMF SDK and Teneo SDK
>> (0.8.0.v200805211659-08--DUUEFDEsUMMz0tL) and I now get a null pointer
>> exception in my code (last tested with Teneo from about 3.4M4 time
>> frame).
>>
>> // Create the DataStore.
>> dataStore =
>> HbHelper.INSTANCE.createRegisterDataStore(getDataStoreName() );
>>
>> // Configure the EPackages used by this DataStore.
>> dataStore.setEPackages(packages);
>> dataStore.initialize(); // <-- This is the call that causes the null
>> pointer exception
>>
>> It appears that an internal variable properties is null and being passed
>> to a Properties.putAll call which throws the null pointer exception.
>>
>> Is there something else I should be doing before I initialize the
>> datastore?
>>
>> Hibernate is configured with a hibernate.properties file which also has
>> not changed.
>>
>> Thanks,
>> Trevor
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Cell: +31 (0)6 288 48 943
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.05148 seconds