Bug 781065 (SOA-3551)

Summary: Cannot load metadata for dynamic VDB on oracle10g
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Filip Nguyen <fnguyen>
Component: EDSAssignee: Van Halbert <vhalbert>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2.0.ER6CC: fnguyen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-3551
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-15 17:48:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server.log
none
mytext-ds.xml
none
myvdb-vdb.xml none

Description Filip Nguyen 2011-11-03 10:55:43 UTC
project_key: SOA

There seems to be a problem with deploying dynamic VDB (attachment) which loads metadata from Oracle10g. It works on any other database supported by SOA P (including Oracle11g).

When I deploy the VDB I get: 
{code:title=Server.log|borderStyle=solid}
2011-11-03 10:32:26,306 INFO  [org.teiid.RUNTIME] (JBoss System Threads(1)-7) VDB myvdb.1 model EMPLOYEES metadata is currently being loaded. Start Time: 11/3/11 10:32 AM
2011-11-03 10:32:26,306 INFO  [org.teiid.RUNTIME] (JBoss System Threads(1)-8) VDB myvdb.1 model TextFileData metadata is currently being loaded. Start Time: 11/3/11 10:32 AM
2011-11-03 10:32:26,307 INFO  [org.teiid.RUNTIME] (HDScanner) VDB "myvdb.1[EMPLOYEES[oracle-connector/oracle/java:DefaultDS], TextFileData[text-connector/file/java:TxtFileDS]]" deployed in inactive state.
2011-11-03 10:32:26,307 DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] (HDScanner) Fully Deployed vfsfile:/home/fnguyen/work/soaplatform/products/esb/jboss-as/server/oracle10g/deploy/myvdb-vdb.xml
2011-11-03 10:32:26,323 INFO  [org.teiid.RUNTIME] (JBoss System Threads(1)-8) VDB myvdb.1 model TextFileData metadata is currently being loaded.
....
....
2011-11-03 10:35:04,832 WARN  [org.teiid.RUNTIME] (JBoss System Threads(1)-7) myvdb.1 is now "incomplete", because model "EMPLOYEES" can not retrieve metadata. Please fix any errors and re-deploy relevant DataSources and/or the VDB.
{code}

In web console VDB is not active and contains following errors:
{code:title=Web console|borderStyle=solid}
ERROR 	VDB myvdb.1 model employees metadata is currently being loaded. Start Time: 11/3/11 10:54 AM 	
ERROR 	myvdb.1 is now "incomplete", because model "employees" can not retrieve metadata. Please fix any errors and re-deploy relevant DataSources and/or the VDB. 	
ERROR 	Teiid runtime names, which are case insensitive, for the imported metadata are not unique. If not already set, use the setting importer.useFullSchemaName to create Teiid names that include the source schema.
{code}

It looks like there is a problem with content of the database, but I only created one database table: 
{code:title=Employees table|borderStyle=solid}
--------------------------------------------------------
--  DDL for Table employees
--------------------------------------------------------

  CREATE TABLE "SOAESB1"."employees" 
   (	"ID" NUMBER(19,0), 
	"NAME" VARCHAR2(255 CHAR), 
	"SURNAME" VARCHAR2(255 CHAR), 
	"SYMBOL" VARCHAR2(255 CHAR)
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "USERS" ;
--------------------------------------------------------
--  DDL for Index SYS_C00330055
--------------------------------------------------------

  CREATE UNIQUE INDEX "SOAESB1"."SYS_C00330055" ON "SOAESB1"."employees" ("ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "USERS" ;
--------------------------------------------------------
--  Constraints for Table employees
--------------------------------------------------------

  ALTER TABLE "SOAESB1"."employees" MODIFY ("ID" NOT NULL ENABLE);
 
  ALTER TABLE "SOAESB1"."employees" ADD PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "USERS"  ENABLE;

{code}

Comment 1 Filip Nguyen 2011-11-03 10:57:06 UTC
Attachment: Added: server.log
Attachment: Added: mytext-ds.xml
Attachment: Added: myvdb-vdb.xml


Comment 2 Filip Nguyen 2011-11-03 11:47:46 UTC
After attaching debugger there seems to be some duplicate table in database that the Teiid is trying to insert into metadata (don't know what this means yet).

{code:title=DEBUG server console | borderStyle=solid}

 org.teiid.metadata.DuplicateRecordException: Duplicate table SOAESB1.BIN$mbjj432fhyLgQCIK4iBmlQ==$0
12:44:31,528 ERROR [STDERR] 	at org.teiid.metadata.Schema.addTable(Schema.java:46)
12:44:31,528 ERROR [STDERR] 	at org.teiid.metadata.MetadataFactory.addTable(MetadataFactory.java:83)
12:44:31,528 ERROR [STDERR] 	at org.teiid.translator.jdbc.JDBCMetdataProcessor.getTables(JDBCMetdataProcessor.java:212)
12:44:31,528 ERROR [STDERR] 	at org.teiid.translator.jdbc.JDBCMetdataProcessor.getConnectorMetadata(JDBCMetdataProcessor.java:114)
12:44:31,528 ERROR [STDERR] 	at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:277)
12:44:31,528 ERROR [STDERR] 	at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:82)
12:44:31,528 ERROR [STDERR] 	at org.teiid.dqp.internal.datamgr.ConnectorManager.getMetadata(ConnectorManager.java:128)
12:44:31,528 ERROR [STDERR] 	at org.teiid.deployers.VDBDeployer.loadMetadata(VDBDeployer.java:344)
12:44:31,528 ERROR [STDERR] 	at org.teiid.deployers.VDBDeployer.access$000(VDBDeployer.java:60)
12:44:31,528 ERROR [STDERR] 	at org.teiid.deployers.VDBDeployer$1.run(VDBDeployer.java:310)
12:44:31,528 ERROR [STDERR] 	at org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:147)
12:44:31,528 ERROR [STDERR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
12:44:31,528 ERROR [STDERR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
12:44:31,529 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:662)

{code}

Comment 3 Van Halbert 2011-11-03 12:30:31 UTC
Link: Added: This issue Cloned to SOA-3552


Comment 4 Van Halbert 2011-11-03 13:25:31 UTC
Its loading the metadata for a recycle bin table: SOAESB1.BIN$mbjj432fhyLgQCIK4iBmlQ==$0. This table must be reported twice in the metadata, which is odd, but not entirely out of the realm of possibility since you are not limiting what metadata the importer should fetch.  See reference (http://docs.jboss.org/teiid/7.5.0.Final/reference/en-US/html_single/#d0e9188) that states how you can set schema/table name patterns, etc. to appropriately limit the metadata.