Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7.28.0.Final
    • Fix Version/s: None
    • Component/s: core engine
    • Labels:
      None
    • Sprint:
      2019 Week 44-46 (from Okt 28)
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      I had issue with standard Spring project. My configuration ended with following exception:

      Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
      	at org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:117)
      

      Because of this I have to setup KieSession this way:

      KieServices kieServices = KieServices.Factory.get();
      ReleaseId kieRelease = kieServices.newReleaseId("sk.f4s", "encounter-rule", "1.0.0-SNAPSHOT");
      KieContainer kieContainer = kieServices.newKieContainer(kieRelease, this.getClass().getClassLoader());
      kieSession = kieContainer.newStatelessKieSession();
      

      After this everything works fine. However I want to reload my kBase with scanner. I add following two lines:

      kieScanner = kieServices.newKieScanner(kieContainer);
      kieScanner.start(1000l);
      

      After this following exception is raised:

      Exception in thread "Timer-0" java.lang.RuntimeException: Unable to load dialect 'org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration'
      	at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.addDialect(KnowledgeBuilderConfigurationImpl.java:394)
      	at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.buildDialectConfigurationMap(KnowledgeBuilderConfigurationImpl.java:380)
      	at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.init(KnowledgeBuilderConfigurationImpl.java:235)
      	at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.init(KnowledgeBuilderConfigurationImpl.java:187)
      	at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.<init>(KnowledgeBuilderConfigurationImpl.java:155)
      	at org.drools.compiler.kie.builder.impl.AbstractKieProject.getBuilderConfiguration(AbstractKieProject.java:302)
      	at org.drools.compiler.kie.builder.impl.AbstractKieProject.createKnowledgeBuilder(AbstractKieProject.java:288)
      	at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:213)
      	at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:75)
      	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:271)
      	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieModule(KieBuilderImpl.java:264)
      	at org.drools.compiler.kie.builder.impl.InternalKieModule.build(InternalKieModule.java:120)
      	at org.kie.scanner.KieRepositoryScannerImpl.updateKieModule(KieRepositoryScannerImpl.java:200)
      	at org.kie.scanner.KieRepositoryScannerImpl.internalUpdate(KieRepositoryScannerImpl.java:185)
      	at org.kie.scanner.KieRepositoryScannerImpl.internalUpdate(KieRepositoryScannerImpl.java:55)
      	at org.drools.compiler.kie.builder.impl.AbstractKieScanner.scanNow(AbstractKieScanner.java:147)
      	at org.drools.compiler.kie.builder.impl.AbstractKieScanner$ScanTask.run(AbstractKieScanner.java:127)
      	at java.util.TimerThread.mainLoop(Timer.java:555)
      	at java.util.TimerThread.run(Timer.java:505)
      Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
      	at org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:117)
      	at org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:78)
      	at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.addDialect(KnowledgeBuilderConfigurationImpl.java:390)
      	... 18 more
      

      I guess reason is that scanner is not using ClassLoader from KieContainer. Of course it will be better to fix reason why 'The Eclipse JDT Core jar is not in the classpath' is raised anyway because I'm using just standard Spring Web project with two Spring contexts (application and Web) what is very standard approach. Compiler IS awailable on classpath only Drools classloader doesn't see it.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                pavel.tavoda Pavel Tavoda
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: