Hello,

I still have a problem loading facts using XStream. The last line of the following code triggers a com.thoughtworks.xstream.mapper.CannotResolveClassException.

            // load up the knowledge base
            KnowledgeBase kbase = readKnowledgeBase();
            StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
           
            // Make the results, in this case the FactHandles, available to the user
            Action executeResultHandler = PipelineFactory.newExecuteResultHandler();

            // Insert the transformed object into the session associated with the PipelineContext
            KnowledgeRuntimeCommand insertStage = PipelineFactory.newStatefulKnowledgeSessionInsert();
            insertStage.setReceiver( executeResultHandler );
               
            // Create the transformer instance and create the Transformer stage, where we are going from Xml to Pojo.
            XStream xstream = new XStream();
            Transformer transformer = PipelineFactory.newXStreamFromXmlTransformer( xstream );
            transformer.setReceiver( insertStage );

            // Create the start adapter Pipeline for StatefulKnowledgeSessions
            Pipeline pipeline = PipelineFactory.newStatelessKnowledgeSessionPipeline( ksession );
            pipeline.setReceiver( transformer );

            // Instantiate a simple result handler and load and insert the XML
            ResultHandlerImpl resultHandler = new ResultHandlerImpl();
            InputStream is = new FileInputStream("D:/workspaces/prise_main_drools/src/main/rules/lproduits.xml");
            pipeline.insert( is, resultHandler );

Any idea ?
Thank you in advance.
Regards,
Benoît




Télécharger en toute sécurité sur Internet ? La solution avec Internet Explorer 8