Developer forum

Forum » Development » 'Expression must evaluate to a node-set' error after updating

'Expression must evaluate to a node-set' error after updating

Martin Nielsen
Reply

Hi DW,

I just updated a custom solution to Application(8.4.0.21) from 8.4.0.7, and now i get this error:

Server Error in '/' Application.


Expression must evaluate to a node-set.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[XPathException: Expression must evaluate to a node-set.]
   MS.Internal.Xml.XPath.XPathParser.ParseNodeTest(AstNode qyInput, AxisType axisType, XPathNodeType nodeType) +7386830
   MS.Internal.Xml.XPath.XPathParser.ParseStep(AstNode qyInput) +89
   MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput) +27
   MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput) +40
   MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput) +27
   MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput) +29
   MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput) +29
   MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput) +29
   MS.Internal.Xml.XPath.XPathParser.ParseExpresion(AstNode qyInput) +46
   MS.Internal.Xml.XPath.QueryBuilder.Build(String query, Boolean allowVar, Boolean allowKey) +91
   System.Xml.XPath.XPathExpression.Compile(String xpath, IXmlNamespaceResolver nsResolver) +53
   System.Xml.XPath.XPathNavigator.SelectSingleNode(String xpath) +21
   Dynamicweb.Settings.Persist() +520
   Dynamicweb.Base.SetGs(String Path, String Value, Boolean UseCDATA) +73
   Dynamicweb.Frontend.Update.SetSolutionRenewVersion(String InternalVersion) +188
   Dynamicweb.Frontend.Update.RunUpdate(String filepath) +697
   Dynamicweb.Frontend.Update..ctor() +679
   Dynamicweb.Frontend.GlobalAsaxHandler.ApplicationStart(Object sender, EventArgs e) +806
   Dynamicweb.Frontend.GlobalAsaxHandler.Application_AuthenticateRequest(Object sender, EventArgs e) +471
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

It seems my Globalsettings file is invalid now. Any idea how i can fix this?

// Martin

 


Replies

 
Mikkel Ricky
Reply

You probably have comments or CDATA sections in your GlobalSettings.aspx. The global settings reader cannot handle these.

Best regards,
Mikkel

 
Martin Nielsen
Reply

Okay, it seems that recycling the app fixed the error.

But now i still get the error i was trying to fix.

On login i get this error:

System.ArgumentException: Parameter 'idList' contains no IDs

Shouldn't it be gone in 8.4.0.21?

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Martin,

When you say "On login", do you mean in frontend or in backend? I suspect this is in frontend. If that is the case, you probably have an old cart in your context, which is playing tricks on you. Try clearing your cookies and removing the cartid from the login user from the AccessUser table, or EcomOrderContextAccessUserRelation table if you're using Order Contexts.

- Jeppe

 
Martin Nielsen
Reply

Hi Jeppe,

It's in the frontend.

I tried your suggestions, but i still get the error.

In AccessUser table, 'AccessUserCartID' is empty, and EcomOrderContextAccessUserRelation is empty aswell.

I tried doing ?cartcmd=emptycart but that didn't do much either.

// Martin

 

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Do you have a link that I can check? If you do not want to publish the link, you can email me.

- Jeppe

 
Martin Nielsen
Reply

You've got mail.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

I've looked at the site, and the issue stems from your custom Solr content module. You call GetProductsByProductIDs(string[], bool, string) but it would seem that the array is empty. You should check that the array does indeed contain at least one element before calling the method.

We have a few tasks in our backlog to clean up the API, and I'll make sure to add this method to the list. In the meantime, you have to solve the issue as described above.

 

You must be logged in to post in the forum