Wrong persistent unit

Dear sdn members,
I am using NetBeans 5.5 , database PostgreSQL 8.1, Sun Application Server 9, and hibernate.I copied following jars from Hibernate to lib directory of my application server
# From hibernate entitymanager 3.2.0 cr2
* hibernate-entitymanager.jar
* lib/hibernate-annotations.jar
* lib/jboss-archive-browsing.jar
* lib/javassist.jar
# From Hibernate Core 3.2.0 cr4
* hibernate3.jar
* lib/antlr-2.7.6.jar
* lib/asm-attrs.jar
* lib/asm.jar
* lib/c3p0-0.9.0.jar
* lib/cglib-2.1.3.jar
* lib/commons-collections-2.1.1.j
* lib/commons-logging-1.0.4.jar
* lib/concurrent-1.3.2.jar
* lib/dom4j-1.6.1.jar
* lib/ehcache-1.1.j
* lib/log4j-1.2.11.jar
Than I tryied to generate entity classes from my database.All passed ok, but when I try to generate JSF from entity classes and run project , two exceptions appear in my browser
javax.servlet.ServletException: Unable to retrieve EntityManagerFactory for unitName HibernateApp
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
     com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
     com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
     org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
     com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName HibernateApp     com.sun.enterprise.util.EntityManagerFactoryWrapper.getDelegate(EntityManagerFactoryWrapper.java:80)     com.sun.enterprise.util.EntityManagerFactoryWrapper.createEntityManager(EntityManagerFactoryWrapper.java:91)     hibernatesample.controller.CustomerController.getEntityManager(CustomerController.java:47)
     hibernatesample.controller.CustomerController.getItemCount(CustomerController.java:187)
     hibernatesample.controller.CustomerController.getLastItem(CustomerController.java:197)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
and here is my persistence.xml file
<persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="HibernateApp" transaction-type="JTA">
<jta-data-source>konekcija</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="value"/>
</properties>
</persistence-unit>
</persistence>I would be very grateful if some could point me on the cause of my exceptions.
with best regards,
Nikola

