]
Steven Hawkins resolved TEIID-3959.
-----------------------------------
Fix Version/s: 9.0
Resolution: Done
Updated the deployer to look for the vdb.xml in a single spot (which is consistent with
the 7.x behavior and Teiid embedded).
dynamic VDB, Not loading UDF , Showing class Not Found .
-----------------------------------------------------------
Key: TEIID-3959
URL:
https://issues.jboss.org/browse/TEIID-3959
Project: Teiid
Issue Type: Feature Request
Affects Versions: 8.12.2
Environment: Windows 7, 64 bit
Reporter: Durgadatta Sahu
Assignee: Steven Hawkins
Fix For: 9.0
Attachments: UDFVDB.vdb, UDFVDB.vdb
Hi I am new to TEIID , and trying to deploy UDF and corresponding JAR at run time .
It is showing following exception:-
10:46:47,729 INFO [org.teiid.RUNTIME] (teiid-async-threads - 6) TEIID50030 VDB
DDS_TEST_VDB.1 model "modelsource" metadata loaded. End Time: 2/6/16 10:46 AM
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) Exception in thread
"teiid-async-threads - 6" org.teiid.metadata.MetadataException: TEIID30387 Could
not load UDF "getDouble", since its invocation class "com.my.app.Demo"
could not be found.
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.query.function.FunctionTree.createFunctionDescriptor(FunctionTree.java:325)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.query.function.FunctionTree.addFunction(FunctionTree.java:212)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.query.function.FunctionTree.<init>(FunctionTree.java:102)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.deployers.CompositeVDB.buildTransformationMetaData(CompositeVDB.java:93)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.deployers.CompositeVDB.metadataLoadFinished(CompositeVDB.java:286)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.deployers.VDBRepository.finishDeployment(VDBRepository.java:297)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.runtime.AbstractVDBDeployer.metadataLoaded(AbstractVDBDeployer.java:244)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.jboss.VDBService.access$1200(VDBService.java:81)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.jboss.VDBService$6.run(VDBService.java:416)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.jboss.VDBService$7.run(VDBService.java:446)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
java.lang.Thread.run(Thread.java:745)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.jboss.threads.JBossThread.run(JBossThread.java:122)
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) Caused by:
java.lang.ClassNotFoundException: com.my.app.Demo from [Module
"deployment.udfa-vdb.xml:main" from Service Module Loader]
10:46:47,729 ERROR [stderr] (teiid-async-threads - 6) at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
java.lang.Class.forName0(Native Method)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
java.lang.Class.forName(Class.java:340)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.query.function.UDFSource.getInvocationClass(UDFSource.java:43)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) at
org.teiid.query.function.FunctionTree.createFunctionDescriptor(FunctionTree.java:315)
10:46:47,739 ERROR [stderr] (teiid-async-threads - 6) ... 13 more
===============================
I have crated a dynamic VDB and define UDF details as follows
<?xml version="1.0" encoding="utf-8"?>
<vdb name="DDS_TEST_VDB" version="1">
<model name="modelsource" type='VIRTUAL' >
<property name ="lib" value
="com.my.app"></property>
<metadata type="DDL">
<![CDATA[
create virtual function getDouble(key Long) returns Double
options (
java_class 'com.my.app.Demo',
java_method 'getValue'
);
]]>
</metadata>
</model>
</vdb>
And I have deployed my jar file and module.xml in following path,
\teiid-8.12.2-server\teiid-8.12.2\modules\com\my\app\main\
module.xml :
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.my.app">
<resources>
<resource-root path="myapp.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
</dependencies>
</module>
Thanks,
Durga