NullPointerException in OC4J TP4 persistence unit predeployment

Hi,
I have an ee5 application that I've been developing on jboss/hibernate, and I'm now trying to deploy it to oc4j/toplink. When I deploy it to oc4j, the deployment fails with this stacktrace:
oracle.oc4j.persistence.PersistenceException: [eTimesheet-ear:C:\oc4j\oc4j-11.1.1.0.0_tp4\j2ee\home\applications\eTimesheet-ear\eTimesheet-ejb.jar] - Exception creating EntityManagerFactory using PersistenceProvider class oracle.toplink.PersistenceProvider for persistence unit eTimesheet.
     at oracle.oc4j.persistence.PersistenceException.exceptionCreatingEntityManagerFactory(PersistenceException.java:113)
     at oracle.oc4j.persistence.PersistenceUnitManagerImpl.createContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:178)
     at oracle.oc4j.persistence.PersistenceUnitManagerImpl.createPersistenceUnit(PersistenceUnitManagerImpl.java:140)
     at oracle.oc4j.persistence.PersistenceUnitManagerImpl.initialize(PersistenceUnitManagerImpl.java:80)
     at oracle.oc4j.persistence.ServerPersistenceUnitManagerImpl.initialize(ServerPersistenceUnitManagerImpl.java:17)
     at com.evermind.server.ejb.EJBPackageDeployment.initializePersistenceUnitManager(EJBPackageDeployment.java:1010)
     at com.evermind.server.ejb.EJBPackageDeployment.preLoadClasses(EJBPackageDeployment.java:1004)
     at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:441)
     at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:262)
     at com.evermind.server.Application.setConfig(Application.java:538)
     at com.evermind.server.Application.setConfig(Application.java:433)
     at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:2125)
     at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:554)
     at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:210)
     at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:99)
     at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
     at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:82)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
     at java.lang.Thread.run(Thread.java:619)
Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080418)): oracle.toplink.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [eTimesheet] failed.
Internal Exception: java.lang.NullPointerException
     at oracle.toplink.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:790)
     at oracle.toplink.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:146)
     at oracle.oc4j.persistence.PersistenceUnitManagerImpl.createContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:173)
     ... 18 more
Caused by: Exception [TOPLINK-28018] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080418)): oracle.toplink.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [eTimesheet] failed.
Internal Exception: java.lang.NullPointerException
     at oracle.toplink.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:198)
     ... 21 more
Caused by: java.lang.NullPointerException
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.EmbeddedIdAccessor.processEmbeddableClass(EmbeddedIdAccessor.java:115)
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.EmbeddedAccessor.process(EmbeddedAccessor.java:259)
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.EmbeddedIdAccessor.process(EmbeddedIdAccessor.java:69)
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessor(ClassAccessor.java:570)
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessorFields(ClassAccessor.java:583)
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessors(ClassAccessor.java:609)
     at oracle.toplink.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:510)
     at oracle.toplink.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:279)
     at oracle.toplink.internal.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:266)
     at oracle.toplink.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:747)
     ... 20 more
I probably shouldn't jump to conclusions, but since this is a nullpointer exception and my code runs ok on hibernate, I suspect this is a bug in toplink.
Thoughts?

I turned on FINEST logging, and it appears that this exception is thrown when processing the following class (trimmed irrelevant parts):
@Entity
@Table(name = "PS_HRLY_APPRVR_VW")
@NamedQueries({ ... })
public class ApproverAssignment implements Serializable
@Embeddable
public static class ApproverAssignmentPK implements Serializable
@Embedded
@AttributeOverride(name = "employeeId", column =
@Column(name = "emplid", updatable = false))
private EmployeeId workerId;
@Embedded
@AttributeOverride(name = "employeeId", column =
@Column(name = "supervisor_id", updatable = false))
private EmployeeId approverId;
@Override
public int hashCode()
@Override
public boolean equals(Object obj)
@EmbeddedId
private ApproverAssignmentPK approverAssignmentPK = new ApproverAssignmentPK();
...getters/setters
Also, here's the source code for EmployeeId:
@Embeddable
public class EmployeeId implements Serializable
private static final long serialVersionUID = 1L;
@Length(max=10, min=9)
private String employeeId;
//for JPA
protected EmployeeId()
protected EmployeeId(String employeeId)
this.employeeId = employeeId;
public String getEmployeeId()
return employeeId;
@Override
public int hashCode()
@Override
public boolean equals(Object obj)
@ConstructsFromString
public static EmployeeId valueOf(String employeeId)
Preconditions.checkNotNull(employeeId, "employeeId is null");
return new EmployeeId(employeeId);
Maybe toplink doesn't like nested @Embeddables? I thought they were legal, but maybe I'm wrong.
Thanks

