Error while executing operator "Read Database" with the name "Read total instances" in Java

akochsic
akochsic New Altair Community Member
edited November 2024 in Community Q&A

Hello,

I am new to rapidminer and I am trying to get an old program running. It is an Java project using the rapidminer command line mode.

Since it is an older project it was developed with a rapidminer version 5.x. I tried to run it with several newer versions, which are available with maven.
While running the program throws following error:
com.rapidminer.operator.UserError: The dummy operator Read total instances (replacing null) cannot be executed. 

 

The process it self is runnable inside rapidminer studio.

I also tried playing aroung with the versioning in rapidminer studio, but with no success. 

You can find the process attached.

 

I don't know what my mistake could be. Hopefully you have an idea.

 

Thanks :)

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • sgenzer
    sgenzer
    Altair Employee

    hello @akochsic - so dummy operators are created usually when you are using an operator in your process that RapidMiner does not recognize. I've not heard of "Read Total Instances" before...

     

    Scott

     

  • akochsic
    akochsic New Altair Community Member

    Hello @sgenzer,

    thanks for your quick reply.

    Sorry for the misunderstanding. "Read total instances" is the name of the operator "Read Database". 

     

    The operator is configured as follows:

    <operator activated="true" class="jdbc_connectors:read_database" compatibility="8.0.001" expanded="true" height="68" name="Read total instances" width="90" x="179" y="210">
    <parameter key="define_connection" value="predefined"/>
    <parameter key="connection" value="local (master)"/>
    <parameter key="database_system" value="MySQL"/>
    <parameter key="define_query" value="query"/>
    <parameter key="query" value="(SELECT `size`&#10;FROM `category_sizes`&#10;WHERE category=? LIMIT 1)&#10;UNION (SELECT 0); -- default value in case category is not in table."/>
    <parameter key="use_default_schema" value="true"/>
    <parameter key="prepare_statement" value="true"/>
    <enumeration key="parameters">
    <parameter key="parameter" value="VARCHAR.%{category}"/>
    </enumeration>
    <parameter key="datamanagement" value="double_array"/>
    <parameter key="data_management" value="auto"/>
    </operator>

    Thanks :)

  • sgenzer
    sgenzer
    Altair Employee

    yes those look like parameters from an old Read Database operator. I'd look at the XML created from a new Read Database operator and xfer your settings & query. For example:

     

      <operator activated="true" class="process" compatibility="8.0.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="jdbc_connectors:read_database" compatibility="8.0.001" expanded="true" height="68" name="Read Database" width="90" x="246" y="34">
    <parameter key="connection" value="MyCoolSQLDB"/>
    <parameter key="query" value="SELECT `bar`&#10;FROM `foo`"/>
    <enumeration key="parameters"/>
    </operator>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    </process>
    </operator>

     

    Note you need to set up a database connection first in order to make this work.

     

    Scott

     

  • akochsic
    akochsic New Altair Community Member

    I tried creating a new repository with a new process and a new "Read database" operator, but I am still facing the same error. I can't really see any difference in the operator I am using and the example code you posted, since also both have the compatibility set to version 8.0.001.

     

    The process is still running perfectly in Rapidminer Studio. I am only facing the issue using Java with the Command Line Execution mode.

     

    This is the new example process I tried now:

     

    <?xml version="1.0" encoding="UTF-8"?><process version="8.0.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="8.0.001" expanded="true" name="Process">
    <parameter key="logverbosity" value="init"/>
    <parameter key="random_seed" value="2001"/>
    <parameter key="send_mail" value="never"/>
    <parameter key="notification_email" value=""/>
    <parameter key="process_duration_for_mail" value="30"/>
    <parameter key="encoding" value="SYSTEM"/>
    <process expanded="true">
    <operator activated="true" class="jdbc_connectors:read_database" compatibility="8.0.001" expanded="true" height="68" name="Read Database (2)" width="90" x="179" y="289">
    <parameter key="define_connection" value="predefined"/>
    <parameter key="connection" value="local (master)"/>
    <parameter key="database_system" value="MySQL"/>
    <parameter key="define_query" value="query"/>
    <parameter key="query" value="SELECT `s`&#10;FROM `article_categories`"/>
    <parameter key="use_default_schema" value="true"/>
    <parameter key="prepare_statement" value="false"/>
    <enumeration key="parameters"/>
    <parameter key="datamanagement" value="double_array"/>
    <parameter key="data_management" value="auto"/>
    </operator>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    </process>
    </operator>
    </process>
  • sgenzer
    sgenzer
    Altair Employee

    hmm sorry - don't know what to tell you. Just curious - why are you insisting on using the command line execution rather than setting up a RM Server?

     

    Scott

     

  • akochsic
    akochsic New Altair Community Member

    Since it's an rather old project, I tried setting it up without the need changing it too much. Maybe it would be a good idea to try working with an RM Server. Thanks for your help.

    I now found a way to get the old project running: I built the rapidminer.jar from the rapidminer5 repository and added it as an external jar to the project. This is obviously not a perfect solution, but a workaround. With the old rapidminer version I don't get any error messages.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.