[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problems with the <jar-file> element in the persistence.xml

Marcos_APS do-not-reply at jboss.com
Wed Jun 27 08:18:22 EDT 2007


- JBoss 4.2.0GA

Hello, everybody!
I'm having problems with the <jar-file> element of my persistence deployment
descriptor (persistence.xml). I have deployed my EJB jar file to the directory
C:\jboss-4.2.0.GA\server\default\deploy and I have placed a jar file that also
has entity beans to be analysed in the directory
C:\jboss-4.2.0.GA\server\default\lib. This file is referenced in the
persitence.xml file. But the problem is that I keep getting error messages when
I'm deploying my EJB jar file to the directory deploy. The persistence provider
can't find the jar file specified in the <jar-file> element. This was my
persistence.xml file the first time I tested it:

<?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="laboratorio-informatica">
    <jta-data-source>java:/LaboratorioInformaticaDS</jta-data-source>		
    <mapping-file>META-INF/orm.xml</mapping-file>
    <jar-file>urca.jar</jar-file>
  </persistence-unit>


and I got this error message when deploying:
java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/jboss-4.2.0.GA/bin/urca.jar

So, I kept modifying the <jar-file> element and got these results:

<jar-file>lib/urca.jar</jar-file>
java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/jboss-4.2.0.GA/bin/lib/urca.jar

<jar-file>/lib/urca.jar</jar-file>
java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/lib/urca.jar

<jar-file>../lib/urca.jar</jar-file>
java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/jboss-4.2.0.GA/server/default/deploy/lib/urca.jar

<jar-file>../server/default/lib/urca.jar</jar-file>
java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/jboss-4.2.0.GA/server/default/deploy/server/default/lib/urca.jar

So, I couldn't in any way tell the persistence provider to look the file at the
directory C:\jboss-4.2.0.GA\server\default\lib.

Please, what do I have to specify in the <jar-file> element to solve this problem?

Thank you.

Marcos

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058118#4058118

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058118



More information about the jboss-user mailing list