[jboss-jira] [JBoss JIRA] (DROOLS-704) Java scriptTask compilation error reports invalid line

kenji uno (JIRA) issues at jboss.org
Fri Feb 17 07:56:00 EST 2017


    [ https://issues.jboss.org/browse/DROOLS-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13365408#comment-13365408 ] 

kenji uno commented on DROOLS-704:
----------------------------------

[-Ddrools.dump.dir|http://blog.athico.com/2008/02/looking-under-drools-skirt.html] may be helpful to trace Java scriptTask compilation error.

Like: _mvn -Ddrools.dump.dir="C:\folder" kie:build_

> Java scriptTask compilation error reports invalid line
> ------------------------------------------------------
>
>                 Key: DROOLS-704
>                 URL: https://issues.jboss.org/browse/DROOLS-704
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 6.1.0.Final
>         Environment: Windows 7 x64,
> jdk1.6.0_45 x64
> jbpm 6.1.0.Final
>            Reporter: Владимир Боднарчук
>            Assignee: Petr Široký
>            Priority: Minor
>
> In case of a compilation error inside the scriptTask java code, the line and the column reported inside the org.drools.compiler.kie.builder.impl.MessageImpl are incorrect.
> The MessageImpl.getPath() should also return a path with the node id that contains the compilation error.
> To reproduce:
> {code:java}
> KieHelper kieHelper = new KieHelper();
> kieHelper.addResource(ResourceFactory.newClassPathResource("sample-jbpm6.bpmn"));
> Results res =  kieHelper.verify();
> for (Message msg : res.getMessages()) {
>      System.out.println("Error: " + msg);
> }
> if (res.hasMessages(Message.Level.ERROR)) {
>      throw new IllegalStateException("Could not verify the workflow");
> }
> {code}
> {noformat}
> Error: class org.drools.compiler.kie.builder.impl.MessageImpl
> [main] ERROR org.drools.compiler.kie.builder.impl.AbstractKieModule - Unable to build KieBaseModel:defaultKieBase
> Process Compilation error : Process org.jbpm.Hello World(com.sample.bpmn.hello)
> 	org/jbpm/Process_org$u46$jbpm$u46$Hello_World265679914.java (9:416) : Syntax error on token "halskdjfh", delete this token
> Exception in thread "main" java.lang.IllegalStateException: Could not verify the workflow
> 	at Main.main(Main.java:26)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Process finished with exit code 1
> {noformat}
> I've tested with both with "ECLIPSE" and "NATIVE" as values of the "drools.dialect.java.compiler".



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)



More information about the jboss-jira mailing list