[jboss-jira] [JBoss JIRA] Created: (JBRULES-2348) unable to resolve Type Declaration class
Richard Ambridge (JIRA)
jira-events at lists.jboss.org
Fri Nov 27 04:39:29 EST 2009
unable to resolve Type Declaration class
----------------------------------------
Key: JBRULES-2348
URL: https://jira.jboss.org/jira/browse/JBRULES-2348
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler, drools-guvnor
Affects Versions: 5.1.0.M1, 5.0.1.FINAL
Environment: Ubuntu 8.04
Reporter: Richard Ambridge
Assignee: Mark Proctor
Attachments: repository_export.zip
Using the following code to create a Knowledge Base from a guvnor compiled pkg, (download the pkg and put in /tmp/my.pkg)
KnowledgeBaseConfiguration conf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
conf.setOption(EventProcessingOption.STREAM);
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
try {
File f = new File("/tmp/my.pkg");
InputStream stream = new FileInputStream(f);
if (stream == null) {
jlog.fatal("Unable to find rule pkg");
} else {
jlog.info("adding pkg");
builder.add(ResourceFactory.newInputStreamResource(stream), ResourceType.PKG);
}
} catch (Exception e) {
e.printStackTrace();
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(conf);
kbase.addKnowledgePackages(builder.getKnowledgePackages());
jlog.info("setup creating knowledge session");
ksession = kbase.newStatefulKnowledgeSession();
jlog.info(" setup ksession created");
The pkg was created from Guvnor.
If in the package declaration area in Guvnor, (where you put the import statements)
If I put
declare Signature
@role ( event )
end
then build the package, save it to disk /tmp/my.pkg
on startup I get:
[#|2009-11-24T14:50:38.944+0000|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=12;_ThreadName=pool-1-thread-3;_RequestID=7c35064d-757e-4519-b5eb-433db89e168d;|org.drools.RuntimeDroolsException: unable to resolve Type Declaration class 'Signature'
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:754)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:515)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
I am unable to declare an object as an event type in guvnor. This prevents any rules creation and compiling :(
Attached is the workbench from eclipse, and the guvnor repository export
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list