• 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

Name Not Bound Exception

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using Netbeans IDE with JBoss as application server and MySql as Database. I am working on it more than a week and can not able to solve it.
I Placed the mysql-connector-java-5.0.8-bin.jar file in the lib folder and configured the mysql-ds.xml file and placed it in the server\default\deploy
directory. And mysql-ds.xml is as follows


Name of my project is sample and in sample-war file I wrote a JSP to call the EJB methods. And this is as follows

I wrote a remote Stateless session bean and an entity bean.
And my persistence.xml file looks as follows
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="titan" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/mysql</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>

When I run the application i got an exception like sample not bound.
When JBoss is started I can see an error in the console. It is
ObjectName: persistence.units:ear=sample2.ear,jar=sample2-ejb.jar,unitName=titan
State: FAILED
Reason: javax.naming.NameNotFoundException: jdbc not bound
I Depend On:
jboss.jca:service=ManagedConnectionFactory,name=jdbc/mysql
Depends On Me:
jboss.j2ee:ear=sample2.ear,jar=sample2-ejb.jar,name=TravelAgentBean,service=EJB3


Thanks
Sravani
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<jta-data-source>jdbc/mysql</jta-data-source>



Change it to



By default, the datasources are bound to the java: namespace
 
sravani jetty
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jaikiran,
I did that but still it is not working.

Thanks
Sravani
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic