You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Slattery, Tim - BLS" <Sl...@bls.gov> on 2004/08/27 20:11:49 UTC
Jboss database config?
Once more for a Jboss newby please?
I can't get connected to my database. The sybase-ds.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!-- =====================================================================
-->
<!--
-->
<!-- JBoss Server Configuration
-->
<!--
-->
<!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver
-->
<!-- Thanks to Marc Zampetti <za...@aol.net>
-->
<!-- This is a minimal example. See the generic example for other stuff
-->
<!-- =====================================================================
-->
<!-- $Id: sybase-ds.xml,v 1.1.2.2 2003/09/05 16:38:24 patriot1burke Exp $
-->
<datasources>
<local-tx-datasource>
<jndi-name>ds.Freqs</jndi-name>
<!-- Sybase jConnect URL for the database.
NOTE: The hostname and port are made up values. The optional
database name is provided, as well as some additinal Driver
parameters.
-->
<connection-url>jdbc:sybase:Tds:146.142.44.41:4100</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
<user-name>Slattery_T</user-name>
<password>xxxxxxx</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseEx
ceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is
obtained from pool
<check-valid-connection-sql>some arbitrary
sql</check-valid-connection-sql>
-->
</local-tx-datasource>
</datasources>
The Java code in my app is:
InitialContext ic = new InitialContext();
datasource = (DataSource) ic.lookup("ds.Freqs");
This throws a NamingException with this message: ds.Freqs not bound
The server log seems to show ds.Freqs being created.
Any clues?
--
Tim Slattery
Slattery_T@bls.gov
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Jboss database config?
Posted by ksitron <ks...@elp.rr.com>.
change this:
datasource = (DataSource) ic.lookup("ds.Freqs");
to:
datasource = (DataSource) ic.lookup("java:/ds.Freqs");
Slattery, Tim - BLS wrote:
>Once more for a Jboss newby please?
>
>I can't get connected to my database. The sybase-ds.xml is as follows:
>
><?xml version="1.0" encoding="UTF-8"?>
>
><!-- =====================================================================
>-->
><!--
>-->
><!-- JBoss Server Configuration
>-->
><!--
>-->
><!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver
>-->
><!-- Thanks to Marc Zampetti <za...@aol.net>
>-->
><!-- This is a minimal example. See the generic example for other stuff
>-->
><!-- =====================================================================
>-->
>
><!-- $Id: sybase-ds.xml,v 1.1.2.2 2003/09/05 16:38:24 patriot1burke Exp $
>-->
>
>
><datasources>
> <local-tx-datasource>
> <jndi-name>ds.Freqs</jndi-name>
> <!-- Sybase jConnect URL for the database.
> NOTE: The hostname and port are made up values. The optional
> database name is provided, as well as some additinal Driver
> parameters.
> -->
> <connection-url>jdbc:sybase:Tds:146.142.44.41:4100</connection-url>
> <driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
> <user-name>Slattery_T</user-name>
> <password>xxxxxxx</password>
>
><exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseEx
>ceptionSorter</exception-sorter-class-name>
> <!-- sql to call when connection is created
> <new-connection-sql>some arbitrary sql</new-connection-sql>
> -->
>
> <!-- sql to call on an existing pooled connection when it is
>obtained from pool
> <check-valid-connection-sql>some arbitrary
>sql</check-valid-connection-sql>
> -->
>
> </local-tx-datasource>
>
></datasources>
>
>
>The Java code in my app is:
>
> InitialContext ic = new InitialContext();
> datasource = (DataSource) ic.lookup("ds.Freqs");
>
>This throws a NamingException with this message: ds.Freqs not bound
>
>The server log seems to show ds.Freqs being created.
>
>Any clues?
>
>
>--
>Tim Slattery
>Slattery_T@bls.gov
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Jboss database config?
Posted by Marco Mistroni <mm...@waersystems.com>.
Hello,
Not sure if it helps, but did u remember to add a realm entry in
the login-config.xml file?
And, as well, add an entry <security-domain> to your ds.xml..
Regards
marco
-----Original Message-----
From: Slattery, Tim - BLS [mailto:Slattery.Tim@bls.gov]
Sent: 27 August 2004 19:12
To: Struts User List (struts-user@jakarta.apache.org)
Subject: Jboss database config?
Once more for a Jboss newby please?
I can't get connected to my database. The sybase-ds.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!--
=====================================================================
-->
<!--
-->
<!-- JBoss Server Configuration
-->
<!--
-->
<!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver
-->
<!-- Thanks to Marc Zampetti <za...@aol.net>
-->
<!-- This is a minimal example. See the generic example for other stuff
-->
<!--
=====================================================================
-->
<!-- $Id: sybase-ds.xml,v 1.1.2.2 2003/09/05 16:38:24 patriot1burke Exp
$
-->
<datasources>
<local-tx-datasource>
<jndi-name>ds.Freqs</jndi-name>
<!-- Sybase jConnect URL for the database.
NOTE: The hostname and port are made up values. The optional
database name is provided, as well as some additinal Driver
parameters.
-->
<connection-url>jdbc:sybase:Tds:146.142.44.41:4100</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
<user-name>Slattery_T</user-name>
<password>xxxxxxx</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.Syba
seEx
ceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is
obtained from pool
<check-valid-connection-sql>some arbitrary
sql</check-valid-connection-sql>
-->
</local-tx-datasource>
</datasources>
The Java code in my app is:
InitialContext ic = new InitialContext();
datasource = (DataSource) ic.lookup("ds.Freqs");
This throws a NamingException with this message: ds.Freqs not bound
The server log seems to show ds.Freqs being created.
Any clues?
--
Tim Slattery
Slattery_T@bls.gov
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org