-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: UNRESOLVED Demands 'persistence.unit:unitName=
PostPosted: Fri Feb 18, 2011 11:44 am 
Regular
Regular

Joined: Fri Feb 04, 2011 8:34 pm
Posts: 66
Hello,
I created the following hibernate.cfg.xml file and placed it in the jboss deploy/ folder.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/houseware</property>
<property name="hibernate.connection.username">admin</property>
<property name="hibernate.connection.password">xxx</property>
<listener type="post-insert" class="org.hibernate.search.event.FullTextIndexEventListener"/>
<listener type="post-update" class="org.hibernate.search.event.FullTextIndexEventListener"/>
<listener type="post-delete" class="org.hibernate.search.event.FullTextIndexEventListener"/>
</session-factory>
</hibernate-configuration>


Here is the errors I am getting:

DEPLOYMENTS IN ERROR:
Deployment "<UNKNOWN jboss.j2ee:ear=HousewareEnterpriseApplication.ear,jar=HousewareEnterpriseApplication-ejb.jar,name=ProductImagesFacade,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=HousewareEnterpriseApplication.ear/HousewareEnterpriseApplication-ejb.jar#HousewareEnterpriseApplication-ejbPU' **

and here is my persistence.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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/ ... ce_2_0.xsd">
<persistence-unit name="HousewareEnterpriseApplication-ejbPU" transaction-type="JTA">
<jta-data-source>java:/Houseware</jta-data-source>
<properties/
</persistence-uni
</persistence>

Any suggestion to resolve this error would be very appreciated.

Thanks
Sam


Top
 Profile  
 
 Post subject: Re: UNRESOLVED Demands 'persistence.unit:unitName=
PostPosted: Mon Feb 21, 2011 9:01 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
It seems your persistence.xml syntax is wrong (please look at the lines in bold), try:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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/ ... ce_2_0.xsd">
<persistence-unit name="HousewareEnterpriseApplication-ejbPU" transaction-type="JTA">
<jta-data-source>java:/Houseware</jta-data-source>
<properties>
</properties>
</persistence-unit>

</persistence>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.