You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Subrahmanya, Noida" <su...@noida.hcltech.com> on 2003/07/30 09:26:44 UTC

RE: [juddi-Users] setup with new database fail in getting connect ion using JNDI datasource

Hi,
 I am using Juddi 8.0. i set up everything. But it fails in getting
connection. I am using JNDI datasource for my database using JDBC driver.
Following is the piece of code from happyjuddi.jsp. 
try
  {
	  out.println(ds);
	  	out.flush();
    conn = ds.getConnection();
    if (conn == null)
	  throw new Exception("No Connection (conn=null)");  

    out.print("<font color=\"green\">");
    out.print("+ Got a JDBC Connection!");
    out.println("</font>");
  }
 
when i run this jsp browser displays upto as follows. It fails in getting
connection at statement "conn = ds.getConnection();"
jUDDI DataSource Check
+ Got a JNDI Context!
+ Got a JDBC DataSource (dsname=java:comp/env/jdbc/juddiDB)
org.apache.commons.dbcp.BasicDataSource@1be8711

After that it does not do anything. Browser was being left for around 12
hours. i have seen that memory utilization goes up to full( 256 RAM).
After that, i stopped my database. Immediately i get "DBCP borrowObject
failed: java.sql.SQLException: Server rejected." at tomcat server window and
releases all memory.

What could be the reason? is there any restriction on JDBC Driver to be used
in Juddi setup.? why it creates org.apache.commons.dbcp.BasicDataSource
object.?
With Thanks and Regards,
 
B. Subrahmanya Nayak
Member Technical Staff,




-----Original Message-----
From: Subrahmanya, Noida 
Sent: Tuesday, June 17, 2003 06:11 PM
To: juddi-users@lists.sourceforge.net
Subject: RE: [juddi-Users] setup with new database


Hi ,

I have the user with admin. 

Tomcat Server ->
    Server (Tomcat-Standalone ->
      Host (localhost) ->
        Context (/juddi) ->
          Resources ->
            Data Source

But when i click DataSource in above tree structure i gives following
exception. 

org.apache.jasper.JasperException: Exception retrieving attribute
'driverClassName'
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:432)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:356)
at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:1759)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)

What would be the reason?. It would be better if latest code would be made
available in archive form.

With Thanks and Regards,
 
B. Subrahmanya Nayak




-----Original Message-----
From: Steve Viens [mailto:sviens@attbi.com]
Sent: Monday, June 16, 2003 05:51 PM
To: juddi-users@lists.sourceforge.net
Subject: RE: [juddi-Users] setup with new database


Currently (unfortunately) the happyjuddi.jsp page will not help you
debug connection problems when using the jUDDI connection pool option
(i.e. 'juddi.useConnectionPool = true') - only when using JNDI
DataSource.

If you'ld like to attempt using a JNDI datasource (with Tomcat 4.1.24)
instead of the jUDDI ConnectionPool I've included instructions (below).
This info was posted to the list last week but I'd don't currently see
it in the archive so I've included it below).

=========== Tomcat 4.1.24 / jUDDI setup instructions =============

Earle, You most definitely are having a Tomcat DataSource configuration
issue. I setup a JNDI DataSource via Tomcat's Admin application. What
follows is instructions that I used to set up a DataSource for jUDDI
under version 4.1.24.

If you're using this version then start up tomcat and click on this
link: 

  http://localhost:8080/admin/login.jsp

..Or select the "Tomcat Administration" link on Tomcat's home page:  

  http://localhost:8080/index.jsp

You'll need to specify an admin "User Name" and "Password" which is
specified in:

  {Tomcat-Dir}\tomcat4.1.24\conf\tomcat-users.xml

I've got a 'user' specified as follows:

  <user 
    username="admin" 
    password="admin" 
    fullName="Steve Viens" 
    roles="admin,manager,standard"/>

