RE: [JBoss-user] not bound problem
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=PoolNameMySqlDB/attribute attribute name=URLjdbc:mysql://localhost:3306/gsfs/attribute attribute name=MinSize10/attribute attribute name=MaxSize100/attribute attribute name=JDBCUsergsfs/attribute attribute name=Passwordgsfs/attribute /mbean In the standardjaws.xml I added: datasourcejava:/MySqlDB/datasource type-mappingmySQL/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
Re: [JBoss-user] not bound problem
This is a multi-part message in MIME format. --InterScan_NT_MIME_Boundary Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Michael Baedorf wrote: Now I try to look for the DB (not using a bean nor a servlet): If not a bean or a servlet, what is this code in? You can't get a DB connection from outside of the JBoss VM. 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 --InterScan_NT_MIME_Boundary Content-Type: text/plain; name=InterScan_Disclaimer.txt Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=InterScan_Disclaimer.txt Confidential e-mail for addressee only. Access to this e-mail by anyone else is unauthorized. If you have received this message in error, please notify the sender immediately by reply e-mail and destroy the original communication. --InterScan_NT_MIME_Boundary-- ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] not bound problem
Try looking up java:/MySqlDB Should work.. Vinay - Original Message - From:Michael Baedorf Sent:Thursday, May 03, 2001 3:06 PM To:[EMAIL PROTECTED] Subject:[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.mysql.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 /mbeanIn the standardjaws.xml I added: datasourcejava:/MySqlDB/datasource type-mappingmySQL/type-mappingAfter starting the server I get the message: [MySqlDB] Starting [MySqlDB] XA Connection pool MySqlDB bound to java:/MySqlDB [MySqlDB] StartedJNDIView 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 boundI 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 Get your FREE download of MSN Explorer at http://explorer.msn.com