Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » NPE in StoreResource.java:473
NPE in StoreResource.java:473 [message #58482] |
Fri, 20 October 2006 22:24 |
Eclipse User |
|
|
|
Originally posted by: sprakash.tibco.com
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
|
|
|
Re: NPE in StoreResource.java:473 [message #58484 is a reply to message #58482] |
Fri, 20 October 2006 22:53 |
Eclipse User |
|
|
|
Originally posted by: sprakash.tibco.com
Sorry, the line numbers are wrong. It should be Line# 467 (that gives the
NPE). Also this is from the build titled I200609141628 (Thu, 14 Sep 2006
-- 16:28 (-0400)). The method doesnt appear to be different even in the
current build:
for (Iterator it = eObject.eClass().getEAllReferences().iterator();
it.hasNext();) {
|
|
| | |
Re: NPE in StoreResource.java:473 [message #59799 is a reply to message #59137] |
Wed, 01 November 2006 06:29 |
Eclipse User |
|
|
|
Originally posted by: sprakash.tibco.com
Martin,
I was told that the latest build (26th Oct) solved this NPE (Bugzilla
162150). But apparently it still does not, in my tests. Do you expect to
be resolving this bug anytime soon?
Thanks,
Sundeep
|
|
| | | | | | |
Goto Forum:
Current Time: Sat Oct 19 07:11:33 GMT 2024
Powered by FUDForum. Page generated in 0.04784 seconds
|