So given the values above I use 'admin' and 'admin' to log in. Once
you're in you've got to create a DataSource under the '/juddi' context.

  Tomcat Server ->
    Server (Tomcat-Standalone ->
      Host (localhost) ->
        Context (/juddi) ->
          Resources ->
            Data Source

Select "Create new DataSource" under the "Data Source Actions" menu. And
enter values similar to the following:

  JNDI Name:         jdbc/juddiDB
  Data Source URL:   jdbc:mysql://localhost/juddi
  JDBC Driver Class: com.mysql.jdbc.Driver
  User Name:         juddi
  Password:          juddi
  Max Active Conn:   4
  Max Idle Conn:     2
  Max Wait for Conn: 5000
  Validation Query:  SELECT * FROM PUBLISHER

Of course the values you use may differ. I'm using the MySQL database
I'm connecting to is named 'juddi' and the ID and PW used to access it
is also 'juddi' and 'juddi'.

Also, I'm using the MySQL ConnectorJ 3.0.6 JDBC driver and I've got the
driver's 'jar' file in Tomcat's 'common/lib' directory. Grab it here if
you want it (and don't already use it).

  http://www.mysql.com/products/connector-j/index.html

Good luck!

Steve

PS: Not sure if I asked or mentioned this before but to be on the safe
side I'd strongly recommend that you build jUDDI from the source in CVS
since it incorporates quite a few bug fixes that have been made since
the 0.7.0 file-release.

-----Original Message-----
From: juddi-users-admin@lists.sourceforge.net
[mailto:juddi-users-admin@lists.sourceforge.net] On Behalf Of
Subrahmanya, Noida
Sent: Monday, June 16, 2003 5:57 AM
To: juddi-users@lists.sourceforge.net
Subject: RE: [juddi-Users] setup with new database


I haveadded following to juddi.properties file
#required JDBC DataSource properties
juddi.dataSource = java:comp/env/jdbc/juddiDB
 
# required JDBC Driver properties
juddi.useConnectionPool = true
juddi.jdbcDriver = ordbjava.jdbc.ordbDriver
juddi.jdbcURL = jdbc:totalxml:demodb
juddi.jdbcUser = public
juddi.jdbcPassword =
 
# optional JDBC Driver connection pool properties
juddi.jdbcMinConnections = 3 juddi.jdbcMaxConnections = 50
juddi.jdbcMaxWaitTime = 15000 juddi.jdbcRetryInterval = 1000

And i have put jar containing ordbDriver at tomcats common\lib. But i am
getting following exception. What would be the cause? and solution?.
ordbjava.jdbc.ordbDriver is an instance of java.sql.Driver. Is this to
be an instance of Javax.sql.DataSource?.. But same exception occurs when
i use ordbjava.jdbc.ordbDataSource which is an instance of
Javax.sql.DataSource.

java.sql.SQLException: Cannot load JDBC driver class 'null'
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource
.jav
a:529)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:3
12)
        at
org.apache.jsp.happyjuddi_jsp._jspService(happyjuddi_jsp.java:93)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:2
10)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tion
FilterChain.j
ava:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erCh
ain.java:193)
 
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.ja
va:256)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvok
eNext(Standar
dPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)


-----Original Message-----
From: Subrahmanya, Noida 
Sent: Monday, June 16, 2003 12:44 PM
To: sviens@attbi.com
Cc: juddi-users@lists.sourceforge.net
Subject: RE: [juddi-Users] setup with new database


Hi, 
Sory for very late reply as now i have atarted to work on juddi. Could u
tell me how to validate whether the JUDDI registry deployed properly
with the new database or not?. is there any example that checks all
validation ,etc.....


With Thanks and Regards,
 
B. Subrahmanya Nayak

With Thanks and Regards,
 
B. Subrahmanya Nayak
Member Technical Staff,
HCL Technologies Ltd.,




-----Original Message-----
From: sviens@attbi.com [mailto:sviens@attbi.com]
Sent: Tuesday, May 27, 2003 07:23 PM
To: Subrahmanya, Noida
Cc: juddi-users@lists.sourceforge.net
Subject: Re: [juddi-Users] setup with new database


jUDDI is designed to allow different persistence (datastore)
implementations to be "plugged-in". The JDBCDataStore included with
jUDDI attempts to support as many as the main-stream RDBMS's as possible
(Oracle, DB2, Sybase, MySQL - even HSQLDB). 
 
If you're interested in using something other than JDBC or if you want
to take advantages of proprietary features of your RDBMS (i.e. using
stored procedures to improve performance) then you will need to develop
your own datastore implementation. To do so you'll need to create
implementations of the DataStoreFactory and DataStore interfaces in the
org.juddi.datastore package and make a change to the jUDDI properties
file to use your new DataStoreFactory implementation (i.e. the
judd.dataStoreFactory property) instead of the one supplied. 
 
Check out jUDDI's JDBCDataStoreFactory and JDBCDataStore for examples.
 
Steve
> I have an XML:DB supported database which is also an object 
> ,relational. I guess JUDDI is an open source UDDI Registry which could

> be set to any database. Coule any body tell what exactly is to be done

> to achieve this? Is there XML:DB supported open source Registery 
> server?
>  
> With Thanks and Regards,
>  
> <?xml:namespace prefix = o ns = 
> "urn:schemas-microsoft-com:office:office"
> />B. Subrahmanya Nayak
> Member Technical Staff,
> HCL Technologies Ltd.,




-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
juddi-users mailing list
juddi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/juddi-users


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
juddi-users mailing list
juddi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/juddi-users

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org