Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# dommer 6/4/2005 8:25 AM
I've just installed Cuyahoga on a gentoo linux box, and so far I'm impressed. But I can't get Rss feeds working. As you can see here http://cuyahoga.troelsrichter.com/1/feed.aspx

Do anyone have an Idea?
# martijnb 6/4/2005 8:50 AM
The error message is not very descriptive. Just a null reference exception. Maybe Mono uses some XML lib behind the scenes that is not installed?

Could you perhaps run it in debug mode (mono --debug) to see some line numbers where the exception occurs?
# dommer 6/4/2005 2:14 PM
I've enabled tracing and set custumErrors to Off in web.config + recompiled mod_mono with debug enabled.

First time after restarting apache I get this error:

System.Exception: Unable to get Articles ---> NHibernate.QueryException: in expected: a [from Article a where a.Section.Id = :sectionId and a.Syndicate = :syndicate and a.DateOnline < :now and a.DateOffline > :now order by a.DateOnline desc ]
in <0x0084b> NHibernate.Hql.FromParser:Token (System.String token, NHibernate.Hql.QueryTranslator q)
in <0x0034c> NHibernate.Hql.ClauseParser:Token (System.String token, NHibernate.Hql.QueryTranslator q)
in <0x0027f> NHibernate.Hql.PreprocessingParser:Token (System.String token, NHibernate.Hql.QueryTranslator q)
in <0x000ad> NHibernate.Hql.ParserHelper:Parse (IParser p, System.String text, System.String seperators, NHibernate.Hql.QueryTranslator q)
in <0x00068> NHibernate.Hql.QueryTranslator:Compile (System.String queryString)--- End of inner exception stack trace ---

in <0x00159> Cuyahoga.Modules.Articles.ArticleModule:GetRssArticles (Int32 number)
in <0x0032f> Cuyahoga.Modules.Articles.ArticleModule:GetRssFeed ()
in <0x00381> Cuyahoga.Web.Rss:Page_Load (System.Object sender, System.EventArgs e)
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0x00056> System.Web.UI.Control:OnLoad (System.EventArgs e)
in <0x00026> System.Web.UI.Control:LoadRecursive ()
in <0x00149> System.Web.UI.Page:InternalProcessRequest ()
in <0x000a9> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext context)
in <0x00233> System.Web.HttpApplication+ExecuteHandlerState:Execute ()
in <0x0007c> System.Web.HttpApplication+StateMachine:ExecuteState (IStateHandler state, System.Boolean readysync)
# martijnb 6/5/2005 3:00 AM
That's bizarre. Especially because the 'normal' article display does work.

The only difference in the hql query is an extra boolean parameter (:syndicate in ArticleModule.cs line 186), but I can't hardly believe that this causes the problem.

For the record: did you build Cuyahoga with NAnt on Mono or did you copy the binaries from a Windows box?
# dommer 6/5/2005 8:58 AM (edited 6/5/2005 9:01 AM)
I build it with nant om Mono without any problems.

I'm using mono 1.17 with mod_mono 1.09-r1.

I've even tried to drop the database and start it all over, to see if it had anything to do with some invalid characters or something. I'm danish and has therefore set the culture on the site to danish. But even with a very simple post I get the error.
# martijnb 6/5/2005 12:10 PM
Have you turned logging on btw? Just uncomment the log4net section in the web.config and set the root logger to 'INFO'. Maybe this way you get a little bit more information.
# dommer 6/5/2005 3:18 PM
When I clear the log and makes a single request to the page log.txt contains the following information