Similar Messages

  • Persistence.createEntityManagerFactory() throw NullPointerException in oc4j

    Hi,
    I am trying to use JPA(toplink essential) with EJB 2.0 spec using the DAO pattern. Outside the oc4j container all my DAO unit tests passes but when I run the same code inside oc4j the Persistence.createEntityManagerFactory() method throws a NPE. I verified that META-INF/persistence.xml file is available through the classpath inside the container but I don’t see any toplink specific logs in oc4j. Do I need to do anything to tell oc4j load up persistence.xml? I have been trying many different options in persistence.xml but I always get the same exception. Any help will be appreciated.
    Code:
    Persistence.createEntityManagerFactory(“default”, new HashMap());
    Exception:
    07/07/06 17:25:21 java.lang.NullPointerException
    07/07/06 17:25:21 at oracle.toplink.essentials.ejb.cmp3.EntityManagerFacto
    ryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:120)
    07/07/06 17:25:21 at javax.persistence.Persistence.createEntityManagerFact
    ory(Persistence.java:59)
    07/07/06 17:25:21 at com.retek.rib.domain.hospital.dao.toplink.ToplinkSess
    ionDispenser.currentEntityManager(ToplinkSessionDispenser.java:31)
    Config File:
    <?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="default" transaction-type="RESOURCE_LOCAL">
    <!--persistence-unit name="ribPersistenceUnit" transaction-type="JTA"-->
    <!--provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
    </provider-->
    <provider>
    oracle.toplink.essentials.PersistenceProvider
    </provider>
    <!--jta-data-source>jdbc/OracleRibDs</jta-data-source-->
    <class>com.retek.rib.domain.hospital.bo.impl.HospitalEntryImpl</class>
    <class>com.retek.rib.domain.ribmessage.bo.impl.RibMessageFailureImpl</class>
    <class>com.retek.rib.domain.ribmessage.bo.impl.RibMessageRoutingInfoImpl</class>
    <class>com.retek.rib.domain.ribmessage.bo.impl.RibMessageHospitalRefImpl</class>
    <!--properties>
    <property name="toplink.jdbc.url" value="jdbc:derby://localhost:1527/testD
    B"/>
    <property name="toplink.jdbc.user" value="APP"/>
    <property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDr
    iver"/>
    <property name="toplink.jdbc.password" value="APP"/>
    </properties-->
    <properties>
    <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@pbora-lnx:1521:
    orcl"/>
    <property name="toplink.jdbc.user" value="stubby2"/>
    <property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDrive
    r"/>
    <property name="toplink.jdbc.password" value="retek"/>
    <property name="toplink.logging.level" value="FINE"/>
    </properties>
    <!--properties>
    <!--property name="toplink.server.platform.class.name" value="oracle.topli
    nk.essentials.platform.server.oc4j.Oc4jPlatform"/- ->
    <property name="toplink.logging.level" value="FINE"/>
    </properties-->
    </persistence-unit>
    </persistence>

    Hi,
    I am trying to use JPA(toplink essential) with EJB 2.0 spec using the DAO pattern. Outside the oc4j container all my DAO unit tests passes but when I run the same code inside oc4j the Persistence.createEntityManagerFactory() method throws a NPE. I verified that META-INF/persistence.xml file is available through the classpath inside the container but I don’t see any toplink specific logs in oc4j. Do I need to do anything to tell oc4j load up persistence.xml? I have been trying many different options in persistence.xml but I always get the same exception. Any help will be appreciated.
    Code:
    Persistence.createEntityManagerFactory(“default”, new HashMap());
    Exception:
    07/07/06 17:25:21 java.lang.NullPointerException
    07/07/06 17:25:21 at oracle.toplink.essentials.ejb.cmp3.EntityManagerFacto
    ryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:120)
    07/07/06 17:25:21 at javax.persistence.Persistence.createEntityManagerFact
    ory(Persistence.java:59)
    07/07/06 17:25:21 at com.retek.rib.domain.hospital.dao.toplink.ToplinkSess
    ionDispenser.currentEntityManager(ToplinkSessionDispenser.java:31)
    Config File:
    <?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="default" transaction-type="RESOURCE_LOCAL">
    <!--persistence-unit name="ribPersistenceUnit" transaction-type="JTA"-->
    <!--provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
    </provider-->
    <provider>
    oracle.toplink.essentials.PersistenceProvider
    </provider>
    <!--jta-data-source>jdbc/OracleRibDs</jta-data-source-->
    <class>com.retek.rib.domain.hospital.bo.impl.HospitalEntryImpl</class>
    <class>com.retek.rib.domain.ribmessage.bo.impl.RibMessageFailureImpl</class>
    <class>com.retek.rib.domain.ribmessage.bo.impl.RibMessageRoutingInfoImpl</class>
    <class>com.retek.rib.domain.ribmessage.bo.impl.RibMessageHospitalRefImpl</class>
    <!--properties>
    <property name="toplink.jdbc.url" value="jdbc:derby://localhost:1527/testD
    B"/>
    <property name="toplink.jdbc.user" value="APP"/>
    <property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDr
    iver"/>
    <property name="toplink.jdbc.password" value="APP"/>
    </properties-->
    <properties>
    <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@pbora-lnx:1521:
    orcl"/>
    <property name="toplink.jdbc.user" value="stubby2"/>
    <property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDrive
    r"/>
    <property name="toplink.jdbc.password" value="retek"/>
    <property name="toplink.logging.level" value="FINE"/>
    </properties>
    <!--properties>
    <!--property name="toplink.server.platform.class.name" value="oracle.topli
    nk.essentials.platform.server.oc4j.Oc4jPlatform"/- ->
    <property name="toplink.logging.level" value="FINE"/>
    </properties-->
    </persistence-unit>
    </persistence>

  • Multiple persistence units and OneToMany associations

    Hi,
    I have an EAR with two persistence units and corresponding entities. Each is contained within a separate library jar file. Some of the entities in one of the jars refer to entities in the other jar. If I refer to just a single entity (i.e., a OneToOne association), everything builds and deploys with no problems, but if I use a collection (OneToMany association), I get errors when trying to deploy the project.
    I've been playing around with this for a while and have seen different errors such as the following:
    [exec] CLI171 Command deploy failed : Deploying application in domain failed; Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    [exec] Exception Description: predeploy for PersistenceUnit [GrammarUserData] failed.
    [exec] Internal Exception: Exception [TOPLINK-7155] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.ValidationException
    [exec] Exception Description: The type [interface java.util.List] for the attribute [sentencePatterns] on the entity class [class com.leadingstep.grammar.configuration.CommonElementConfiguration] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.
    I also had the collection defined as a Set and it complained about that as well. I have many other OneToMany associations used between entities within the same persistence unit that use the List interface with no problems, and so that's why I'm wondering if the problem actually comes from the fact that the entities in the failed case belong to different persistence units?
    At another point, the error message I was getting was:
    [#|2009-12-22T20:05:02.427-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=15;_ThreadName=Thread-32;_RequestID=67ca0eee-64d9-41dc-8093-eec811cb32b6;|Exception occured in J2EEC Phase
    com.sun.enterprise.deployment.backend.IASDeploymentException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: predeploy for PersistenceUnit [GrammarUserData] failed.
    Internal Exception: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: [class com.leadingstep.grammar.configuration.CommonConstructorConfiguration] uses a non-entity [class com.leadingstep.grammar.db.sentences.SentenceGroup] as target entity in the relationship attribute [private java.util.List com.leadingstep.grammar.configuration.CommonConstructorConfiguration.sentenceGroups].
    The target entity it refers to here definitely has the @Entity annotation and again, is associated with other entities within the same persistence unit with no problems.
    Am I right in thinking the problem comes from the association of entities between the different persistence units? Is there something special I have to do to make this work?
    BTW, both persistence units use the <exclude-unlisted-classes> and specifically list every entity that should be included.
    Thanks for any help!
    Renee

    One other thought on this. I'm using Glassfish with Toplink and have it create the tables using:
                   <property name="toplink.ddl-generation" value="create-tables" />
    Could it be something related to the table creation in this case that's causing the problem?
    Renee

  • Toplink JPA properties in persistence unit are ignored

    I'm trying to make some EJB3 stateless session bean webservices, using the toplink essentials (build b41 beta 2) shipped with OC4J stand-alone 10.1.3.3.0.
    Basically I have a 'model' project with my EJB3 entity beans, and a persistence.xml. Then I have a webservice project, that has the model project as a dependency. Both projects are in the same application in JDeveloper. I use a deployment profile to deploy to my seperate OC4J stand-alone instance.
    My service runs and deploys fine. The persistence unit is read, and the correct datasource is selected and logged in on. However I notice two things:
    - the container complains during deployment, telling me property toplink.server.platform.class.name is deprecated and I should use toplink.target-server. However, I've set the property toplink.target-server as a property in my persistence.xml file...
    - I don't see any Toplink logging, although I've set the property toplink.logging.level to FINE in the persistence.xml.
    This leads me to believe that the properties are somehow ignored. Has anyone experienced this as well? Any hints/tips/suggestions on how to fix this?
    Cheers,
    Bas
    My persistence.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <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"
                 version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
      <persistence-unit name="VervoerPublicatiesPU" transaction-type="JTA">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <jta-data-source>jdbc/SQLPUBDS</jta-data-source>
        <class>a.b.c.A</class>      
        <class>a.b.c.B</class>
        <properties>
            <property name="toplink.logging.level" value="FINE"/>
            <property name="oracle.toplink.essentials.config.CacheType" value="SoftWeak"/>
            <property name="toplink.target-database" value="SQLServer"/>
            <property name="toplink.target-server" value="OC4J_10_1_3"/>
        </properties>
      </persistence-unit>
    </persistence>

    I debugged this problem a few weeks ago. There are 2 things going on:
    1. The EJB3 container is automatically adding the property 'toplink.server.platform.class.name' into what is passed to TopLink to ensure the proper container is configured. I have had a bug filed to get this changed to toplink.target-server in the 10.1.3.4 patch-set.
    2. The logging by default goes into the OC4J log found in <HOME>\j2ee\home\log\oc4j
    You can re-configure OC4J to also log these messages to stdout or if you only want them to stdout you can simply set the logging-type in the persistence unit properties.
          <property name="toplink.logging.logger" value="DefaultLogger"/>Doug

  • Getting a datasource from a persistence-unit

    Is there any way to get the name of the datasource (non-jta or jta) from a persistence unit via the EntityManagerFactory or EntityManager instances?
    We need to do some JDBC work (for exotic data types) and are currently parsing the persistence.xml file ourselves to get the data source name (which is an awful thing to do) but would much rather be able to say Connection conn = Utility.getConnection(EntityManger em) or even String datasource = Utility.getDataSource(EntityManager em).
    Thanks, Mark

    Mark,
    Hi, I tried non-JTA code on OC4J.
    Try the following change acc.getDatasourceConnection() - tested on OC4J 10.1.3.4 using a RESOURCE_LOCAL non-JTA connection to Oracle 10g entityManager on a servlet.
    I get the same oracle.jdbc.driver.T4CConnection@18d702e connection to my Oracle 10 db from either the .getConnection() or .getDatasouceConnection() call - verify your persistence.xml properties
    <property name="eclipselink.target-server" value="OC4J"/>
    <property name="eclipselink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="eclipselink.jdbc.platform" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
         if (acc != null) {
         //conn = acc.getConnection(); // returns null (I get the same T4CConnection)
         conn = (Connection)acc.getDatasourceConnection(); // returns oracle.jdbc.driver.T4CConnection
    [EL Finer]: 2008.09.30 17:03:07.905--ServerSession(24691161)--Thread(Thread[HTTPThreadGroup-1,9,HTTPThreadGroup])--client acquired
    [EL Finer]: 2008.09.30 17:03:13.061--UnitOfWork(18699935)--Thread(Thread[HTTPThreadGroup-1,9,HTTPThreadGroup])--acquire unit of work: 11546616
    08/09/30 17:03:20 __Connection: oracle.jdbc.driver.T4CConnection@18d702e
    I suspect you are running a RESOURCE_LOCAL entitymanager on your servlet client (not on an EJB) that defines all database properties like 3) below.
    like
    public class FrontController extends HttpServlet implements Servlet {
         public EntityManagerFactory emf = Persistence.createEntityManagerFactory("unified");
         public EntityManager entityManager = emf.createEntityManager();
    not
    @Local @Stateless
    public class ApplicationService implements ApplicationServiceLocal {
         @PersistenceContext(unitName="unified",type=PersistenceContextType.TRANSACTION)     
         private EntityManager entityManager;
    1) JTA on OC4J - NOPE
    Debugging in to UnitOfWorkImpl - I see the oracle.oc4j.sql.ManagedDataSource@202088
    However, I think this is still a tx datasource because usesExternalTransactionController = true
    uow     UnitOfWorkImpl (id=534)     
         project     Project (id=573)     
              datasourceLogin     DatabaseLogin (id=582)     
                   connector     JNDIConnector (id=592)     
                        dataSource     ManagedDataSource (id=599)     
                             m_connectionManger     OracleConnectionManager (id=613)     
                             m_connectionRetryInterval     1     
                             m_dataSourceName     "OracleDS" (id=619)     
                             m_debug     ManagedDataSourceDebugInfo (id=620)     
                             m_dmsConnectionStatMap     WeakHashMap<K,V> (id=622)     
                             m_loginTimeout     0     
                             m_logWriter     null     
                             m_managedConnectionFactory     ManagedConnectionFactoryImpl (id=624)     
                             m_manageLocalTransactions     true     
                             m_manageSqlObjects     "basic" (id=626)     
                             m_maxConnectAttempts     3     
                             m_mBean     ManagedJDBCDataSource (id=632)     
                             m_password     null     
                             m_reference     null     
                             m_unStattedConnections     WeakHashMap<K,V> (id=698)     
                             m_unStattedConnectionsLock     Object[0] (id=658)     
                             m_url     null     
                             m_user     null     
                   usesExternalTransactionController     true     
    Using your getConnection(EntityManager em) code:
    acc     DatabaseAccessor (id=537)     
         datasourceConnection     null     
    using:
    <persistence-unit name="unified" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <non-jta-data-source>jdbc/OracleDS</non-jta-data-source>
    <properties>
    <property name="eclipselink.target-server" value="OC4J"/>
    2) non-JTA on OC4J - NOPE
    using..
    entityManager.getTransaction().begin(); // non-JTA
    System.out.println("__Connection: " + getConnection(entityManager));
    on..
    <persistence-unit name="unified" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <non-jta-data-source>jdbc/OracleDS</non-jta-data-source>
    does not work with...
         @PersistenceContext(unitName="unified",type=PersistenceContextType.TRANSACTION)     
         private EntityManager entityManager;
    08/09/30 16:45:59 Exception: Cannot use resource level transactions with a container managed EntityManager
    3) non-JTA, non container managed on OC4J - YES
    using..
         // Local non-JTA application managed EMF and EM
         public EntityManagerFactory emf = Persistence.createEntityManagerFactory("unified");
         public EntityManager entityManager = emf.createEntityManager();
    persistence.xml
    <persistence-unit name="unified" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <properties>
    <property name="eclipselink.target-server" value="OC4J"/>
    <property name="eclipselink.logging.level" value="FINEST"/>
    <property name="eclipselink.session-name" value="eclipselinkwls"/>
    <property name="eclipselink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="eclipselink.jdbc.platform" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
    <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@x.x.x.x:1521:orcl"/>
    <property name="eclipselink.jdbc.user" value="scott"/>
    <property name="eclipselink.jdbc.password" value="password...."/>
    uow     UnitOfWorkImpl (id=518)     
         platform     Oracle10Platform (id=544)     
         project     Project (id=527)     
              aliasDescriptors     null     
              datasourceLogin     DatabaseLogin (id=533)     
                   cacheTransactionIsolation     5     
                   connectionHealthValidatedOnError     true     
                   connector     DefaultConnector (id=542)     
                        connectDirectly     true     
                        databaseURL     "jdbc:oracle:thin:@10.156.53.19:1521:orcl" (id=555)     
                        driver     OracleDriver (id=556)     
                        driverClass     Class<T> (oracle.jdbc.driver.OracleDriver) (id=557)     
                        driverClassName     "oracle.jdbc.driver.OracleDriver" (id=558)     
                        driverURLHeader     "" (id=560)     
    oracle.jdbc.driver.T4CConnection@18d702e
    acc     DatabaseAccessor (id=571)     
         activeBatchWritingMechanism     ParameterizedSQLBatchWritingMechanism (id=575)     
         datasourceConnection     T4CConnection (id=579)     
              database     "x.x.x.x:1521:orcl" (id=638)     
              databaseMetaData     OracleDatabaseMetaData (id=639)     
              databaseProductVersion     "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\nWith the Partitioning, OLAP and Data Mining options" (id=641)     
              thinVsessionProgram     "JDBC Thin Client" (id=736)     
              thinVsessionTerminal     "unknown" (id=737)     
              timeout     null     
              timestamptzInGmt     true     
              txnLevel     2     
              txnMode     0     
              url     "jdbc:oracle:thin:@x.x.x.x:1521:orcl" (id=738)     
              useFetchSizeWithLongColumn     false     
              userName     "SCOTT" (id=739)     
              usingXA     false     
              ver     T4C7Oversion (id=740)     
              versionNumber     10201     
              walletLocation     null     
              whichDMS     2     
              wrapper     null     
              xaWantsError     false     
    With the following change...
         public Connection getConnection(EntityManager em) {
         Connection conn = null;
         if (em != null && em.isOpen()) {
         JpaEntityManager jem = (JpaEntityManager)em.getDelegate();
         if (jem != null) {
         Session session = jem.getActiveSession();
         if (session != null) {
         UnitOfWorkImpl uow = (UnitOfWorkImpl)session.acquireUnitOfWork();
         if (uow != null) {
         Accessor acc = uow.getAccessor();
         if (acc != null) {
         //conn = acc.getConnection(); // returns null (I get the same T4CConnection)
         conn = (Connection)acc.getDatasourceConnection(); // returns oracle.jdbc.driver.T4CConnection
         return conn;
    we get...
    [EL Finer]: 2008.09.30 17:03:07.905--ServerSession(24691161)--Thread(Thread[HTTPThreadGroup-1,9,HTTPThreadGroup])--client acquired
    [EL Finer]: 2008.09.30 17:03:13.061--UnitOfWork(18699935)--Thread(Thread[HTTPThreadGroup-1,9,HTTPThreadGroup])--acquire unit of work: 11546616
    08/09/30 17:03:20 __Connection: oracle.jdbc.driver.T4CConnection@18d702e
    thank you
    [email protected]

  • Appclient: Error checking for persistence unit annotations in the main clas

    what does this mean? i tried to launch my app client as follows:
    appclient -client foo.jar
    Oct 9, 2006 3:49:02 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    java.lang.RuntimeException: Error checking for persistence unit annotations in the main class
    at com.sun.enterprise.appclient.StandAloneAppClientInfo.classContainsAnnotation(StandAloneAppClientInfo.java:88)
    at com.sun.enterprise.appclient.AppClientInfo.mainClassContainsPURefcAnnotations(AppClientInfo.java:342)
    at com.sun.enterprise.appclient.AppClientInfo.appClientDependsOnPersistenceUnit(AppClientInfo.java:311)
    at com.sun.enterprise.appclient.AppClientInfo.completeInit(AppClientInfo.java:164)
    at com.sun.enterprise.appclient.AppClientInfoFactory.buildAppClientInfo(AppClientInfoFactory.java:136)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:287)
    at com.sun.enterprise.appclient.Main.main(Main.java:180)
    Caused by: java.lang.NullPointerException
    at java.util.zip.ZipFile.getInputStream(ZipFile.java:286)
    at java.util.jar.JarFile.getInputStream(JarFile.java:382)
    at com.sun.enterprise.deployment.util.AnnotationDetector.containsAnnotation(AnnotationDetector.java:139)
    at com.sun.enterprise.appclient.StandAloneAppClientInfo.classContainsAnnotation(StandAloneAppClientInfo.java:86)
    ... 6 more

    Hi, Did you find out what caused this as I have the same problem.
    :\Sun\EJB3\Chapter02-SessionSamples\SessionBeanSamples\archive>%GLASSFISH_HOME%
    bin/appclient.bat -client searchfacadeclient.jar
    006-11-08 12:52:48 com.sun.enterprise.deployment.annotation.impl.ModuleScanner
    etElements
    ARNING: Cannot load SearchFacadeTest reason : SearchFacadeTest
    006-11-08 12:52:48 com.sun.enterprise.appclient.MainWithModuleSupport <init>
    ARNING: ACC003: Application threw an exception.
    ava.lang.RuntimeException: Error checking for persistence unit annotations in t
    e main class
    at com.sun.enterprise.appclient.StandAloneAppClientInfo.classContainsAnn
    tation(StandAloneAppClientInfo.java:88)
    at com.sun.enterprise.appclient.AppClientInfo.mainClassContainsPURefcAnn
    tations(AppClientInfo.java:342)
    at com.sun.enterprise.appclient.AppClientInfo.appClientDependsOnPersiste
    ceUnit(AppClientInfo.java:311)
    at com.sun.enterprise.appclient.AppClientInfo.completeInit(AppClientInfo
    java:164)
    at com.sun.enterprise.appclient.AppClientInfoFactory.buildAppClientInfo(
    ppClientInfoFactory.java:136)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithMod
    leSupport.java:287)
    at com.sun.enterprise.appclient.Main.main(Main.java:180)
    aused by: java.lang.NullPointerException
    at java.util.zip.ZipFile.getInputStream(ZipFile.java:286)
    at java.util.jar.JarFile.getInputStream(JarFile.java:382)
    at com.sun.enterprise.deployment.util.AnnotationDetector.containsAnnotat
    on(AnnotationDetector.java:139)
    at com.sun.enterprise.appclient.StandAloneAppClientInfo.classContainsAnn
    tation(StandAloneAppClientInfo.java:86)
    ... 6 more
    xception in thread "main" java.lang.RuntimeException: java.lang.RuntimeExceptio
    : Error checking for persistence unit annotations in the main class
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithMod
    leSupport.java:364)
    at com.sun.enterprise.appclient.Main.main(Main.java:180)
    aused by: java.lang.RuntimeException: Error checking for persistence unit annot
    tions in the main class
    at com.sun.enterprise.appclient.StandAloneAppClientInfo.classContainsAnn
    tation(StandAloneAppClientInfo.java:88)
    at com.sun.enterprise.appclient.AppClientInfo.mainClassContainsPURefcAnn
    tations(AppClientInfo.java:342)
    at com.sun.enterprise.appclient.AppClientInfo.appClientDependsOnPersiste
    ceUnit(AppClientInfo.java:311)
    at com.sun.enterprise.appclient.AppClientInfo.completeInit(AppClientInfo
    java:164)
    at com.sun.enterprise.appclient.AppClientInfoFactory.buildAppClientInfo(
    ppClientInfoFactory.java:136)

  • Error checking for persistence unit annotations in the main class

    Hi
    When I tried running the examples from the SUN JMS tutorials, I landed in a problem. I did the following changes...
    1. I created a new project in eclipse
    2. created the java class 'Producer.java' in a package..(the one in java tutorial is not in a package)
    3. copied the build.xml and made the the respective changes.
    I successfully created the jar file, but when I tried to run the the application
    appclient -client JMSProducer.jar eg.jms.P2PProducer.Producer queue 3it throws the following exception:
    Nov 29, 2006 3:40:33 PM com.sun.enterprise.deployment.annotation.impl.ModuleScan
    ner getElements
    WARNING: Cannot load ${main.class} reason : ${main.class}
    Nov 29, 2006 3:40:33 PM com.sun.enterprise.appclient.MainWithModuleSupport <init
    >
    WARNING: ACC003: Application threw an exception.
    java.lang.RuntimeException: Error checking for persistence unit annotations in t
    he main class
            at com.sun.enterprise.appclient.StandAloneAppClientInfo.classContainsAnn
    otation(StandAloneAppClientInfo.java:88)
            at com.sun.enterprise.appclient.AppClientInfo.mainClassContainsPURefcAnn
    otations(AppClientInfo.java:342)
            at com.sun.enterprise.appclient.AppClientInfo.appClientDependsOnPersiste
    nceUnit(AppClientInfo.java:311)
            at com.sun.enterprise.appclient.AppClientInfo.completeInit(AppClientInfo
    .java:164)
            at com.sun.enterprise.appclient.AppClientInfoFactory.buildAppClientInfo(
    AppClientInfoFactory.java:136)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithMod
    uleSupport.java:287)
            at com.sun.enterprise.appclient.Main.main(Main.java:180)
    Caused by: java.lang.NullPointerException
            at java.util.zip.ZipFile.getInputStream(ZipFile.java:286)
            at java.util.jar.JarFile.getInputStream(JarFile.java:387)
            at com.sun.enterprise.deployment.util.AnnotationDetector.containsAnnotat
    ion(AnnotationDetector.java:139)I have spent so much time identifying the problem... can anyone point the error please?

    I'm having the same problem, albeit 18 months later. I am working with a tutorial from apress, which seems very high on Glassfish as a AppServer environment for learning EJB 3.0. I have the same error when I try to run the client application in the Sun Platform 9.0 Application Server's AppClient Module container , "... Error checking for persistence unit annotations in the main class..." and I think it has something to do with the fact that the AppClient is expecting "something" in the MANIFEST.MF file that actually isn't there... ( sigh ). " so close, and yet so far away.... "
    --- andyj748

  • Multiple persistence units with name "Model" are defined at the same scope

    Hi,
    I get this error when deploying from Jdeveloper 10.1.3.4 to OAS 10.1.3.
    The release notes for Jdev 10.1.3.1 say the following:
    "To avoid this error, update the ViewController project settings to remove the dependency on the Model project before deploying the ADF web application to Standlone OC4J."
    So I removed the dependancy but now none of my EJB's are deployed! If I go to the Enterprise Manager Console I can only see my WEB MODULE but no EJBs.
    Can anyone shed any light on this issue? Perhaps I have configured my incorrectly.
    ps. I am trying to deploy an EJB3 web app so I do not have any deployment descriptors as the documentation say that they are not needed.
    Thanks

    Also, the reason you are seeing those errors in your first project after generating entities from the second connection is because the project wide schema is being updated to the second connections generation schema. If you go into the JPA project properties you can change it back. This workflow would need to change with multiple persistence unit support.
    Neil

  • EJB 3.0 - problem with persistence unit.

    Hi everybody, I got this problem I would like you to help me.
    I'm doing a proyect with EJB 3.0 using Netbeans 5.5 and Jboss
    The data source is MySQL.
    When I deploy the proyect, the Jboss Log show me this:
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    State: FAILED
    Reason: javax.naming.NameNotFoundException: jdbc not bound
    I Depend On:
    jboss.jca:service=ManagedConnectionFactory,name=jdbc/connectionPool
    Depends On Me:
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3
    [Please help me, I'm kind of new in EJB]
    [ENTIRE JBOSS LOG]
    10:08:37,375 INFO [TomcatDeployer] undeploy, ctxPath=/DecmoCVLAC-war, warUrl=.../tmp/deploy/tmp16823DecmoCVLAC.ear-contents/DecmoCVLAC-war-exp.war/
    10:08:37,515 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:37,515 INFO [EARDeployer] Undeployed J2EE application: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:37,546 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:39,281 INFO [Ejb3Deployment] EJB3 deployment time took: 47
    10:08:39,296 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU with dependencies:
    10:08:39,296 INFO [JmxKernelAbstraction]      jboss.jca:name=jdbc/connectionPool,service=ManagedConnectionFactory
    10:08:39,312 WARN [ServiceController] Problem starting service persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    javax.naming.NameNotFoundException: jdbc not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:240)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:99)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy91.start(Unknown Source)
    at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:82)
    at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:626)
    at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:475)
    at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy36.start(Unknown Source)
    at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:449)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
    at org.jboss.ws.server.WebServiceDeployer.start(WebServiceDeployer.java:117)
    at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
    at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy37.start(Unknown Source)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
    at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy6.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
    10:08:39,812 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3 with dependencies:
    10:08:39,812 INFO [JmxKernelAbstraction]      persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    10:08:39,828 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3 with dependencies:
    10:08:39,828 INFO [JmxKernelAbstraction]      persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    10:08:39,859 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.4.GA/server/default/tmp/deploy/tmp16824DecmoCVLAC.ear-contents/DecmoCVLAC-ejb.jar
    10:08:39,859 INFO [TomcatDeployer] deploy, ctxPath=/DecmoCVLAC-war, warUrl=.../tmp/deploy/tmp16824DecmoCVLAC.ear-contents/DecmoCVLAC-war-exp.war/
    10:08:40,046 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:40,062 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    --- MBeans waiting for other MBeans ---
    ObjectName: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    State: FAILED
    Reason: javax.naming.NameNotFoundException: jdbc not bound
    I Depend On:
    jboss.jca:service=ManagedConnectionFactory,name=jdbc/connectionPool
    Depends On Me:
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3
    ObjectName: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    State: NOTYETINSTALLED
    I Depend On:
    persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    ObjectName: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3
    State: NOTYETINSTALLED
    I Depend On:
    persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    State: FAILED
    Reason: javax.naming.NameNotFoundException: jdbc not bound
    I Depend On:
    jboss.jca:service=ManagedConnectionFactory,name=jdbc/connectionPool
    Depends On Me:
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3

    Reason: javax.naming.NameNotFoundException: jdbc not bound
    Although i am quite new to this as well i would say that there is a problem with your connection with the database.
    It seems it cannot connect to Mysql.
    have you download the mysql package library and imported it ?
    Also in your deploy folder in you Jboss
    have you altered the jdbc to connect to you database in your dataset ? ( i am not sure about mysql, but postgre reguired this)
    Most probably it would be the same in mysql.
    <connection-url>jdbc:postgresql://127.0.0.1:5432/Dissertation</connection-url>
    Not sure if this is what you reguire, i am new at this my self

  • Weblogic 10.3.0 not picking up persistence unit

    Hello,
    I am facing a problem where Weblogic does not seem to pickup the persistence unit:
    [wldeploy] Target state: deploy failed on Server examplesServer
    [wldeploy] java.lang.IllegalArgumentException: No persistence unit named 'dao' is available in scope ejb-app. Available persistence units: []OS: Windows XP (Development Environemnt)
    WebLogic Server Version: 10.3.0.0
    Though I'm working via Eclipse Helios, I am using Weblogic generated (and later modified) Ant scripts to compile, build and deploy to my local Weblogic install, in a 'split development' setup.
    Following is the file strutcture:
    source
    +---build.xml (Ant script)
    +---APP-INF
    |    +---lib
    |         +--- * (shared libraries)
    |
    +---META-INF
    |    +---application.xml
    |    +---weblogic-application.xml
    |
    +---web-app
    |    +---WEB-INF
    |         +---src
    |         +---lib
    |
    +---ejb-app
         +---com.example.ejb.data (Contains Entity annotations)
          |    +---Pojo1.java
          |    +---Pojo2.java
          |
          +---com.example.ejb.ctrl (Contains business logic and services)
          |    +---MyService.java
          |
          +---META-INF
               +---ejb-jar.xml
                +---weblogic-ejb-jar.xml
                +---persistence.xml     Here is my persistence.xml:
    <?xml version="1.0"?>
    <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_1_0.xsd"
         version="1.0">
         <persistence-unit name="dao" transaction-type="RESOURCE_LOCAL">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <jta-data-source>OraDS</jta-data-source>
              <non-jta-data-source>OraDS</non-jta-data-source>
              <class>com.example.ejb.data.Pojo1</class>
              <class>com.example.ejb.data.Pojo2</class>
              <properties>
                   <property name="eclipselink.target-server" value="WebLogic_10" />
                   <property name="eclipselink.logging.level" value="FINEST" />
              </properties>
         </persistence-unit>
    </persistence>            I am attempting to inject the persistence unit via annotation in MyService.java (a @Stateless session bean):
    @PersistenceContext(unitName = "dao")
    private EntityManager entityManager;     I had done the same with 10.3.0's default Kodo provider and was getting the same issue.
    I've moved the persistence.xml to source/APP-INF, source/APP-INF/lib, source/META-INF and run deploys, it still gives me the error.
    The whole EAR is built with wlcompile and appc as per Split Directory development flow.
    For some reason, Weblogic does not seem to pick up the "dao" persistence unit into its JNDI tree, application wide or 'ejb-app' module scoped.
    Any direction on what next should I be looking at would be helpful.
    Edited by: Vyoma on May 25, 2011 10:15 PM
    Fixed code formatting.

    Pierluigi Vernetto, thanks for that link. Though it was for a web module consumption of the persistence package, I was able to adapt it for use by my ejb module.
    Here is my solution, under split-directory development workflow.
    Create the persistence module, place the persistence.xml in that module's META-INF.
    Create an Ant task in the build.xml to 'wlcompile' and JAR it to the EAR direcotries APP-INF/lib directory.
    Exclude the persistence module from the rest of the 'wlcompile' and 'appc' tasks.
    I was then able to inject it with annotation in my EJB module.
    dvohra16, thanks for that pointer. Now that I've been able to solve, the pressure is off (and shifted to other things). But I will surely check your option out. If I can get that working, it will be much easier than tinkering around with the build.xml and would be the normal flow of split-directory development workflow.
    As of now, I will say this thread as 'solved', but if I get it working the way you mention (on my sandbox project), I will surely come back and update this thread.
    Edited by: Vyoma on May 27, 2011 11:21 AM

  • Weblogic 12c not picking up persistence unit in WAR

    I'm trying to get an example CRUD application to run on WebLogic 12c (for the app see: http://henk53.wordpress.com/2012/04/15/jsf2-primefaces3-ejb3-jpa2-integration-project/)
    So far the applications runs on JBoss AS 7.1, GlassFish 3.1.2 and TomEE beta 2. In all those application servers persistence.xml is picked-up, and processed so I'm at a loss what's wrong with WebLogic. I'm using Eclipse 3.7.2 and the Oracle WebLogic 12C WTP server adapter for the deployment.
    I'm getting the following exception:
    java.lang.IllegalArgumentException: No persistence unit named 'entityManager' is available in scope jsf_ejb_jpa. Available persistence units: []
         at weblogic.persistence.ModulePersistenceUnitRegistry.getPersistenceUnit(ModulePersistenceUnitRegistry.java:130)
         at weblogic.persistence.BasePersistenceContextProxyImpl.<init>(BasePersistenceContextProxyImpl.java:40)
         at weblogic.persistence.TransactionalEntityManagerProxyImpl.<init>(TransactionalEntityManagerProxyImpl.java:31)
         at weblogic.persistence.EntityManagerInvocationHandlerFactory.createTransactionalEntityManagerInvocationHandler(EntityManagerInvocationHandlerFactory.java:20)
         at weblogic.persistence.PersistenceManagerObjectFactory.createPersistenceContextProxy(PersistenceManagerObjectFactory.java:66)
         at weblogic.persistence.PersistenceManagerObjectFactory.getObjectInstance(PersistenceManagerObjectFactory.java:31)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:251)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:406)
         at weblogic.j2eeclient.java.ClientReadOnlyContextWrapper.lookup(ClientReadOnlyContextWrapper.java:35)
         at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at javax.naming.InitialContext.doLookup(InitialContext.java:265)
         at com.oracle.pitchfork.inject.Jsr250Metadata.jndiLookup(Jsr250Metadata.java:307)
         at com.oracle.pitchfork.inject.Jsr250Metadata.resolveByName(Jsr250Metadata.java:303)
         at com.oracle.pitchfork.inject.Jsr250Metadata.resolve(Jsr250Metadata.java:266)
         at com.oracle.pitchfork.inject.Jsr250Metadata.applyInjections(Jsr250Metadata.java:228)
         at com.oracle.pitchfork.inject.Jsr250Metadata.inject(Jsr250Metadata.java:219)
         at com.oracle.pitchfork.spi.BaseComponentBrokerImpl.getBean(BaseComponentBrokerImpl.java:63)
         at com.oracle.pitchfork.spi.EjbComponentCreatorBrokerImpl.getBean(EjbComponentCreatorBrokerImpl.java:33)
         at weblogic.ejb.container.injection.EjbComponentCreatorImpl.getBean(EjbComponentCreatorImpl.java:76)
         at weblogic.ejb.container.manager.BaseEJBManager.createNewBeanInstance(BaseEJBManager.java:209)
         at weblogic.ejb.container.manager.BaseEJBManager.allocateBean(BaseEJBManager.java:235)
         at weblogic.ejb.container.manager.StatelessManager.createBean(StatelessManager.java:293)
         at weblogic.ejb.container.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:185)
         at weblogic.ejb.container.pool.StatelessSessionPool.getBean(StatelessSessionPool.java:114)
         at weblogic.ejb.container.manager.StatelessManager.preInvoke(StatelessManager.java:174)
         at weblogic.ejb.container.internal.BaseLocalObject.getBeanInstance(BaseLocalObject.java:146)
         at weblogic.ejb.container.internal.BaseLocalObject.preInvoke(BaseLocalObject.java:103)
         at weblogic.ejb.container.internal.BaseLocalObject.__WL_preInvoke(BaseLocalObject.java:67)
         at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:20)
         at com.example.dao.jpa.JpaUserDAO_wrkew_UserDAOImpl.add(Unknown Source)
         at com.example.backing.IndexBacking.addUser(IndexBacking.java:38)
    Notice that "entityManager" is the name of the instance variable in which injection is being performed:
    @PersistenceContext(name="example")
    private EntityManager entityManager;
    If I rename this variable to "em: as follows:
    @PersistenceContext(name="example")
    private EntityManager em;
    Then, lo and behold, the exception changes into:
    java.lang.IllegalArgumentException: No persistence unit named 'em' is available in scope jsf_ejb_jpa. Available persistence units: []
    As the example uses a data-source defined in web.xml, which is only marginally supported in most application servers, I tried to define a WebLogic specific application scoped data-source instead and let the persistence unit use that. I couldn't find a way to do this in a .war (is this even possible?), so I created an .ear archive instead. When deploying the EAR, the data-source is clearly being created, but I'm getting the same exception again.
    I finally created an EJB module with a persistence.xml and a simple Singleton that's injected with the entityManager, and added that to the EAR. This works for the EJB module, but in the web module injection of the other entity manager still fails.
    Any idea what might be the problem?

    After some more fiddling, I discovered it's not WebLogic itself that's at fault here, but most likely Oracle's WTP adapter. Apparently it doesn't include persistence.xml in the archive that gets deployed. When I export the project as an .ear archive and copy this to WebLogic's autodeploy directly, things do work.
    I tried to find out what the main difference was between the deployments, but I could not find where the Oracle WTP adapter creates the deployment. I tried to test where a resource inside the EAR resides on the filesystem via the following code inside a backing bean:
    URL url = Thread.currentThread().getContextClassLoader().getResource("com/example/backing");
    It looks like there isn't a real .war or .ear being created and deployed, but there's a link back to the workspace, as the URL resolves to:
    file:/Users/henk/eclipse37ee/workspace/jsf_ejb_jpa/build/classes/com/example/backing/
    If I execute the same code for the ear in the autodeploy folder, the URL resolves to some jar inside:
    /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/tmp/_WL_user/_appsdir_jsf_ejb_jpa_ear_ear/2jzks6/war/WEB-INF/lib/
    In case of the WTP 'deployment' linking back to the Eclipse workspace, META-INF/persistence.xml is actually there too, but for some reason Weblogic can't find it there?
    Edited by: Henk on Apr 29, 2012 2:57 PM

  • 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

  • Duplicate persistence units in JPA weblogic

    Hello, I'm cross-posting thsi question from weblogic forum as a suggestion from james.bayer.
    I am using weblogic 10.3.
    I am trying to deploy a spring web application with severaljars, that contain jpa entities with a persistence.xml. The persistence unit name in all persistence.xml are equal. That is for spring no problem, because i wrote a PersistenceUnitManager, that merges all persistence units into one.
    So far so good. But weblogic cant't deploy the war, because while validation of the deployment, wls throws an exception, that there are two persistence unit with the same name.
    Does anybody has an idea how to deploy this war?
    Can i switch off the validation of the persistence.xml?
    The full stack trace is:
    weblogic.application.ModuleException: Failed to load webapp: 'sfw-poc-condicao-pagamento-web.war'
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:404)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:180)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:508)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:47)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1223)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:40)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:22)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:166)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused By: weblogic.deployment.EnvironmentException: duplicate persistence units with name sfw-persistence-unit in scope sfw-poc-condicao-pagamento-web.war. First PU location: file:/C:/java/servers/Oracle/Middleware/user_projects/domains/base_domain/servers/softway/tmp/_WL_user/sfw-poc-condicao-pagamento-web/rrg25b/war/WEB-INF/lib/sfw-class-loader-0.0.1-SNAPSHOT.jar. Second PU location: file:/C:/java/servers/Oracle/Middleware/user_projects/domains/base_domain/servers/softway/tmp/_WL_user/sfw-poc-condicao-pagamento-web/rrg25b/war/WEB-INF/lib/sfw-custom-jar-0.0.1-20100622.030351-65.jar
         at weblogic.deployment.AbstractPersistenceUnitRegistry.assertNoDuplicate(AbstractPersistenceUnitRegistry.java:313)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.processDescriptor(AbstractPersistenceUnitRegistry.java:291)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:192)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:101)
         at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
         at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1812)
         at weblogic.servlet.internal.WebAppModule.getWebClassLoader(WebAppModule.java:1604)
         at weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:2969)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:438)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:487)
         at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
         at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:381)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:180)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:508)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:47)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1223)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:40)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:22)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:166)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Thanks a lot

    They need to have different names.
    James : http://www.eclipselink.org

  • Problems with duplicate persistence units

    I suppose that Weblogic 10.3 do not support some locations of persistence.xml.
    For example. On Jboss server I can succesfully deploy ear with this structure
    -services-ejb.jar
    -services-ws.jar
    -/APP-INF/lib
    -/APP-INF/lib/services-jpa.jar with persistence.xml i META-INF
    -/META-INF/application.xml
    But on Weblogic 10.3 it is impossible. Weblogic got an error with duplicate PU in the same location...
    <2009-06-04 16:06:18 CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.management.DeploymentException:
    at weblogic.application.internal.flow.JpaFlow.prepare(JpaFlow.java:59)
    weblogic.deployment.EnvironmentException: duplicate persistence units with name servicesJPA in scope services-ear.
    First PU location: file:D:/apache/bea10.3/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/services-ear/skzpn4/APP-INF/lib/services-jpa.jar.
    Second PU location: file:D:/apache/bea10.3/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/services-ear/skzpn4/APP-INF/lib/services-jpa.jar
    My application.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
    <description>services ear</description>
    <display-name>services-ear</display-name>
    <module>
    <ejb>services-ejb.jar</ejb>
    </module>
    <module>
    <web>
    <web-uri>services-ws.war</web-uri>
    <context-root>/services-ws</context-root>
    </web>
    </module>
    <library-directory>APP-INF/lib</library-directory>
    </application>
    Is any solution to keep persistence in library directory?

    Edwin,
    I have tried the same thing that you describe in question one in the attached VI. If you change the data ranges and then run the VI, you will note that the numeric value will only ba allowed in the new range. (If the current value is outside of the range that you have set, then you will need to change the value of the cotrol to be in the new range before the new range properties will take effect.)
    As for your second question, can you expand upon this? I am not sure that I understand what you mean. Is an example VI possible? Thanks
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask
    Attachments:
    Data_Range_with_Units.vi ‏22 KB

  • Persistence Units: Transaction Type

    Hi,
    I'm just getting into Java EE 5 and EJB3. I've found many examples of persistence.xml files with the persistence-units' transaction-types set to either JTA or LOCAL_RESOURCE. What I haven't been able to find is any discussion on when one type should be used over the other.
    I've been playing a little in NetBeans 5.5 and created a persistence.xml for an entity class library. The design view of the xml file doesn't have any options to switch from one to the other (that I can see anyway). Mine is set to use RESOURCE_LOCAL. I know I could manually edit the file to use JTA, but should I? Why would I? Why does NB only allow for RESOURCE_LOCAL? I don't know how relevant it is, but the provider is toplink essentials.
    If anyone can point me to a good resource that discusses these issues, I would be grateful.
    Thanks in advance,
    Shelli

    You apparently have configured it as a container managed entity manager. It roughly means that the container is injecting the entity manager in the environment and controlling the transactions itself, rather than that you are controlling the transactions yourself in the code.
    Either change it to JTA to get the container to do the work, or if you want to keep it RESOURCE_LOCAL somehow, then stop using container managed injection and control the transactions yourself.
    This has not much to do with JDBC however. In the future better use the [EJB forum|http://forums.sun.com/forum.jspa?forumID=13].

Maybe you are looking for

  • COPA issue

    Hi Gurus, Two condition type are assigned to one value field.One condition type can have either + or negative values.The value field should do summation correctly in either of cases. If I activate check box transfer +/-  indicator , those with positi

  • Exchange 2007 - unable to connect to smtp after severall hours

    Hi, We have a Windows SBS 2008 server with Exchange 2007 SP3. After severall hours we are unable to connect to the server with telnet on port 25 from outside. Sometimes a local telnet on the server still works but not always. The only solution is to

  • My calendar on iPhone doesn't sync with my iPad or mac

    I have i cloud on all three of my apple devices. When I add to my calendar on my I Phone it doesn't syn to my Mac or I Pad. Help

  • Photoshop Crashing during simple tasks

    Hello all, We're having a problem with Photoshop crashing during simple tasks like masking. This is on a Mac Pro 5,1 with a 2.4GHz Xeon, ATI Radeon 5770 Graphics card, and 32GB RAM. Photoshop CC 14.2.0  Here is the error report: Process:         Adob

  • Compare two year column

    Hi to all, I'm new at Crystal and I have a question. I have a source table that have the following layout: NAME       DATE      SALES_VALUE aaaaa      Jan09           1000 bbbbb      Feb09           1111 ccccc      Mar09           1010 aaaaa      Jan