Eclipselink Multitenancy problem

We have a web application that should support multi tenancy. As persistence framework we want to user Eclipselkink with its Multitenant feature.
Here are our requirements:
- The web application should be container managed (JTA)
- We want to use the single table approach. Each tenant entity becomes a tenant_id.
- Admins are able to create tenants on the fly. That means each user was assigned to its tenant. On login we read the tenantId and pass it to the EntityManager.
At the moment I have some transaction problems. I´ve injected the EntityManagerFactory with @PersistenceUnit annotation and pass the tenant id and the shared cache setting to the entity manager. Queries works fine but merge/persist of entities don´t work anymore. There is no exception. I think its a transaction problem.
In a further version i used the @PersistenceContext and everything is works fine. But i think injection the persistence context is don´t allowed in "Persistence Context per Tenant" (see https://wiki.eclipse.org/EclipseLink/Examples/JPA/Multitenant)
How could I use container managed transactions (persistence context) and tell the entity manager which tenant id it should use?
Thanks for your answers.

We have a web application that should support multi tenancy. As persistence framework we want to user Eclipselkink with its Multitenant feature.
Here are our requirements:
- The web application should be container managed (JTA)
- We want to use the single table approach. Each tenant entity becomes a tenant_id.
- Admins are able to create tenants on the fly. That means each user was assigned to its tenant. On login we read the tenantId and pass it to the EntityManager.
At the moment I have some transaction problems. I´ve injected the EntityManagerFactory with @PersistenceUnit annotation and pass the tenant id and the shared cache setting to the entity manager. Queries works fine but merge/persist of entities don´t work anymore. There is no exception. I think its a transaction problem.
In a further version i used the @PersistenceContext and everything is works fine. But i think injection the persistence context is don´t allowed in "Persistence Context per Tenant" (see https://wiki.eclipse.org/EclipseLink/Examples/JPA/Multitenant)
How could I use container managed transactions (persistence context) and tell the entity manager which tenant id it should use?
Thanks for your answers.

Similar Messages

  • Moving to EclipseLink (SessionCustomizer problem)

    Hi,
    I moved from Toplink Essentials to EclipseLink with Tomcat 6.0.18 and have this problem:
    I created two web applications both uses EclipseLink. Due to using non-jta-datasources I created in both applications JPAEclipseLinkSessionCustomizer as shown here: http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial
    When I start one application everything works fine. As soon as I run the other application which uses EclipseLink I got exception:
    Exception [EclipseLink-28014] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): org.eclipse.persistence.exceptions.EntityManagerSetupException
    Exception Description: Exception was thrown while processing property (eclipselink.session.customizer) with value (hlaseni.JPAEclipseLinkSessionCustomizer).
    Internal Exception: java.lang.ClassCastException: hlaseni.JPAEclipseLinkSessionCustomizer cannot be cast to org.eclipse.persistence.config.SessionCustomizer
    Can anyone help?
    Thanks
    PERSISTENCE.XML
    <?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="hlaseniPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <non-jta-data-source>java:comp/env/jdbc/Hlaseni</non-jta-data-source>
    <class>hlaseni.entity.Zmeny</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
    <property name="eclipselink.session.customizer" value="hlaseni.JPAEclipseLinkSessionCustomizer"/>
    <property name="eclipselink.logging.level" value="INFO"/>
    </properties>
    </persistence-unit>
    </persistence>
    CLASS JPAEclipseLinkSessionCustomizer:
    package hlaseni;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import org.eclipse.persistence.config.SessionCustomizer;
    import org.eclipse.persistence.sessions.JNDIConnector;
    import org.eclipse.persistence.sessions.Session;
    public class JPAEclipseLinkSessionCustomizer implements SessionCustomizer {
    public void customize(Session session) throws Exception {
    JNDIConnector connector = null;
    Context context = null;
    try {
    context = new InitialContext();
    if (null != context) {
    connector = (JNDIConnector) session.getLogin().getConnector(); // possible CCE
    connector.setLookupType(JNDIConnector.STRING_LOOKUP);
    System.out.println("_JPAEclipseLinkSessionCustomizer: configured " + connector.getName());
    } else {
    throw new Exception("_JPAEclipseLinkSessionCustomizer: Context is null");
    } catch (Exception e) {
    e.printStackTrace();
    }

    Pavel,
    I was able to run EclipseLink JPA using a non-JTA datasource on Tomcat 6.0.18 using the following configuration.
    I will update the tutorial with this 3rd type of database connectivity.
    1) transaction-type RESOURCE_LOCAL direct connection using "javax.persistence.jdbc" properties - previously working
    2) transaction-type RESOURCE_LOCAL non-JTA datasource connection using "non-jta-data-source" or "javax.persistence.nonJtaDataSource" - verified today
    3) transaction-type JTA "jta-data-source" - working only when Tomcat is run as a service
    2) non-jta-datasource setup for persistence.xml, web.xml and server.xml
    Note: if the resource-ref setup is missing or if the jndi names do not match you will see "name not bound" exceptions
    persistence.xml
    <persistence-unit name="statJPA" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <non-jta-data-source>java:comp/env/ds/OracleDS</non-jta-data-source>
    <class>org.eclipse.persistence.example.unified.business.***</class>
    <properties>
    <property name="eclipselink.session.customizer" value="org.eclipse.persistence.example.unified.integration.JPAEclipseLinkSessionCustomizer"/>
    <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
    <!-- this one overrides -->
    <property name="javax.persistence.nonJtaDataSource" value="java:comp/env/ds/OracleDS"/>
    <property name="eclipselink.logging.level" value="FINEST"/>
    </properties>
    </persistence-unit>
    JPAEclipseLinkSessionCustomizer.java
    - matches what is on
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial#Session_Customizer
    web.xml
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>UnifiedTomcatWeb</display-name>
    <servlet>
    <display-name>FrontController</display-name>
    <servlet-name>FrontController</servlet-name>
    <servlet-class>org.eclipse.persistence.example.unified.presentation.FrontController</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>FrontController</servlet-name>
    <url-pattern>/FrontController</url-pattern>
    </servlet-mapping>
    <persistence-context-ref>
    <persistence-context-ref-name>persistence/em</persistence-context-ref-name>
    <persistence-unit-name>statJPA</persistence-unit-name>
    </persistence-context-ref>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>ds/OracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    server.xml
    <GlobalNamingResources>
    <Resource
    name="ds/OracleDS"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="scott"
    password="pw"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@y.y.y.y:1521:orcl"
    />
    </GlobalNamingResources>
    <Context
    className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true"
    charsetMapperClass="org.apache.catalina.util.CharsetMapper"
    cookies="true" crossContext="false" debug="0"
    displayName="UnifiedTomcatWeb"
    docBase="C:\opt\tomcat6018\webapps\UnifiedTomcatWeb.war"
    mapperClass="org.apache.catalina.core.StandardContextMapper"
    path="/UnifiedTomcatWeb"
    privileged="false" reloadable="false"
    swallowOutput="false" useNaming="true"
    wrapperClass="org.apache.catalina.core.StandardWrapper">
    <ResourceLink
    global="ds/OracleDS"
    name="ds/OracleDS"
    type="javax.sql.DataSource"/>
    </Context>
    </Host>
    Logs:
    [EL Finest]: 2009-06-01 15:19:23.828--ServerSession(13961193)--Thread(Thread[http-8080-1,5,main])--property=javax.persistence.nonJtaDataSource; value=java:comp/env/ds/OracleDS
    [EL Finest]: 2009-06-01 15:19:23.844--ServerSession(13961193)--Thread(Thread[http-8080-1,5,main])--property=eclipselink.session.customizer; value=org.eclipse.persistence.example.unified.integration.JPAEclipseLinkSessionCustomizer
    _JPAEclipseLinkSessionCustomizer: configured java:comp/env/ds/OracleDS*+_
    [EL Info]: 2009-06-01 15:19:23.844--ServerSession(13961193)--Thread(Thread[http-8080-1,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.0.0.qualifier
    [EL Config]: 2009-06-01 15:19:23.859--ServerSession(13961193)--Connection(6427893)--Thread(Thread[http-8080-1,5,main])--connecting
    (DatabaseLogin(
    platform=>OraclePlatform
    user name=> ""
    connector=>JNDIConnector datasource name=>java:comp/env/ds/OracleDS
    [EL Config]: 2009-06-01 15:19:24.327--ServerSession(13961193)--Connection(24968504)--Thread(Thread[http-8080-1,5,main])--Connected
    : jdbc:oracle:thin:@y.y.y.y:1521:orcl
    User: SCOTT
    Database: Oracle Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Driver: Oracle JDBC driver Version: 11.1.0.0.0-Beta5
    EL Info]: 2009-06-01 15:19:24.358--ServerSession(13961193)--Thread(Thread[http-8080-1,5,main])--file:/C:/opt/tomcat6018/webapps/UnifiedTomcatWeb/WEB-INF/classes/-statJPA login successful
    - user sends "demo" command to servlet....
    [EL Finer]: 2009-06-01 15:19:24.39--ServerSession(13961193)--Thread(Thread[http-8080-1,5,main])--client acquired
    [EL Finest]: 2009-06-01 15:19:24.39--UnitOfWork(13645178)--Thread(Thread[http-8080-1,5,main])--PERSIST operation called on: [email protected].
    [EL Finer]: 2009-06-01 15:19:24.483--UnitOfWork(13645178)--Thread(Thread[http-8080-1,5,main])--begin unit of work commit
    [EL Finer]: 2009-06-01 15:19:24.483--ClientSession(26548428)--Connection(16408563)--Thread(Thread[http-8080-1,5,main])--begin transaction
    [EL Finest]: 2009-06-01 15:19:24.499--ClientSession(26548428)--Thread(Thread[http-8080-1,5,main])--reconnecting to external connection pool
    [EL Finest]: 2009-06-01 15:19:24.499--UnitOfWork(13645178)--Thread(Thread[http-8080-1,5,main])--Execute query InsertObjectQuery([email protected])
    [EL Fine]: 2009-06-01 15:19:24.499--ClientSession(26548428)--Connection(26760685)--Thread(Thread[http-8080-1,5,main])--INSERT INTO
    STAT_LABEL (ID, DATE_STAMP) VALUES (?, ?)
    bind => [7127, null]
    thank you
    /michael

  • 11g Release 1 Patch Set 3 (WLS 10.3.4)

    Hi.
    While creating new server in OEPE Helios(11.1.1.6) I found that WLS 10.3.4 is available for selection. However I didnt find any information neither links to download it. Only 10.3.3 is available.
    When and where it is\would be available for download?
    Thanks

    frf,
    Hello, as part of the WebLogic 10.3.4 release on friday - we verified JPA 2.0 functionality for enterprise users using JPA as their persistence pattern. The main issues were JPA 2.0 XSD validation and JPA 2.0 container managed persistence unit injection.
    The details of the following post outline what happens out of the box and how JPA 2.0 can be officially enabled on JEE5 compliant WebLogic 10.3.4 install +(with or without the QWG8 patch)+
    In 10.3.3.0 you were required to use the FilteringClassLoader via the *<wls:prefer-application-packages>* addition to your application managed persistence unit - this workaround is now deprecated and not required in 10.3.4.0 for both application and container managed persistence contexts.
    Specifically we will start retesting EE applications using a SSB injected @PersistenceContext container managed JTA transactional JPA 2.0 persistence units with/without JPA 2.0 XSD elements.
    I verified the server and it is using SVN rev# *8635 from 6 Dec 2010* https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8635
    Essentially in order to enable JPA 2.0 functionality on WebLogic 10.3.4 shipped on 14 Jan 2011 - you apply the QWG8 patch below or manually edit your server classpath to put the JPA 2.0 persistence specification API jar and the com.oracle.jpa2support_1.0.0.0_2-0.jar ahead of the other liibraries on the classpath.
    commEnv.cmd: line 67
    @rem Set BEA Home
    set BEA_HOME=C:\opt\wls1034r20110115
    @rem Enable JPA 2.0 functionality on WebLogic Server 10.3.4 with the following patch line for commEnv.cmd:67
    set PRE_CLASSPATH=%BEA_HOME%\modules\javax.persistence_1.0.0.0_2-0-0.jar;%BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-0.jarEverything is shipped with WebLogic 10.3.4 but JPA 1.0 is enabled by default so that this JEE5 capable server is backwards compatible with JEE5/JPA1 out of the box. Without the above patch you will see the following.
    <15-Jan-2011 5:58:40 o'clock PM EST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.4.0 Fri Dec 17 20:47:33 PST 2010 1384255 >
    [EL Info]: 2011-01-15 18:06:38.082--ServerSession(48997950)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101206-r8635
    [EL Info]: 2011-01-15 18:06:38.082--ServerSession(48997950)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Server: 10.3.4.0
    We have the required bundles in the modules directory...
    javax.persistence_1.0.0.0_2-0-0.jar (upgraded from 1-0-2)
    org.eclipse.persistence_1.0.0.0_2-1.jar (upgraded from 2-0)
    A very quick test of a JPA 2.0 container managed app with the following persistence.xml in the ejb.jar works as detailed below.
    There are 3 issues we must check.
    1) JPA 2.0 XSD parsing errors: as expected there are no more JPA 2.0 schema parsing issues.
    2) New JPA 2.0 schema elements like the *<shared-cache-mode>NONE</shared-cache-mode>* element - this passes validation but we need to verify runtime functionality
    3) JPA 2.0 runtime API like a entityManager.getMetamodel(); call on the Servlet or Statless session bean
    4) JPA 2.0 weaving/instrumentation - Again we need to verify something like weaving of Entities contaiing lazy IndirectLists are weaved properly by the container.
    Note: All testing in this post is on a WebLogic 10.3.4.0 install out-of-the-box. The only modification I made was in creating a derby 10.5.3.0 JTA global datasource "localJTA" on the server - and drop a container managed JPA 2.0 app as an EAR in the autodeploy directory on the default user domain.
    <persistence version="2.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_2_0.xsd">
        <persistence-unit name="example" transaction-type="JTA">
            <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <!-- we will default to Kodo without specifying the provider -->
            <jta-data-source>localJTA</jta-data-source>
            <shared-cache-mode>NONE</shared-cache-mode><!-- shared-cache-mode must come after any class definitions (usually SE only) - the JPA schema is ordered -->
            <properties>
                <property name="eclipselink.target-server" value="WebLogic_10"/>
                <property name="eclipselink.target-database" value="Derby"/>           
                <property name="eclipselink.logging.level" value="FINEST"/>
                <!-- new for 10.3.4.0 http://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging#Server_Logging  -->
                <property name="eclipselink.logging.logger" value="DefaultLogger"/>
                <!-- turn off DDL generation after the model is stable -->           
                <!-- property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
                <property name="eclipselink.ddl-generation.output-mode" value="database"/-->
            </properties>      
        </persistence-unit>For 3) we get the following exception out of the box on a servlet if we do not apply the above mentioned patch below - because the container defaults to Java EE 5 functionality - or JPA 1.0
    http://download.oracle.com/docs/cd/E18476_01/doc.220/e18480/weblogicchap.htm
    java.lang.NoSuchMethodError: javax/persistence/EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel;
    at org.eclipse.persistence.example.jpa.server.weblogic.enterprise.presentation.FrontController.processGliderComm
    and(FrontController.java:346)
    or 3) The same exception if we try to run JPA 2.0 on the DI entityManager from the SSB in the EJB container classLoader
    javax.ejb.EJBException: EJB Exception: : java.lang.NoSuchMethodError: javax/persistence/EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel;
    +     at org.eclipse.persistence.example.jpa.server.business.ApplicationService.insertObjects(ApplicationService.java:66)+
    +     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)+
    +     at java.lang.reflect.Method.invoke(Method.java:597)+
    +     at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)+
    +..+
    +     at $Proxy74.insertObjects(Unknown Source)+
    +     at org.eclipse.persistence.example.jpa.server.business.ApplicationService_5ptwty_ApplicationServiceLocalImpl.__WL_invoke(Unknown Source)+
    We also get the Kodo/OpenJPA provider when we attempt to weave.
    +<openjpa-1.1.1-SNAPSHOT-r422266:965591 fatal user error> org.apache.openjpa.util.MetaDataException: "org.eclipse.persistence.example.jpa.server.business.Cell.id" declares generator name "EL_SEQUENCE_CELL", but uses the AUTO generation type. The only valid generator names under AUTO are "uuid-hex" and "uuid-string".+
    +     at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getGeneratedValueStrategy(AnnotationPersistenceMetaDataParser.java:1226)+
    Therefore there is still a little bit of configuration required.
    Enabling JPA2 support
    1) install the QWG8 patch, or
    2) manually add the com.oracle.jpa2support_1.0.0.0_2-0.jar ahead of the server classpath by following the instructions in the documentation at
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309
    or doing it manually by modifying the following line
    C:\opt\wls10340_pub110115\wlserver_10.3\common\bin\commEnv.cmd
    set PRE_CLASSPATH=%BEA_HOME%\modules\javax.persistence_1.0.0.0_2-0-0.jar;%BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-0.jar
    Results
    The following code
    @Local
    @Stateless
    public class ApplicationService implements ApplicationServiceLocal {
        @PersistenceContext(unitName="example", type=PersistenceContextType.TRANSACTION)     
        private EntityManager entityManager;
        public boolean insertObjects(List<Cell> classes) {
            try {
                for(int i=0; i< classes.size(); i++) {
                    entityManager.persist(classes.get(i));
                System.out.println("JPA 2.0 Metamodel: " + entityManager.getMetamodel());           ...prints out the JPA 2.0 EntityManager dependency injected into the SSB proxy for the life of the transaction in the function
    JPA 2.0 Metamodel: MetamodelImpl@34817119 [ 5 Types: , 2 ManagedTypes: , 2 EntityTypes: , 0 MappedSuperclassTypes: , 0 EmbeddableTypes: ]+
    +[EL Finer]: 2011-01-15 22:36:00.33--UnitOfWork(34913451)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beforeCompletion callback, status=STATUS_ACTIVE+
    You can see that when we debug the stateless session bean $Proxy that has our injected EntityManager...
    this     ApplicationService_5ptwty_Impl  (id=11616)     
         __WL_EJBContext     SessionEJBContextImpl  (id=11654)     
         entityManager     $Proxy73  (id=11639)     
              h     TransactionalEntityManagerProxyImpl  (id=11638)     
                   appName     "org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEAR" (id=11513)     
                   closeMethod     Method  (id=11663)     
                   moduleName     "org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB.jar" (id=11515)     
                   persistenceUnit     PersistenceUnitInfoImpl  (id=11665)     
                   persistenceUnitName     "org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEAR#org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB.jar#example" (id=11666)     
                   queryMethods     HashSet<E>  (id=11668)     
                   transactionAccessMethod     Method  (id=11669)     
                   transactionalMethods     HashSet<E>  (id=11670)     
                   txHelper     TransactionHelperImpl  (id=11523)     
                   txRegistry     ServerTransactionManagerImpl  (id=11524)     
                   unqualifiedPersistenceUnitName     "example" (id=11672)     ...no longer complains about an unknown getMetamodel() JPA 2.0 method signature
    Oracle WebLogic Server 11gR1 PatchSet 3 r20110115 at localhost [Oracle WebLogic Server]     
         Java HotSpot(TM) Client VM[localhost:8453]     
              Daemon Thread [[ACTIVE] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'] (Running)     
              Daemon Thread [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)'] (Suspended)     
                   TransactionalEntityManagerProxyImpl.invoke(Object, Method, Object[]) line: 18     
                   $Proxy59.getMetamodel() line: not available [local variables unavailable]     
                   ApplicationService_5ptwty_Impl(ApplicationService).insertObjects(List<Cell>) line: 60     
    ..               JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 204     
                   $Proxy71.insertObjects(List) line: not available     
                   ApplicationService_5ptwty_ApplicationServiceLocalImpl.__WL_invoke(Object, Object[], int) line: not available     
                   SessionLocalMethodInvoker.invoke(BaseLocalObject, MethodDescriptor, Object[], int, String, Class<?>) line: 39     
                   ApplicationService_5ptwty_ApplicationServiceLocalImpl.insertObjects(List) line: not available     
                   FrontController.generateGlider(PrintWriter) line: 252     
    ..               FrontController(HttpServlet).service(ServletRequest, ServletResponse) line: 820     
                   StubSecurityHelper$ServletServiceAction.run() line: 227     
    ..               ExecuteThread.run() line: 176     
    arg1     Method  (id=11511)     
         clazz     Class<T> (javax.persistence.EntityManager) (id=8312)     
         name     "getMetamodel" (id=11543)     
         returnType     Class<T> (javax.persistence.metamodel.Metamodel) (id=11545)     For 4) Weaving is occuring as expected on either the JPA 1.0 or JPA 2.0 entities. We check this by either checking that our Entity is an instanceof org.eclipse.persistence.internal.weaving.PersistenceWeaved interface, or debug into the Entity and look for our bytcode instrumented weaved fields that start with _persistence*.  The question is - we need a weaved field or weaved function that was introduced for JPA 2.0
    [4]     Cell  (id=11571)     
         _persistence_fetchGroup     null     
         _persistence_primaryKey     null     
         _persistence_session     null     
         _persistence_shouldRefreshFetchGroup     false     
         aCellAttribute     null     
         id     null     
         left     null     
         peers     HashSet<E>  (id=11572)     
              map     HashMap<K,V>  (id=11575)     
    com.oracle.jpa2support_1.0.0.0_2-0.jar forensicsI had a look at the patch jar com.oracle.jpa2support_1.0.0.0_2-0.jar that WebLogic 10.3.4 ships with that allows installers to enable JPA 2.0 (JSR-317) support to superceed the default JPA 1.0 (JSR-220) support. It looks like the container proxy code for container managed EntityManagerFactory and EntityManager $Proxy objects has been updated so that a JPA 2.0 EntityManager $Proxy object get injected with the proper API level object via the InvocationHandlerFactory, FactoryInterceptor. The Query proxy has been updated as well. There is a fix for Kodo(OpenJPA) and OpenJPA related to the recent change and deprecation of certain functions of those providers. The EclipseLink JPA 2.0 provider (as the provider for TopLink) did not need weblogic changes beyond placing the JPA javax.peristence 2.0 specification jar higher on the classpath.
    The root EclipseLink tracking bug is 334468
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=334468
    OTN downloadhttp://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html
    Patching
    http://download.oracle.com/docs/cd/E18476_01/doc.220/e18480/weblogicchap.htm
    Documentationhttp://download.oracle.com/docs/cd/E17904_01/web.1111/e13852/toc.htm
    Supported Oracle WebLogic Server Versionshttp://download.oracle.com/docs/cd/E15315_06/help/oracle.eclipse.tools.weblogic.doc/html/SupportedServerVersions.html
    TopLink JPA 2.0 Specifichttp://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309
    see related
    JPA 2: Reverify JPA 2.0 XSD support in persistence.xml on AM/CM app on WebLogic 10.3.3.0
    http://bugs.eclipse.org/331569
    JPA 2.0: Add WebLogic 10.3 configuration process to enable the JPA 2.0 library functionality - updated
    http://bugs.eclipse.org/296271
    http://en.wikipedia.org/wiki/Oracle_WebLogic_Server - updated
    JPA: Add downloadable 60k weblogic.EAR to wiki page (outside of SVN) - reopened
    http://bugs.eclipse.org/294745
    JPA: support WebLogic 10.3.4.0 introduction of new JPA MBean that changes the default JPA provider
    http://bugs.eclipse.org/312824
    JPA: Update tutorial wiki for WebLogic 10.3 to match the Oracle WebLogic 11g 10.3.3.0 - assigned
    http://bugs.eclipse.org/310849
    To be answered
    OTN Post: WebLogic 10.0 + JPA 2.0 = errors - updated
    Re: WebLogic 10.0 + JPA 2.0 = errors
    Deploy Hibernate based EAR file on Weblogic 10.3.3?
    OTN Post: Default JPA provider for Weblogic Server 10.3.2 (11g) - updated
    Default JPA provider for Weblogic Server 10.3.2 (11g)
    OTN Post: Hibernate 3.6 Final (JPA 2.0) + WL 10.3.x :Unable to deploy sample appn - updated
    Hibernate 3.6 Final (JPA 2.0) + WL 10.3.x :Unable to deploy sample appn
    WebLogic 10.0 + JPA 2.0 = errors
    OTN Post: EJB with Hibernate On Weblogic - updated
    Re: EJB with Hibernate On Weblogic
    OTN Post: OEPE 1.6 - Oracle WebLogic Server 11gR1 PatchSet 3 requres WLS 10.3.4 - answered
    OEPE 1.6 - Oracle WebLogic Server 11gR1 PatchSet 3 requres WLS 10.3.4
    OTN Post: EJB with Hibernate On Weblogic - updated
    Re: EJB with Hibernate On Weblogic
    OTN Post: OpenJPA_2.0 NoSuchMethod error (getValidationMode()) - updated
    OpenJPA_2.0 NoSuchMethod error (getValidationMode())
    JPA 2.0 features used on WebLogic even if they are not available at runtime - notified
    http://netbeans.org/bugzilla/show_bug.cgi?id=189205
    Option to enable JPA 2.0 for dev WebLogic - notified
    http://netbeans.org/bugzilla/show_bug.cgi?id=189348
    False-positive error badge on project with JPA targeting WebLogic - notified
    http://netbeans.org/bugzilla/show_bug.cgi?id=189626
    Giving up on Hibernate (for now), trying EclipseLink...
    http://forums.netbeans.org/post-94817.html
    http://blogs.sun.com/arungupta/entry/which_java_ee_6_app
    Eclipselink 2.0 + WebLogic 10 => No joy (Unable to get Eclipse link 2.0 working with WebLogic 10) - answered
    http://www.eclipse.org/forums/index.php?t=msg&goto=644000&S=40e13288641c0af5dc8489343b896348#msg_644000
    eclipselink-users Problem of eclipselink upgrade (2.0.2) - WebLogic 10.3.3.0 - answered
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04631.html
    Re: EclipseLink + JPA 2 in Weblogic 10.3.0
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04375.html - answered below
    Re: eclipselink-users Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10,
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg05609.html
    [eclipselink-users] Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10 - answered
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg05639.html
    To be Deprecated
    JPA 2: Reverify JPA 2.0 XSD support in persistence.xml on AM/CM app on WebLogic 10.3.3.0
    http://bugs.eclipse.org/331569
    JPA 2.0: Add WebLogic 10.3 configuration process to enable the JPA 2.0 library functionality
    http://bugs.eclipse.org/296271
    WebLogic 10.3 availability?
    / Michael O'Brien
    http://www.eclipselink.org

  • JPA on the Grid

    Hi,
    I am trying to do oracle with coherence.My objective is to put data in to the database using toplink grid and again trying to retrieve data even when database is OFF. Because the data is updated in to the cache.I am following the link http://docs.oracle.com/cd/E17904_01/doc.1111/e16596/configjpa.htm.I am trying to implement 2.3 section in the above link. So i am using Hr schema in the database.I am using eclipse IDE.I created entity class using option "Create entities from tables".
    My entity class is as follows.
    Region.java
    package com;
    import java.io.Serializable;
    import javax.persistence.*;
    import org.eclipse.persistence.annotations.Customizer;
    import oracle.eclipselink.coherence.integrated.config.GridCacheCustomizer;
    * The persistent class for the REGIONS database table.
    @Entity
    @Table(name="REGIONS")
    @Customizer(GridCacheCustomizer.class)
    public class Region implements Serializable {
         private static final long serialVersionUID = 1L;
         @Id
         @Column(name="REGION_ID")
         private long regionId;
         @Column(name="REGION_NAME")
         private String regionName;
    public Region() {
         public long getRegionId() {
              return this.regionId;
         public void setRegionId(long regionId) {
              this.regionId = regionId;
         public String getRegionName() {
              return this.regionName;
         public void setRegionName(String regionName) {
              this.regionName = regionName;
    Persistance.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.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_2_0.xsd">
         <persistence-unit name="SimpleCoherenceApp" transaction-type="RESOURCE_LOCAL">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <class>com.Region</class>
              <properties>
                   <property name="eclipselink.target-server" value="WebLogic_10"/>
                   <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
                   <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
                   <property name="javax.persistence.jdbc.user" value="hr"/>
                   <property name="javax.persistence.jdbc.password" value="hr"/>
                   <property name="eclipselink.logging.level" value="FINEST"/>
                   <property name="eclipselink.cache.type.default" value="Full"/>
              </properties>
         </persistence-unit>
    </persistence>
    coherence-cache-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>*</cache-name>
    <scheme-name>eclipselink-distributed</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>eclipselink-distributed</scheme-name>
    <service-name>EclipseLinkJPA</service-name>
    <!--
    Configure a wrapper serializer to support serialization of relationships.
    -->
    <!-- <serializer>
    <class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>
    <instance>
    <class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>
    <init-params></init-params>
    </instance>
    </serializer> -->
    <backing-map-scheme>
    <!--
    Backing map scheme with no eviction policy.
    -->
    <local-scheme>
    </local-scheme>
    </backing-map-scheme>
    <autostart>true</autostart>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    Now the main class is as follows:
    Manager.java
    package com;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    public class Manager {
         * @param args
         public static void main(String[] args)
              EntityManagerFactory emf=Persistence.createEntityManagerFactory("SimpleCoherenceApp");
              EntityManager em=emf.createEntityManager();
              em.getTransaction().begin();
              Region R = new Region();
              R.setRegionId(9);
              R.setRegionName("Africa");
              em.persist(R);
              em.getTransaction().commit();
    The data is not inserting in to the database.My console is as follows:
    [EL Finest]: 2012-06-07 20:06:13.451--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Initial; factoryCount 0
    [EL Finest]: 2012-06-07 20:06:13.708--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
    [EL Finest]: 2012-06-07 20:06:13.708--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.multitenant.tenants-share-emf; default value=true
    [EL Finest]: 2012-06-07 20:06:13.708--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.multitenant.tenants-share-cache; default value=false
    [EL Finest]: 2012-06-07 20:06:13.725--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.metadata-source; default value=null
    [EL Finer]: 2012-06-07 20:06:13.728--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
    [EL Finer]: 2012-06-07 20:06:13.732--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
    [EL Config]: 2012-06-07 20:06:13.866--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The access type for the persistent class [class com.Region] is set to [FIELD].
    [EL Config]: 2012-06-07 20:06:13.904--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The alias name for the entity class [class com.Region] is being defaulted to: Region.
    [EL Finest]: 2012-06-07 20:06:13.963--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
    [EL Finer]: 2012-06-07 20:06:13.964--Thread(Thread[Main Thread,5,main])--JavaSECMPInitializer - transformer is null.
    [EL Finest]: 2012-06-07 20:06:13.964--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
    [EL Finest]: 2012-06-07 20:06:13.964--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
    [EL Finest]: 2012-06-07 20:06:13.979--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Begin deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
    [EL Finer]: 2012-06-07 20:06:14.005--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
    [EL Finest]: 2012-06-07 20:06:14.015--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
    [EL Finest]: 2012-06-07 20:06:14.015--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2012-06-07 20:06:14.015--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2012-06-07 20:06:14.017--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.user; value=hr
    [EL Finest]: 2012-06-07 20:06:14.017--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
    [EL Finest]: 2012-06-07 20:06:14.741--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.driver; value=oracle.jdbc.OracleDriver
    [EL Finest]: 2012-06-07 20:06:14.741--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.url; value=jdbc:oracle:thin:@localhost:1521:xe
    [EL Finest]: 2012-06-07 20:06:14.749--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.cache.type.default; value=Full; translated value=org.eclipse.persistence.internal.identitymaps.FullIdentityMap
    [EL Info]: 2012-06-07 20:06:14.763--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461
    [EL Warning]: 2012-06-07 20:06:14.764--Thread(Thread[Main Thread,5,main])--java.lang.ClassNotFoundException: weblogic.version
         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:107)
         at org.eclipse.persistence.platform.server.wls.WebLogicPlatform.initializeServerNameAndVersion(WebLogicPlatform.java:86)
         at org.eclipse.persistence.platform.server.ServerPlatformBase.getServerNameAndVersion(ServerPlatformBase.java:181)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:661)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
         at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
         at com.Manager.main(Manager.java:15)
    [EL Finest]: 2012-06-07 20:06:15.175--Thread(Thread[Main Thread,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle11Platform, regular expression: (?i)oracle.*11
    [EL Finest]: 2012-06-07 20:06:15.178--Thread(Thread[Main Thread,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform, regular expression: (?i)oracle.*10
    [EL Fine]: 2012-06-07 20:06:15.178--Thread(Thread[Main Thread,5,main])--Detected database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Config]: 2012-06-07 20:06:15.203--ServerSession(34841853)--Connection(37577244)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> "hr"
         datasource URL=> "jdbc:oracle:thin:@localhost:1521:xe"
    [EL Config]: 2012-06-07 20:06:15.217--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:xe
         User: HR
         Database: Oracle Version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver Version: 10.2.0.1.0XE
    [EL Finest]: 2012-06-07 20:06:15.22--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection acquired from connection pool [default].
    [EL Finest]: 2012-06-07 20:06:15.221--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection released to connection pool [default].
    [EL Info]: 2012-06-07 20:06:15.346--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp login successful
    [EL Warning]: 2012-06-07 20:06:15.363--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [EL Warning]: 2012-06-07 20:06:15.365--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [EL Warning]: 2012-06-07 20:06:15.365--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [EL Finest]: 2012-06-07 20:06:15.366--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The applicationName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
    [EL Finest]: 2012-06-07 20:06:15.366--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The moduleName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
    [EL Finer]: 2012-06-07 20:06:15.402--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Canonical Metamodel class [com.Region_] not found during initialization.
    [EL Finest]: 2012-06-07 20:06:15.402--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--End deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Deployed; factoryCount 1
    [EL Finer]: 2012-06-07 20:06:15.422--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--client acquired: 33723171
    [EL Finer]: 2012-06-07 20:06:15.433--ClientSession(33723171)--Thread(Thread[Main Thread,5,main])--acquire unit of work: 33613802
    [EL Finest]: 2012-06-07 20:06:15.437--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--persist() operation called on: com.Region@200eb1e.
    [EL Finer]: 2012-06-07 20:06:15.448--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--begin unit of work commit
    [EL Finest]: 2012-06-07 20:06:15.492--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--Execute query InsertObjectQuery(com.Region@200eb1e)
    [EL Finest]: 2012-06-07 20:06:15.506--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection acquired from connection pool [default].
    [EL Finer]: 2012-06-07 20:06:15.508--ClientSession(33723171)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--begin transaction
    [EL Fine]: 2012-06-07 20:06:15.516--ClientSession(33723171)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--INSERT INTO REGIONS (REGION_ID, REGION_NAME) VALUES (?, ?)
         bind => [9, Africa]
    2012-06-07 20:06:15.896/3.638 Oracle Coherence 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded operational configuration from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence.xml"
    2012-06-07 20:06:15.906/3.647 Oracle Coherence 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded operational overrides from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    2012-06-07 20:06:15.907/3.648 Oracle Coherence 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded operational overrides from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/tangosol-coherence-override.xml"
    2012-06-07 20:06:15.910/3.651 Oracle Coherence 3.6.0.4 <D5> (thread=Main Thread, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.6.0.4 Build 19111
    Grid Edition: Development mode
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    2012-06-07 20:06:16.063/3.804 Oracle Coherence GE 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded cache configuration from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/coherence-cache-config.xml"
    2012-06-07 20:06:17.158/4.899 Oracle Coherence GE 3.6.0.4 <D4> (thread=Main Thread, member=n/a): TCMP bound to /172.16.30.150:8090 using SystemSocketProvider
    2012-06-07 20:06:17.818/5.559 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Failed to satisfy the variance: allowed=16, actual=34
    2012-06-07 20:06:17.819/5.560 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Increasing allowable variance to 18
    2012-06-07 20:06:18.054/5.795 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): This Member(Id=3, Timestamp=2012-06-07 20:06:17.821, Address=172.16.30.150:8090, MachineId=41622, Location=machine:Praveen-PC,process:316, Role=ManagerManager, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0xC4DB" with senior Member(Id=1, Timestamp=2012-06-07 16:51:43.007, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:2836, Role=CoherenceConsole, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
    2012-06-07 20:06:18.098/5.839 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1
    2012-06-07 20:06:18.099/5.840 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
    2012-06-07 20:06:18.109/5.850 Oracle Coherence GE 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Started cluster Name=cluster:0xC4DB
    Group{Address=224.3.6.0, Port=36000, TTL=4}
    MasterMemberSet
    ThisMember=Member(Id=3, Timestamp=2012-06-07 20:06:17.821, Address=172.16.30.150:8090, MachineId=41622, Location=machine:Praveen-PC,process:316, Role=ManagerManager)
    OldestMember=Member(Id=1, Timestamp=2012-06-07 16:51:43.007, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:2836, Role=CoherenceConsole)
    ActualMemberSet=MemberSet(Size=2, BitSetCount=2
    Member(Id=1, Timestamp=2012-06-07 16:51:43.007, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:2836, Role=CoherenceConsole)
    Member(Id=3, Timestamp=2012-06-07 20:06:17.821, Address=172.16.30.150:8090, MachineId=41622, Location=machine:Praveen-PC,process:316, Role=ManagerManager)
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0, BitSetCount=0
    TcpRing{Connections=[1]}
    IpMonitor{AddressListSize=0}
    2012-06-07 20:06:18.189/5.930 Oracle Coherence GE 3.6.0.4 <D5> (thread=Invocation:Management, member=3): Service Management joined the cluster with senior service member 1
    2012-06-07 20:06:18.394/6.135 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPA, member=3): Service EclipseLinkJPA joined the cluster with senior service member 3
    [EL Finer]: 2012-06-07 20:06:18.538--ClientSession(33723171)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--rollback transaction
    [EL Finest]: 2012-06-07 20:06:18.541--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection released to connection pool [default].
    [EL Warning]: 2012-06-07 20:06:18.542--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--Local Exception Stack:
    Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
    Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
         at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
         at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
         at com.Manager.main(Manager.java:21)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
         ... 13 more
    Caused by: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
         ... 19 more
    [EL Finer]: 2012-06-07 20:06:18.549--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--release unit of work
    [EL Finer]: 2012-06-07 20:06:18.55--ClientSession(33723171)--Thread(Thread[Main Thread,5,main])--client released
    Exception in thread "Main Thread" javax.persistence.RollbackException: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
    Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
         at com.Manager.main(Manager.java:23)
    Caused by: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
    Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
         at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
         at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
         at com.Manager.main(Manager.java:21)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
         ... 13 more
    Caused by: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
         ... 19 more
    So, any suggestions would be great.
    Regards,
    Praveen

    HI NJ,
    when i am using @Customizer(GridCacheCustomizer.class) in the entity class,the data is not at all inserting in to the database.So if i commented this annotation,the data is inserting in to the database.The console is showing as follows:
    [EL Finest]: 2012-06-11 14:30:27.803--ServerSession(30146205)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Initial; factoryCount 0
    [EL Finest]: 2012-06-11 14:30:27.819--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
    [EL Finest]: 2012-06-11 14:30:27.82--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.multitenant.tenants-share-emf; default value=true
    [EL Finest]: 2012-06-11 14:30:27.82--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.multitenant.tenants-share-cache; default value=false
    [EL Finest]: 2012-06-11 14:30:27.836--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.metadata-source; default value=null
    [EL Finer]: 2012-06-11 14:30:27.836--ServerSession(30146205)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
    [EL Finer]: 2012-06-11 14:30:27.839--ServerSession(30146205)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
    [EL Config]: 2012-06-11 14:30:27.941--ServerSession(30146205)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.Region] is set to [FIELD].
    [EL Config]: 2012-06-11 14:30:27.967--ServerSession(30146205)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.Region] is being defaulted to: Region.
    [EL Finest]: 2012-06-11 14:30:27.989--ServerSession(30146205)--Thread(Thread[main,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
    [EL Finer]: 2012-06-11 14:30:27.989--Thread(Thread[main,5,main])--JavaSECMPInitializer - transformer is null.
    [EL Finest]: 2012-06-11 14:30:27.989--ServerSession(30146205)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
    [EL Finest]: 2012-06-11 14:30:27.99--ServerSession(30146205)--Thread(Thread[main,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
    [EL Finest]: 2012-06-11 14:30:27.994--ServerSession(30146205)--Thread(Thread[main,5,main])--Begin deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
    [EL Finer]: 2012-06-11 14:30:28.003--ServerSession(30146205)--Thread(Thread[main,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Finest]: 2012-06-11 14:30:28.008--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
    [EL Finest]: 2012-06-11 14:30:28.008--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2012-06-11 14:30:28.008--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2012-06-11 14:30:28.009--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.user; value=hr
    [EL Finest]: 2012-06-11 14:30:28.009--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
    [EL Finest]: 2012-06-11 14:30:28.458--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value=oracle.jdbc.OracleDriver
    [EL Finest]: 2012-06-11 14:30:28.459--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.url; value=jdbc:oracle:thin:@localhost:1521:xe
    [EL Finest]: 2012-06-11 14:30:28.459--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.cache.type.default; value=Full; translated value=org.eclipse.persistence.internal.identitymaps.FullIdentityMap
    [EL Info]: 2012-06-11 14:30:28.46--ServerSession(30146205)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461
    [EL Warning]: 2012-06-11 14:30:28.461--Thread(Thread[main,5,main])--java.lang.ClassNotFoundException: weblogic.version
         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:107)
         at org.eclipse.persistence.platform.server.wls.WebLogicPlatform.initializeServerNameAndVersion(WebLogicPlatform.java:85)
         at org.eclipse.persistence.platform.server.ServerPlatformBase.getServerNameAndVersion(ServerPlatformBase.java:181)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:661)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:581)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
         at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
         at com.Manager.main(Manager.java:15)
    [EL Finest]: 2012-06-11 14:30:28.591--Thread(Thread[main,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle11Platform, regular expression: (?i)oracle.*11
    [EL Finest]: 2012-06-11 14:30:28.591--Thread(Thread[main,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform, regular expression: (?i)oracle.*10
    [EL Fine]: 2012-06-11 14:30:28.591--Thread(Thread[main,5,main])--Detected database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Config]: 2012-06-11 14:30:28.61--ServerSession(30146205)--Connection(25252664)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> "hr"
         datasource URL=> "jdbc:oracle:thin:@localhost:1521:xe"
    [EL Config]: 2012-06-11 14:30:28.62--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:xe
         User: HR
         Database: Oracle Version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver Version: 10.2.0.1.0XE
    [EL Finest]: 2012-06-11 14:30:28.621--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
    [EL Finest]: 2012-06-11 14:30:28.621--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection released to connection pool [default].
    [EL Info]: 2012-06-11 14:30:28.678--ServerSession(30146205)--Thread(Thread[main,5,main])--file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp login successful
    [EL Warning]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [EL Warning]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [EL Warning]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [EL Finest]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--The applicationName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
    [EL Finest]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--The moduleName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
    [EL Finer]: 2012-06-11 14:30:28.697--ServerSession(30146205)--Thread(Thread[main,5,main])--Canonical Metamodel class [com.Region_] not found during initialization.
    [EL Finest]: 2012-06-11 14:30:28.697--ServerSession(30146205)--Thread(Thread[main,5,main])--End deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Deployed; factoryCount 1
    [EL Finer]: 2012-06-11 14:30:28.714--ServerSession(30146205)--Thread(Thread[main,5,main])--client acquired: 6146452
    [EL Finer]: 2012-06-11 14:30:28.727--ClientSession(6146452)--Thread(Thread[main,5,main])--acquire unit of work: 13994297
    [EL Finest]: 2012-06-11 14:30:28.727--UnitOfWork(13994297)--Thread(Thread[main,5,main])--persist() operation called on: com.Region@124111a.
    [EL Finer]: 2012-06-11 14:30:28.729--UnitOfWork(13994297)--Thread(Thread[main,5,main])--begin unit of work commit
    [EL Finest]: 2012-06-11 14:30:28.736--UnitOfWork(13994297)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(com.Region@124111a)
    [EL Finest]: 2012-06-11 14:30:28.738--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
    [EL Finer]: 2012-06-11 14:30:28.738--ClientSession(6146452)--Connection(3975755)--Thread(Thread[main,5,main])--begin transaction
    [EL Fine]: 2012-06-11 14:30:28.739--ClientSession(6146452)--Connection(3975755)--Thread(Thread[main,5,main])--INSERT INTO REGIONS (REGION_ID, REGION_NAME) VALUES (?, ?)
         bind => [12, Africa]
    2012-06-11 14:30:28.973/1.408 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence.xml"
    2012-06-11 14:30:28.976/1.411 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    2012-06-11 14:30:28.976/1.411 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/tangosol-coherence-override.xml"
    2012-06-11 14:30:28.978/1.413 Oracle Coherence 3.6.0.4 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.6.0.4 Build 19111
    Grid Edition: Development mode
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    2012-06-11 14:30:29.131/1.566 Oracle Coherence GE 3.6.0.4 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/coherence-cache-config.xml"
    2012-06-11 14:30:29.719/2.154 Oracle Coherence GE 3.6.0.4 <D4> (thread=main, member=n/a): TCMP bound to /172.16.30.150:8088 using SystemSocketProvider
    2012-06-11 14:30:33.317/5.752 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0xC4DB" with Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) UID=0xAC101E9600000137DAC5DED2A2961F98
    2012-06-11 14:30:33.320/5.755 Oracle Coherence GE 3.6.0.4 <Info> (thread=main, member=n/a): Started cluster Name=cluster:0xC4DB
    Group{Address=224.3.6.0, Port=36000, TTL=4}
    MasterMemberSet
    ThisMember=Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager)
    OldestMember=Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager)
    ActualMemberSet=MemberSet(Size=1, BitSetCount=2
    Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager)
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0, BitSetCount=0
    TcpRing{Connections=[]}
    IpMonitor{AddressListSize=0}
    2012-06-11 14:30:33.339/5.774 Oracle Coherence GE 3.6.0.4 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2012-06-11 14:30:33.495/5.930 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPA, member=1): Service EclipseLinkJPA joined the cluster with senior service member 1
    [EL Finer]: 2012-06-11 14:30:33.559--ClientSession(6146452)--Connection(3975755)--Thread(Thread[main,5,main])--rollback transaction
    [EL Finest]: 2012-06-11 14:30:33.56--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection released to connection pool [default].
    [EL Warning]: 2012-06-11 14:30:33.56--UnitOfWork(13994297)--Thread(Thread[main,5,main])--Local Exception Stack:
    Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
    Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
         at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
         at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
         at com.Manager.main(Manager.java:21)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
         ... 13 more
    Caused by: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
         ... 19 more
    [EL Finer]: 2012-06-11 14:30:33.562--UnitOfWork(13994297)--Thread(Thread[main,5,main])--release unit of work
    [EL Finer]: 2012-06-11 14:30:33.562--ClientSession(6146452)--Thread(Thread[main,5,main])--client released
    Exception in thread "main" javax.persistence.RollbackException: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
    Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
         at com.Manager.main(Manager.java:21)
    Caused by: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
    Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
         at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
         at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
         at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
         ... 2 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
         ... 13 more
    Caused by: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
         at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
         ... 19 more
    2012-06-11 14:30:33.563/5.998 Oracle Coherence GE 3.6.0.4 <D4> (thread=ShutdownHook, member=1): ShutdownHook: stopping cluster node
    Regards,
    Praveen

  • EclipseLink JPA multitenancy

    I am using EclipseLink to auto populate the column on inserts. (column i want it to auto update is COMPANY_ID)
    Table is like
    COMPANY_ID
    EMPLOYEE_ID
    NAME
    SALARY
    AGE
    My entity is
    @Entity
    @NamedQueries({
    @NamedQuery(name = "EmployeeVpd1.findAll", query = "select o from EmployeeVpd1 o")
    @Table(name = "EMPLOYEE_VPD_1")
    @Multitenant
    @TenantDiscriminatorColumn(name ="COMPANY_ID")
    public class EmployeeVpd1 implements Serializable {
    private Long age;
    @Id
    @Column(name="EMPLOYEE_ID", nullable = false)
    private Long employeeId;
    @Column(length = 30)
    private String name;
    private Long salary;
    public EmployeeVpd1() {
    public EmployeeVpd1(Long age, Long employeeId,
    String name, Long salary) {
    this.age = age;
    this.employeeId = employeeId;
    this.name = name;
    this.salary = salary;
    public Long getAge() {
    return age;
    public void setAge(Long age) {
    this.age = age;
    public Long getEmployeeId() {
    return employeeId;
    public void setEmployeeId(Long employeeId) {
    this.employeeId = employeeId;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public Long getSalary() {
    return salary;
    public void setSalary(Long salary) {
    this.salary = salary;
    Persistent class is (hard coded that tenant id to Oracle)
    <persistence-unit name="EJB">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:/app/jdbc/jdbc/VPDDS</jta-data-source>
    <class>ejb.EmployeeVpd1</class>
    <properties>
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    <property name="javax.persistence.jtaDataSource"
    value="java:/app/jdbc/jdbc/VPDDS"/>
    <property name="eclipselink.jdbc.exclusive-connection.mode" value="Always" />
    <property name="eclipselink.tenant-id" value="Oracle"/>
    </properties>
    </persistence-unit>
    Java class for creating the entity and inserting it to db
    @PersistenceUnit
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("EJB");
    em=emf.createEntityManager();
    em.persist(employee1)
    Its inserting the row into the table but the COMPANY_ID is not getting set to Oracle . Its always setting to null

    Hi,
    The multitenancy feature wasn't implemented till 2.3. Can you try a more recent version?
    http://www.eclipse.org/eclipselink/downloads/nightly.php
    Cheers,
    Guy

  • EclipseLink (OSGi version) problems

    I just started playing with EclipseLink tonight and am having trouble making it all work. I'm failing to get a persistance manager factory:
    javax.persistence.PersistenceException: No Persistence provider for EntityManager named bugdb
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:129)
    I've tried to set everything up analogous to the RCP comics example http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.rcp.comics/, down to the multiple META-INF directories, but I'm obviously missing something. Is this a commonly encountered problem with a simple solution?
    I've zipped my silly little testproject and put it here: https://www.hirt.se/twiki/pub/Main/DevelopmentTools/bugdb.zip.
    Kind regards,
    Marcus

    Never mind - after switching to the non-OSGi version, everything works perfectly. ;) Guess I'll stay away from the OSGi version for now.
    Kind regards,
    Marcus

  • From KDO-openJPA to eclipseLink problem.

    1.static weaving,Entity's super class with @MappedSuperclass Annotation does't add the changeTracking in the class,but it can do in openJPA,although the eclipselink's document say it can,but it is't so
    sample:
    1.1EntityBase class
    @MappedSuperclass
    public abstract class EntityBase {
    private String id;
    @Id
    @Column(name="ID")
    public String getId() {
    return id;
         @PrePersist
         private void prePersist() {
              if (getId() == null) {
                   setId(generateUUID());
    1.2 CodableEntity class
    @MappedSuperclass
    public abstract class CodableEntity extends EntityBase {
    private String code;
    @Column(name="CODE")
    public String getCode() {
    return code;
    1.3 SampleEntity class
    @Entity
    @Table(name="T_Sample")
    public class SampleEntity extends CodableEntity {
    static weaving,the EntityBase and the CodableEntity hav't the changeTracking code.
    I modify the eclipseLink1.0M10 source code.
    org.eclipse.persistence.internal.weaving.TransformerFactory
    * INTERNAL:
    * Store a set of attribute mappings on the given ClassDetails that correspont to the given class.
    * Return the list of mappings that is not specifically found on the given class. These attributes will
    * be found on MappedSuperclasses.
    protected List storeAttributeMappings(Class clz, ClassDetails classDetails, List mappings, boolean weaveValueHolders) {     
    List unMappedAttributes = new ArrayList();
    Map attributesMap = new HashMap();
    Map settersMap = new HashMap();
    Map gettersMap = new HashMap();
    List lazyMappings = new ArrayList();
    for (Iterator iterator = mappings.iterator(); iterator.hasNext();) {
    DatabaseMapping mapping = (DatabaseMapping)iterator.next();
    String attribute = mapping.getAttributeName();
    AttributeDetails attributeDetails = new AttributeDetails(attribute, mapping);
    // Initial look for the type of this attribute.
    Class typeClass = getAttributeTypeFromClass(clz, attribute, mapping, false);
    if (typeClass == null) {
    attributeDetails.setAttributeOnSuperClass(true);
    // if (mapping.getField() != null || mapping.isForeignReferenceMapping()) {
    unMappedAttributes.add(mapping);
    right??
    2.OpenJPAQuery provider a method,setResultClass,i think it is very good,it can instance the class and fill the DB Result to Object by property/constructor,if it's map,it can put.
    Message was edited by:
    user646129

    thanks your reply.
    can eclipselink suport JPA query that select express with alias?
    i.e
    select o.id,o.name,o.level as manageLevel from xxx where o.id=?1
    beacase my dto is a class,I hope the result can map to the class.
    I have modied the openJPA1.0.2 and eclipseLink1.0M10 to add the feature,but I think if can support the feature the dto layer is simple.
    below is My Modify.
    1.JPQL.g
    selectClause returns [Object node]
    scope{
    boolean distinct;
    List exprs;
    @init {
    node = null;
    $selectClause::distinct = false;
    $selectClause::exprs = new ArrayList();
    : t=SELECT (DISTINCT { $selectClause::distinct = true; })?
    n = selectItem {$selectClause::exprs.add($n.node); }
    ( COMMA n = selectItem { $selectClause::exprs.add($n.node); } )*
    $node = factory.newSelectClause($t.getLine(), $t.getCharPositionInLine(),
    $selectClause::distinct, $selectClause::exprs);
    selectItem returns [Object node]
    @init { node = null; }
         : n = selectExpression {$node = $n.node;}
              ((AS)? ident = IDENT )?
    if ($ident != null){
         $node = factory.newWithAlias($node, $ident.getText());
    selectExpression returns [Object node]
    @init { node = null; }
    : n = pathExprOrVariableAccess {$node = $n.node;}
    | n = aggregateExpression {$node = $n.node;}
    | n = functionsReturningStrings {$node = $n.node;}
    | n = functionsReturningDatetime {$node = $n.node;}
    | OBJECT LEFT_ROUND_BRACKET n = variableAccess RIGHT_ROUND_BRACKET {$node = $n.node;}
    | n = constructorExpression {$node = $n.node;}
    | n = literal {$node = $n.node;}
    2.antlr compile the JPQL.g
    3.modify the org\eclipse\persistence\internal\jpa\parsing\jpql
    3.1 and WithAliasNode interface
    public interface WithAliasNode {
         * set the alias
         * @param alias
         public void setAlias(String alias);
         * get the alias
         * @return
         public String getAlias();
    3.2 add WithAliasDotNode... class
    public class WithAliasDotNode extends DotNode implements WithAliasNode {
         private String alias;
    * INTERNAL
    * Apply this node to the passed query
    public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) {
    if (theQuery.isReportQuery()){
    ReportQuery reportQuery = (ReportQuery)theQuery;
    reportQuery.addAttribute(alias == null ? resolveAttribute() : alias, generateExpression(context));
    reportQuery.dontRetrievePrimaryKeys();
         public String getAlias() {
              return alias;
         public void setAlias(String alias) {
              this.alias = alias;
    In openJPA add the feature is very simple,but eclipselink ..,I think that if you can't suport the feature,please give me a extensible chance.

  • Gemini JPA / EclipseLink Problem in e4 RCP Application

    I'm not completely certain where my issue is coming from i.e. EclipseLink or Gemini JPA, so I'm hoping that's the first thing you can point me to.
    When my application starts up I'm getting this on the console:
    [EL Config]: metadata: 2015-07-27 13:26:03.641--ServerSession(675233602)--Thread(Thread[Refresh Thread: Equinox Container: 00913eb3-9d34-0015-1b66-dbde7e24aedc,5,main])--The alias name for the entity class [class <snip>] is being defaulted to: <snip>.
    WARNING: DataSourceFactory service for com.microsoft.sqlserver.jdbc.SQLServerDriver was not found. EMF service not registered.
    And when I go to use JPA in the application, I get this:
    *** FATAL ERROR *** Could not create data source for com.microsoft.sqlserver.jdbc.SQLServerDriver
    The lines that start with [EL Config] suggest (to me at least) that JPA is starting up, and is reading my persistence.xml file.
    I just switched the application from Gemini JPA 1.1.0.RELEASE and EclipseLink 2.4 to Gemini JPA 1.2.0.M01 and EclipseLink 2.6 in an effort to fix the issue, but it hasn't helped. (To be clear, the issue did occur with the release Gemini JPA, and is still occurring with the newer Gemini JPA).
    I've attached my persistence.xml file (redacted...), since I can't inline it here.
    Should I be looking in Gemini or in EclipseLink for the solution to this issue?
    I've tried Googling the issue, but don't get useful results.
    I'm less concerned for the first issue (the WARNING), and more concerned for the second issue.
    My next step is to set the individual connection properties, and drop the URL, maybe that will work.
    *edit* I realized I should have mentioned that the SQL Server JDBC driver jar is in the lib folder of the project, and should be set to export with the project. lib is also declared as part of the bundle class path in the manifest file.
    Thank you for taking the time to read my post.
    Dominic Hilsbos

    After changing my persistence.xml, I got a ClassNotFoundException, which told me that EclipseLink couldn't find my jdbc driver.
    I found my error, it was in the Bundle-Classpath.
    I had: .,lib/
    What I needed was; .,lib/sqljdbc41.jar
    Thank you to all who looked at this.
    Dominic Hilsbos

  • Problem while inserting into a table which has ManyToOne relation

    Problem while inserting into a table *(Files)* which has ManyToOne relation with another table *(Folder)* involving a attribute both in primary key as well as in foreign key in JPA 1.0.
    Relevent Code
    Entities:
    public class Files implements Serializable {
    @EmbeddedId
    protected FilesPK filesPK;
    private String filename;
    @JoinColumns({
    @JoinColumn(name = "folder_id", referencedColumnName = "folder_id"),
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Folders folders;
    public class FilesPK implements Serializable {
    private int fileId;
    private int uid;
    public class Folders implements Serializable {
    @EmbeddedId
    protected FoldersPK foldersPK;
    private String folderName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "folders")
    private Collection<Files> filesCollection;
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Users users;
    public class FoldersPK implements Serializable {
    private int folderId;
    private int uid;
    public class Users implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer uid;
    private String username;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "users")
    private Collection<Folders> foldersCollection;
    I left out @Basic & @Column annotations for sake of less code.
    EJB method
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    FoldersPK folderPk = new FoldersPK(folderID, uid);
         // My understanding that it should automatically handle folderId in files table,
    // but it is not…
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    It is giving error:
    Internal Exception: java.sql.SQLException: Field 'folderid' doesn't have a default value_
    Error Code: 1364
    Call: INSERT INTO files (filename, uid, fileid) VALUES (?, ?, ?)_
    _       bind => [hello.txt, 1, 0]_
    It is not even considering folderId while inserting into db.
    However it works fine when I add folderId variable in Files entity and changed insertFile like this:
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    file.setFolderId(folderId) // added line
    FoldersPK folderPk = new FoldersPK(folderID, uid);
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    My question is that is this behavior expected or it is a bug.
    Is it required to add "column_name" variable separately even when an entity has reference to ManyToOne mapping foreign Entity ?
    I used Mysql 5.1 for database, then generate entities using toplink, JPA 1.0, glassfish v2.1.
    I've also tested this using eclipselink and got same error.
    Please provide some pointers.
    Thanks

    Hello,
    What version of EclipseLink did you try? This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280436 that was fixed in EclipseLink 2.0, so please try a later version.
    You can also try working around the problem by making both fields writable through the reference mapping.
    Best Regards,
    Chris

  • Problem with outer joins and the class indicator/discriminator

    Hello,
    I am having a problem defining a query in toplink (10.1.3.3).
    In the workbench, I have created a parent and 2 child descriptors. The parent is "AbstractValue", the children are "DefaultValue", classified by the discriminator 'DEF', and "OverrideValue", classified by 'OVR', both located in the same table.
    Another descriptor (containing a one-on-one mapping to both a "DefaultValue", and a "OverrideValue") needs to be queried for its 'value'.
    The way the query should act is: If an override value (row) exists, this one applies for that object. If an override doesn't exist, return the default value.
    The query then comes down to (as I have it now):
    builder.getAllowingNull("OverrideValue").getAllowingNull("value").ifNull(builder.get("DefaultValue").get("value")).equal(builder.getParameter(VALUE_PARAM));
    The problem is that toplink adds the distinction for the different kind of "values" in the where clause WITHOUT checking for null values e.g. it performs an outer join, but then still checks for the discriminator value thus
    ....t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND ...
    instead of
    ... LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR') ...
    This leads to the behaviour that the query returns ONLY the objects that have override and default values.
    An overview of the queries (simplified)
    Toplink, at the moment, returns only results if both override and default values exists:
    SELECT t1.id
    t1.def_id,
    t1.ovr_id
    FROM values t2,
    parameter t1,
    values t0
    WHERE nvl(t2.value, t0.value) = 15 AND
    t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND
    t1.def_id = t0.id AND t0.discriminator = 'DEF'
    Situation Wanted:
    SELECT t1.id
    t1.def_id,
    t1.ovr_id
    FROM parameter t1
    LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR')
    JOIN values t0 ON (t1.def_id = t0.id AND t0.discriminator = 'DEF')
    WHERE nvl(t2.value, t0.value) = 15
    Anyone know if there is some statement I am missing to allow an actual outer join on descriptors containing class indicators/discriminators? A possible rewrite?
    Thanks in advance,
    Rudy

    This is a bug in TopLink's outer join support for Oracle. Currently the outer join is put in the where clause, instead of the from clause, as we do on other platforms. You might be able to fix it by changing your OraclePlatform to return false for shouldPrintOuterJoinInWhereClause().
    Please log this bug on EclipseLink, or through Oracle technial support.
    There is a workaround using,
    descriptor.getInhertiancePolicy().setAlwaysUseOuterJoinForClassType(true);
    James : http://www.eclipselink.org

  • Problem with Persistence.xml in JDev final after migration

    Hi,
    I am trying to migrate a current project from JDev 11gTp4 to the JDev production release. When deploying the EJB module I get the following problem though (Stack from DefaultServer.log)
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Nexus-NexusModel-ejb)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
         at javax.xml.parsers.DocumentBuilderFactory.setSchema(DocumentBuilderFactory.java:561)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.setupDocumentBuilderFactory(RegistryDocumentBuilder.java:393)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.getDefaultDocumentBuilderFactory(RegistryDocumentBuilder.java:359)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.getDocumentBuilder(RegistryDocumentBuilder.java:298)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:150)
         at org.eclipse.persistence.platform.xml.jaxp.JAXPParser.parse(JAXPParser.java:163)
         at org.eclipse.persistence.platform.xml.jaxp.JAXPParser.parse(JAXPParser.java:197)
         at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:213)
         at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:309)
         at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsReader.read(XMLEntityMappingsReader.java:72)
         at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsReader.read(XMLEntityMappingsReader.java:112)
         at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.loadStandardMappingFiles(MetadataProcessor.java:343)
         at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.loadMappingFiles(MetadataProcessor.java:271)
         at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:294)
         at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:830)
         at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:189)
         at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:330)
         at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:245)
         at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:63)
         at weblogic.ejb.container.deployer.EJBModule.setupPersistenceUnitRegistry(EJBModule.java:209)
         at weblogic.ejb.container.deployer.EJBModule$1.execute(EJBModule.java:310)
         at weblogic.deployment.PersistenceUnitRegistryInitializer.setupPersistenceUnitRegistries(PersistenceUnitRegistryInitializer.java:62)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:376)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    My persistence.xml looks like
    <?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="Nexus-ejbPU">
    <provider>
    org.eclipse.persistence.jpa.PersistenceProvider
    </provider>
    <jta-data-source>
    jdbc/NexusPoolDS
    </jta-data-source>
    <mapping-file>
    META-INF/orm.xml
    </mapping-file>
    <properties>
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    <property name="eclipselink.logging.file" value="Toplink.log"/>
    <property name="eclipselink.logging.timestamp" value="true"/>
    <property name="eclipselink.logging.exceptions" value="true"/>
    <property name="eclipselink.logging.session" value="true"/>
    </properties>
    </persistence-unit>
    </persistence>
    orm.xml looks like this
    <?xml version="1.0" encoding="windows-1252" ?>
    <entity-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
    version="1.0"
    xmlns="http://java.sun.com/xml/ns/persistence/orm">
    <persistence-unit-metadata>
    <persistence-unit-defaults>
    <schema>
    XXX
    </schema>
    </persistence-unit-defaults>
    </persistence-unit-metadata>
    <package>
    za.co.medscheme.model.persistence.xxx
    </package>
    <schema>
    XXX
    </schema>
    </entity-mappings>
    I have noticed that the persistence.xml file have changed quite drastically from the version we had in TP4 release during project upgrade, but can not explain the problem we are getting. I have also tried to just create a dummy project and create a persistence unit, and the file looks exactly the same afterwards. Any thoughts?
    Drikus

    Just thought I would add a temporary solution to the problem for those of you sitting with the same issue.
    In the root folder of your application you will find a src folder with a meta-inf folder and weblogic-application.xml inside.
    Add the following before the closing weblogic-application tag...
    <xml>
    <parser-factory>
    <saxparser-factory>
    weblogic.xml.jaxp.WebLogicSAXParserFactory
    </saxparser-factory>
    <document-builder-factory>
    weblogic.xml.jaxp.WebLogicDocumentBuilderFactory
    </document-builder-factory>
    <transformer-factory>
    weblogic.xml.jaxp.WebLogicSAXTransformerFactory
    </transformer-factory>
    </parser-factory>
    </xml>
    If there wasnt an xml tag in the file, it seems that JDeveloper somehow adds one on the fly for you pointing to an oracle xml parser that does not contain the setSchema method required by weblogic on deployment.
    Hope this helps anybody else that has this problem.
    Regards
    Drikus Britz

  • Problem with tutorial; "Build a Web Application with JDeveloper 11g Using "

    I've got a rather new installation of Vista Business x64 on my developer rig, and last week I installed the new JDeveloper 11g version. The installation was all-inclusive, no customization on my end.
    In addition I've got a test installation of an Oracle DB 11gR1 on an available server here.
    To familiarize myself with the new JDeveloper I decided to spend some time with the JDeveloper 11g tutorials found here: http://www.oracle.com/technology/obe/obe11jdev/11/index.html.
    I've started twice on the second tutorial, "Build a Web Application with JDeveloper 11g Using EJB, JPA, and JavaServer Faces", and find myself repeatedly stuck at step 19 in section "Creating the Data Model and Testing it".
    It seems impossible to deploy the application to the default application server. The server starts fine on its own, I can access it via the admin console on port 7001 and it looks good. However, when I try to run the HRFacadeBean funny things are happening, symptomized by the following error messages seen in the IDE log-area:
    The "Messages" pane displays:
    "Compiling...
    Context: MakeProjectAndDependenciesCommand application=HR_EJB_JPA_App.jws project=EJBModel.jpr
    C:\Oracle\Middleware\jdk160_05\jre\bin\java.exe -jar C:\Oracle\Middleware\jdeveloper\jdev\lib\ojc.jar -g -warn -nowarn:320 -nowarn:372 -nowarn:412 -nowarn:413 -nowarn:415 -nowarn:486 -nowarn:487 -nowarn:489 -nowarn:556 -nowarn:558 -nowarn:560 -nowarn:561 -nowarn:705 -Xlint:-fallthrough -Xlint:-serial -Xlint:-unchecked -source 1.6 -target 1.6 -noquiet -encoding Cp1252 -d C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\classes -namereferences -make C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\classes\EJBModel.cdi -classpath C:\Oracle\Middleware\jdk160_05\jre\lib\resources.jar;C:\Oracle\Middleware\jdk160_05\jre\lib\rt.jar;C:\Oracle\Middleware\jdk160_05\jre\lib\jsse.jar;C:\Oracle\Middleware\jdk160_05\jre\lib\jce.jar;C:\Oracle\Middleware\jdk160_05\jre\lib\charsets.jar;C:\JDeveloper\mywork\HR_EJB_JPA_App\.adf;C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\classes;C:\Oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1\toplink.jar;C:\Oracle\Middleware\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle\Middleware\modules\javax.persistence_1.0.0.0_1-0.jar;C:\Oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1\eclipselink.jar;C:\Oracle\Middleware\jdeveloper\modules\oracle.xdk_11.1.1\xmlparserv2.jar;C:\Oracle\Middleware\jdeveloper\modules\oracle.xdk_11.1.1\xml.jar;C:\Oracle\Middleware\modules\javax.jsf_1.2.0.0.jar;C:\Oracle\Middleware\modules\javax.ejb_3.0.1.jar;C:\Oracle\Middleware\modules\javax.enterprise.deploy_1.2.jar;C:\Oracle\Middleware\modules\javax.interceptor_1.0.jar;C:\Oracle\Middleware\modules\javax.jms_1.1.1.jar;C:\Oracle\Middleware\modules\javax.jsp_1.1.0.0_2-1.jar;C:\Oracle\Middleware\modules\javax.jws_2.0.jar;C:\Oracle\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.mail_1.1.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.xml.soap_1.3.1.0.jar;C:\Oracle\Middleware\modules\javax.xml.rpc_1.2.1.jar;C:\Oracle\Middleware\modules\javax.xml.ws_2.1.1.jar;C:\Oracle\Middleware\modules\javax.management.j2ee_1.0.jar;C:\Oracle\Middleware\modules\javax.resource_1.5.1.jar;C:\Oracle\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle\Middleware\modules\javax.transaction_1.0.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.xml.stream_1.1.1.0.jar;C:\Oracle\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.xml.registry_1.0.0.0_1-0.jar;C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar;C:\Oracle\Middleware\wlserver_10.3\common\lib -sourcepath C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src;C:\Oracle\Middleware\jdk160_05\src.zip;C:\Oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1\toplink-src.zip;C:\Oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1\eclipselink-src.zip C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src\oracle\Dept.java C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src\oracle\Emp.java C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src\oracle\HRFacadeLocal.java C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src\oracle\HRFacadeClient.java C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src\oracle\HRFacade.java C:\JDeveloper\mywork\HR_EJB_JPA_App\EJBModel\src\oracle\HRFacadeBean.java
    [11:45:27 PM] Successful compilation: 0 errors, 0 warnings.
    [Application HR_EJB_JPA_App is bound to Server Instance DefaultServer]
    [Starting Server Instance DefaultServer]
    #### Server Instance DefaultServer could not be started: Server Instance was terminated.
    The "Running: DefaultServer" displays:
    "C:\Oracle\Middleware\user_projects\domains\base_domain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    [Server Instance DefaultServer is shutting down.  All applications currently running will be terminated and undeployed.]
    Process exited.
    C:\Oracle\Middleware\user_projects\domains\base_domain\bin\stopWebLogic.cmd
    Stopping Weblogic Server...
    Initializing WebLogic Scripting Tool (WLST) ...
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands
    Connecting to t3://localhost:7101 with userid weblogic ...
    This Exception occurred at Wed Oct 29 23:47:40 CET 2008.
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7101: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection refused: connect; No available router to destination]
         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
         at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:783)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:365)
         at weblogic.jndi.Environment.getContext(Environment.java:315)
         at weblogic.jndi.Environment.getContext(Environment.java:285)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at weblogic.management.scripting.WLSTHelper.populateInitialContext(WLSTHelper.java:512)
         at weblogic.management.scripting.WLSTHelper.initDeprecatedConnection(WLSTHelper.java:565)
         at weblogic.management.scripting.WLSTHelper.initConnections(WLSTHelper.java:305)
         at weblogic.management.scripting.WLSTHelper.connect(WLSTHelper.java:203)
         at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:60)
         at weblogic.management.scripting.utils.WLSTUtil.initializeOnlineWLST(WLSTUtil.java:125)
         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:597)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:160)
         at org.python.core.PyMethod.__call__(PyMethod.java:96)
         at org.python.core.PyObject.__call__(PyObject.java:248)
         at org.python.core.PyObject.invoke(PyObject.java:2016)
         at org.python.pycode._pyx4.connect$1(<iostream>:16)
         at org.python.pycode._pyx4.call_function(<iostream>)
         at org.python.core.PyTableCode.call(PyTableCode.java:208)
         at org.python.core.PyTableCode.call(PyTableCode.java:404)
         at org.python.core.PyFunction.__call__(PyFunction.java:184)
         at org.python.pycode._pyx16.f$0(C:\Oracle\Middleware\user_projects\domains\base_domain\shutdown.py:1)
         at org.python.pycode._pyx16.call_function(C:\Oracle\Middleware\user_projects\domains\base_domain\shutdown.py)
         at org.python.core.PyTableCode.call(PyTableCode.java:208)
         at org.python.core.PyCode.call(PyCode.java:14)
         at org.python.core.Py.runCode(Py.java:1135)
         at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:167)
         at weblogic.management.scripting.WLST.main(WLST.java:129)
         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:597)
         at weblogic.WLST.main(WLST.java:29)
    Caused by: java.net.ConnectException: t3://localhost:7101: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection refused: connect; No available router to destination
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:203)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
         at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:344)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:339)
         ... 38 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection refused: connect; No available router to destination
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:251)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:225)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteCluster(RJVMFinder.java:303)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:193)
         ... 43 more
    Problem invoking WLST - Traceback (innermost last):
    File "C:\Oracle\Middleware\user_projects\domains\base_domain\shutdown.py", line 1, in ?
    File "<iostream>", line 22, in connect
    WLSTException: Error occured while performing connect : Error getting the initial context. There is no server running at t3://localhost:7101 Use dumpStack() to view the full stacktrace
    Done
    I'm not that familiar with these things but it seems to me that there is an issue with port numbers here. The application seems to expect a app.server service at port 7101, but does'nt find one.
    Any suggestions on how to fix this problem would be appreciated?
    LA$$E

    Jupp,
    It fails in a similar way.
    What I did was; create a simle 'Hello World' html file, saving it with the jsp extension. In Jdev11g i made a new application and an emtpy project, then loaded the jsp file and made it the default run-target. This compiles nicely.
    When running the project it first attempts to start the WebLogicServer (WLS). After a few minutes it is started as seen in the "Running: DefaultServer" pane:
    C:\Oracle\Middleware\user_projects\domains\base_domain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m
    WLS Start Mode=Development
    CLASSPATH=;C:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.5/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Oracle\Middleware\jdeveloper\modules\features\adf.share_11.1.1.jar;;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar;;
    PATH=C:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\native;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1\patch_cie660\profiles\default\native;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.5\bin;C:\Oracle\MIDDLE~1\JDK160~1\jre\bin;C:\Oracle\MIDDLE~1\JDK160~1\bin;C:\oracle_client\product\11.1.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http:\\hostname:port\console *
    starting weblogic with Java version:
    java version "1.6.0_05"
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
    Starting WLS with line:
    C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -DproxySet=false -Djbo.34010=false -Xverify:none -da -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~1 -Doracle.home=C:\Oracle\Middleware\jdeveloper -Doracle.security.jps.config=C:\Oracle\MIDDLE~1\USER_P~1\domains\BASE_D~1\config\oracle\jps-config.xml -Doracle.dms.context=OFF -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_cie660\profiles\default\sysext_manifest_classpath -Dweblogic.Name=AdminServer -Djava.security.policy=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy weblogic.Server
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
    C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_zh_TW.jar>
    <30.okt.2008 kl 19.20 CET> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 10.0-b19 from Sun Microsystems Inc.>
    <30.okt.2008 kl 19.20 CET> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3 Mon Aug 18 22:39:18 EDT 2008 1142987 >
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <30.okt.2008 kl 19.20 CET> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
    <30.okt.2008 kl 19.20 CET> <Notice> <Log Management> <BEA-170019> <The server log file C:\Oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\logs\AdminServer.log is opened. All server side log events will be written to this file.>
    <30.okt.2008 kl 19.20 CET> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
    <30.okt.2008 kl 19.20 CET> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddi was not deployed. Error: [Deployer:149158]No application files exist at 'C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddi.war'.>
    <30.okt.2008 kl 19.20 CET> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddiexplorer was not deployed. Error: [Deployer:149158]No application files exist at 'C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddiexplorer.war'.>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <30.okt.2008 kl 19.20 CET> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
    <30.okt.2008 kl 19.20 CET> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
    <30.okt.2008 kl 19.20 CET> <Warning> <Server> <BEA-002611> <Hostname "Kromp.lan", maps to multiple IP addresses: 10.0.0.8, 127.0.0.1>
    <30.okt.2008 kl 19.20 CET> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.0.0.8:7001 for protocols iiop, t3, ldap, snmp, http.>
    <30.okt.2008 kl 19.20 CET> <Warning> <Server> <BEA-002611> <Hostname "127.0.0.1", maps to multiple IP addresses: 10.0.0.8, 127.0.0.1>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "base_domain" running in Development Mode>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <30.okt.2008 kl 19.20 CET> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    DefaultServer startup time: 121552 ms.
    DefaultServer started.
    In the "Messages" pane, however, things are not looking so good:
    Context: MakeProjectAndDependenciesCommand application=TestAppJsp.jws project=TestProjJsp.jpr
    [7:20:49 PM] Successful compilation: 0 errors, 0 warnings.
    [Application TestAppJsp is bound to Server Instance DefaultServer]
    [Starting Server Instance DefaultServer]
    #### Server Instance DefaultServer could not be started: Server Instance was terminated.
    But, of course, the server is actually running as I can access it via its Admin Console.
    So, I try to run the project again, and this time the following is shown in the "Messages" pane:
    Compiling...
    Context: MakeProjectAndDependenciesCommand application=TestAppJsp.jws project=TestProjJsp.jpr
    [7:26:39 PM] Successful compilation: 0 errors, 0 warnings.
    [Application TestAppJsp is bound to Server Instance DefaultServer]
    [Starting Server Instance DefaultServer]
    #### Server Instance DefaultServer could not be started: Server Instance was terminated.
    The "Running: DefaultServer" now comes up with:
    C:\Oracle\Middleware\user_projects\domains\base_domain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    [Server Instance DefaultServer is shutting down.  All applications currently running will be terminated and undeployed.]
    Process exited.
    The WLS is still running though as I can still access its adm console.
    To me it seems that it is attempting to start a separate instance of the WLS for each run attempt, but then I could be wrong.....:(
    Later I'll try to change the default WLS port from 7001 to 7101 as suggested in another port here.
    I must admit that I'm a bit surprised that the JDev11g doesn't work fine at this very simple level when performing a default install.

  • Error while migrating to eclipselink

    Hi !
    I am running this code:
    public class Test {
        public static void main(String[] args) {
            Persistence.createEntityManagerFactory("MyPersistenceUnit");
    }Then the environemnt outputs:
    run-single:
    2010-4-2 0:35:05 javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver log&#65533;
    WARNING: javax.persistence.spi::No valid providers found using:&#65533;
    2010-4-2 0:35:05 javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver log&#65533;
    WARNING: javax.persistence.spi::&#28530;&#26414;&#25955;&#27753;&#28787;&#25902;&#28773;&#29299;&#26995;&#29797;&#28259;&#25902;&#27248;&#24878;&#20581;&#29299;&#26995;&#29797;&#28259;&#25936;&#29295;&#30313;&#25701;&#65533;
    - jar:file:/D:/NetBeans/java3/modules/ext/eclipselink/eclipselink-2.0.0.jar!/META-INF/services/javax.persistence.spi.PersistenceProvider&#65533;
    2010-4-2 0:35:05 javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver log&#65533;
    WARNING: javax.persistence.spi::&#28530;&#26414;&#25955;&#27753;&#28787;&#25902;&#28773;&#29299;&#26995;&#29797;&#28259;&#25902;&#27248;&#24878;&#20581;&#29299;&#26995;&#29797;&#28259;&#25936;&#29295;&#30313;&#25701;&#65533;
    - jar:file:/D:/Java/project%20workspace/Identity/dist/lib/eclipselink-2.0.0.jar!/META-INF/services/javax.persistence.spi.PersistenceProvider&#65533;
    2010-4-2 0:35:05 javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver log&#65533;
    WARNING: javax.persistence.spi::&#28530;&#26414;&#25955;&#27753;&#28787;&#25902;&#28773;&#29299;&#26995;&#29797;&#28259;&#25902;&#27248;&#24878;&#20581;&#29299;&#26995;&#29797;&#28259;&#25936;&#29295;&#30313;&#25701;&#65533;
    - jar:file:/D:/Java/project%20workspace/Utilities/dist/lib/eclipselink-2.0.0.jar!/META-INF/services/javax.persistence.spi.PersistenceProvider&#65533;
    Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named MyPersistenceUnit&#65533;
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)Whats going on ?

    sharingan wrote:
    I ran into same problem but this got resolved when i rectified my dependencies to look like the following in pom.xml
         <dependency>
                   <groupId>org.eclipse.persistence</groupId>
                   <artifactId>javax.persistence</artifactId>
                   <version>1.0</version>
              </dependency>
    <dependency>
                   <groupId>org.eclipse.persistence</groupId>
                   <artifactId>eclipse.persistence</artifactId>
                   <version>1.0</version>
              </dependency>You're about 3 years too late.

  • EJB 3.0 Constraints Problem

    Hi everybody !
    Hope someone can help me !! Im really go crazy with this stuff :s...
    Im Using jdeveloper .... I have 2 Entity Bean called Jiverating and Jiveuser, I creadte them using "Create Entity Bean from Table".... also a Session Bean called ForumFacadeBean I created using a EJB diagram as EJB Sesion Bean ....
    I can execute query without any problem but when I want to sotre a new Jiverating the aplication thows an exception... I just call the following metold of ForumFacadeBean
    public Jiverating persistJiverating(Jiverating jiverating) {   
    em.persist(jiverating);
    return jiverating;
    The exception I got is:
    <Jan 13, 2012 8:42:48 PM PET> <Warning> <EclipseLink> <BEA-2005000> <2012-01-13 20:42:48.125--UnitOfWork(317933487)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)>
    <Jan 13, 2012 8:42:48 PM PET> <Warning> <EclipseLink> <BEA-2005000> <2012-01-13 20:42:48.126--UnitOfWork(317933487)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)>
    <Jan 13, 2012 8:42:48 PM PET> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB pe.com.gart.ejb.entities.ForumFacadeBean.persistJiverating(pe.com.bcts.gart.ejb.entities.Jiverating)],Xid=BEA1-001B5FB5B4DB06A00B5F(317932956),Status=Rolled back. [Reason=Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=30,SCInfo[osinergminWebPortalDesa+WC_Spaces]=(state=rolledback),properties=({weblogic.transaction.name=[EJB pe.com.gart.ejb.entities.ForumFacadeBean.persistJiverating(pe.com.bcts.gart.ejb.entities.Jiverating)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=WC_Spaces+192.168.101.124:9000+osinergminWebPortalDesa+t3+, XAResources={WSATGatewayRM_WC_Spaces_osinergminWebPortalDesa, CustomPortalServicesEJB@Portal@Portal_osinergminWebPortalDesa, webapp@Portal@Portal_osinergminWebPortalDesa},NonXAResources={})],CoordinatorURL=WC_Spaces+192.168.101.124:9000+osinergminWebPortalDesa+t3+): weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=[email protected]f34805
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
    *     bind => [2, 0, 2, 11]*Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1881)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:345)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:240)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:627)
         at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
         at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
         at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl.persistJiverating(Unknown Source)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl_1035_WLStub.persistJiverating(Unknown Source)
         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:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
         at $Proxy247.persistJiverating(Unknown Source)
         at customdiscussions.backing.AddRating.<init>(AddRating.java:51)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at oracle.adfinternal.controller.beans.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:187)
         at oracle.adfinternal.controller.beans.ManagedBeanFactory.instantiateBean(ManagedBeanFactory.java:874)
         at oracle.adfinternal.controller.state.ScopeMap.get(ScopeMap.java:83)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:250)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:513)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:782)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:75)
         at oracle.adfinternal.view.faces.unified.taglib.UnifiedDocumentTag.doStartTag(UnifiedDocumentTag.java:50)
         at jsp_servlet.__addrating_jspx._jspx___tag1(__addrating_jspx.java:154)
         at jsp_servlet.__addrating_jspx._jspx___tag0(__addrating_jspx.java:113)
         at jsp_servlet.__addrating_jspx._jspService(__addrating_jspx.java:74)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:268)
         at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:471)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:191)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:800)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:294)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:214)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    I dont underestand this error beacuse when I execute INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (2, 0, 2, 11) directly on the database I got no error !
    please help me !!!!!

    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not foundWell it is a database constraint, so it is the database that is blocking the insertion of the record.
    I dont underestand this error beacuse when I execute INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (2, 0, 2, 11) directly on the database I got no error !And did you actually attempt to -commit- the transaction? If you did then I can only conclude one thing: you are using two different databases. One has a constraint, the other does not. Constraints do not magically appear out of thin air, especially ones that generate an ORA error.

  • Hibernate OR EclipseLink...Which is best with Weblogic and Oracle DB?

    Hi All,
    In my company, we are using Oracle DB and Weblogic application server. So in the process to upgrade or switch to new ORM, we shortlisted two options - Hibernate and EclipseLink.
    I gathered following summary regarding both ORMs -
    Hibernate:
    1.     When you need to train people, like we are going to do next week – most of the companies have Hibernate experts.
    2.     When you hire new developers, most of them come with specific Hibernate experience.
    3.     When you need to consult with experts, both in the internet or consultants, you have LOTS of options. Endless forums and communities all regarding Hibernate.
    4.     Hibernate is an open source which has a huge community. This means that it will be improved all the time and will push the ORM market forward.
    5.     Hibernate is an open source which means you have the code to handle, and in case needed, fit it to your needs.
    6.     There are lots of plugins to Hibernate, such as validations tool, audit tools, etc. These becomes standard as well and dismiss you from impl. things yourself.
    7.     One most important thing with ORM tool, is to configure it according to your application’s needs. Usually the default setting doesn’t fit to your needs.
    For that sake, when the market has a huge experience with the tool’s configuration, and lots of experts (see point 1 and 3) – most of chances you will find similar cases and
    lots of knowledge about how to configure the tool and thus – your application.
    EclipseLink:
    1. Fully supported by Oracle. Hibernate no. In case of pb, it could be cumbersome to prove that it is a pure Weblogic one. Concretely, we will have to prove it (waste of time and complexity).
    2. Eclipse link is developed by Oracle and the preferred ORM in the Weblogic /Oracle DB world.
    3. Even if at a certain time EclipseLink was a bit late compared to Hibernate (feature), EclipseLink evolved very fast and we can consider now that they close the gap.
    4. No additional fee as soon as you have Weblogic license. You will need to pays additional fee if you want some professional support on Hibernate.
    5. We are currently relying on Hibernate for our legacy offer and are facing pb in second level cache (JGroups). Today, we are riding off this part!. Consequences are limitation in clustering approach (perf)
    6. On EclipseLink side we do succeed to manage first and second level cache in a clustering approach.
    7. Indeed Hibernate is open source, so you can imagine handling it. In reality, the code is so complex that it is nearly impossible to modify it. Moreover as it is LGPL, you need to feedback all the modified sources to the community systematically.
    8. All tests performed by Oracle concerning Weblogic are using EclipseLink. Moreover, Oracle says that some specific optimizations are done to manage Oracle DB.
    9. Hibernate comes from JBoss community.
    Right now we are preferring Hibernate but there are concerns/reasons like EclipseLink developed by Oracle and preferred ORM in Webogic/ Oracle DB world (compatibility of ORM with DB and App. server), support comparison with both ORM, which are preventing to finalize the decision.
    Please help me with you views and opinions and share you experience with us so that we can make a perfect decision.
    If you want you can also reply to me @ [email protected].
    Thanks.

    The way the ORMs are designed, integration with application servers are relatively simple, and all provides the same features. Also since WebLogic have been around for a while, all ORMs are all well tested in this configuration.
    Hibernate has lot more users, and is likely very often used with Oracle DB, so you can expect not much bug against Oracle DB, maybe even less bug than EclipseLink, which is not much used. EclipseLink does provide support for some esoteric Oracle DB features like hierarchical and flashback queries.
    OpenJPA and DataNucleus are also JPA compliant. It’s likely that Open JPA has a higher user base than EclipseLink, so less unknown bugs.
    Oracle paying support is well known to be a bad joke. It’s a negative return to use this channel, even if they would be free. So in reality, you end up to use the open (free) forum to get support.
    What’s was lacking with Hibernate before is Dynamic Fetch Planning, but they now have some support, see http://opensource.atlassian.com/projects/hibernate/browse/HHH-3414. OpenJPA was the first to implement this must have.
    EclipseLink has query in memory, which can be used, but the API do not help to leverage it, and EclipseLink’s leadership made it clear that they are not going to make it better, instead they want to push Coherence cache.
    Hibernate has an open API for second level cache, which mean you can get out of problem by using another implementation, for example, EHCache seems to be professionally tested, so I would be surprise you find obvious bugs.
    I cannot comment on Hibernate source code quality, but I can tell you that locking mechanism in EclipseLink is used to be very fragile, and many concepts are dispersed over the code base.
    The runtime monitoring of Hibernate have always been great due to the fact that JBoss have always been strong on JMX, EclipseLink has not much usable features on this.
    If I would be you, I would consider OpenJPA or Hibernate instead of EclipseLink, the main reason is that because EclipseLink has a so low user base, I have found lot of obvious bugs in production, like if I was the only user of it. Then, when I submitted bugs to the small development team, which do not encourage user base contribution, they were too busy trying to keep up adding the JPA interfaces on top of their existing proprietary APIs.

Maybe you are looking for

  • Slices & Saving For Web

    Hi all, I am making a bulk emailer - I have a Jpeg (originally designed in Illustrator) that I need to slice and save as an html. It is a long skinny jpeg for optimal screen/email viewing (750 x 4389 pixels). After resizing the original image to 72dp

  • Are their any advantages of selecting Postscript over PCL?

    I would be interested in any views on the selection of SAP Device types, specifically for HP laser printers.  Traditionally I have always used the device specific PCL device types readily available but it appears that more and more printer vendors no

  • Time and date are set incorrectly on the routers and switches

    I've just noticed that the date and time on all my Cat4006's, Cat3548's and Cat6000 were grossly incorrect. I was wondering if this would contribute to problems I am having on the network. Does the switches/routers check the timestamp on the packets

  • Problem with ACR 7 support of Canon 5D Mark III

    Just purchased LR4 with ACR7 (upgrade from LR3.6 - not happy about that either, but I am mostly over it) and tried to import photos from my Canon 5D Mark III.  Import feature sees all the .CR2 files but when I try to import them it complains that it

  • I can't watch You Tube videos via WiFi but I can in 3G.

    This is on all iDevices - not just iPad.  It's a new router that supports Smart Wi-Fi apps. Why?  Is this a setting?  And it only seems to be You Tube.  It says Playback Error or Video Not Available. Thoughts?