4 Replies Latest reply: May 10, 2012 7:22 AM by 936421 RSS

    Jdeveloper wierdness - getFactByType found more than one instance

    873926
      Hi All,

      Has anyone seen this before? It feels like metadata corruption in the rules engine.

      I'm connecting to a decision service with some java code, and after copying rules from another project (though this might not be the cause) I'm getting:

      Running Rules
      +15-Jul-2011 11:08:46 oracle.rules.rl.RuleSession logIt+
      SEVERE: The RL function getFactByType found more than one instance of the fact type, uk.co.nrol3factory.xsd.Nrol3User.
      at line 100 column 19
      +15-Jul-2011 11:08:46 oracle.rules.rl.RuleSession logIt+
      SEVERE: RLRuntimeException: The RL function getFactByType found more than one instance of the fact type, uk.co.nrol3factory.xsd.Nrol3User.
      +     at line 100 column 19 /Function(MyDecisionService)/Action[7]+
      +     at line 100 column 3 /Function(MyDecisionService)/Action[7]+

      Exception in thread "main" oracle.rules.rl.exceptions.RLRuntimeException: The RL function getFactByType found more than one instance of the fact type, uk.co.nrol3factory.xsd.Nrol3User.
      at line 100 column 19
      +     at oracle.rules.rl.exceptions.ExceptionFactory.createMultipleResultException(ExceptionFactory.java:1266)+
      +     at oracle.rules.rl.engine.jess.GetFactByType.call(RLFunctions.java:858)+

      etc.

      Furthermore, I shut down JDev and restarted, and all the rules I copied from the other project have gone!

      Any ideas? Anyone?

      Rory

      Edited by: 870923 on 15-Jul-2011 03:21

      Edited by: 870923 on 15-Jul-2011 03:21
        • 1. Re: Jdeveloper wierdness - getFactByType found more than one instance
          873926
          Update:

          I deleted the decision service and built the whole thing up from scratch again and got back to the point where I was when the error occurred, but this time with no exception. It doesn't make any sense. It smells like some sort of caching problem.

          Well, this could well be my final posting on this forum. I've put forward four separate questions over the last couple of weeks and have had back not one reply. After battling with JDeveloper for two weeks now I go before the decision panel tomorrrow to recommend an interfaces approach for the software we are building. Given the battles I've had with SOA Suite/JDev, combined with lack of transparency of errors or meaningful logging, as well as the 0% return on the questions I've asked in this forum... what can I say?
          • 2. Re: Jdeveloper wierdness - getFactByType found more than one instance
            873926
            Figured this one out. Nothing to do with data dictionaries. It was because I was creating a new object in a rule which wasn't declared as a return type.
            • 3. Re: Jdeveloper wierdness - getFactByType found more than one instance
              879282
              I know this is an old thread, but I'm sure someone else will get this error like I and the original poster did.

              I got the same error and couldn't figure out what it was. There were no gaps in the rules and after reading through the XML I couldn't find this "more than one instance" of a fact type.

              So I ended up deleting the rule and it's references, recreating it with the same rules and values and it worked. I don't know why this works as the XML should be the same.
              If anyone else comes up with a way around this error I'd be glad to hear it.
              • 4. Re: Jdeveloper wierdness - getFactByType found more than one instance
                936421
                You are creating more than one instance of the same fact and Rules Engine cannot decide which instance to use. This happens when more than one rule creating the same type of instance is scheduled to fire. You may be expecting a modify statement to disable one of the rules but that particular rule which you expect to be disabled might be firing before the rule that disables it.