Hi All,
We have implemented business logic with the drools (5.2.0). I have export this project as jar file and placed in web module in WEB-INF/lib folder. When we test this drools jar from web module in local machine, it is working fine and accessing the rules file.
But when export this war file to DEV box (that is running in Windows) and try access to the drools, we are getting the following exception.
16 Dec 2011 14:27:13 ERROR EligibilityImpl:87 - Error Message is...java.lang.RuntimeException: Unable to parser Reader
at org.drools.compiler.DrlParser.getParser(DrlParser.java:314)
at org.drools.compiler.DrlParser.parse(DrlParser.java:142)
at org.drools.compiler.DrlParser.parse(DrlParser.java:148)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:275)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:451)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at gov.il.dhs.ccms.impl.EligibilityImpl.readKnowledgeBase(EligibilityImpl.java:251)
at gov.il.dhs.ccms.impl.EligibilityImpl.executeEligibilityRules(EligibilityImpl.java:72)
at gov.il.dhs.ccms.eligibility.EligibilityServiceImpl.getEligibilityResults(EligibilityServiceImpl.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
at flex.messaging.AsyncMessageBroker.routeMessageToService(AsyncMessageBroker.java:563)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:592)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:525)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:751)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:126)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: sun.io.MalformedInputException
at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:262)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:316)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:366)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:252)
at java.io.InputStreamReader.read(InputStreamReader.java:212)
at java.io.Reader.read(Reader.java:143)
at org.drools.io.impl.ReaderInputStream.read(ReaderInputStream.java:122)
at java.io.InputStream.read(InputStream.java:113)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:354)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:252)
at java.io.InputStreamReader.read(InputStreamReader.java:212)
at org.antlr.runtime.ANTLRReaderStream.load(ANTLRReaderStream.java:82)
at org.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:68)
at org.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:52)
at org.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:48)
at org.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:40)
at org.drools.compiler.DrlParser.getParser(DrlParser.java:309)
... 43 more
The project structure of drools projects is :
/src
-- gov
--il
-- dhs
-- rules
-- abc.drl
I have added the drl file to KnowledgeBuilder like this
kbuilder.add(ResourceFactory.newClassPathResource("gov/il/dhs/ccms/rules/Eligibility.drl"), ResourceType.DRL).
I added InputSteamReader with encoding type "UTF-8" also, it is working in local but not in DEV box.
Could u please help us to solve this issue.