This discussion is archived
7 Replies Latest reply: Feb 8, 2012 2:15 PM by 916325 RSS

Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"

Patrick Devine Newbie
Currently Being Moderated
Hello,

I'm wondering if someone can help me understand what is causing a persistent web server error that seems to be related to entities and/or instance creation. Lately, after building with screens and clicking on the top-level goal, I'll get this generic error:

-----
An error occurred trying to process your request.
This error has been logged and is available in the application logs.

For support and assistance please contact support@domain.local.
-----

I then check the Embedded Web Server Output, and see the text pasted at the bottom of this post - the key error seeming to be "java.lang.IllegalArgumentException: Entity instance does not match expected entity".

Observations:

- It seems to occur after I've made some significant changes to my data model: merging two entities, or switching relationships to being inferred.

- There are no errors or warnings in the "Error List" and all documents are compiling successfully.

- It only happens when I build with screens. I can 'build', or 'build and debug' without screens successfully.

- The most recent occurrence was after I had converted a few relationships to "Inferred" and resolved all compiling errors.

- It only occurs after clicking on the top-level goal, and sometimes a few screens afterwards. By switching most of my relationships back to non-inferred (except for one), I've been able to get some of the screens working - up until I arrive at the screen that involves creating instances for the second entity involved in the remaining inferred relationship.

- The remaining inferred relationship that I was suspecting as a cause seems to be working correctly (i.e. I can see that the instances were connected in the Data tab, even after the error has appeared in the web output).


I would be very grateful for any assistance with this error, as it's become somewhat of a time sink and I've already tried a few angles for troubleshooting it.

Thanks!
- Patrick



Embedded Web Server Output:

Deploying application
Jul 18, 2011 2:35:18 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\projects\[project name]\Release\web-determinations\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Server startup complete!
OK - Tomcat server started
4 [http-127.0.0.1-9000-Processor4] ERROR com.oracle.determinations.web.platform.servlet.WebDeterminationsServletUtility - java.lang.IllegalArgumentException: Entity instance does not match expected entity
java.lang.IllegalArgumentException: Entity instance does not match expected entity
     at com.oracle.determinations.engine.local.RelationshipRule.backwardChainInternalItem(RelationshipRule.java:209)
     at com.oracle.determinations.engine.local.RelationshipRule.backwardChainRelationshipItem(RelationshipRule.java:132)
     at com.oracle.determinations.engine.local.eval.RelationshipExpression.backwardChain(RelationshipExpression.java:216)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleTableValue.backwardChain(RuleTableValue.java:264)
     at com.oracle.determinations.engine.local.eval.ExpressionAttributeRef.backwardChain(ExpressionAttributeRef.java:122)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleTableValue.backwardChain(RuleTableValue.java:264)
     at com.oracle.determinations.engine.local.eval.ExpressionAttributeRef.backwardChain(ExpressionAttributeRef.java:122)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleTableValue.backwardChain(RuleTableValue.java:264)
     at com.oracle.determinations.engine.local.eval.ExpressionAttributeRef.backwardChain(ExpressionAttributeRef.java:122)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleSimpleValue.backwardChain(RuleSimpleValue.java:212)
     at com.oracle.determinations.engine.local.eval.ExpressionAttributeRef.backwardChain(ExpressionAttributeRef.java:122)
     at com.oracle.determinations.engine.local.eval.RelationshipExpression.backwardChain(RelationshipExpression.java:223)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleSimpleValue.backwardChain(RuleSimpleValue.java:211)
     at com.oracle.determinations.engine.local.eval.ExpressionAttributeRef.backwardChain(ExpressionAttributeRef.java:122)
     at com.oracle.determinations.engine.local.eval.ExpressionScopeSelect.backwardChain(ExpressionScopeSelect.java:40)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleTableValue.backwardChain(RuleTableValue.java:264)
     at com.oracle.determinations.engine.local.eval.ExpressionAttributeRef.backwardChain(ExpressionAttributeRef.java:122)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.RelationshipExpression.backwardChain(RelationshipExpression.java:223)
     at com.oracle.determinations.engine.local.eval.SimpleExpression.backwardChain(SimpleExpression.java:101)
     at com.oracle.determinations.engine.local.eval.ExpressionEvaluation.backwardChain(ExpressionEvaluation.java:102)
     at com.oracle.determinations.engine.local.RuleSimpleValue.backwardChain(RuleSimpleValue.java:211)
     at com.oracle.determinations.engine.local.LocalAttribute.backwardChain(LocalAttribute.java:562)
     at com.oracle.determinations.engine.local.LocalAttribute.getRelevanceReport(LocalAttribute.java:515)
     at com.oracle.determinations.interview.engine.local.AttributeGoal.getNextScreen(AttributeGoal.java:113)
     at com.oracle.determinations.interview.engine.local.LocalInterviewSession.getNextScreen(LocalInterviewSession.java:213)
     at com.oracle.determinations.web.platform.controller.actions.InvestigateAction.submit(InvestigateAction.java:99)
     at com.oracle.determinations.web.platform.servlet.WebDeterminationsServlet.doPost(WebDeterminationsServlet.java:102)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at com.oracle.determinations.web.platform.util.CharsetFilter.doFilter(CharsetFilter.java:46)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
     at java.lang.Thread.run(Unknown Source)

