These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Method not found exception
PostPosted: Tue Jul 11, 2006 12:55 pm 
Newbie

Joined: Thu Jun 22, 2006 9:48 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
NHibernate 1.0.0.0

Mapping documents:

Report.hbm.xml
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-cascade="none" default-access="field.pascalcase-m-underscore">
<class name="Iqs.CAQ.Core.Reporting.Report,Iqs.CAQ.Core" table="IQS_REPORTS" lazy="true">

<id name="Id" column="ID" type="Int32">
<generator class="native"/>
</id>

<property column="REPORT_ID" type="String" name="ReportId" not-null="true" length="255"/>
<property ... />

<many-to-one name="Folder" column="FOLDER_ID" class="Iqs.CAQ.Core.Reporting.ReportFolder,Iqs.CAQ.Core" outer-join="true"/>

</class>
</hibernate-mapping>

ReportFolder.hbm.xml
-----------------------

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-cascade="none" default-access="field.pascalcase-m-underscore">
<class name="Iqs.CAQ.Core.Reporting.ReportFolder,Iqs.CAQ.Core" table="IQS_REPORTS_FOLDER" lazy="true">

<id name="FolderId" column="FOLDER_ID" type="Int32">
<generator class="native"/>
</id>

<property column="PARENT_ID" type="Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate" name="ParentId" />
<property ... />

<bag name="Reports" table="IQS_REPORTS" lazy="true">
<key column="FOLDER_ID"/>
<one-to-many class="Iqs.CAQ.Core.Reporting.Report,Iqs.CAQ.Core"/>
</bag>
</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:
Exception:
{"Could not execute query"}
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
at NHibernate.Impl.QueryImpl.List()
at Iqs.CAQ.Core.Reporting.ReportingFactory.GetReport(Int32 progId, String reportID) in ...\ReportingFactory.cs:line 37
at ...


Inner Exception:
{"Method not found: 'System.Object Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(System.Type, System.Type[], Castle.DynamicProxy.IInterceptor, System.Object[])'."}
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
at NHibernate.Persister.AbstractEntityPersister.CreateProxy(Object id, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation)
at NHibernate.Impl.SessionImpl.InternalLoad(Type clazz, Object id)
at NHibernate.Type.ManyToOneType.ResolveIdentifier(Object id, ISessionImplementor session)
at NHibernate.Type.EntityType.ResolveIdentifier(Object id, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.InitializeEntitiesAndCollections(IList hydratedObjects, Object resultSetId, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
at NHibernate.Hql.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)

Name and version of the database you are using:
SQL-Server

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:




IQuery q = session1.CreateQuery("FROM Report as r WHERE r.Folder.ProgId=:progid AND r.ReportId=:reportid");
q.SetInt32("progid", progId);
q.SetString("reportid", reportID);

ListClass<Report> rfc = new ListClass<Report>(q.List());

The above code throws the "Method not found" exception sometimes. It depends on the reportid parameter. I can get some records without problmes. But for other records I get the exception. I have checked the database. The foreign keys (which hibernate knows) are correct (r.Folder exists).

What could be the reason for the "Method not found" exception?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.