2005-06-06 00:06:46,049 [311301] INFO Cuyahoga.Web.Util.UrlHandlerModule [] <> - urlToRewrite = /1/feed.aspx
2005-06-06 00:06:46,050 [311301] INFO Cuyahoga.Web.Util.UrlHandlerModule [] <> - path = /Rss.aspx
2005-06-06 00:06:46,050 [311301] INFO Cuyahoga.Web.Util.UrlHandlerModule [] <> - pathInfo =
2005-06-06 00:06:46,050 [311301] INFO Cuyahoga.Web.Util.UrlHandlerModule [] <> - querystring = SectionId=1
2005-06-06 00:06:46,051 [311301] INFO NHibernate.Loader.Loader [] <> - SELECT Node1_.nodeid as nodeid0_, Node1_.updatetimestamp as updateti2_0_, Node1_.title as title0_, Node1_.shortdescription as shortdes4_0_, Node1_.position as position0_, Node1_.culture as culture0_, Node1_.showinnavigation as showinna7_0_, Node1_.siteid as siteid0_, Node1_.parentnodeid as parentno9_0_, Node1_.templateid as templateid0_, Site2_.siteid as siteid1_, Site2_.updatetimestamp as updateti2_1_, Site2_.name as name1_, Site2_.homeurl as homeurl1_, Site2_.defaultculture as defaultc5_1_, Site2_.defaultplaceholder as defaultp6_1_, Site2_.webmasteremail as webmaste7_1_, Site2_.templateid as templateid1_, Site2_.roleid as roleid1_, Role3_.roleid as roleid2_, Role3_.updatetimestamp as updateti2_2_, Role3_.name as name2_, Role3_.permissionlevel as permissi4_2_, Template4_.templateid as templateid3_, Template4_.updatetimestamp as updateti2_3_, Template4_.name as name3_, Template4_.basepath as basepath3_, Template4_.templatecontrol as template5_3_, Template4_.css as css3_, ModuleTy5_.moduletypeid as moduletypeid4_, ModuleTy5_.name as name4_, ModuleTy5_.assemblyname as assembly3_4_, ModuleTy5_.classname as classname4_, ModuleTy5_.path as path4_, ModuleTy5_.editpath as editpath4_,Section0_.sectionid as sectionid5_, Section0_.updatetimestamp as updateti2_5_, Section0_.title as title5_, Section0_.placeholder as placehol4_5_, Section0_.position as position5_, Section0_.cacheduration as cachedur6_5_, Section0_.showtitle as showtitle5_, Section0_.nodeid as nodeid5_, Section0_.moduletypeid as modulety9_5_ FROM cuyahoga_section Section0_ left outer join cuyahoga_node Node1_ on Section0_.nodeid=Node1_.nodeid left outer join cuyahoga_site Site2_ on Node1_.siteid=Site2_.siteid left outer join cuyahoga_role Role3_ on Site2_.roleid=Role3_.roleid left outer join cuyahoga_template Template4_ on Node1_.templateid=Template4_.templateid left outer join cuyahoga_moduletype ModuleTy5_ on Section0_.moduletypeid=ModuleTy5_.moduletypeid WHERE Section0_.sectionid = ?p0
2005-06-06 00:06:46,051 [311301] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT Node1_.nodeid as nodeid0_, Node1_.updatetimestamp as updateti2_0_, Node1_.title as title0_, Node1_.shortdescription as shortdes4_0_, Node1_.position as position0_, Node1_.culture as culture0_, Node1_.showinnavigation as showinna7_0_, Node1_.siteid as siteid0_, Node1_.parentnodeid as parentno9_0_, Node1_.templateid as templateid0_, Site2_.siteid as siteid1_, Site2_.updatetimestamp as updateti2_1_, Site2_.name as name1_, Site2_.homeurl as homeurl1_, Site2_.defaultculture as defaultc5_1_, Site2_.defaultplaceholder as defaultp6_1_, Site2_.webmasteremail as webmaste7_1_, Site2_.templateid as templateid1_, Site2_.roleid as roleid1_, Role3_.roleid as roleid2_, Role3_.updatetimestamp as updateti2_2_, Role3_.name as name2_, Role3_.permissionlevel as permissi4_2_, Template4_.templateid as templateid3_, Template4_.updatetimestamp as updateti2_3_, Template4_.name as name3_, Template4_.basepath as basepath3_, Template4_.templatecontrol as template5_3_, Template4_.css as css3_, ModuleTy5_.moduletypeid as moduletypeid4_, ModuleTy5_.name as name4_, ModuleTy5_.assemblyname as assembly3_4_, ModuleTy5_.classname as classname4_, ModuleTy5_.path as path4_, ModuleTy5_.editpath as editpath4_,Section0_.sectionid as sectionid5_, Section0_.updatetimestamp as updateti2_5_, Section0_.title as title5_, Section0_.placeholder as placehol4_5_, Section0_.position as position5_, Section0_.cacheduration as cachedur6_5_, Section0_.showtitle as showtitle5_, Section0_.nodeid as nodeid5_, Section0_.moduletypeid as modulety9_5_ FROM cuyahoga_section Section0_ left outer join cuyahoga_node Node1_ on Section0_.nodeid=Node1_.nodeid left outer join cuyahoga_site Site2_ on Node1_.siteid=Site2_.siteid left outer join cuyahoga_role Role3_ on Site2_.roleid=Role3_.roleid left outer join cuyahoga_template Template4_ on Node1_.templateid=Template4_.templateid left outer join cuyahoga_moduletype ModuleTy5_ on Section0_.moduletypeid=ModuleTy5_.moduletypeid WHERE Section0_.sectionid = ?p0
2005-06-06 00:06:46,057 [311301] INFO NHibernate.Loader.Loader [] <> - SELECT cuyahoga0_.Value as Value__, cuyahoga0_.Name as Name__ FROM cuyahoga_sectionsetting cuyahoga0_ WHERE cuyahoga0_.sectionid = ?p0
2005-06-06 00:06:46,057 [311301] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT cuyahoga0_.Value as Value__, cuyahoga0_.Name as Name__ FROM cuyahoga_sectionsetting cuyahoga0_ WHERE cuyahoga0_.sectionid = ?p0
2005-06-06 00:06:46,058 [311301] INFO NHibernate.Loader.Loader [] <> - select article0_.articleid as articleid, article0_.updatetimestamp as updateti2_, article0_.title as title, article0_.summary as summary, article0_.content as content, article0_.dateonline as dateonline, article0_.dateoffline as dateoffl7_, article0_.inserttimestamp as insertti8_, article0_.syndicate as syndicate, article0_.sectionid as sectionid, article0_.createdby as createdby, article0_.modifiedby as modifiedby, article0_.articlecategoryid as article13_ from cm_article article0_ where (article0_.sectionid=?p0)and(article0_.syndicate=?p1)and(article0_.dateonline<?p2)and(article0_.dateoffline>?p3) order by article0_.dateonline desc limit ?p4, ?p5
2005-06-06 00:06:46,058 [311301] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing select article0_.articleid as articleid, article0_.updatetimestamp as updateti2_, article0_.title as title, article0_.summary as summary, article0_.content as content, article0_.dateonline as dateonline, article0_.dateoffline as dateoffl7_, article0_.inserttimestamp as insertti8_, article0_.syndicate as syndicate, article0_.sectionid as sectionid, article0_.createdby as createdby, article0_.modifiedby as modifiedby, article0_.articlecategoryid as article13_ from cm_article article0_ where (article0_.sectionid=?p0)and(article0_.syndicate=?p1)and(article0_.dateonline<?p2)and(article0_.dateoffline>?p3) order by article0_.dateonline desc limit ?p4, ?p5
2005-06-06 00:06:46,060 [311301] INFO NHibernate.Loader.Loader [] <> - SELECT User0_.userid as userid, User0_.updatetimestamp as updateti2_, User0_.username as username, User0_.password as password, User0_.firstname as firstname, User0_.lastname as lastname, User0_.email as email, User0_.website as website, User0_.isactive as isactive, User0_.lastlogin as lastlogin, User0_.lastip as lastip, User0_.inserttimestamp as insertt12_ FROM cuyahoga_user User0_ WHERE User0_.userid = ?p0
2005-06-06 00:06:46,060 [311301] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT User0_.userid as userid, User0_.updatetimestamp as updateti2_, User0_.username as username, User0_.password as password, User0_.firstname as firstname, User0_.lastname as lastname, User0_.email as email, User0_.website as website, User0_.isactive as isactive, User0_.lastlogin as lastlogin, User0_.lastip as lastip, User0_.inserttimestamp as insertt12_ FROM cuyahoga_user User0_ WHERE User0_.userid = ?p0
2005-06-06 00:06:46,061 [311301] INFO NHibernate.Loader.Loader [] <> - SELECT Category0_.articlecategoryid as articlecategoryid, Category0_.updatetimestamp as updateti2_, Category0_.title as title, Category0_.summary as summary, Category0_.syndicate as syndicate FROM cm_articlecategory Category0_ WHERE Category0_.articlecategoryid = ?p0
2005-06-06 00:06:46,061 [311301] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT Category0_.articlecategoryid as articlecategoryid, Category0_.updatetimestamp as updateti2_, Category0_.title as title, Category0_.summary as summary, Category0_.syndicate as syndicate FROM cm_articlecategory Category0_ WHERE Category0_.articlecategoryid = ?p0
# martijnb 6/6/2005 3:13 PM
Are you using MySQL? Maybe this causes the error because of the q.SetFirstResult(0) and q.SetMaxResults(number) calls. Otherwise, I really don't know. When I have a little more time I'll try to reproduce this.
# martijnb 6/6/2005 3:43 PM
Btw, the huge queries you see in the log are because the proxies don't (didn't?) work on Mono and not because NHibernate generates stupid queries ;).
# dommer 6/7/2005 6:51 AM
Yes, I'm using the newest available MySql Database Server. When I get a little spare time I'll try to make it run on PostgreSQL instead.

