this should work

    javax.sql.DataSource ds=
(javax.sql.DataSource)ic.lookup("java:/SQLServerPool");

If not, do you have a complete stack trace.

Phong.

----- Original Message -----
From: prateeks saxena <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 3:49 PM
Subject: [JBoss-user] Connection Pooling and JNDI (fails to find )


Hi
    I am using SQLServer and i have switched
on the connection pooling . I have done everything according to JBOSS site
docs. But i am facing the problem when i try to look up the name. Actually
I am writing a BMP and i am trying to get the connection object from there.
     ********************************
     System.setProperty("java.naming.factory.initial",
          "org.jnp.interfaces.NamingContextFactory");
     System.setProperty("java.naming.provider.url",
          "localhost:1099");
     InitialContext ic=new  InitialContext();

javax.sql.DataSource ds= (javax.sql.DataSource)ic.lookup("SQLServerPool");
java.sql.Connection con=ds.getConnection("dev","dev");
************************************************
In lookup i tried everything like java:/SQLServerPool
but it fails to find it. COuld anybody help me out to solve the problem

and this is the outcome when i run the Jboss.


*******************************
Using configuration "file:///d:/Program Files/IBM/VisualAge for
Java/ide/project_resources/JBoss/conf/default"
[Console logging] Initialized
[Classpath extension] Initializing
[Classpath extension] Initialized
[File logging] Initializing
[File logging] Initialized
[Classpath extension] Initializing
[Classpath extension] Initialized
[Classpath extension] Initializing
[Classpath extension] Initialized
[Info] Java version: 1.2.2,IBM Corp.
[Info] Java VM: IBM VisualAge VM 1.2,IBM Corp.
[Info] System: Windows NT 4.0,x86
[Classpath extension] Initializing
[Classpath extension] Initialized
[JDBC] Loaded JDBC-driver:org.hsql.jdbcDriver
[JDBC] Loaded JDBC-driver:org.enhydra.instantdb.jdbc.idbDriver
[JDBC] Loaded JDBC-driver:COM.ibm.db2.jdbc.net.DB2Driver
[JDBC] Loaded JDBC-driver:com.inet.tds.TdsDriver
[Webserver] Initializing
[Webserver] Initialized
[Hypersonic] Initializing
[Hypersonic] Initialized
[Naming] Initializing
[Naming] Naming started on port 1099
[Naming] Initialized
[Transaction manager] Initializing
[Transaction manager] Initialized
[JAAS Security Manager] Initializing
[JAAS Security Manager] Initialized
[Simple Realm Mapping] Initializing
[Simple Realm Mapping] Initialized
[Security manager] Initializing
[Security manager] Initialized
[InstantDB] Initializing
[InstantDB] Initialized
[DefaultDS] Initializing
[DefaultDS] Initialized
[Container factory] Initializing
[Container factory] Initialized
[Auto deploy] Auto-deploying D:\Program Files\IBM\VisualAge for
Java\ide\project_resources\JBoss\deploy
[Auto deploy] Initializing
[Auto deploy] Initialized
[JMX RMI Adaptor] Initializing
[JMX RMI Adaptor] Initialized
[JMX RMI Connector] Initializing
[JMX RMI Connector] Initialized
[Configuration] Initializing
[Configuration] Initialized
[DB2] Initializing
[DB2] Initialized
[SQLServerPool] Initializing
[SQLServerPool] Initialized
[J2EE Deployer] Initializing
[J2EE Deployer] Initialized
[SpyderMQ] Initializing
[SpyderMQ] Initialized
[Security manager] Starting
[Security manager] Started
[Naming] Starting
[Naming] Started
[Hypersonic] Starting
[Hypersonic] Server 1.4 is running
[Hypersonic] Database started
[Hypersonic] Press [Ctrl]+[C] to abort
[Hypersonic] Started
[Transaction manager] Starting
[Transaction manager] Started
[InstantDB] Starting
[InstantDB] XA Connection pool InstantDB bound to java:/InstantDB
Enhydra InstantDB - Version 3.21
[InstantDB] The Initial Developer of the Original Code is Lutris
Technologies Inc.
Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies,
Inc.
All Rights Reserved.
[InstantDB] Started
[SQLServerPool] Starting
[SQLServerPool] XA Connection pool SQLServerPool bound to
java:/SQLServerPool
[SQLServerPool] Started
[DB2] Starting
[DB2] XA Connection pool DB2 bound to java:/DB2
[DB2] Started
[DefaultDS] Starting
[DefaultDS] XA Connection pool DefaultDS bound to java:/DefaultDS
[DefaultDS] Started
[Webserver] Starting
[Webserver] Codebase set to http://pgs-230:8083/
[Webserver] Started webserver on port 8083
[Webserver] Started
[Simple Realm Mapping] Starting
[Simple Realm Mapping] Started
[SpyderMQ] Starting
[SpyderMQ] Testing if SpyderMQ is present....
[SpyderMQ] OK
[SpyderMQ] Starting SpyderMQ...
[SpyderMQ] Started
[JAAS Security Manager] Starting
[JAAS Security Manager] Started
[Container factory] Starting
[Container factory] Started
[SpyderMQ] Cannot start the JMS server ! null
[Auto deploy] Starting
[SpyderMQ] java.lang.NullPointerException
[Auto deploy] Auto deploy of file:/D:/Program Files/IBM/VisualAge for
Java/ide/project_resources/JBoss/deploy/
[SpyderMQ]     java.lang.Throwable()
     java.lang.Exception()
     java.lang.RuntimeException()
     java.lang.NullPointerException()
     void org.spydermq.server.StartServer.run()
     void org.spydermq.server.StartServer.run()
     void java.lang.Thread.run()

