How to use file as datasource in DDL Dynamic VDB
reuseman Sep 27, 2017 9:58 AMHere is what i have done so far
Setting file resource adapter in JBoss configuration (standalone-teiid.xml)
<subsystem xmlns="urn:jboss:domain:resource-adapters:4.0"> <resource-adapters> <resource-adapter id="file"> <module slot="main" id="org.jboss.teiid.resource-adapter.file"/> <connection-definitions> <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory" jndi-name="java:/jbosslabLocationDS" enabled="true" use-java-context="true" pool-name="jbosslabLocationDS"> <config-property name="AllowParentPaths"> true </config-property> <config-property name="Parentdirectory"> C:/Programs/eap/jboss-eap-7.0-teiid-9/jbosslab/ </config-property> </connection-definition> </connection-definitions> </resource-adapter>
Create DDL VDB
CREATE DATABASE jbosslab VERSION '1.0.0'; USE DATABASE jbosslab VERSION '1.0.0'; -- Select translator (mysql5) CREATE FOREIGN DATA WRAPPER mysql5; -- Create server with datasource CREATE SERVER "mysql_server" TYPE 'mysql' FOREIGN DATA WRAPPER mysql5 OPTIONS ("jndi-name" 'java:jboss/datasources/JbosslabDS'); -- Select translator (file) CREATE FOREIGN DATA WRAPPER file; -- Create server with datasource CREATE SERVER "file_server" TYPE 'file' FOREIGN DATA WRAPPER file OPTIONS ( ParentDirectory 'C:/Programs/eap/jboss-eap-7.0-teiid-9/jbosslab/', "jndi-name" 'java:/jbosslabLocationDS' ); -- Create source schema from mysql CREATE SCHEMA "mysql_source_schema" SERVER "mysql_server"; -- Create virtual schema contains view layer CREATE VIRTUAL SCHEMA "report"; -- Create source schema from file -- CREATE SCHEMA "file_source_schema" SERVER "file_server";
Every time uncomment the last line, the vdb is unaccessible and get the following error in query
Error: TEIID31099 VDB jbosslab.1.0.0[mysql_source_schema{mysql_server=mysql_server, mysql5, java:jboss/datasources/JbosslabDS}, file_source_schema{file_server=file_server, file, file_server}, report{}] is not active, but FAILED. If loading you can resubmit your query after loading has completed or after the errors have been corrected. SQLState: 50000 ErrorCode: 31099
What does i have missing?