Thanks so far

# martijnb 6/12/2005 2:29 AM
A little update: I can now reproduce the error on my local Mono box but I totally have no clue why the error occurs.

When testing the new 0.8.0 release on Mono, I first set it up to work with PostgreSQL and everything went fine, including displaying the rss feeds. Then I switched to MySQL by changing the NHibernate section in the web.config. Setting up a site went all fine until requesting the first rss feed: boom! Turned on all logging that is available and there seems to be nothing wrong with the generated queries. Strange, strange, strange...

The next step is checking if the same thing happens with NHibernate proxies turned on. Rumour has it that these currently work on Mono.
# martijnb 6/14/2005 2:56 PM
dommerI've enabled tracing and set custumErrors to Off in web.config + recompiled mod_mono with debug enabled.

First time after restarting apache I get this error:

System.Exception: Unable to get Articles ---> NHibernate.QueryException: in expected: a [from Article a where a.Section.Id = :sectionId and a.Syndicate = :syndicate and a.DateOnline < :now and a.DateOffline > :now order by a.DateOnline desc ]

Sorted this one out. The first time after restarting it raises this exception because the classes of the ArticleModule were not configured yet.

Still haven't got a clue were the other exception (the null reference) comes from though.
# dommer 6/22/2005 2:09 PM (edited 6/22/2005 2:13 PM)
I've tried to reinstall the hole thing (version 0.8) running postgreSQL.
I still have problems with the feeds.

