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
"[SOLVED] Error: Content is not allowed in prolog"
michaelhecht
Member Posts: 89 Maven
Hello,
I just started to try to implement RapidMiner into my own application. To make it easier for me I use Jython instead of Java,
which makes the code quite small:
I just started to try to implement RapidMiner into my own application. To make it easier for me I use Jython instead of Java,
which makes the code quite small:
On running it i get a problem in the Process-line:
import com.rapidminer.RapidMiner as RapidMiner
import com.rapidminer.Process as Process
import com.rapidminer.RapidMiner.ExecutionMode as ExecutionMode
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init()
process = Process('D:/RapidMinerRepository/PolynomOptimierung.rmp')
result = process.run()
print result
The workflow works well in the GUI and in the forum I didn't find any solution, so how to fix it?
Dec 8, 2011 7:56:26 AM com.rapid_i.Launcher ensureRapidMinerHomeSet
...
[Fatal Error] :1:1: Content is not allowed in prolog.
Traceback (most recent call last):
File "jyRapid.py", line 7, in <module>
process = Process('D:/RapidMinerRepository/PolynomOptimierung.rmp')
at com.rapidminer.Process.readProcess(Process.java:1080)
at com.rapidminer.Process.readProcess(Process.java:1055)
at com.rapidminer.Process.<init>(Process.java:254)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:210)
com.rapidminer.tools.XMLException: com.rapidminer.tools.XMLException: Cannot parse document: Content is not allowed in prolog.
Tagged:
0
Best Answer
-
kludikovsky Member Posts: 30 Maven
This saved my day.
The files was sored as UTF-8. SImply converted to ANSI solved the issue.Thnx,
0
Answers
please open your .rpm file with a text editor and check if there is any other character before the "<?xml..." part.
If so remove it and try to run your application again. If there is no other character it has to be an encoding problem.
Try to save the .rpm file with another enconding.
Regards,
Nils
if I use "UTF-8" but fails with the same error by using "UTF-16": Process(...) fails with both "UTF-8" and "UTF-16". Which coding I can test instead?
The Java XML parser took both, Process(...) took none.
The error message is the same. So either I always install my software with the wrong configuration or
there is a basic error in the Java code ?!
Here is the XML: Netbeans output:
I generated manually a new file with the only content: The result: It seems that the error message is not appropriate to the error!
Sometimes I really wonder if someone really reads the posts or not!
Here is the quite simple solution of the quite stupid error:
original code corrected code Tomorrow I will send working code for the Jython version (for those who are interested).
Extended: See http://rapid-i.com/rapidforum/index.php/topic,4408.0.html
Best regards, Michael
But i'm glad you solved it!
Cheers,
Nils