• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Probles in setting datasource

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I need to convert the existing database connection to datasource.
Done the below changes:
Added below code to web.xml


Created a file jboss-web.xml in web-inf having below contents


Copied the mysql-ds.xml from \jboss-5.0.0.GA-jdk6\docs\examples\jca to MyProject\WEB_INF and modified it as below:


My existing application has persistence.xml file as:


Client Class for calling the Connection method:


then removed the hsqldb-ds.xml from jboss/deploy folder.
Getting compilation error as:
jboss.ejb:persistencePolicy=database,service=EJBTimerService
-> jboss.jdbc:datasource=DefaultDS,service=metadata{Create:** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **}
-> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **}

jboss.ejb:service=EJB3TimerService
-> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **}

jboss.ejb:service=EJBTimerService
-> jboss.ejb:persistencePolicy=database,service=EJBTimerService{Create:Configured}


After logging in i m getting below exception in console:
17:52:49,494 ERROR [STDERR] javax.naming.NameNotFoundException: amarshi not bound
17:52:49,510 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
17:52:49,510 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
17:52:49,510 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
17:52:49,510 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
17:52:49,510 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
17:52:49,510 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
17:52:49,510 ERROR [STDERR] at javax.naming.InitialContext.lookup(Unknown Source)


PLease correct me which step went wrong.

Thanks
Amarshi

 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic