Which part don't you understand?

In jboss you cannot access a datasource over the network,
even if it is local sockets to a process on the same server.

Your use of the provider url in the jndi settings makes the
java:/ namespace (where the datasource is bound within jndi)
inaccessible.

Before you ask, moving it to the global namespace does not
fix the problem. DataSources are not remote objects (at least
in jboss's implementation).

Regards,
Adrian

On Wed, 2004-01-14 at 17:35, Bret Kumler wrote:
> Not sure what you mean, but I'm interested in learning more.
> 
> You'll have to forgive me, I'm not a developer. I'm actually one of those qa
> guys.
> 
> I'm trying to port a test case system I created with proprietary tool.
> 
> Anything to make it better.
> Thanks for the help.
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Adrian Brock
> Sent: Tuesday, January 13, 2004 5:41 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-user] JNDI question
> 
> 
> If you are trying to use the DataSource on the server,
> you should be using new InitialContext().
> 
> JBoss does not support using a DataSource outside of the virtual
> machine.
> That is why your ds is actually bound at java:/MYDATASOURCE
> 
> Personally I don't see the point of using a ds in a seperate process.
> The main reasons for using JCA is to provide automatic transaction
> enlistment, configured security and pooling. All of which are
> greatly complicated and perform badly (or negated in the case of
> pooling) once you go outside the VM.
> 
> I can see the convenience where you can make a
> common deployment, but you should really look at a more
> stateless design where the sqls are run on the server with the
> results returned to the client. In most cases the stateless
> design will perform much better.
> 
> Regards,
> Adrian
> 
> On Tue, 2004-01-13 at 23:59, Bret Kumler wrote:
> > Correct.
> >
> > Here's my oracle-ds.xml content:
> >
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <!DOCTYPE datasources SYSTEM
> > "C:\jboss-3.2.3\docs\dtd\jboss-ds_1_0.dtd">
> >
> > <datasources>
> >
> > <local-tx-datasource>
> >
> > <jndi-name>MYDATASOURCE</jndi-name>
> >
> > <connection-url>jdbc:oracle:thin:@101.33.214:1521:TEST</connection-url>
> >
> > <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
> >
> > <user-name>testt</user-name>
> >
> > <password>test</password>
> >
> > <min-pool-size>10</min-pool-size>
> >
> > <max-pool-size>100</max-pool-size>
> >
> > <check-valid-connection-sql>true</check-valid-connection-sql>
> >
> >
> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleEx
> ceptionSorter</exception-sorter-class-name>
> >
> > </local-tx-datasource>
> >
> > </datasources>
> >
> >
> >
> > Here's my code.
> >
> >
> > //Loads the data from a properties file
> >
> > private void loadPMProperties(){
> >     Properties props = new Properties();
> >     try{
> >
> > props.load(this.getClass().getResourceAsStream("/tc.properties"));
> >        jdbc_jndi_name = props.getProperty("TC_DATASOURCE").trim();
> >        jboss_jndi_factory_name =
> > props.getProperty("JNDI_FACTORY").trim();
> >        pkg_prefixes= props.getProperty("PKG_PREFIXES").trim();
> >        jboss_url = props.getProperty("URL").trim();
> >
> >      }catch(IOException ioe){
> >        logger.error("Failed to load properties file
> > '"+"tc.properties"+"'");
> >        logger.error(ioe.getMessage());;
> >      }
> >    }
> >
> > private Context getInitialContext(){
> >
> >    Properties properties = null;
> >    Context ctx =null;
> >    try {
> >      properties = new Properties();
> >      properties.put(Context.INITIAL_CONTEXT_FACTORY,
> > jboss_jndi_factory_name);
> >      properties.put(Context.PROVIDER_URL, jboss_url);
> >      properties.put(Context.URL_PKG_PREFIXES, pkg_prefixes);
> >      ctx= new InitialContext(properties);
> >    }
> >    catch (javax.naming.NamingException e) {
> >      logger.error("Unable to connect to JBOSS server at " +
> > jboss_url);
> >    }
> >    return ctx;
> >  }
> >
> > public ArrayList getData(){
> >
> > // Incomplete
> > try {
> >      Context ctx = getInitialContext();
> >      pool = (DataSource)ctx.lookup(jdbc_jndi_name); // IT DIES RIGHT
> > HERE THE LOOK UP
> >      }
> >    catch (javax.naming.NamingException ex){
> >      logger.error("Couldn't obtain JDBC connection pool: " +
> > jdbc_jndi_name);
> >    }
> >  }
> >
> >
> > Here's the content of my tc.properties
> > URL=localhost:1099
> > TC_DATASOURCE=MYDATASOURCE
> > JNDI_FACTORY=org.jnp.interfaces.NamingContextFactory
> > PKG_PREFIXES=org.jboss.naming
> >
> >
> >
> > It can not find the connection pool name
> >
> >
> > Thanks for the help
> >
> >
> >
> >
> >
> >          -----Original Message-----
> >         From: [EMAIL PROTECTED]
> >         [mailto:[EMAIL PROTECTED] Behalf Of
> >         Jae Gangemi
> >         Sent: Tuesday, January 13, 2004 2:44 PM
> >         To: [EMAIL PROTECTED]
> >         Subject: RE: [JBoss-user] JNDI question
> >
> >
> >         if i'm understanding your question properly, you define all
> >         the database information in a datasource file which is then
> >         placed in
> >         the your deployment directory. (see docs/examples/jca for
> >         example data sources)
> >
> >         when jboss starts up, it reads the datasource and builds the
> >         appropriate connections. if you need to retreive one of those
> >         datasources, you would use the following code:
> >
> >         ...
> >         Context ctx = new InitialContext();
> >         dataSource = (DataSource) ctx.lookup(dataSourceName)
> >
> >         where dataSourceName is the jndi name you specificed in the
> >         datasource deployment xml file.
> >
> >         as for the intial context factory class, you can just specify
> >         the following in a jndi.properties file that is included w/
> >         your jar:
> >
> >
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> >         java.naming.provider.url=localhost:1099
> >
> >         -jae
> >
> >                 -----Original Message-----
> >                 From: [EMAIL PROTECTED]
> >                 [mailto:[EMAIL PROTECTED] On
> >                 Behalf Of Bret Kumler
> >                 Sent: Tuesday, January 13, 2004 4:51 PM
> >                 To: Jboss
> >                 Subject: [JBoss-user] JNDI question
> >
> >
> >                 I was wonder, with the default installation of JBOSS,
> >                 what is the jndi factory lookup for a datasource, the
> >                 url, username and the password.
> >
> >
> >
> >                 E.G. for Weblogic:
> >
> >                  private Context getInitialContext(){
> >
> >                    Properties properties = null;
> >                    Context ctx =null;
> >                    String weblogic_url="t3://localhost:7001";
> >                    String
> >
> weblogic_jndi_factory_name="weblogic.jndi.WLInitialContextFactory";
> >                    String user="system";
> >                    String pass="password";
> >                    try {
> >                      properties = new Properties();
> >                      properties.put(Context.INITIAL_CONTEXT_FACTORY,
> >                 weblogic_jndi_factory_name);
> >                      properties.put(Context.PROVIDER_URL,
> >                 weblogic_url);
> >                      if (user != null) {
> >                        properties.put(Context.SECURITY_PRINCIPAL,
> >                 user);
> >                        properties.put(Context.SECURITY_CREDENTIALS,
> >                 pass == null ? "" : pass);
> >                      }
> >                      ctx= new InitialContext(properties);
> >                    }
> >                    catch (javax.naming.NamingException e) {
> >                      logger.error("Unable to connect to WebLogic
> >                 server at " + weblogic_url);
> >                    }
> >                    return ctx;
> >                  }
> >
> >
> >                 Thanks
> >
> >
> --
> xxxxxxxxxxxxxxxxxxxxxxxx
> Adrian Brock
> Director of Support
> Back Office
> JBoss Group, LLC
> xxxxxxxxxxxxxxxxxxxxxxxx
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Perforce Software.
> Perforce is the Fast Software Configuration Management System offering
> advanced branching capabilities and atomic changes on 50+ platforms.
> Free Eval! http://www.perforce.com/perforce/loadprog.html
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to