<br> Krishnan,<br><br> As your files have different package names:<br><br>com.company.a;<br>com.company.b;<br> <br> You need to use different package builders for them. I.e., you can use the same PackageBuilder to build multiple files only if the files share the same package name.
<br><br> []s<br> Edson<br><br> <br><div><span class="gmail_quote">2007/8/22, Krishnan <<a href="mailto:krishiyer@gmail.com">krishiyer@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br clear="all">Hi All, <br><br>When I migrated to use the latest 4.0 GA release jars, loading of my rule files fails. <br><br>I have basically split my rule files into hierarchies as below :- <br><br>Directory structure
<br>
<br>rules\a\A.drl<br>rules\b\B.drl<br><br>A.drl <br><br>com.company.a;<br><br>some rules ... <br><br>B.drl <br><br>com.company.b;<br><br>some rules ... <br><br>Java code to load the rules<br><br>                //read in the source<br>
                final Reader source = new InputStreamReader(new FileInputStream(ruleFile));<br><br>                //this will parse and compile in one step<br>                //NOTE: There are 2 methods here, the one argument one is for normal DRL.<br>                builder.addPackageFromDrl
(source);<br><br>builder is created as follows :- <br><br> private PackageBuilder getPackageBuilder() {<br>                //Use package builder to build up a rule package.<br>                //An alternative lower level class called "DrlParser" can also be used...
<br><br>                PackageBuilderConfiguration conf = new PackageBuilderConfiguration();<br> JavaDialectConfiguration javaConf = (JavaDialectConfiguration) conf.getDialectConfiguration( "java" );<br>                javaConf.setJavaLanguageLevel
("1.5");<br>                PackageBuilder builder = new PackageBuilder(conf);<br><br>                return builder;<br> }<br><br>Exception I get is as follows :- <br><br>EXCEPTION [org.drools.compiler.PackageBuilder$PackageMergeException:
Can't merge packages with different names. This package: com.makesys.fs.is.dnpiac.vendorBehaviour.snmp - New package: com.makesys.fs.is.dnpiac.vendorBehaviour.cli]<br>STACK [org.drools.compiler.PackageBuilder$PackageMergeException:
Can't merge packages with different names. This package: com.makesys.fs.is.dnpiac.vendorBehaviour.snmp - New package: com.makesys.fs.is.dnpiac.vendorBehaviour.cli<br>        at org.drools.compiler.PackageBuilder.validatePackageName
(PackageBuilder.java:299)<br>        at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:226)<br>        at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:160)<br>        at com.makesys.fs.is.dnpiac.DNPIACConfigReaderHelper.loadRuleFile
(DNPIACConfigReaderHelper.java:359)<br>        at com.makesys.fs.is.dnpiac.DNPIACConfigReaderHelper.loadRuleFiles(DNPIACConfigReaderHelper.java:426)<br>        at com.makesys.fs.is.dnpiac.DNPIACConfigReaderHelper.loadRuleFiles(DNPIACConfigReaderHelper.java
:380)<br>        at com.makesys.fs.is.dnpiac.DNPIACConfigReaderHelper.initializeParams(DNPIACConfigReaderHelper.java:531)<br>        at com.makesys.fs.is.dnpiac.DNPIAutoConfigurationAdapter.collect(DNPIAutoConfigurationAdapter.java:61)
<br>        at com.makesys.fs.app.adapter.BaseAdapter.activate(BaseAdapter.java:177)<br>        at com.makesys.fs.app.adapter.UnicastAdapterImpl.activate(UnicastAdapterImpl.java:109)<br>        at sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
<br>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>        at java.lang.reflect.Method.invoke(Method.java
:585)<br>        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)<br>        at sun.rmi.transport.Transport$1.run(Transport.java:153)<br>        at java.security.AccessController.doPrivileged(Native Method)<br>        at sun.rmi.transport.Transport.serviceCall
(Transport.java:149)<br>        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)<br>        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)<br>        at java.lang.Thread.run(Thread.java
:595)<br>]<br><br><br>Not sure what the issue is. Any ideas ?<br><br>TIA, <br>Krishnan<br><span class="sg"><br>-- <br>Sivaramakrishna Iyer Krishnan (Anand) <br><br>Never assume the obvious is true. <br>- William Safire
</span><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div>
<br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>