Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » NPE in StoreResource.java:473
NPE in StoreResource.java:473 [message #594504] Fri, 20 October 2006 22:24
Sundeep Prakash is currently offline Sundeep PrakashFriend
Messages: 14
Registered: July 2009
Junior Member
Hello Martin,

I have a simple HibernateResource with a query, which as I see in my
debugger, Hibernate executes correctly and returns a single result.
However, Teneo NPEs while trying to make a list for the Hibernate
resource. Here is the exception (with some Hibernate debug log prepended):


Creating resource with query string:
hibernate://?dsname=matrix&query1=FROM Enterprise ent LEFT JOIN FETCH
ent.resourceConfigurations r WHERE r.id=11
6189 [main] DEBUG org.hibernate.SQL - select
enterprise0_."simpleeditableentity_id" as id1_1_0_,
resourceco2_."simpleeditableentity_id" as id1_1_1_, enterprise0_2_._vn_ as
column2_1_0_, enterprise0_2_."name" as name3_1_0_,
enterprise0_2_."description" as descript4_1_0_, enterprise0_1_."createdby"
as createdby2_4_0_, enterprise0_1_."modifiedby" as modifiedby3_4_0_,
enterprise0_1_."creationdate" as creation4_4_0_,
enterprise0_1_."modificationdate" as modifica5_4_0_,
enterprise0_."admincluster_id" as adminclu2_36_0_, resourceco2_2_._vn_ as
column2_1_1_, resourceco2_2_."name" as name3_1_1_,
resourceco2_2_."description" as descript4_1_1_, resourceco2_1_."createdby"
as createdby2_4_1_, resourceco2_1_."modifiedby" as modifiedby3_4_1_,
resourceco2_1_."creationdate" as creation4_4_1_,
resourceco2_1_."modificationdate" as modifica5_4_1_, resourceco2_."type"
as type2_55_1_, resourceco2_."contents" as contents3_55_1_,
resourceco2_.econtainer_class as econtainer4_55_1_,
resourceco2_.e_container as e5_55_1_, resourceco2_.e_container_featureid
as e6_55_1_, case when resourceco2_3_."resourceconfiguration_id" is not
null then 22 when resourceco2_."simpleeditableentity_id" is not null then
11 end as clazz_1_, resourceco1_.id as id0__, resourceco1_.elt as elt0__,
resourceco1_."enterprise_resourceconfigurations_idx" as enterprise3_0__
from "enterprise" enterprise0_ inner join "simpleeditableentity"
enterprise0_1_ on
enterprise0_."simpleeditableentity_id"=enterprise0_1_."adminentity_id "
inner join "adminentity" enterprise0_2_ on
enterprise0_."simpleeditableentity_id"=enterprise0_2_."id " left outer join
enterprise_resourceconfiguration resourceco1_ on
enterprise0_."simpleeditableentity_id"=resourceco1_.id left outer join
"resourceconfiguration" resourceco2_ on
resourceco1_.elt=resourceco2_."simpleeditableentity_id" left outer join
"simpleeditableentity" resourceco2_1_ on
resourceco2_."simpleeditableentity_id"=resourceco2_1_."adminentity_id "
left outer join "adminentity" resourceco2_2_ on
resourceco2_."simpleeditableentity_id"=resourceco2_2_."id " left outer join
"servicebustransportconfiguration" resourceco2_3_ on
resourceco2_."simpleeditableentity_id"=resourceco2_3_."resourceconfiguration_id "
where resourceco2_."simpleeditableentity_id"=11
6299 [main] DEBUG org.hibernate.SQL - select adminclust0_.e_id as
e1_86_0_, adminclust0_._vn_ as column2_86_0_, adminclust0_."clustername"
as clustern3_86_0_, adminclust0_.econtainer_class as econtainer4_86_0_,
adminclust0_.e_container as e5_86_0_, adminclust0_.e_container_featureid
as e6_86_0_ from "admincluster" adminclust0_ where adminclust0_.e_id=?
Exception in thread "main" java.lang.NullPointerException
at
org.eclipse.emf.teneo.resource.StoreResource.attachedHelper( StoreResource.java:473)
at
org.eclipse.emf.teneo.resource.StoreResource.attached(StoreR esource.java:425)
at
org.eclipse.emf.teneo.resource.StoreResource.load(StoreResou rce.java:252)

The exception seems to occur because StoreResource.attachedHelper is
handed a null object. This in turn happens because
getNonResolvingContent(eObject).basicIterator() returns an iterator which
has null objects in it. What exactly is getNonResolvingContent(eObject)?
eObject in my case has the real object i.e. the only result that Hibernate
returned.

When I put an NPE check in StoreResource.attachedHelper, everything is
fine. Is this a good enough fix (and should I file a bug report), or is
the problem happening in the first place because of some earlier mistake
on my part?

Thanks much,

Sundeep
Previous Topic:teneo - annotations in Rational Rose model - anyone?
Next Topic:[teneo] ClassCastException during read of one-to-one mapping
Goto Forum:
  


Current Time: Thu Apr 25 08:01:12 GMT 2024

Powered by FUDForum. Page generated in 0.02801 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top