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

help needed

Maya Pillai
Ranch Hand

Joined: Jul 17, 2008
Posts: 60
I am trying to configure datasource in my jboss-4.2.2.GA server.I am getting an error javax.naming.NameNotFoundException mysqlds not bound


mysql-ds.xml
----------------

<datasources>
<local-tx-datasource>
<jndi-name>java:mysqlds</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/test</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>tester</user-name>
<password>tester123</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- 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 -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>


Please help
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10268
    
169

<jndi-name>java:mysqlds</jndi-name>


Change this to just



By default, it will be bound to the java: namespace, so you can look it up using java:mysqlds


[My Blog] [JavaRanch Journal]
Maya Pillai
Ranch Hand

Joined: Jul 17, 2008
Posts: 60
Still I am getting error

javax.naming.NameNotFoundException mysqlds not bound

Please help
Maya Pillai
Ranch Hand

Joined: Jul 17, 2008
Posts: 60
Solved it by adding DataSource ds = (javax.sql.DataSource)ic.lookup("java:/mysqlds"); in the java file....now got another exception from this line

con = ds.getConnection();


org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transa ction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fe15:773:49509757 :96 status:



Any solution.?

Thanks in advance
[ December 23, 2008: Message edited by: Maya Pillai ]
 
Don't get me started about those stupid light bulbs.
 
subject: help needed