aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBoss Datasource created, not binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss Datasource created, not binding" Watch "JBoss Datasource created, not binding" New topic
Author

JBoss Datasource created, not binding

Justin Westra
Greenhorn

Joined: Sep 04, 2012
Posts: 3
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

Joined: Sep 04, 2012
Posts: 4
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

Joined: Jul 20, 2005
Posts: 10263
    
168

What problem are you running into?

[My Blog] [JavaRanch Journal]
Justin Westra
Greenhorn

Joined: Sep 04, 2012
Posts: 3
The problem is jboss isn't binding the names, regardless how I name them
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10263
    
168

Where exactly have you placed that *-ds.xml file and what command do you use to start the server?
Justin Westra
Greenhorn

Joined: Sep 04, 2012
Posts: 3
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss Datasource created, not binding