Server error in '/' application
Description: Error processing request.

Error Message: HTTP 500.

Stack Trace:

System.Exception: Unable to get Articles ---> NHibernate.QueryException: in expected: a [from Article a where a.Section.Id = :sectionId and a.Syndicate = :syndicate and a.DateOnline < :now and a.DateOffline > :now order by a.DateOnline desc ]
in <0x007c0> NHibernate.Hql.FromParser:Token (System.String token, NHibernate.Hql.QueryTranslator q)
in <0x0034c> NHibernate.Hql.ClauseParser:Token (System.String token, NHibernate.Hql.QueryTranslator q)
in <0x0027f> NHibernate.Hql.PreprocessingParser:Token (System.String token, NHibernate.Hql.QueryTranslator q)
in <0x000b0> NHibernate.Hql.ParserHelper:Parse (IParser p, System.String text, System.String seperators, NHibernate.Hql.QueryTranslator q)
in <0x0006b> NHibernate.Hql.QueryTranslator:Compile (System.String queryString)--- End of inner exception stack trace ---

in <0x0013d> Cuyahoga.Modules.Articles.ArticleModule:GetRssArticles (Int32 number)
in <0x0032f> Cuyahoga.Modules.Articles.ArticleModule:GetRssFeed ()
in <0x00384> Cuyahoga.Web.Rss:Page_Load (System.Object sender, System.EventArgs e)
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0x00056> System.Web.UI.Control:OnLoad (System.EventArgs e)
in <0x00026> System.Web.UI.Control:LoadRecursive ()
in <0x00149> System.Web.UI.Page:InternalProcessRequest ()
in <0x000a9> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext context)
in <0x00233> System.Web.HttpApplication+ExecuteHandlerState:Execute ()
in <0x0007c> System.Web.HttpApplication+StateMachine:ExecuteState (IStateHandler state, System.Boolean readysync)

and my log-file looks like this:

