The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"Cannot read from XML, problem with Weka Classifier"

Vale85Vale85 Member Posts: 1 Learner III
edited June 2019 in Help
Hi, I'm developing a Java application which load and execute a Rapid Miner process stored in a xml file. The application reads from a directory the .mod files requested from the process (these files are the models of some algorithms previously learned), but when reads the Weka algorithms models, like "W-j48", I have the follow errors:

com.rapidminer.operator.UserError: Could not read file 'C:\Programmi\springsource\tc-server-6.0.20.C\webapps\tlicaring\WEB-INF/modelli/wa_j48.mod': java.io.IOException: Cannot read from XML stream, wrong format: WekaClassifier : WekaClassifier.
at com.rapidminer.operator.io.ModelLoader.read(ModelLoader.java:79)
at com.rapidminer.operator.io.ModelLoader.read(ModelLoader.java:51)
at com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:123)
at com.rapidminer.operator.Operator.execute(Operator.java:768)
at com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
at com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:709)
at com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:368)
at com.rapidminer.operator.Operator.execute(Operator.java:768)
at com.rapidminer.Process.run(Process.java:863)
at com.rapidminer.Process.run(Process.java:770)
at com.rapidminer.Process.run(Process.java:765)
at com.rapidminer.Process.run(Process.java:755)
at tlicaring.analisys.RapidMinerAnalisysTgu_wa.run(RapidMinerAnalisysTgu_wa.java:92)
at tlicaring.web.AnalisiFormController.onSubmit(AnalisiFormController.java:51)
at org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:409)
at org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:381)
at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:60)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:379)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Cannot read from XML stream, wrong format: WekaClassifier : WekaClassifier
at com.rapidminer.tools.XMLSerialization.fromXML(XMLSerialization.java:129)
at com.rapidminer.operator.AbstractIOObject.read(AbstractIOObject.java:148)
at com.rapidminer.operator.AbstractIOObject.read(AbstractIOObject.java:192)
at com.rapidminer.operator.io.ModelLoader.read(ModelLoader.java:77)
... 40 more
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: WekaClassifier : WekaClassifier
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:49)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:76)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:60)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:76)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:34)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:113)
at com.thoughtworks.xstream.core.ReferenceByIdMarshallingStrategy.unmarshal(ReferenceByIdMarshallingStrategy.java:14)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:824)
at com.thoughtworks.xstream.XStream$3.readFromStream(XStream.java:1320)
at com.thoughtworks.xstream.core.util.CustomObjectInputStream.readObjectOverride(CustomObjectInputStream.java:75)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
at com.rapidminer.tools.XMLSerialization.fromXML(XMLSerialization.java:123)
... 43 more

I've opened the model and I'v seen that this xml begins with a tag <Weka Classifier>, instead the other models begin with different tags. I suppose that this tag is not recognized from the Xml parser. But this process works very well from the Rapid Miner GUI, so probably I don't link some libraries in my application...all the other models works well, only the Weka model have this problem...someone can help me? please, it's a very urgent question, because I have to deliver this project the next week...thank you very much...
Tagged:

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    I guess you don't have loaded the Weka Extension when starting the integrated RapidMiner. Then RapidMiner can't know the class...

    If you use RapidMiner in an enviroment where support times are critical, you should think about a support subscription, which will give you guaranteed response time. The response times on forum requests are fast in average but depend on our workload if you need help in a minute, become enterprise customer.
    Anyway I hope you had solved it in time.

    Greetings,
      Sebastian
Sign In or Register to comment.