Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
    • Posted in
    • Tags

    Mulptiple PersistenceUnit within the Persistence.xml

    Posted on

    Caused by: java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 2 persistence unit definitions in application deployment deployment "xyz-1.0.ear". Either change the application deployment to have only one persistence unit definition or specify the unitName for each reference to a persistence unit.

    The Structure of the persistence.xml looks like the following

    persistence 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_2_0.xsd"
    version="2.0">

           
       java:jboss/datasources/FedDS1
        XYZServices-1.0.jar      
        xyz.data.entities.Event   
    
    



    java:jboss/datasources/FedDS2
    XYZServices-1.0.jar

    xyz.data.entities.Event

    The persistence.xml resides in the ear.

    by

    points

    Responses

    Red Hat

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat, Inc.