Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss Datasource created, not binding

 
Justin Westra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've had this issue for a while. Working with JBoss 5.1.0. I'm trying to create a new *-ds.xml file following the format of the sample datasources. My jndi-name is "alert" and the following are other configured datasources on this server:

2012-08-30 12:03:40,141 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (main) Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'javaefaultDS'
2012-08-30 12:03:40,184 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (main) Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/LiferayPool' to JNDI name 'java:jdbc/LiferayPool'
2012-08-30 12:03:40,222 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (main) Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/MyDS' to JNDI name 'java:jdbc/MyDS'

The following is my new datasource file:

<?xml version="1.0" encoding="UTF-8"?>

<datasources>
<local-tx-datasource>
<jndi-name>alert</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>hidden-for-security</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>hidden-for-security</user-name>
<password>hidden-for-security</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<min-pool-size>5</min-pool-size>
<max-pool-size>10</max-pool-size>

<!-- should only be used on drivers after 3.22.1 with "ping" support
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-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 - MySQLValidConnectionChecker is preferred for newer drivers
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>

Anyone seen this before? Any help is appreciated
 
Norayr Kocharyan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I understand the JNDI naming is becoming strict. you should be using something like java:jobss/<name> notation. the ones you see at the top that did bind might have done so in a form of backwards compatibility. Try a proper JNDI name.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What problem are you running into?
 
Justin Westra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is jboss isn't binding the names, regardless how I name them
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where exactly have you placed that *-ds.xml file and what command do you use to start the server?
 
Justin Westra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the server/default/deploy folder, and I use the jboss run.sh script in the bin folder (we're using the server for a liferay portal if that helps at all). This is just really confusing to me, I've got binding working automatically in our dev env, but not QA. No idea what happened to this box.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic