You just can't have access to a data source outside of the container.
You need to get the datasource from within an ejb.

Francois

> -----Message d'origine-----
> De:   Michael Baedorf [SMTP:[EMAIL PROTECTED]]
> Date: 3 mai, 2001 09:50
> �:    [EMAIL PROTECTED]
> Objet:        [JBoss-user] not bound problem
> 
> Hello,
> 
> I�m a newbie and I have a problem getting a database connection.
> 
> I configured the following in the jboss.jcml:
>   
>   <mbean code="org.jboss.jdbc.JdbcProvider"
> name="DefaultDomain:service=JdbcProvider">
>      <attribute name="Drivers">  
>         
> 
> org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,org.gjt.mm.my
> sql.Driver
>      </attribute>
>   </mbean>
> 
> 
>    <mbean code="org.jboss.jdbc.XADataSourceLoader"  
>               name="DefaultDomain:service=XADataSource,name=MySqlDB">
>     <attribute name= "DataSourceClass">
>                  
> org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
>     <attribute name="PoolName">MySqlDB</attribute>
>     <attribute name="URL">jdbc:mysql://localhost:3306/gsfs</attribute>
>     <attribute name="MinSize">10</attribute>
>     <attribute name="MaxSize">100</attribute>
>     <attribute name="JDBCUser">gsfs</attribute>
>     <attribute name="Password">gsfs</attribute>
>   </mbean>
> 
> In the standardjaws.xml I added:
>     <datasource>java:/MySqlDB</datasource>
>     <type-mapping>mySQL</type-mapping>
> 
> After starting the server I get the message:
>    [MySqlDB] Starting
>    [MySqlDB] XA Connection pool MySqlDB bound to java:/MySqlDB
>    [MySqlDB] Started
> 
> JNDIView result:
> java: Namespace
>   +- MinervaXACMFactory (class: 
>       org.opentools.minerva.connector.jboss.MinervaXACMFactory)
>   +- DefaultDS (class: org.opentools.minerva.jdbc.xa.XAPoolDataSource)
>   +- SecurityProxyFactory (class:
> org.jboss.security.SubjectSecurityProxyFactory)
>   +- MySqlDB (class: org.opentools.minerva.jdbc.xa.XAPoolDataSource)
>   ...
> 
> Now I try to look for the DB (not using a bean nor a servlet):
> try {   
>    props = new Properties();
>    props.setProperty  
>           ("java.naming.factory.initial",
> "org.jnp.interfaces.NamingContextFactory");
>    props.setProperty
>           ("java.naming.provider.url", "localhost:1099");
>    props.setProperty
>           ("java.naming.factory.url.pkgs", "org.jboss.naming");
>             
>             ctx = new InitialContext(props);
>             System.out.println("Got Context");
> 
>             objRef = ctx.lookup("MySqlDB");
>             System.out.println("Got Reference");
>    ...
> } catch ...
> 
> Running the simple program only throw an exception:
>     MySqlDB not bound
> 
> I included all packages mentioned in chapter 1 of the online
> documentation.
> 
> Can somebody tell me what�s the error?
> 
> Thanks.
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> 
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> 
> _______________________________________________
> 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