Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

error while deploying ejb3.0 in jboss 4.2

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I am learning EJB3.0 JPA and i tried deploying a sample bean on Jboss server and i am getting the following exception

ObjectName: persistence.units:jar=sampleEJB.jar,unitName=employeeDB
State: FAILED
Reason: java.lang.RuntimeException: You have not defined a jta-data-source for a JTA enabled persistence context named: employeeDB
Depends On Me:
jboss.j2ee:jar=sampleEJB.jar,name=SampleSessionBean,service=EJB3


how to resolve this problem and also tell me whether i need to configure datasource in jboss for this and whether any libraries i need to put for making this work.

I am trying to connect to oracle DB and also i am not sure whether my persistence.xml is right .. i am putting my persistence.xml over here and correct me by giving examples if there is anything wrong.

<persistence-unit name="employeeDB">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.edu.entity.EmployeeEntity</class>
<properties>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" />
<property name="hibernate.connection.url"
value="jdbc:oracle:thin:@localhost:1521:orcl" />
<property name="hibernate.connection.username" value="****" />
<property name="hibernate.connection.password" value="****" />
</properties>
</persistence-unit>

Thanks,
Suresh B
 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I am also working on a EJB 3 project and this is the type of persistance.xml that I use to access my MySQL database.



In addition to this I use a mysql-ds.xml file which I put in the deploy folder of the jboss and mysql-connector.jar (which contains the MySql driver classes) in the lib folder of jboss



I don't know if this will work for oracle or not but I told you what I know. I Hope that this will help you...
 
Suresh Magi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ankit,

Thanks for the reply. It really helped me. I modified oracle-*.xml and dropped that file into deploy folder of JBOSS and changed my persistence.xml file a bit and then it started working.

Thanks,
Suresh B
 
Alas, poor Yorick, he knew this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic