cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
249
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 09-12-2004 04:29:06 PM
Hi,

I am using Audim 3.4, tomcat 4.1.24, and SQLServer 2000.

I use the Database element and get this error in the log file.

SERVER ERROR: An Audium element encountered an exception. The exception was: There was a problem looking up the JNDI data source 'jdbc/test'

This is the Database element's settings
  • Type: single
  • JNDI Name: jdbc/test (I tried 'test' but still failed)
  • SQL Query: select count(*) from RebateOfferNumber2

I follow the suggestion posted here http://www.audiumcentral.com/supportcenter/viewtopic.php?t=130&highlight=jdbc

I've attahced server.xml in C:\Program Files\Apache Group\Tomcat 4.1\conf

Thank you.

Subject: RE: JNDI setup
Replied by: Michael Bochynski on 09-12-2004 04:53:20 PM
Hi,

Please make the following changes to your JDBC configuration:

1. Change the [i:f9bd38d066]"user"[/i:f9bd38d066] to [i:f9bd38d066]"username"[/i:f9bd38d066]
2. Change the [i:f9bd38d066]"driverName"[/i:f9bd38d066] to [i:f9bd38d066]"url"[/i:f9bd38d066]
3. Modify your database url as follows:
[i:f9bd38d066]jdbc:microsoft:sqlserver://167.209.148.31:1433;databaseName=bbylab;SelectMethod=cursor;[/i:f9bd38d066]

Note that the URL ends with semicolon. Moreover, capital letters in the URL [b:f9bd38d066]do[/b:f9bd38d066] matter, hence if your database name is BByLab, modify the paramater accordingly.

You can also double check that user [i:f9bd38d066]sa[/i:f9bd38d066] identified by the given passowrd has access to the bbylab database.

Hope this helps,
Michael

Subject: RE: JNDI setup
Replied by: null on 09-12-2004 08:43:53 PM
I tried your suggestion but it still doesn't work. I still get this error message

[quote:c7cb2bcb50]SERVER ERROR: An Audium element encountered an exception. The exception was: There was a problem looking up the JNDI data source 'java:comp/env/jdbc/test'.[/quote:c7cb2bcb50]

I wrote a simple JSP to test the connection and it works.

[code:1:c7cb2bcb50]<HTML>
<HEAD>
<%@ page import="java.sql.*,
javax.sql.*,
java.io.*,
javax.naming.InitialContext" %>
</HEAD>
<BODY>

<%
InitialContext initCtx = new InitialContext&#38;#40;&#38;#41;;
DataSource ds = &#38;#40;DataSource&#38;#41;initCtx.lookup&#38;#40;"java&#38;#58;comp/env/jdbc/test"&#38;#41;;
Connection conn = ds.getConnection&#38;#40;&#38;#41;;
Statement stmt = conn.createStatement&#38;#40;&#38;#41;;
ResultSet rst = stmt.executeQuery&#38;#40;"select count&#38;#40;*&#38;#41; from RebateOfferNumber2"&#38;#41;;
if&#38;#40;rst.next&#38;#40;&#38;#41;&#38;#41;
&#38;#123;
%>
<%= rst.getString&#40;1&#41; %>
<%
&#38;#125;
else
&#38;#123;
%>
error
<%
&#38;#125;

conn.close&#38;#40;&#38;#41;;
initCtx.close&#38;#40;&#38;#41;;

%>
</Body>
</HTML>[/code:1:c7cb2bcb50]

Here are the Database element's settings
  • Type: single
  • JNDI name: java:comp/env/jdbc/test
  • Query: select count(*) from RebateOfferNumber2

I've attached the updated version of server.xml for your reference.
Thank you.

Subject: RE: JNDI setup
Replied by: Michael Bochynski on 09-12-2004 09:27:24 PM
Hi,

note that the JNDI name in your custom Java/JSP code will be different than in the Database element. Please change your JNDI name setting to "jdbc/test".

I would also suggest using the simple select qurey, such as

select COL_NAME from TABLE where ID=1

Regards,
Michael

Subject: RE: JNDI setup
Replied by: null on 09-12-2004 09:46:41 PM
Thanks for your help. I changed the JNDI name to jdbc/test and changed the query to [code:1:60d573efaf]SELECT MfrPhoneNumber
FROM RebateOfferNumber2
WHERE &#40;OfferNumber = 99999&#41;[/code:1:60d573efaf]

but still getting the same error. Any other ideas?

I already set the logging level to 'complete'. Is there any way to get more information about this error?

I don't know if this may cause any problem. I am testing Audium through Internet Explorer. I DO follow this article http://www.audiumcentral.com/supportcenter/viewtopic.php?t=113&#38;highlight=port and have successfully followed the call flow up to the Database call.

Thanks.

Subject: RE: JNDI setup
Replied by: Michael Bochynski on 21-12-2004 09:15:36 PM
Hi,

I apologize for the confusion. The correct way to set up JNDI for the Database element is to use only the name of the JDBC, without â¿¿jdbc/â¿¿ part. Hence, in your situation, the correct setting for JNDI name in the Database element would be â¿¿testâ¿¿.

Please let me know if it works for you.

Regards,
Michael

Subject: RE: JNDI setup
Replied by: null on 22-12-2004 03:25:22 PM
It works now. Thanks for your help.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links