On 6/24/15 4:24 AM, ankita savaliya wrote:
am using derby as datasource in weblogic with
org.apache.derby.jdbc.ClientDataSource driver. I have started derby
database with ${WL_HOME}/common/derby/bin/startNetworkServer.sh
Datasource is getting created properly but while fetching connection
and creating context aware function it throws class not found error.
Caused by: java.sql.SQLSyntaxErrorException: The class
'test.vti.VTITest' does not exist or is inaccessible. This can happen
if the class is not public. at
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source) at
org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source) at org.apache.derby.client.am.Statement.executeUpdate(Unknown
Source) at
weblogic.jdbc.wrapper.Statement.executeUpdate(Statement.java:530) at
oracle.essbase.ds.manager.DataSourceManager.createDSView(DataSourceManager.java:340)
at
oracle.essbase.ds.manager.DataSourceManager.save(DataSourceManager.java:128)
at test.DSDBTestWS.createDBDS(DSDBTestWS.java:290) at
test.DSDBTestWS.saveDS(DSDBTestWS.java:104) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
How to include test.vti.VTITest in classpath so that ClientDataSource
driver can find it ?
Any help on this is appreciated.
Hi Ankita,
I assume that VTITest is a class you wrote which implements
org.apache.derby.vti.AwareVTI:
http://db.apache.org/derby/docs/10.11/publishedapi/org/apache/derby/vti/AwareVTI.html
Class loading by application servers can be tricky. There are two ways
to solve this problem:
1) Figure out how to make your VTITest class visible to the same class
loader which is loading the Derby jars on behalf of Weblogic. I haven't
tried this, so I can't give you much advice here. Maybe it is as simple
as just putting your class on the classpath which is used when booting
Weblogic. But it may be trickier than that.
2) An alternative is to put your class in a jar file which is loaded
into the Derby database and then wire that jar file into the
database-specific classpath for user-written code. Instructions for
doing this can be found in the "Loading classes from a database" section
of the Derby Developer's Guide:
http://db.apache.org/derby/docs/10.11/devguide/cdevdeploy30736.html
Hope this helps,
-Rick