2005-06-22 23:09:53,449 [65541] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT user0_.userid as userid0_, user0_.updatetimestamp as updateti2_0_, user0_.firstname as firstname0_, user0_.lastlogin as lastlogin0_, user0_.username as username0_, user0_.password as password0_, user0_.lastip as lastip0_, user0_.website as website0_, user0_.inserttimestamp as insertt13_0_, user0_.lastname as lastname0_, user0_.timezone as timezone0_, user0_.email as email0_, user0_.isactive as isactive0_ FROM cuyahoga_user user0_ WHERE user0_.userid = :p0
2005-06-22 23:09:54,162 [65541] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT section0_.sectionid as sectionid7_, section0_.updatetimestamp as updateti2_7_, section0_.nodeid as nodeid7_, section0_.cacheduration as cachedur6_7_, section0_.title as title7_, section0_.moduletypeid as modulety9_7_, section0_.showtitle as showtitle7_, section0_.placeholder as placehol4_7_, section0_.position as position7_, node1_.nodeid as nodeid0_, node1_.updatetimestamp as updateti2_0_, node1_.parentnodeid as parentno9_0_, node1_.title as title0_, node1_.templateid as templateid0_, node1_.siteid as siteid0_, node1_.shortdescription as shortdes4_0_, node1_.position as position0_, node1_.culture as culture0_, node1_.showinnavigation as showinna7_0_, node2_.nodeid as nodeid1_, node2_.updatetimestamp as updateti2_1_, node2_.parentnodeid as parentno9_1_, node2_.title as title1_, node2_.templateid as templateid1_, node2_.siteid as siteid1_, node2_.shortdescription as shortdes4_1_, node2_.position as position1_, node2_.culture as culture1_, node2_.showinnavigation as showinna7_1_, template3_.templateid as templateid2_, template3_.basepath as basepath2_, template3_.templatecontrol as template5_2_, template3_.css as css2_, template3_.updatetimestamp as updateti2_2_, template3_.name as name2_, site4_.siteid as siteid3_, site4_.updatetimestamp as updateti2_3_, site4_.name as name3_, site4_.defaultplaceholder as defaultp6_3_, site4_.homeurl as homeurl3_, site4_.usefriendlyurls as usefrien8_3_, site4_.templateid as templateid3_, site4_.defaultculture as defaultc5_3_, site4_.roleid as roleid3_, site4_.webmasteremail as webmaste7_3_, role5_.roleid as roleid4_, role5_.permissionlevel as permissi4_4_, role5_.updatetimestamp as updateti2_4_, role5_.name as name4_, template6_.templateid as templateid5_, template6_.basepath as basepath5_, template6_.templatecontrol as template5_5_, template6_.css as css5_, template6_.updatetimestamp as updateti2_5_, template6_.name as name5_, modulety7_.moduletypeid as modulety1_6_, modulety7_.path as path6_, modulety7_.editpath as editpath6_, modulety7_.classname as classname6_, modulety7_.assemblyname as assembly3_6_, modulety7_.name as name6_ FROM cuyahoga_section section0_ left outer join cuyahoga_node node1_ on section0_.nodeid=node1_.nodeid left outer join cuyahoga_node node2_ on node1_.parentnodeid=node2_.nodeid left outer join cuyahoga_template template3_ on node2_.templateid=template3_.templateid left outer join cuyahoga_site site4_ on node2_.siteid=site4_.siteid left outer join cuyahoga_role role5_ on site4_.roleid=role5_.roleid left outer join cuyahoga_template template6_ on node1_.templateid=template6_.templateid left outer join cuyahoga_moduletype modulety7_ on section0_.moduletypeid=modulety7_.moduletypeid WHERE section0_.sectionid = :p0
2005-06-22 23:09:54,173 [65541] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT site0_.siteid as siteid1_, site0_.updatetimestamp as updateti2_1_, site0_.name as name1_, site0_.defaultplaceholder as defaultp6_1_, site0_.homeurl as homeurl1_, site0_.usefriendlyurls as usefrien8_1_, site0_.templateid as templateid1_, site0_.defaultculture as defaultc5_1_, site0_.roleid as roleid1_, site0_.webmasteremail as webmaste7_1_, role1_.roleid as roleid0_, role1_.permissionlevel as permissi4_0_, role1_.updatetimestamp as updateti2_0_, role1_.name as name0_ FROM cuyahoga_site site0_ left outer join cuyahoga_role role1_ on site0_.roleid=role1_.roleid WHERE site0_.siteid = :p0
2005-06-22 23:09:54,249 [65541] INFO NHibernate.Impl.BatcherImpl [] <> - Preparing SELECT cuyahoga0_.sectionid as sectionid__, cuyahoga0_.Value as Value__, cuyahoga0_.Name as Name__ FROM cuyahoga_sectionsetting cuyahoga0_ WHERE cuyahoga0_.sectionid = :p0


Any clue?
# martijnb 6/22/2005 2:49 PM
Yes, that's the exception that you get after requesting an rss feed right after starting the application (see above). Try requesting the feed a second time and see if you still get the nullreference exception.
# dommer 6/24/2005 2:33 PM
same error :(

you can try it yourself at http://cuyahoga.troelsrichter.com. Feel free to login as admin with default password if it helps.

I really want this to work, I find the combination og NHibernate and a Mono ASP.NET application really interesting.
# martijnb 6/25/2005 10:30 AM
I took the freedom of logging in on your site and I saw that the cache duration for the article module was 0 (no cache). Changed this to 10 (seconds) and guess what, the rss feed is working!

Now this is obviously a bug and perhaps one that doesn't have anything to do with MySQL or PostgreSQL and maybe it's not even mono-related. I'm going to sort it out.
# martijnb 6/25/2005 1:15 PM
Blegh, that was really a stupid bug. The RSS content was always retrieved from the cache, even when the cache duration was set to 0. Surprisingly this worked on MS .NET.

Anyway, attached is a fixed version of Rss.aspx.cs. Good luck!