[J2EE Deployer] Deploy J2EE application: file:/D:/Program
Files/IBM/VisualAge for Java/ide/project_resources/JBoss/deploy/
[J2EE Deployer] Create application deploy
[J2EE Deployer] Installing EJB package: deploy
[J2EE Deployer] Starting module deploy
[Container factory] Deploying:file:/d:/program files/ibm/visualage for
java/ide/project_resources/JBoss/tmp/deploy/deploy/ejb1002.jar
[Verifier] Verifying file:/d:/program files/ibm/visualage for
java/ide/project_resources/JBoss/tmp/deploy/deploy/ejb1002.jar
[Container factory] Deploying MusicCDBean
[Container factory] Deploying Increment
[Container factory] Deploying Interest
[Container factory] Deploying SQLConnectionPool
[Bean Cache] Cache policy scheduler started
[Container factory] Deployed application: file:/d:/program
files/ibm/visualage for
java/ide/project_resources/JBoss/tmp/deploy/deploy/ejb1002.jar
[J2EE Deployer] J2EE application: file:/D:/Program Files/IBM/VisualAge for
Java/ide/project_resources/JBoss/deploy/ is deployed.
[Auto deploy] Started
[J2EE Deployer] Starting
[J2EE Deployer] No web container found - only EJB deployment available...
[J2EE Deployer] Cleaning up deployment directory file:/d:/program
files/ibm/visualage for java/ide/project_resources/JBoss/./tmp/deploy/
[J2EE Deployer] Started
[JMX RMI Adaptor] Starting
[JMX RMI Adaptor] Started
[JMX RMI Connector] Starting
[JMX RMI Connector] Started
[Default] 23 services and 4 other MBeans started.
[Default] jBoss 2.0 FINAL Started
[Bean Cache] Resized cache for bean Increment: old size = 1000, new size =
50
[Bean Cache] Resized cache for bean MusicCDBean: old size = 1000, new size
= 50



PLEASE SEE THE CODE FOR THE FILES
******************************* JBOSS.CONF
<MLET CODE="org.jboss.jdbc.XADataSourceLoader"
ARCHIVE="jboss.jar,Opta200.jar"
CODEBASE="./lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="SQLServerPool">
    <ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>
******************************jboss.jcml
 <mbean name="DefaultDomain:service=XADataSource,name=SQLServerPool">
       <attribute name="Password">dev</attribute>
       <attribute name="MaxSize">10</attribute>
       <attribute name="GCMinIdleTime">1200000</attribute>
       <attribute name="GCInterval">120000</attribute>
       <attribute
name="URL">jdbc:inetdae:PGS-404?database=Interaxon_Dev</attribute>
       <attribute name="InvalidateOnError">false</attribute>
       <attribute name="GCEnabled">false</attribute>
       <attribute name="MinSize">1</attribute>
       <attribute name="IdleTimeout">1800000</attribute>
       <attribute name="TimestampUsed">false</attribute>
       <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
       <attribute name="IdleTimeoutEnabled">false</attribute>
       <attribute name="Blocking">true</attribute>
       <attribute name="JDBCUser">dev</attribute>
       <attribute name="LoggingEnabled">false</attribute>
       <attribute name="Properties">host=jdbc:inetdae:PGS-404;
database=Interaxon_Dev</attribute>
     </mbean>

*******************************


Could you please help  me out.

regards
prateek


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user




_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to