[
http://jira.jboss.com/jira/browse/JBRULES-557?page=comments#action_12347726 ]
Edson Tirelli commented on JBRULES-557:
---------------------------------------
Commited fix into 3.0.x branch in revision #7856:
Sending drools-core/src/main/java/org/drools/rule/PackageCompilationData.java
Sending drools-core/src/main/java/org/drools/util/asm/ClassFieldInspector.java
Transmitting file data ..
Committed revision 7856.
Commited into trunk in revision #7857:
Sending drools-core/src/main/java/org/drools/rule/PackageCompilationData.java
Sending drools-core/src/main/java/org/drools/util/asm/ClassFieldInspector.java
Transmitting file data ..
Committed revision 7857.
Although, I must warn that it will be easy to make it work with JANINO, but if you are
using JDT as the compiler, you will need to implement a special classloader for your
dynamically generated classes. This classloader must be able to provide the classes
bytecode for the classes it handles, as JDT requires the actual bytecodes to compile the
rules. So, to be short, your classloader must implement the method:
public InputStream getResourceAsStream(final String name) {
if( name is a dynamically generated class )
return <bytecode for the given dynamically generated class>
else
return super.getResourceAsStream( name );
}
I have a sample code that works and will provide instructions later on how to do it. Need
to clean it up first.
Dynamically generated classes not accessed by drools classloader
----------------------------------------------------------------
Key: JBRULES-557
URL:
http://jira.jboss.com/jira/browse/JBRULES-557
Project: JBoss Rules
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 3.0.4
Reporter: Jeff DeLong
Assigned To: Edson Tirelli
Fix For: 3.0.5
Class generation example required generated classes to be written to files system in
order to be accessed by the drools classloader. Believe this was not a requirement in
previous releases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira