Drools compile hiba a Bonitában

0 votes
asked May 6, 2014 in SzolgInt by borbast (39 points)  

Bonita verzió: 6.2.6
Drools verzió: 5.4.0.Final

Hiba kód:

WARNING: Error while executing connector with id 7
org.bonitasoft.engine.core.connector.exception.SConnectorException: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1
    at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:309)
    at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:145)
    at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:117)
    at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:123)
    at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:73)
    at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
    at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:45)
    at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:113)
    at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:301)
    ... 12 more
Caused by: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.getValue(ConnectorExecutorImpl.java:122)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:107)
    ... 13 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at org.eclipse.jdt.internal.compiler.parser.Parser.consumeCastExpressionWithQualifiedGenericsArray(Parser.java:2083)
    at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5983)
    at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9339)
    at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9571)
    at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9528)
    at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:8126)
    at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:712)
    at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:377)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:422)
    at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:389)
    at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
    at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:371)
    at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:46)
    at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:102)
    at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:1006)
    at org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:842)
    at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:831)
    at org.drools.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:448)
    at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:690)
    at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)
    at hu.bme.mit.inf.servint.raptor.droolslogic.RaptorDroolsAPI.readKnowledgeBase(RaptorDroolsAPI.java:90)
    at hu.bme.mit.inf.servint.raptor.droolslogic.RaptorDroolsAPI.adjustLaptopPrice(RaptorDroolsAPI.java:67)
    at org.mycompany.connector.AdjustLaptopPriceImpl.executeBusinessLogic(AdjustLaptopPriceImpl.java:39)
    at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:74)
    at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:70)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:156)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:139)
    ... 4 more

1 Answer

+1 vote
answered May 6, 2014 by zbendefy (62 points)  
edited May 6, 2014 by zbendefy

Neked mikor történik a hiba?

Nálunk akkor dob hasonló hibát, amikor a knowledgebuilder.add(r, ResourceType.DTABLE, config); metódust hívjuk. Eclipse-ből tökéletesen működik, bonitából nem.

szerk: pontosabban ennél a sornál történik: ResourceFactory.newFileResource(...)

commented May 6, 2014 by zbendefy (62 points)  
edited May 6, 2014 by zbendefy
Megtaláltam a hibát a mienkben. szabály Táblákat (xls) töltöttünk be a drools-ba. A hiba az volt, hogy eclipse-ben működött a ResourceFactory.newFileResource(...) sor, míg bonitában ugyanitt elhasalt egy ArrayOutOfBoundsException: -1 gyel. A probléma az volt, hogy, NEM szabad egyesíteni a CONDITION-nél, ACTION-nél, stb. a cellákat a táblázatban.
commented May 6, 2014 by borbast (39 points)  
Nekünk nem oldotta meg a problémát (továbbra is ugyanazt a hibát kapjuk), de amúgy igen, abban a sorban van a hiba (csak nekünk newUrlPath illetve newClassResourcePath van).
commented May 7, 2014 by zbendefy (62 points)  
Rosszat mondtam, valami dependencia hiba miatt jött elő ez a hiba.

Valami parseoló lib hiányzott csak hülyén jelentek meg az exceptiönök. Ami megoldotta az az, hogy nem mavennel raktuk be a függőségeket, hanem project dependenciesben, és eclipse-ből generáltunk futtatható jart.
...