Hi Joaquin,
Thank you for the reply, but i do not want this to enable. This is an additional popup & is already suppressed which not the issue in my case.
When a user is assigned to multiple Org units, they get a popup asking the user to select the Org they want to login. But no matter what the user selects, the system will assign it to the first Org unit sorted based Org Id.
Please refer the screenshot
[http://img213.imageshack.us/img213/989/cic0q.jpg]
Even if i select the 2nd Org unit, system still selects with the first one

Similar Messages

  • Why not jdeveloper creates the persistance unit and the session client and

    why you do not create the persistance unit (outside) and the session client and ...the interface and other required opjects automatically when I create the application or the project?
    why you are using symbols like AFD, JSF, JSP, JPA,.JEE...and tens more, why you do not use a meaningfull names of these process symbols.
    Thanks
    Ali

    Asalman,
    I'm quite happy the JDeveloper behaves the way it does. Why? Because in most of my scenarios I don't want to be driven in a particular direction of development. This my choice of development and I don't like tools that dictate this to me.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Wrong Org unit determination when a user is assign to multiple Org unit

    Hi Experts,
    I have a user who is assigned 3 org units. All the three fall under the same parent of Org unit.
    Now when the user logs in & executes the tcode CIC0, she gets a pop up asking to selet a Org unit out of the 3 available option.
    No matter what the user selects, system always pick the first Org unit ignoring the selection made by user.
    We are using SAP CRM 4.0 win client version.
    I went through the below link but this did not have any solution
    Multiple business roles and org data determination
    Please help!!!
    Please refer the screenshot
    http://img213.imageshack.us/img213/989/cic0q.jpg

    Hi Joaquin,
    When the user log in he gets a pop up asking to choose a Org unit, please refer the screenshot in my previous post.
    No matter what he selects, it the first Org structure gets assigned.
    Please refer the screenshot below
    The business activity screen shows the 1st Org unit. Hence user thinks he has selected the the 2nd org unit creates a Business activity but that gets assign to the wrong org unit unless it is changed manually.
    http://img528.imageshack.us/img528/2821/businessactivityscreen.jpg
    Is it because they both have the same profile

  • New Persistent Unit Jdeveloper 11.1.2.3.0

    Hello friends,
    I am trying to add another persistent unit to my EJB project I have already mapped the tables from DB1 I would like to map tables to entities from another DB to the same EJB project
    I've seen in the persistent.xml the icon to add another persistent, I add it (it asks me to set an offline DB connection, well I do it) then I go to the create entities from tables wizard I choose an online DB connection to another DB and try to map the tables to entities
    but no sucess, the persisent.xml the <class>siedocejb.entidades.ACAulaXCurso</class> are duplicated in all of the entities
    It creates the new persistent but not the new entities
    [code]
    <persistence-unit name="evaaa2">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <properties>
          <property name="eclipselink.target-server" value="WebLogic_10"/>
        </properties>
      </persistence-unit>
    [code]
    How can I add the new entities?

    Hi,
    sounds like an IDE bug to me if this doesn't work for entities of different names (note that in the end its the entity manager that determines the connection, which means that the IDE probably doesn't distinguish the entity names if they are the same). If you have a support contract I suggest you follow up with Oracle support to have a service request filed. Alternatively, you manually create the entities for the information to read from the second database.
    Frank

  • Customs Declaration: wrong legal unit displayed

    Hi, we have a funny situation in the customs declaration doc CULOEX where in the organisation data tab all the available legal units are shown, when only one is assigned to the FTO in the config.
    When we select the correct LU, the wrong one disappears. This does not look right and could confuse users anyone else had the same problem?
    Thx
    Philip

    Check one more time the legal unit assignments to the foreign trade org.
    check your legal reg determiniation also. Might be it is trying to determin the country that is not assigned properly.

  • Wrong packeging unit problem

    hi Gurus
    when creating packing against sto all item was packed as box unit but 1 item wrongly packed as pc unit.when i check the invoice print out it seems 123 boxes against 113(1 box = 10 pc).
    I can not cancel the bill bcos it already passed to accounting and it is very old bill.
    how can i solv this problem?
    if any one can help me out.
    Thanks and regards
    Tuhina

    hi Gurus
    when creating packing against sto all item was packed as box unit but 1 item wrongly packed as pc unit.when i check the invoice print out it seems 123 boxes against 113(1 box = 10 pc).
    I can not cancel the bill bcos it already passed to accounting and it is very old bill.
    how can i solv this problem?
    if any one can help me out.
    Thanks and regards
    Tuhina

  • Unit Test code using wrong persistence unit

    In the midst of learning Maven, I created a simple application in which I am using JPA (Java Persistence 1.0.2) with EclipseLink implementation (2.0.2).
    Note: This is an Application Managed environment. So I manually control EntityManager's life cycle.
    The persistence.xml file used by the main source code is different from the one that unit test code uses. Main code uses an Oracle DB and the test code uses an in-memory Derby.
    Running unit tests was updating the Oracle DB (!) and I eventually managed to fix that by using two different persistence-units in the XML files.
    However, I don't understand why that fixed the problem. I manually create and shut down the entity managers and they are not running concurrently. I'm pretty sure Maven (or the way I set it up) doesn't mess up the resources (XML files). In fact by looking at Maven's debug output I can see it's using the right XML file for unit tests.
    Could someone enlighten me, please?

    Do you have both persistence.xml files on your classpath? If so, and they contain the same name for their respective persistence units, you should be getting a warning or error since they must have unique names. There is no way to tell which one you want to access otherwise.
    Best Regards,
    Chris

  • Contract printing problem "Wrong price unit"

    Hello,
    I have created a Consignment contract item with target qty. There is no price neither price unit mentionned at this item
    When I have printed the output message the following data are displayed.
    material number : OK
    material description : OK
    value/price unit : NOK
    In fact, in the preview I get XX$/1KG instead of XX$/1000kg as mentionned in the info record
    When I check the contract language I find that it is different from the plant language  FR instead of EN.
    so I performed following tests:
    1- When creating a new  contrat with same values and I change the language key to EN===> there is no printing problem  "OK"
    2- When creating a new contract  with samevalues and I change keep langage as FR===> Printing a proble apperas in the price unit   1kg  instead of  1000kg   "NOK"
    PLease to advise about potential reasons

    I remark that the Key Language in the contract is different from the plant language:  
    I performed the following tests:
    1- When creating a new  contrat with same values and I change the language key to EN (the same as the plant language) ===>  It is working fin  "OK"
    2- When creating a new contract  with same values and I change keep langage as FR (different from the plant language) ===> Printing a problem occur  in the price unit   1kg  instead of  1000kg   "NOK"
    Please to advise about potential reasons

  • Switch propertie from a JPA persistent unit at runtime

    Hi,
    I have a mysql database mapped through JPA (using oracle toplink bundled in Netbeans6.1) an I want to change the "toplink.jdbc.url" propertie of the persistence unit declaration at runtime of my app, is this possible? Getting more into the problem: my app will run in different networks and I cannot leave the propertie "toplink.jdbc.url" static, so in my app I have a swing dialog to change the database server IP and I store it in my own properties file (file_name.properties), so I want my java code to read that properties file and set the correct "toplink.jdbc.url".

    Hello,
    I am using Hibernate and Here are some of the properties in the PersistenceUnit.
    I have used your way of Overriding the properties by passing the Map into createEntityManagerFactory method.
    <property name="hibernate.connection.username" value="root"/>
    <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
    <property name="hibernate.connection.password" value="r3dm0u53"/>
    propertiesMap.put("hibernate.connection.password", "password");
    entityManager = javax.persistence.Persistence.createEntityManagerFactory("persistencePU", propertiesMap).createEntityManager();
    But it is not working the application is still running on the values that it has in the PU file.
    What to do now? any idea?

  • Multiple persistent units

    Hi,
    I have one EJB project with two beans refering to two different data bases using two persistence units.
    Bean A - persistence unit DB_A_unit  - entity class CL_A - table DB_A
    Bean B - persistence unit DB_B_unit  - entity class CL_B - table DB_B
    In persistence.xml I defined both units with different data source aliases.
    Now I try to execute a method of bean A and get the exception:
    The persistence unit is inconsistent with the database schema
    The table DB_B does not exist.
    If I try to execute a method of bean B I and get the exception:
    The persistence unit is inconsistent with the database schema
    The table DB_A does not exist.
    Why does a method call in bean A affect the entity of bean B? How can I avoid this?
    Thanks,
    Kevin

    I found a solution:
    <persistence-unit name="DB_A_unit">
       <jta-data-source>a_alias</jta-data-source>
       <class>CL_A</class>
       <exclude-unlisted-classes>true</exclude-unlisted-classes>          
    </persistence-unit>
    <persistence-unit name="DB_B_unit">
       <jta-data-source>b_alias</jta-data-source>
       <class>CL_B</class>
       <exclude-unlisted-classes>true</exclude-unlisted-classes>          
    </persistence-unit>

  • Change the Operating Unit and GL set of books on a responsiblity

    Hi Every one
    few of the responsibilities which were configured have a either a wrong of set of books or a wrong operating unit
    For example a responsibilty which was suppose to have US Set of Books and US operating Unit has MX Set of Books and US Operating Unit
    though in Multi Org setup MX set of Books is associated to MX operating Unit. Also vice versa happened on other responsibilities for example right set of books but wrong operating unit.
    My question what is the impact of changing GL Set of Books, MO Profile Value to right one? we already have one year transactions on these responsibilities which are related Oracle Cost Management and Oracle inventory.
    Thanks in advance.

    I am running into similar question - I am on R12 and am back tracking some origional set up issues
    I want to change a opearing unit to report to a different GL ,I vcan change it in HR Organization profiles however If i post an entry via AP to GL it shows up in the (old ) GL
    Is there a process i can run to update ?

  • Business unit and customer assignment

    Frnds
    whr do i assign business unit to customer?
    I have one customer assigned to a wrong Business Unit and i need to change it.
    so can you please tell me whr can i do that?
    thanks

    Hi,
    If this is a Characterstic defined - definitely this will be getting populated from Billing document in SD Module. Secondly, there could be a derivation rule defined as per your configuration. Derivation rules can be checked in Transaction code - KEDR.
    Thanks
    Murali.

  • Recalculate Unit Costing at Sales Order Level

    Hello all,
    We have unit costing for certain Item categories. User has wrongly updated unit costing at SO line item level.
    now we want to recalculate it.
    Is thr any program to recalculate Unit costing for specific Sales Order with corresponding Line Items
    Regards
    KP

    Hi KP,
    You can also do it in VA02. Follow the below steps:
    1. Provide sale order no in VA02
    2. Select the item no,which you want to recost and click on item condition icon
    3. Select condition "EK02" and click on costing icon, here system will ask you for recost and click the recost button and press enter until you get costing results button and finally if you get desire price then save it.
    Regards,
    Mukthar

  • Mass Maintenance of alternate unit of measures

    Hi,
    I have an issue wherein 2000 materials have been updated with wrong alternate unit of measures.
    I have checked MM17 but it would allow only changes and not deletions.
    Kindly advice,whether there is any other way of deleting AuM.
    Thank you

    Dear.
    Ask your ABAP Team to write BDC or LSMW program.
    This will help you.
    Regards
    Utsav

  • Classcast exceptions when persistence units deployed as shared libraries

    Hi
    We are using weblogic 10.3.3 & eclipse link 2.0 persistent units:
    We have uim-entities.jar(persistent unit) under uim-core-lib.ear(/APP-INF/lib) that is deployed as a shared library. We have multiple applications(ears) referring to this shared library (same persistent name, "default") using lib-ref in weblogic-application.xml. We are facing issue while deploying and running the application.(Primarily classcast exceptions on log4j classes and entity DAOs). If the persistent unit is replication in each app's APP-INF/lib, we are not seeing those exceptions.
    Are there any known issues in using persistent units as shared libraries.
    Pasting the exception for your reference:
    log4j:ERROR Could not create an Appender. Reported error follows.
    java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:238)
    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
    at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:415)
    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:919)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:682)
    at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:811)
    at oracle.communications.inventory.api.framework.logging.LogFactory.<clinit>(LogFactory.java:176)
    at oracle.communications.inventory.api.framework.listener.InventoryEntityLifeCycleEventListener.<clinit>(InventoryEntityLifeCycleEventListener.java:36)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:88)
    at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.getClassForName(EntityListenerMetadata.java:158)
    at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.process(EntityListenerMetadata.java:311)
    at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.processEntityListeners(MappedSuperclassAccessor.java:796)
    at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processListeners(EntityAccessor.java:1064)
    at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.addEntityListeners(MetadataProcessor.java:104)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:327)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195
    Thanks,
    Murali

    Murali,
    Hi, the CCE for Apache Log4J is outside of the scope of JPA - i have not see the "oracle.communications.inventory.api.framework.logging" package in play before - what kind of connection factory are you using or are you using JTA?
    Note: WebLogic 10.3.4.0 has been upgraded to enable container managed persistence context injection and no longer requires the use of shared libraries. See the wiki post...
    http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Enabling_JPA2_support
    For WebLogic 10.3.3.0 and JPA 2.0 usage as application managed libraries using the <wls:prefer-application-packages/> weblogic-application.xml tag see the wiki post...
    http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_3:_Application_Level_Shared_Library_-InUse
    thank you
    /Michael O'Brien
    http://www.eclipselink.org

Maybe you are looking for