Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

"[SOLVED] Rapidminer R extension [Fatal Error] Content is not allowed in prolog."

ad_astraad_astra Member Posts: 2 Contributor I
edited June 2019 in Help
When trying to install the rapidminer R extension, I got a cryptic error like" Content is not allowed in prolog".  By googling around, I found this cryptic error might be caused by the XML reader barfing on a non-existent file, which in rapidminer's case is being looked for by user fragment documentation, whatever that is?  There are two warnings that pop up relative to this, and in some cases (I'm guessing it depends on your Java version?) causes the cryptic: [Fatal Error] Content is not allowed in prolog.

I was able to FIX this error by going into Rapidminer-->Tools-->Preferences-->R 

the first  field should be your library, /Library/Frameworks/R.framework/Versions/2.15/Resources/library/rJava/jri/libjri.jnilib

and I just copied in anything to the next two fields, so the XML parser wouldn't throw an uncaught exception.  So I just copied the exact same path from above (the one for the dll) into those two fields.  Of course it throws warnings because it isn't expecting the dll but it continues on with just a warning and the R extension works correctly!!!

I spent FOREVER messing with my PATH and R_HOME and JAVA_HOME thinking I was doing something wrong.  Maybe if my PATHs are set correctly then rapidminer would know where to find what its looking for, because I did actually manage to get the R extension working on my computer at some point in the past without using this funny work around.  Maybe there a command line option that can suppress that error and turn it into a warning?

There were three things that weren't explained well in the installation documentation for MacOSX users. 
1) when it asks for the dll, give it the dll listed above, I think if you pick one of other ones it also messes up, such as REngine or RLib
2) I didn't know where to change the DLL once it was set during the installation script, since it automatically rediscovers the one you set previously even if it is wrong. 
3) Whats up with the user fragment documentation warnings and in my case ERRORS, and should we be setting this manually if it doesn't get set automatically?

Best regards,
Robert

Tagged:

