MyCATApache/Mycat-Server · critical · io.mycat.config.ConfigException

not supported yet !

Error message

not supported yet !{hostName}

What it means

ConfigInitializer.createDataSource only supports MySQL and PostgreSQL data hosts; for any other DB type it throws ConfigException('not supported yet !' + hostName) because there is no DataSource implementation for that host's DB type.

Solutions

  1. Change the dataHost's dbType to mysql or postgresql in schema.xml
  2. Check the configured dbType string for typos/case mismatches
  3. Use a Mycat version or fork that includes a DataSource implementation for your DB type
  4. Wrap that backend with a MySQL-protocol proxy if you must keep Mycat 1.x

Example fix

// before (schema.xml)
<dbType>oracle</dbType>
// after
<dbType>mysql</dbType>
Defensive patterns

Strategy: validation

Validate before calling

String dbType = dataHost.getDbType();
if (!"mysql".equalsIgnoreCase(dbType) && !"postgresql".equalsIgnoreCase(dbType)) {
    throw new IllegalArgumentException("Unsupported dbType for Mycat 1.x: " + dbType);
}

Try / catch

try {
    dataSource = createDataSource(...);
} catch (ConfigException e) {
    if (e.getMessage().startsWith("not supported yet")) {
        // fall back to mysql proxy type or abort startup with clear message
    }
}

Prevention

When it happens

Trigger: Defining a <dataHost> in schema.xml whose <dbType> is something other than mysql or postgresql, causing createDataSource to fall through to the else branch.

Common situations: Users configure oracle, sqlserver, mongodb, or a typo'd dbType (e.g. 'MYSQL' with wrong case in older versions) in dataHost config; also seen after upgrading Mycat and expecting a newly advertised DB type to work.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11). Data as JSON: /api/errors/97d77555ce9b91e7. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/io/mycat/config/ConfigInitializer.java:295

				nodes[i].setIdleTimeout(system.getIdleTimeout());
				MySQLDataSource ds = new MySQLDataSource(nodes[i], conf, isRead);
				dataSources[i] = ds;
			}

		} else if (dbDriver.equals("jdbc")) {
			for (int i = 0; i < nodes.length; i++) {
				nodes[i].setIdleTimeout(system.getIdleTimeout());
				JDBCDatasource ds = new JDBCDatasource(nodes[i], conf, isRead);
				dataSources[i] = ds;
			}
		} else if ("postgresql".equalsIgnoreCase(dbType) && dbDriver.equalsIgnoreCase("native")){
			for (int i = 0; i < nodes.length; i++) {
				nodes[i].setIdleTimeout(system.getIdleTimeout());
				PostgreSQLDataSource ds = new PostgreSQLDataSource(nodes[i], conf, isRead);
				dataSources[i] = ds;
			}
		} else{
			throw new ConfigException("not supported yet !" + hostName);
		}
		return dataSources;
	}

	private PhysicalDBPool getPhysicalDBPool(DataHostConfig conf,
			ConfigLoader configLoader) {
		String name = conf.getName();
		//数据库类型,我们这里只讨论MySQL
		String dbType = conf.getDbType();
		//连接数据库驱动,我们这里只讨论MyCat自己实现的native
		String dbDriver = conf.getDbDriver();
		//针对所有写节点创建PhysicalDatasource
		PhysicalDatasource[] writeSources = createDataSource(conf, name,
				dbType, dbDriver, conf.getWriteHosts(), false);
		Map<Integer, DBHostConfig[]> readHostsMap = conf.getReadHosts();
		Map<Integer, PhysicalDatasource[]> readSourcesMap = new HashMap<Integer, PhysicalDatasource[]>(
				readHostsMap.size());
		//对于每个读节点建立key为writeHost下标value为readHost的PhysicalDatasource[]的哈希表

View on GitHub (pinned to 65f8d8beb7)