You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by kosurusekhar <ko...@gmail.com> on 2012/12/27 06:04:12 UTC

Problem with User Defined Type - External Java Class

I created an User Defined Type as per derby docs and i am using it in Store
Proc IN Parameter. Both UDT & Store Proc Java Classes packed into a single
jar and uploaded to Derby Database using IJ client.
When i am trying to accecss the Store Proc with JDBC code i could see
ClassNotFoundException in Derby console and in log file.

For the same class i created object in another Store Proc. (Not as Store
Proc Method Parameter, in side the method implementation) There it is able
to create the object. How Derby is trying to load the method parameters
external java classes ?

I created another test store proc with UDT as java.util.List. it is working
fine. 

Please help me to register my UDT external java class into Derby Classpath ?

I am sure it is there in derby classpath but while mapping the Store proc
method paratemeters it is not able to find the particular class. is there
multiple class loaders are working so that it is not able to identify my UDT
java class, please help me to solve this issue.

Thanks in Advance.



Regards,
Sekhar







--
View this message in context: http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: Problem with User Defined Type - External Java Class

Posted by Dag Wanvik <da...@oracle.com>.
On 02.01.2013 15:04, kosurusekhar wrote:
> Hi Rick,
> How can i customized the starting of network server through a java
> program. (Production relation settings).
http://db.apache.org/derby/docs/10.9/publishedapi/jdbc4/org/apache/derby/drda/NetworkServerControl.html

Cf. methods provided in this class.

Thanks,
Dag

>
>
> Regards
> Sekhar.
>
>
>
> --
> View this message in context: http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086p126167.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Problem with User Defined Type - External Java Class

Posted by kosurusekhar <ko...@gmail.com>.
Hi Rick,

Thanks for the reply.

I am running my tests with Network Server not in Embedded Mode. So i found
one  JIRA Ticket <https://issues.apache.org/jira/browse/DERBY-556>  on 
Classloader Context Problem with Network Server. So we need to change the
starting the nw server and add the jars to classpath. In the same ticket
they written some test case java class to start the Network Server and add
the jars to ClassLoader. After doing this i got into different error, now
ClassNotFoundException is not came for me. if you more info related to this
help me. How can i customized the starting of network server through a java
program. (Production relation settings).


Regards
Sekhar.



--
View this message in context: http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086p126167.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: Problem with User Defined Type - External Java Class

Posted by Katherine Marsden <km...@sbcglobal.net>.
On 12/27/2012 8:38 PM, kosurusekhar wrote:
> Hi Rick,
> The jar is included in classpath, but while mapping the Store proc 
> parameters it is throwing error, in another store proc i created 
> object for my UDT class, there it created an object. I am suspecting 
> that mapping the variables done by another ClassLoader.
>
If you don't have control over the ClassLoader classpath, one option 
might be to install the jar in the database.
https://builds.apache.org/job/Derby-docs/lastSuccessfulBuild/artifact/trunk/out/devguide/cdevdeploy30736.html

Re: Problem with User Defined Type - External Java Class

Posted by kosurusekhar <ko...@gmail.com>.
Hi Rick,

The jar is included in classpath, but while mapping the Store proc
parameters it is throwing error, in another store proc i created object for
my UDT class, there it created an object. I am suspecting that mapping the
variables done by another ClassLoader.


Regards
Sekhar.

On Thu, Dec 27, 2012 at 10:24 PM, Rick Hillegas-3 [via Apache Database] <
ml-node+s10148n126105h28@n7.nabble.com> wrote:

> On 12/26/12 9:04 PM, kosurusekhar wrote:
>
> > I created an User Defined Type as per derby docs and i am using it in
> Store
> > Proc IN Parameter. Both UDT&  Store Proc Java Classes packed into a
> single
> > jar and uploaded to Derby Database using IJ client.
> > When i am trying to accecss the Store Proc with JDBC code i could see
> > ClassNotFoundException in Derby console and in log file.
> >
> > For the same class i created object in another Store Proc. (Not as Store
> > Proc Method Parameter, in side the method implementation) There it is
> able
> > to create the object. How Derby is trying to load the method parameters
> > external java classes ?
> >
> > I created another test store proc with UDT as java.util.List. it is
> working
> > fine.
> Hi Sekhar,
>
> It sounds as though your classpath does not include the jar file which
> contains the UDT class.
>
> Hope this helps,
> -Rick
>
> > Please help me to register my UDT external java class into Derby
> Classpath ?
> >
> > I am sure it is there in derby classpath but while mapping the Store
> proc
> > method paratemeters it is not able to find the particular class. is
> there
> > multiple class loaders are working so that it is not able to identify my
> UDT
> > java class, please help me to solve this issue.
> >
> > Thanks in Advance.
> >
> >
> >
> > Regards,
> > Sekhar
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086.html
> > Sent from the Apache Derby Users mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086p126105.html
>  To unsubscribe from Problem with User Defined Type - External Java Class, click
> here<http://apache-database.10148.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=126086&code=a29zdXJ1c2VraGFyQGdtYWlsLmNvbXwxMjYwODZ8NjU2MTQ1MjUw>
> .
> NAML<http://apache-database.10148.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086p126112.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: Problem with User Defined Type - External Java Class

Posted by Rick Hillegas <ri...@oracle.com>.
On 12/26/12 9:04 PM, kosurusekhar wrote:
> I created an User Defined Type as per derby docs and i am using it in Store
> Proc IN Parameter. Both UDT&  Store Proc Java Classes packed into a single
> jar and uploaded to Derby Database using IJ client.
> When i am trying to accecss the Store Proc with JDBC code i could see
> ClassNotFoundException in Derby console and in log file.
>
> For the same class i created object in another Store Proc. (Not as Store
> Proc Method Parameter, in side the method implementation) There it is able
> to create the object. How Derby is trying to load the method parameters
> external java classes ?
>
> I created another test store proc with UDT as java.util.List. it is working
> fine.
Hi Sekhar,

It sounds as though your classpath does not include the jar file which 
contains the UDT class.

Hope this helps,
-Rick
> Please help me to register my UDT external java class into Derby Classpath ?
>
> I am sure it is there in derby classpath but while mapping the Store proc
> method paratemeters it is not able to find the particular class. is there
> multiple class loaders are working so that it is not able to identify my UDT
> java class, please help me to solve this issue.
>
> Thanks in Advance.
>
>
>
> Regards,
> Sekhar
>
>
>
>
>
>
>
> --
> View this message in context: http://apache-database.10148.n7.nabble.com/Problem-with-User-Defined-Type-External-Java-Class-tp126086.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>