Answers

  • pmiddletpmiddlet Member Posts: 9 Contributor II
    One thing that's obvious here is that, for whatever reason, rapidminer is forced on startup to look for additional sources of user written code and help docs (this assumes that most people who write R code publish it, for example, internally in the R standard help doc format. However, this is generally not what I have seen in practice although ideally it should be.

    Another user in this forum noticed that when they added a line to a file in ANY of the R settings (under Tools -> Preferences -> R) that all of a sudden, the prolog error (a java initiated error which is searching for an xml file to parse) disappears, although 'warnings' still persist.

    Still another user found a workaround to get RM to work by successfully starting R in a Mac terminal, starting an interactive session with R, and then calling libPaths() in R. What precisely this accomplished under the hood for that user is a mystery to me.

    The one thing here is certain. The code fragments and documentation, which are listed as optional, are attempting to be loaded by default. I think this perhaps a root cause of this problem. This is a software error for which one must develop a wierd workaround. This problem would be no different for the supported product.

    The documentation for this software is simply not universal enough to include the Mac OS community - obviously of which is an important segment that shouldn't be disregarded. For this reason, I'm not inclined at this point to consider a full purchase of the product as I don't believe that there is demonstrated value in doing so based on these bugs, the shoddy documentation, and so forth. It's possibile that rapid-i isn't aware of these issues from the forum - else they are aware and simply don't know how to solve them. It is also possible, though I would like to believe otherwise, that they are purposefully withholding information as a simple strategy which frustrates users enough to purchase an enterprise license. This is not unheard of, but doesn't lend credibility to a company looking to profit from supported software.

    I hope that one of the moderators is reading this and will move actionably to address an enormously widespread problem of complications involving inclusion of the R Extension. There is much chatter in this community and over the rest of the internet about this. So it would stand to reason that rapid-i would be working to address this problem, as other similar software integrates with R quite seamlessly. Just my $.02.
  • haddockhaddock Member Posts: 849 Maven
    and over the rest of the internet
    Did you really check that ? Or were you just warming to your theme?
  • pmiddletpmiddlet Member Posts: 9 Contributor II
    I found discussions on this in a couple of tech blogs outside of this forum, though I have not done a widespread search on this to look at the absolute extent. Of course, I should have specified "outside of this forum" instead of "and over the rest of the internet".  I think the point was clear in either case.  This problem is nowhere near unique.
  • haddockhaddock Member Posts: 849 Maven
    NO

    You make very unpleasant accusations as well!

    Here
    It is also possible, though I would like to believe otherwise, that they are purposefully withholding information as a simple strategy which frustrates users enough to purchase an enterprise license. This is not unheard of, but doesn't lend credibility to a company looking to profit from supported software.
    and there
    hence, my opinion is that they either haven't looked at it, can't solve it, or are waiting until we're frustrated enough to buy a support license. In the final case the problem will still exist for Mac users, but someone will be responsible for fixing it while-U-wait and pay on the license Smiley That doesn't add alot of value in my book (and could even appear a bit underhanded) despite the other good tenants of the software.
    And you expect them to rush to help you! Which planet are you from?


    PS For other readers ..
    you can get this error also from character encoding problems, see here
    http://illegalargumentexception.blogspot.fr/2010/09/java-content-is-not-allowed-in-prolog.html
    as ever the Devil lurks in the detail

  • Nils_WoehlerNils_Woehler Member Posts: 463 Maven
    Hi,

    in fact there was a bug that made RapidMiner try to load R Fragments and R Documentation even if no folder was set in the preferences.
    But this bug wasn't crucial as it didn't abort the start of the R extension. It just printed a warning that the fragments couldn't be loaded.
    The R extension could still be used if R was set up correctly.

    However some users were irritated and thought the R extension was broken since the library that parses XML printed "Fatal error".
    Thus we added a check to prevent the error to appear if no paths for R Fragments or R Documentation are set.

    Best,
    Nils
  • pmiddletpmiddlet Member Posts: 9 Contributor II
    Ok, so I had a fair guess :)  And to all, I do apologize for my venting on screen. Despite what planet you may think I'm from, I'm simply a scientist who sees a product in its infancy that, quite frankly, could, and should beat the likes of the 'big paid' companies which issue software for similar purposes, yet for unrealistic prices.

    When I see this, and I want a company's product to succeed *and* I'm looking to make a purchase of that product (not simply troll a forum for open source help), I don't take anything lightly. This is why I'm engaging to help out w/ error trapping, though admittedly I could be friendlier about it. The more of a bought-in community this software gains, the more they will be able to expand resources to further develop the software. So again, please accept my apologies.

    With that, Nils, here is a data dump from my Mac terminal. BTW, the GUI launches from the Mac interface, but does not load the R extension,  with the following error msg.
    Jun 21, 2012 2:44:52 PM SEVERE: Could not initialize R via JRI. Reason: Unable to initialize R
    Jun 21, 2012 2:44:52 PM SEVERE: Could not acquire connection to R: Could not initiate session with native R. Try using server. Reason: Could not initialize R via JRI. Reason: Unable to initialize R
    Jun 21, 2012 2:44:52 PM SEVERE: Could not acquire connection to R. Could not load Console.
    When I load in terminal, the folllowing appears.
    Interestingly, though RAPIDMINER_HOME is set in .bash_profile, RM doesn't seem to be getting this message. I also have my profile source .bashrc as well,
    ==> rapid
    Jun 21 14:34:19 MGYAFMDV13 java[3600] <Error>: CGContextGetCTM: invalid context 0x0
    Jun 21 14:34:19 MGYAFMDV13 java[3600] <Error>: CGContextSetBaseCTM: invalid context 0x0
    Jun 21 14:34:19 MGYAFMDV13 java[3600] <Error>: CGContextGetCTM: invalid context 0x0
    Jun 21 14:34:19 MGYAFMDV13 java[3600] <Error>: CGContextSetBaseCTM: invalid context 0x0
    Jun 21, 2012 2:34:19 PM com.rapidminer.tools.ParameterService init
    INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
    Jun 21, 2012 2:34:19 PM com.rapidminer.tools.I18N <clinit>
    INFO: Set locale to en.
    Jun 21, 2012 2:34:19 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
    INFO: Property rapidminer.home is not set. Guessing.
    Jun 21, 2012 2:34:19 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
    INFO: Trying parent directory of '/Applications/Math_Stats/rapidminer/lib/rapidminer.jar'...gotcha!
    Jun 21, 2012 2:34:20 PM com.rapidminer.PluginInitR initPlugin
    INFO: Trying to load R Library...
    Jun 21, 2012 2:34:20 PM org.rosuda.JRI.Rengine <clinit>
    INFO: Creating Connection to R...
    Jun 21, 2012 2:34:20 PM org.rosuda.JRI.Rengine loadLibrary
    INFO: Trying to loaded R library from /Library/Frameworks/R.framework/Versions/2.15/Resources/library/rJava/jri/libjri.jnilib
    Jun 21, 2012 2:34:20 PM org.rosuda.JRI.Rengine loadLibrary
    INFO: Engine ID: class org.rosuda.JRI.Rengine ClassLoader:PluginClassLoader ([file:/Users/phil4485/.RapidMiner5/managed/rmx_r-5.1.4.jar])
    Jun 21, 2012 2:34:20 PM org.rosuda.JRI.Rengine loadLibrary
    INFO: Successfully loaded R library from /Library/Frameworks/R.framework/Versions/2.15/Resources/library/rJava/jri/libjri.jnilib(true)
    Jun 21, 2012 2:34:21 PM com.rapidminer.parameter.ParameterTypePassword decryptPassword
    WARNING: Password in XML file looks like unencrypted plain text.
    [Fatal Error] :1:1: Content is not allowed in prolog.
    Jun 21, 2012 2:34:24 PM com.rapidminer.operator.r.ROperatorFactory readROperatorFragments
    WARNING: Could not read R fragments from 'file:/Users/phil4485/', error: Content is not allowed in prolog.
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
    at com.rapidminer.io.process.XMLTools.parse(XMLTools.java:176)
    at com.rapidminer.operator.r.ROperatorFactory.readROperatorFragments(ROperatorFactory.java:166)
    at com.rapidminer.operator.r.ROperatorFactory.<init>(ROperatorFactory.java:129)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:362)
    at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:269)
    at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:231)
    at com.rapidminer.tools.plugin.Plugin.registerOperators(Plugin.java:483)
    at com.rapidminer.tools.plugin.Plugin.registerAllPluginOperators(Plugin.java:782)
    at com.rapidminer.tools.OperatorService.init(OperatorService.java:182)
    at com.rapidminer.RapidMiner.init(RapidMiner.java:508)
    at com.rapidminer.gui.RapidMinerGUI.run(RapidMinerGUI.java:218)
    at com.rapidminer.gui.RapidMinerGUI.launch(RapidMinerGUI.java:523)
    at com.rapidminer.gui.RapidMinerGUI.main(RapidMinerGUI.java:505)
    [Fatal Error] :1:1: Content is not allowed in prolog.
    Jun 21, 2012 2:34:24 PM com.rapidminer.operator.r.ROperatorFactory <init>
    WARNING: Could not read documentation of user defined R operators from .
    java.io.IOException: Malformed XML operator help bundle: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.rapidminer.tools.documentation.XMLOperatorDocBundle.<init>(XMLOperatorDocBundle.java:129)
    at com.rapidminer.operator.r.ROperatorFactory.<init>(ROperatorFactory.java:150)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:362)
    at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:269)
    at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:231)
    at com.rapidminer.tools.plugin.Plugin.registerOperators(Plugin.java:483)
    at com.rapidminer.tools.plugin.Plugin.registerAllPluginOperators(Plugin.java:782)
    at com.rapidminer.tools.OperatorService.init(OperatorService.java:182)
    at com.rapidminer.RapidMiner.init(RapidMiner.java:508)
    at com.rapidminer.gui.RapidMinerGUI.run(RapidMinerGUI.java:218)
    at com.rapidminer.gui.RapidMinerGUI.launch(RapidMinerGUI.java:523)
    at com.rapidminer.gui.RapidMinerGUI.main(RapidMinerGUI.java:505)
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
    at com.rapidminer.tools.documentation.XMLOperatorDocBundle.<init>(XMLOperatorDocBundle.java:127)
    ... 17 more
    Jun 21, 2012 2:34:24 PM com.rapidminer.tools.plugin.Plugin registerOperators
    INFO: No operator descriptor specified for plugin Community. Trying plugin initializtation class com.rapidminer.community.CommunityPluginInit.
    Jun 21, 2012 2:34:24 PM com.rapidminer.tools.plugin.Plugin registerOperators
    WARNING: No operator descriptor defined for: Community
    Jun 21, 2012 2:34:24 PM com.rapidminer.tools.jdbc.JDBCProperties <init>
    WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
    Jun 21, 2012 2:34:24 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
    INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
    Jun 21, 2012 2:34:24 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
    INFO: JDBC driver oracle.jdbc.driver.OracleDriver not found. Probably the driver is not installed.
    Jun 21 14:34:26 MGYAFMDV13 java[3600] <Error>: CGContextGetCTM: invalid context 0x0
    Jun 21 14:34:26 MGYAFMDV13 java[3600] <Error>: CGContextSetBaseCTM: invalid context 0x0
    Jun 21 14:34:26 MGYAFMDV13 java[3600] <Error>: CGContextGetCTM: invalid context 0x0
    Jun 21 14:34:26 MGYAFMDV13 java[3600] <Error>: CGContextSetBaseCTM: invalid context 0x0
    cannot find system Renviron
    ARGUMENT 'LANGUAGE=en' __ignored__
    Notice the aforementioned 'xml fatal error'. In the next to the last statement, the GUI appears like it will load, and then poof, it's gone. Now, given what you've said, I cannot tell if this is a result of an XML parsing error, or something having to do with how RM wants to look for Renviron. I have /Library/Frameworks/R.framework/Liibraries/x86_64, which houses Renviron in my PATH. In either case, RM completely crashes from the terminal. Could it be looking for it in /etc/profile or one of the other script sources?

    Thoughts?
Sign In or Register to comment.