Hi, I am running WebLogic 6.1 on Win2k and I have problem with Cloudscape database in Default Admin Server. === Start init method in myJDBCReadServlet.java === Init Error: javax.naming.NameNotFoundException: Unable to resolve MyJDBCDataSource. Resolved: '' Unresolved:'MyJDBCDataSource' ; remaining name '' === Finish init method in myJDBCReadServlet.java === I created simple table in the database using IJ utility and inserted some values: prompt>java -classpath %CLASSPATH%;..\lib\tools.jar COM.cloudscape.tools.ij ij version 3.5 (c) 1997-2000 Informix Software, Inc. ij> CONNECT 'jdbc:cloudscape:demo;create=true'; WARNING 01J01: Database 'demo' not created, connection made to existing database instead. ij> SHOW CONNECTIONS; CONNECTION0* - jdbc:cloudscape:demo;create=true * = current connection ij> CREATE TABLE employee(name CHAR(25), location CHAR(20), id INTEGER); 0 rows inserted/updated/deleted The Connection Pool configuration is the following: Name : MyJDBC Connection Pool URL : jdbc:cloudscape:demo Driver Classname: COM.cloudscape.core.JDBCDriver Properties : user=none password=none server=none My Data Source configuration is the following: Name : MyJDBC Data Source JNDI Name: MyJDBCDataSource Pool Name: MyJDBC Connection Pool
I added the following line to myserver startup script to point to the database location: -Dcloudscape.system.home=./samples/eval/cloudscape/data Here is the piece of the myJDBCReadServlet code which generated the exception: public void init() { System.out.println("=== Start init method in myJDBCReadServlet.java ==="); try { ctx = new InitialContext(); ds = (javax.sql.DataSource) ctx.lookup ("MyJDBCDataSource"); } catch (Exception E) { System.out.println("Init Error: " + E); } System.out.println("=== Finish init method in myJDBCReadServlet.java ==="); } Any help will be greatly appreciated, Jacob Nikom
Ranjith R
Greenhorn
Joined: Sep 18, 2001
Posts: 22
posted
0
hi there..<br> make sure that your datasource is created without any error <br>when you start up the default server. If you find any error <br>msgs like : Cannot Create Data Source Named ...etc, then <br>include the jdbc driver jar file path into your CLASSPATH. If <br>even this fails, try adding this path to the CLASSPATH setting in the startWebLogic.cmd file located in <br>your "wlserver6.1\urdomain" folder.<br> and finally make sure that you got the following lines in the weblogic-cmp-rdbms-jar.xml dd. file <br><br> <pre> <weblogic-rdbms-bean> <pool-name>Your_Pool_Name</pool-name> <table-name>Table_to_access</table-name> .... </pre> take care..
Take care<BR>r@njith
jacob nikom
Greenhorn
Joined: Oct 01, 2001
Posts: 12
posted
0
Problem solved! Ranjith - thank you for your help. Yes, cloudscape.jar file should be on the CLASSPATH. I also put tools.jar from the same directory. However, it is not enough to run WebLogic with Cloudscape successfuly. You have to tell WebLogic where the database files are. To do it you have to include start-up option in the startWebLogic.cmd file. It looks like: -Dcloudscape.system.home="C:~\samples\eval\cloudscape\data" After that it runs. Actually, the file cloudscape.html in the directory ~\samples\eval\cloudscape has quite a bit information. Unfortunately, it is difficult to comprehend it until you understand what the problem is. Regards, Jacob
subject: Problem with JNDI and Cloudscape database