Hi Steve,<br><br>Thank you for your reply and letting me know about the jboss forums.<br>Fortunately, I could make the thing work: I had to place the persistence unit into<br>an ejb-jar, and add a jta datasource to the persistence.xml. Someday I'll try it<br>
again with separate jars.<br><br>Regards,<br>Tamas<br><br><br><div class="gmail_quote">On Thu, Nov 11, 2010 at 4:49 PM, Stephen Davidson <span dir="ltr"><<a href="mailto:gorky@freenet.carleton.ca">gorky@freenet.carleton.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Greetings.<br>
<br>
While there is a way to get this to work, I do apologize for not knowing<br>
it offhand. And unfortunately, this mailing list is no longer monitored<br>
by anyone from the JBoss Group.<br>
<br>
Feel free to try the Forums.<br>
<br>
Regards,<br>
Steve<br>
<div><div></div><div class="h5"><br>
On 11/10/2010 05:30 AM, REV Tamas wrote:<br>
> Hi,<br>
><br>
> I'm new to JBoss and Eclipse. I've been using NetBeans and GlassFish for<br>
> Java EE development.<br>
><br>
> Now I'm working on a very simple PoC just to see how I can use these<br>
> technologies. I have a very simple<br>
> JPA project. It contains a persistence xml and a few entities, inherited<br>
> from each other.<br>
> persistence.xml excrept:<br>
> <persistence version="1.0" ...><br>
> <persistence-unit name="HotelPoi" transaction-type="JTA"><br>
> ...<br>
> </persistence-unit><br>
> </persistence><br>
><br>
><br>
> I have an EJB project too, it contains a stateless session bean. The<br>
> bean injects a persistence unit this way:<br>
> @PersistenceUnit(name="HotelPoi")<br>
> EntityManager em;<br>
><br>
> I receive the following deploy-time exception:<br>
><br>
> 2010-11-10 12:19:51,656 DEBUG [org.jboss.ejb3.Ejb3Module] Starting<br>
> failed jboss.j2ee:service=EJB3,module=HotelPoiFinder.jar<br>
> java.lang.RuntimeException: Illegal @PersistenceUnit on<br>
> javax.persistence.EntityManager com.edreams.poi.finder.PoiFinder.em<br>
> :There is no default persistence unit in this deployment.<br>
> at<br>
> org.jboss.injection.PersistenceUnitHandler.handleFieldAnnotations(PersistenceUnitHandler.java:247)<br>
> at<br>
> org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)<br>
> at<br>
> org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)<br>
><br>
> I double-checked the ear and it contains the JpaProject in the lib<br>
> directory. I placed it in the root dir too and receive the same exception.<br>
><br>
</div></div>> I'm using JBoss <a href="http://4.2.3.GA" target="_blank">4.2.3.GA</a> <<a href="http://4.2.3.GA" target="_blank">http://4.2.3.GA</a>> and Eclipse with the<br>
<div class="im">> following build id: 20100617-1415<br>
><br>
> Do you have any ideas how to make this injection work?<br>
><br>
> Best Regards,<br>
> Tamas<br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> jboss-user mailing list<br>
> <a href="mailto:jboss-user@lists.jboss.org">jboss-user@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/jboss-user" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-user</a><br>
<br>
_______________________________________________<br>
jboss-user mailing list<br>
<a href="mailto:jboss-user@lists.jboss.org">jboss-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/jboss-user" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-user</a><br>
</blockquote></div><br>