Edited by: Patrick Devine on Jul 18, 2011 3:23 PM
  • 1. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    KristyVanDerVlist Pro
    Currently Being Moderated
    Hi Patrick,

    Which version are you using? There were some known issues relating to the evaluation of screen orders that were fixed in 10.2 so if you're using a version prior to that can you upgrade and if so does that fix the issue? If you are 10.2 or higher and this problem is occurring, is it possible for you to send me your rulebase project or a version of it that reproduces the problem? The stack trace indicates that the engine is failing to evaluate the rule that infers a relationship correctly but I can't tell what the root cause is without being able to see what rule it's evaluating.



    Thanks,
    Kristy
  • 2. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    Patrick Devine Newbie
    Currently Being Moderated
    Hi Kristy,

    I'm using v. 10.2.0.110. Thanks for offering to look at the rulebase directly - I'll follow up directly via email.

    Cheers,
    - Patrick
  • 3. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    Patrick Devine Newbie
    Currently Being Moderated
    ... as I was prepping a rulebase to send over, I encountered a new type of error for the first time. In case it's related or sheds any light on the situation, I'll describe it here. I can't remember what, if anything, I changed in the rulebase, but it's now reliably giving me a 404 error when I try to debug with screens.

    http://i.imgur.com/l1rLj.png

    When I click on the message in red, this is what comes up:

    http://i.imgur.com/ywM2f.png

    I've restarted my laptop (to no avail), and also have confirmed that this doesn't occur with previous versions of the rulebase. I realize it's a long shot but thought I'd share it anyway.

    I'll revert to a previous version in an attempt to get screens working again so I can demonstrate the original error.

    Thanks,
    - Patrick
  • 4. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    KristyVanDerVlist Pro
    Currently Being Moderated
    Hi Patrick,

    The bad news is that your issue is due to a bug in the Determinations Engine. The good news is that there is a workaround. Basically there’s an implied directionality for all relationships which, for inferred relationships is defined by the direction in which you declared the relationship in the properties file. The problem only happens if you write your membership rule in the reverse direction to the one in which it was originally declared. In your case because your membership rule concludes the relationship ‘the benefits of the benefit plan’ you need to make sure that your relationship was declared in that direction as well. To do that, you’ll need to delete your existing relationship in the properties file and then create it as follows:

    Source: the benefit plan
    Target: the benefit
    Relationship Type: Inferred (Many to Many)
    Text: the benefits of the benefit plan
    Reverse Text: the benefit plan of the benefit

    We will fix the issue in the next release.

    Thanks,
    Kristy
  • 5. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    KristyVanDerVlist Pro
    Currently Being Moderated
    That one looks like its being caused by either Web Determinations failing to deploy to the Embedded Tomcat properly or your rulebase wasn't able to be loaded. Can you provide logs from the Embedded Tomcat Window?
  • 6. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    Patrick Devine Newbie
    Currently Being Moderated
    Hi Kristy,

    The workaround you described above is resolving the issues. Thanks for your help in tracking this down for us!

    - Patrick
  • 7. Re: Explaining a WD Error: "Entity Instance Does Not Match Expected Entity"
    916325 Newbie
    Currently Being Moderated
    Hello,

    Longtime reader, first time poster.

    Just ran into this problem inside OPM while running the debugger using 10.3. We recently changed several One-to-Many relationships to be inferred, and the original proof while it seemed to work just, seems to be the cause of the issue.

    After reading this thread, I flipped the proof around, starting with the entity that used to be on the "to One" side of the old relationship, and the problem went away.

    Just thought I'd add to this post before anyone else started pulling their hair out on a similar issue :)

    -Dan

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points