Couldn't persist OneToMany JoinColumn/JoinTable (Unidir) using TopLink JPA

Hi All,
I am having a lot of difficulty deploying a OneToMany Unidirectional (Zipcode) record which consist of multiple Zipnames using TopLink on Glassfish v2r2, JDK1.6.0_06, MySQL 5.0, Netbeans 6.1 and Windows XP platform.
Below are the relevant EJBs snippets:
Zipcode class
@Entity
@Table(name="ZIPCODE")
public class Zipcode implements Serializable {
@OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
@JoinColumn(name="ZIPCODE_ID")    
             or
    @JoinTable(name="ZIPCODE_ZIPNAME",          
               joinColumns={@JoinColumn(name="ZIPCODE_ID")},
               inverseJoinColumns={@JoinColumn(name="ZIPNAME_ID")})
    private Collection<Zipname> zipnames = new ArrayList<Zipname>();
    public Collection<Zipname> getNames()
     return zipnames;
    public void setZipnames(Collection<Zipname> zipnames)
     this.zipnames = zipnames;
Zipname class does not maintain relationship back to Zipcode.
public class ZipcodeApplicationClient {
@PersistenceContext(unitName="GeographicalDB-PU")
private static EntityManager manager;
    public ZipcodeApplicationClient() {
    public static void main(String[] args) {
        try {
            Zipcode zipcode_1 = new Zipcode();
            zipcode_1.setcode(9001);
            Zipname zipname_1 = new Zipname();
            zipname_1.setName("Harbour Cove");
            zipcode_1.getNames().add(zipname_1);
            // Can add one Zipname record with JoinTable but not JoinColumn
            Zipname zipname_2 = new Zipname();
            zipname_2.setName("Wonderland");
            zipcode_1.getNames().add(zipname_2);
            manager.persist(zipcode_1);   // line 45
The same deployment error message below was generated from both JoinColumn and JoinTable methods:
run-deploy:
run-display-browser:
run-ac:
Copying 1 file to C:\Documents and Settings\Jack\GeographicalBean\dist
Caught an unexpected exception!
java.lang.NullPointerException
        at client.ZipcodeApplicationClient.main(ZipcodeApplicationClient.java:45)
        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 com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
        at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
        at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
        at com.sun.enterprise.appclient.Main.main(Main.java:200)
run-InvestmentBean-app-client:The JoinColumn method would not work for one Zipname record. On the other hand, JoinTable approach would allow us to add a single Zipname record without error out.
Q1. Can you confirm whether TopLink JPA 1.0 (Glassfish v2r2) support OneToMany JoinColumn Unidirectional at all?
Q2. Does TopLink JPA 1.0 (Glassfish v2r2) support OneToMany JoinTable Unidirectional? If so, what is the cause of this issue? Otherwise, please make appropriate recommendation steps to take.
This question has been posted on http://forums.sun.com/thread.jspa?threadID=5330670&tstart=0 and http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=78&t=004489&p=1 earlier in the hope a quicker response.
Your guidance would be very much appreciated.
Many thanks,
Jack

Hi,
Below are some more error output from the OneToMany JoinTable Unidirectional approach:
pre-run-deploy:
Initial deploying InvestmentBean to C:\Documents and Settings\abc\InvestmentBean\dist\gfdeploy
Completed initial distribution of InvestmentBean
Start registering the project's server resources
Finished registering server resources
moduleID=InvestmentBean
deployment started : 0%
deployment finished : 100%
Deploying application in domain completed successfully
Trying to create reference for application in target server completed successfully
Trying to start application in target server completed successfully
WARNING:
JDO76614: Deployment encountered SQL Exceptions:
JDO76609: Got SQLException executing statement "CREATE TABLE ZIPCODE (ID INTEGER NOT NULL, DIALING_CODE VARCHAR(255), TIME_ZONE VARCHAR(255), CODE INTEGER, NEAREST_AIRPORT VARCHAR(255), LONGITUDE VARCHAR(255), NEAREST_TRAIN_STATION VARCHAR(255), NEAREST_URBAN_CENTRE VARCHAR(255), HOTELS VARCHAR(255), LATITUDE VARCHAR(255), NEARBY_FEATURES VARCHAR(255), COUNCIL VARCHAR(255), LOCALITY VARCHAR(255), PRIMARY KEY (ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipcode' already exists
JDO76609: Got SQLException executing statement "CREATE TABLE ZIPCODE_ZIPNAME (ZIPCODE_ID INTEGER NOT NULL, ZIPNAME_ID INTEGER NOT NULL, PRIMARY KEY (ZIPCODE_ID, ZIPNAME_ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipcode_zipname' already exists
JDO76609: Got SQLException executing statement "CREATE TABLE ZIPNAME (ID INTEGER NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipname' already exists
JDO76609: Got SQLException executing statement "ALTER TABLE ZIPCODE_ZIPNAME ADD CONSTRAINT FK_ZIPCODE_ZIPNAME_ZIPCODE_ID FOREIGN KEY (ZIPCODE_ID) REFERENCES ZIPCODE (ID)": java.sql.SQLException: Can't create table '.\geographicaldb\#sql-434_4.frm' (errno: 121)
JDO76609: Got SQLException executing statement "ALTER TABLE ZIPCODE_ZIPNAME ADD CONSTRAINT FK_ZIPCODE_ZIPNAME_ZIPNAME_ID FOREIGN KEY (ZIPNAME_ID) REFERENCES ZIPNAME (ID)": java.sql.SQLException: Can't create table '.\geographicaldb\#sql-434_4.frm' (errno: 121)Enable of InvestmentBean in target server completed successfully
Enable of application in all targets completed successfully
All operations completed successfully
post-run-deploy:
run-deploy:
run-display-browser:
run-ac:
Copying 1 file to C:\Documents and Settings\Jack\GeographicalBean\dist
Caught an unexpected exception!
java.lang.NullPointerException
at client.ZipcodeApplicationClient.main(ZipcodeApplicationClient.java:45)
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 com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
run-GeographicalBean-app-client:
run:
I would like to correct an earleir comment where I stated that this method did work when adding a single Zipname record. This is no true.
Thanks,
Jack

Similar Messages

  • Useing toplink jpa in jdev11 and mysql4,but meet the DatabaseException

    Hello everyone,I'm useing toplink jpa in jdev11 and mysql4.I create a class from database success.Then I use "Java Service Facade" to create a class called JavaServiceFacade sucess.Then I add some code:
    System.out.println(javaServiceFacade.queryCnationalityFindAll().size())
    in main
    then I run the program,but I got this error:
    xception in thread "main" Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
    Error Code: 0
         at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:290)
         at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:87)
         at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
         at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:218)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.connect(DatabaseAccessor.java:227)
         at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:294)
         at oracle.toplink.essentials.threetier.ConnectionPool.buildConnection(ConnectionPool.java:102)
         at oracle.toplink.essentials.threetier.ConnectionPool.startUp(ConnectionPool.java:324)
         at oracle.toplink.essentials.threetier.ServerSession.connect(ServerSession.java:443)
         at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:571)
         at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:208)
         at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
         at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
         at project6.JavaServiceFacade.getEntityManager(JavaServiceFacade.java:23)
         at project6.JavaServiceFacade.queryCnationalityFindAll(JavaServiceFacade.java:72)
         at project6.JavaServiceFacade.main(JavaServiceFacade.java:18)
    Caused by: java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3074)
         at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
         at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:140)
         at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:85)
         ... 17 more
    there's some chinese you may not know,that means there's something wrong with
    Microsoft odbc.I'm puzzle of that:I'm useing java+mysql,why there's wrong with odbc???
    thank you very much
    (maybe it's jdev11 technical preview edition so it can't work?)

    HI
    can you reply the feedback of metalink? because I'm having similar problem.
    I debug in junit and embebbed at the jdev and it works well, but when I deploy in a standalone oc4j it gives me the same error of Excepção de E/S: The Network Adapter could not establish the connection
    And I'm not using 11g, I'm still in 10g but the problem might be the same.
    cumps
    DnlCY
    null

  • Why it is so slow using toplink JPA in applet or webstart

    I use jpa in the applet,but it is too slow to initialize the toplink jpa.
    It takes about 80 seconds to execute this method:
    EntityManagerFactory factory=Persistence.createEntityManagerFactory("unit");
    The applet/webstart has the security authorization.
    I even modify the java.policy file to give the applet AllPermission.
    How could I fix this?
    thx for u help.
    with regards

    To test if it is jpa's problem.
    I create a new desktop project and didn't use toplink JPA.
    It performace good. But if I use JPA in this project.It became so slow.
    as I said before. I have give the programme authorization to run.
    Can anyone help.
    Even when I change to openJPA.It just performace a little faster.
    cause the project is nearly finished,I can't replace JPA in the project.It cost too much time that I can't afford.
    I don't know what is the problem.
    Please help.
    thank you.

  • How to use a third party datasource in java se use toplink jpa?

    because i am working on a desktop app, i don't have a container.So i can't use a JNDI provider;
    but i want to use proxool or dbcp connection pool instead of toplink's connection pool.
    how can i handle this?
    thx for your help

    Define a SessionCustomizer that assigns your data source::
    public class MySessionCustomizer implements oracle.toplink.tools.sessionconfiguration.SessionCustomizer {
        public void customize(Session session) throws Exception {
            session.getLogin().setConnector(new oracle.toplink.jndi.JNDIConnector(myDataSource));
    }Pass it to createEntityManagerFactory method as a property
    Map props = new HashMap();
    props.put("toplink.session.customizer", "MySessionCustomizer");

  • TopLink JPA doesn't persist Clob field when useStringBinding

    I'm using Toplink JPA on a JSF application deploying on Tomcat.
    Everything works fine except the table with Clob field.
    When insert data with size larger than 4KB, the error will occur.
    I did some searching and I fixed this by using SessionCustomizer.
    In my persistence.xml I put this
    <property name="toplink.session.customizer" value="com.my.sessions.MySessionCustomizer"/>
    and MySessionCustomizer is like this
    public class MySessionCustomizer implements SessionCustomizer {
         public void customize(Session session) throws Exception {
              DatabaseLogin login = session.getLogin();
              login.useStringBinding();
              login.setShouldBindAllParameters(false);
              login.dontCacheAllStatements();
    Things seem to work fine now but I found that Toplink does not persist the field that useStringBinding in database (Oracle 9i)
    eg. when I update an object into a table which has 1 clob field and some other field like VARCHAR2, all the data in non-clob fields are stored perfectly in Oracle but the data in Clob field just gone blank. It just gone blank in the database but in my application, it's still there. I mean as long as my session is still alive, everything seems to work fine from the application side. But when I start a new session, the data in the Clob is lost because it's not in the database.
    Why is this happening? Do I need to do anything extra when useStringBinding?
    It seems to me that the field with StringBinding just don't get into the database.
    Could somebody help me with this?

    This is an issue with the Oracle thin JDBC driver in that it has a 4k limit for LOBS. The best workaround is to use the Oracle OCI JDBC driver, which does not have this limitation (I think this limitation was also improved in the Oracle 10.2 thin JDBC driver).
    If you are using TopLink 10.1.3 a workaround to the JDBC issue is provided by using the Oracle9Platform and configuring the mapping for the CLOB to have a field-classification of java.sql.Clob.class.
    If you are using TopLink Essentials unfortunately this support is not currently available. I believe there is already an issue logged for this in Glassfish. If you cannot use the OCI driver you may need to insert the CLOB data using direct JDBC code.

  • HT1222 I like the new iOS 7 for iphone... But i think it's not a good idea to allow switch the iphone on flight mode when it is locked.. What happens if your iphone is stolen or lost? You couldn't be able to locate it using find my iphone... Can i remove

    I like the new iOS 7 for iphone... But i think it's not a good idea to allow switch the iphone on flight mode when it is locked.. What happens if your iphone is stolen or lost? You couldn't be able to locate it using find my iphone... Can i remove this from the bottom menu?

    And have your phone set to require a passcode before it can be accessed.

  • Using Toplink API to persist data to database

    My requirement is to persist data to the database (oracle) using Toplink Java API approach.
    I have a basic setup program, but its not solving the purpose.
    Kindly let me know where I am missing.
    package sample;
    import oracle.toplink.essentials.descriptors.ClassDescriptor;
    import oracle.toplink.essentials.descriptors.RelationalDescriptor;
    import oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl;
    import oracle.toplink.essentials.mappings.DirectToFieldMapping;
    import oracle.toplink.essentials.queryframework.DatabaseQuery;
    import oracle.toplink.essentials.sessions.Login;
    import oracle.toplink.essentials.sessions.UnitOfWork;
    public class EmployeeProject extends oracle.toplink.essentials.sessions.Project
    private ClassDescriptor classDescriptor;
    public EmployeeProject()
    applyPROJECT();
    applyLOGIN();
    classDescriptor = buildEmployeeDescriptor();
    addDescriptor(classDescriptor);
    System.out.println("classDescriptor.getMappings(): " + classDescriptor.getMappings());
    protected void applyPROJECT(){
    setName("Employee");
    protected void applyLOGIN()
    oracle.toplink.essentials.sessions.DatabaseLogin login = new oracle.toplink.essentials.sessions.DatabaseLogin();
    login.setDriverClassName("oracle.jdbc.OracleDriver");
    login.setConnectionString("jdbc:oracle:thin:ptyagi-pc.idc.oracle.com:1521:orcl");
    login.setUserName("system");
    login.setPassword("orcl");
    // Configuration Properties
    setDatasourceLogin((Login)login);
    // SECTION: DESCRIPTOR
    public ClassDescriptor buildEmployeeDescriptor() {
    RelationalDescriptor descriptor = new RelationalDescriptor();
    // specify the class to be made persistent
    descriptor.setJavaClass(sample.Employee.class);
    // specify the tables to be used and primary key
    descriptor.addTableName("EMP1");
    descriptor.addPrimaryKeyFieldName("EMP1.ID");
    // Descriptor Properties
    descriptor.useSoftCacheWeakIdentityMap();
    descriptor.setIdentityMapSize(100);
    descriptor.setAlias("Employee");
    // Mappings
    DirectToFieldMapping idMapping = new DirectToFieldMapping();
    idMapping.setAttributeName("id");
    idMapping.setFieldName("EMP1.ID");
    descriptor.addMapping(idMapping);
    DirectToFieldMapping nameMapping = new DirectToFieldMapping();
    nameMapping.setAttributeName("name");
    nameMapping.setFieldName("EMP1.NAME");
    descriptor.addMapping(nameMapping);
    DirectToFieldMapping salMapping = new DirectToFieldMapping();
    salMapping.setAttributeName("salary");
    salMapping.setFieldName("EMP1.SALARY");
    descriptor.addMapping(salMapping);
    return descriptor;
    public static void main(String [] args) {
    EmployeeProject empProj = new EmployeeProject();
    Employee emp = new Employee();
    emp.setID(1);
    emp.setName("Pulkita");
    emp.setSalary(100);
    DatabaseSessionImpl databaseSessionImpl = new DatabaseSessionImpl(empProj);
    databaseSessionImpl.login();
    databaseSessionImpl.beginTransaction();
    UnitOfWork unitOfWork = databaseSessionImpl.acquireUnitOfWork();
    unitOfWork.registerNewObject(emp);
    unitOfWork.commit();
    }

    The issue is with the line:
    databaseSessionImpl.beginTransaction();Since you began the transaction yourself you must also commit it. The easiest solution is to remove the above line and allow the UnitOfWork to begin and commit the transaction itself.
    Doug

  • How to resolve this: Some Gmail features have failed to load due to an Internet connectivity problem. If this problem persists, try reloading the page, using the older version, or using basic HTML mode.

    Keep getting this message while using Gmail "Some Gmail features have failed to load due to an Internet connectivity problem. If this problem persists, try reloading the page, using the older version, or using basic HTML mode. "
    I have to use the older version of gmail for it to work properly.

    now i cant even send emails out of gmail, except when using the older version.

  • I have recently purchased my mac book with retina.i have explore all the feature but couldn't able to understand how to use my facetime. plz assist me

    i have recently purchased my mac book with retina.i have explore all the feature but couldn't able to understand how to use my facetime. plz assist me
    rahul

    Greetings rahul81,
    After reviewing your post, it sounds like you want to know how to use FaceTime. I would recommend that you read this article, it may be able to help the issue.
    FaceTime for Mac (Yosemite): Make and receive FaceTime calls
    Thanks for using Apple Support Communities.
    Take care,
    Mario

  • My iPod is to desactiver and I do not arrive has to restore him(it) has cause of a persistent error ( 3194 ), somebody can use PLEASE??

    My iPod is to desactiver and I do not arrive has to restore him(it) has cause of a persistent error ( 3194 ), somebody can use PLEASE??

    From this Apple support document: iTunes: Specific update-and-restore error messages and advanced troubleshooting
    This device is not eligible for the requested build: Also sometimes displayed as an "error 3194." If you receive this alert, update to the latest version of iTunes. Third-party security software or router security settings can also cause this issue. To resolve this, follow Troubleshooting security software issues.
    Downgrading to a previous version of iOS is not supported. If you have installed software to perform unauthorized modifications to your iOS device, that software may have redirected connections to the update server (gs.apple.com) within the Hosts file. First you must uninstall the unauthorized modification software from the computer, then edit out the "gs.apple.com" redirect from the hosts file, and then restart the computer for the host file changes to take affect.  For steps to edit the Hosts file and allow iTunes to communicate with the update server, see iTunes: Troubleshooting iTunes Store on your computer, iPhone, iPad, or iPod—follow steps under the headingBlocked by configuration (Mac OS X / Windows) > Rebuild network information > The hosts file may also be blocking the iTunes Store. If you do not uninstall the unauthorized modification software prior to editing the hosts file, that software may automatically modify the hosts file again on restart. Also, using an older or modified .ipsw file can cause this issue. Try moving the current .ipsw file, or try restoring in a new user to ensure that iTunes downloads a new .ipsw.
    Error 3194: Resolve error 3194 by updating to the latest version of iTunes. "This device is not eligible for the requested build" in the updater logs confirms this is the root of the issue. For more Error 3194 steps see: This device is not eligible for the requested build above.
    B-rock

  • I got a blacklisted iphone 5 from att and I reset it and now when I try to set it up it needs a sim card so I went to the att store and they put a sim in and on the iPhone it says replacement needed couldn't complete activation.i just want use it as a ip

    I got a blacklisted iphone 5 from att and I reset it and now when I try to set it up it needs a sim card so I went to the att store and they put a sim in and on the iPhone it says replacement needed couldn't complete activation.i just want use it as a ipod

    To use it as an iPod it must be activated...to do that it has to accept a sim.  A blacklisted iPhone cannot do that.  Take it back to AT and T where you got it and get your money back.

  • Problem using Toplink with JUnit

    Hi,
    I have a problem using Toplink with JUnit. Method under test is very simple: it use a static EntityManager object to open a transaction and persists data to db. When I invoke the method from a test method, it gives me the exception:
    java.lang.AssertionError
         at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.computePURootURL(PersistenceUnitProcessor.java:248)
         at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:232)
         at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:216)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:239)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initializeFromMain(JavaSECMPInitializer.java:278)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.getJavaSECMPInitializer(JavaSECMPInitializer.java:81)
         at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:119)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
         at it.valerio.electromanager.model.EntityFacade.<clinit>(EntityFacade.java:12)
         at it.valerio.electromanager.business.ClienteBiz.insertIntoDatabase(ClienteBiz.java:36)
         at it.valerio.electromanager.test.model.ClienteTest.insertDBTest(ClienteTest.java:30)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
         at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
         at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
         at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
         at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
         at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
         at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
         at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
         at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
         at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
         at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Where is the problem???
    Regards,
    Valerio

    EntityFacade class is very simple and it uses a static EntityManager object. Here the code:
    public class EntityFacade {
         private static EntityManager em = Persistence.createEntityManagerFactory("ElectroManager").createEntityManager();
         private static Logger logger=Logger.getLogger(EntityFacade.class);
         public static void insertCliente(Cliente c)
              logger.debug("Inserisco cliente nel db: " + c);
              em.getTransaction().begin();
              c.setId(getNextIdForTable("Cliente"));
              em.persist(c);
              em.getTransaction().commit();
    If I call the method from inside a main it works well, so I think the problem is not the classpath neither the URL in the persistence.xml. However the URL is:
    <property name="toplink.jdbc.url" value="jdbc:derby:c:/programmi/ElectroManager/db/electroManager"/>
    I use the latest build version of TopLink.
    Thanks.

  • Updating a persons name using toplink uow

    Hi,
    I am having problems updating the name of a PERSON. I am using Toplink with a SessionBeanFacade.
    I am using a Backing Bean, which is calling the Session Bean Facade. I was debugging the code and the strange thing is: I can see the updated name in the entity and in the uow, but after uow.commit the updated name isn't in the database. Why won't the values from the uow persist?
    SESSION BEAN FACADE
      public Object mergeEntity(Object entity) {
        UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
        Object workingCopy = uow.readObject(entity);
        if (workingCopy == null)
          throw new RuntimeException("Could not find entity to update");
        uow.deepMergeClone(entity);
        uow.commit();
        return workingCopy;
    BACKING BEAN
      public void recoverBusinesspartner(ActionEvent actionEvent) {
        DCBindingContainer dcBind = (DCBindingContainer)getBindings();
        DCIteratorBinding iterBind = (DCIteratorBinding)dcBind.get("personIterator");
        iterBind.getCurrentRow().setAttribute("name", "Bodhy");
        dcBind.getOperationBinding("mergeEntity").execute();
      }Thank you
    Bodhy
    Edited by: Bodhy on 30.09.2008 06:02
    P.S. I don't get any errors or some other message in my log. I am using JDeveloper 11g TP3

    Hello,
    Glad you found the problem. As I mentioned in my previous post, you should not be modifying objects from the session cache. When you do any sort of query on a session other than a UnitOfWork, the objects returned exist in the shared session cache. When you register an object, the state of the object is pulled from the session cache and used for a comparison - TopLink will think that is the state the database is in.
    This is why Detach resolves the issue- it makes a copy of the object so that changes to it do not get put into the cached copy.
    I would recommend looking at:
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/cachun001.htm
    and
    http://www.oracle.com/technology/products/ias/toplink/technical/unitOfWorkWP.pdf
    to see how caching and the UOW work in TopLink
    Best Regards,
    Chris

  • How to configure WebLogic to use TopLink?

    I am using BEA Workshop to develop a webservice and I am having some issues to make it work. Basically, I am using Toplink plus JAX-WS. The main problem is how to get the EntityManager from the context in order to persist the data into database.
    Here is a piece of code, hope it can help to understand the issue:
    Context ctx = null;
         Hashtable ht = new Hashtable();
         ht.put(Context.INITIAL_CONTEXT_FACTORY,
                   "weblogic.jndi.WLInitialContextFactory");
         ht.put(Context.PROVIDER_URL,
         "t3://localhost:7001");
         ctx = new InitialContext(ht);
    EntityManager em = (EntityManager) ctx.lookup("persistence/LogicalName");
    Thanks!
    Diego

    Thanks for the info mkeith!
    Maybe this can give you a better idea of what I am talking about. I changed a few things based on the tutorials that oracle provides:
    I keep getting the following exception when I try to deploy into weblogic:
    weblogic.deployment.EnvironmentException: Error processing persitence unit defau
    lt of module ejb.jar: Error instantiating the Persistence Provider class oracle.
    toplink.essentials.PersistenceProvider of the PersistenceUnit default: java.lang
    .ClassNotFoundException: oracle.toplink.essentials.PersistenceProvider
    at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactor
    persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="default" transaction-type="JTA">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <jta-data-source>OracleDS</jta-data-source>
    <class>br.com.tim.mw.soa.soarepo.entity.MacroProcessEntity</class>
    <properties>
    <property name="toplink.logging.level" value="FINE" />
    <property name="toplink.jdbc.driver" value="oracle.jdbc.OracleDriver" />
    <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@localhost:WS" />
    <property name="toplink.jdbc.password" value="jpa" />
    <property name="toplink.jdbc.user" value="jpa" />
    </properties>
    </persistence-unit>
    </persistence>
    Entity
    @Entity()
    @Table(name="JPATable", schema="JPA")
    @PersistenceUnit(name="default")
    public class JPATableEntity implements Serializable {
    //default serial version id, required for serializable classes.
    private static final long serialVersionUID = 1L;
    private Long macroProcId;
    JPAResourceBean
    public class JPAResourceBean {
    protected EntityManagerFactory emf;
    * Lazily acquire the EntityManagerFactory and cache it.
    public EntityManagerFactory getEMF (){
    if (emf == null){
    emf = Persistence.createEntityManagerFactory("default", new java.util.HashMap());
    return emf;
    Persist Method
    protected void persist(Object object) {
    try{
    em = jpaBEAN.getEMF().createEntityManager();
    //Persist Object in Database
    em.persist(object);
    }catch(Exception err){
    java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", err);
    throw new RuntimeException(err);
    }finally{
    if( em.isOpen() ){
    em.close();
    if( jpaBEAN.getEMF().isOpen() ){
    jpaBEAN.getEMF().close();
    I also created a Data Source in WebLogic, but I am not sure if that's enough.
    Thanks in advance,
    Diego

  • Problem using TopLink Grid on WebLogic

    I encountered an error using TopLink Grid with WebLogic.
    I have a servlet that persists an object through TopLink Grid, and then try to retrieve an object. It has the following setup:
    JPA 2.0
    TopLink 11.1.1.4.0
    Coherence 3.6.0.4 (bundled with WebLogic)
    WebLogic Server 10.3.4
    Cache config: Grid Entity
    Method of obtaining EntityManager: Injection of @PersistenceContext
    Transaction Management: JTA
    I put coherence-cache-config.xml and tangosol-coherence-override.xml in /APP-INF/classes in my EAR file.
    I did not use active-cache.jar in my servlet. After the WebLogic server is started, the Coherence cache client is to be launched when the persist operation is called.
    However, found that the insertion fails with error. Only when em.find() is called could the Coherence cache client be launched properly. I find it very strange because toplink grid complains about missing coherence-cache-config.xml when it tries to insert, but is perfectly ok when it tries to do an em.find().
    Has anybody encountered the same issue before?
    The log is: (the lines starting with #### are output by the servlet)
    #### Inserting new dept
    <Mar 7, 2011 10:17:43 AM CST> <Notice> <EclipseLink> <BEA-2005000> <2011-03-07 10:17:43.816--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101206-r8635>
    <Mar 7, 2011 10:17:43 AM CST> <Notice> <EclipseLink> <BEA-2005000> <2011-03-07 10:17:43.82--Server: 10.3.4.0>
    <Mar 7, 2011 10:17:44 AM CST> <Notice> <EclipseLink> <BEA-2005000> <2011-03-07 10:17:44.261--file:/C:/Oracle/Middleware_1034/user_projects/domains/base_domain/servers/ManagedServer01/tmp/_WL_user/TopLinkGridApp/6df6x4/APP-INF/lib/TopLinkGridJPA.jar_GridLinkJPA login successful>
    2011-03-07 10:17:45.113/50.199 Oracle Coherence 3.6.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "zip:C:/Oracle/Middleware_1034/user_projects/domains/base_domain/servers/ManagedServer01/tmp/_WL_user/TopLinkGridApp/6df6x4/APP-INF/lib/coherence.jar!/tangosol-coherence.xml"
    2011-03-07 10:17:45.132/50.217 Oracle Coherence 3.6.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "zip:C:/Oracle/Middleware_1034/user_projects/domains/base_domain/servers/ManagedServer01/tmp/_WL_user/TopLinkGridApp/6df6x4/APP-INF/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    2011-03-07 10:17:45.141/50.226 Oracle Coherence 3.6.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "file:/C:/Oracle/Middleware_1034/user_projects/domains/base_domain/servers/ManagedServer01/tmp/_WL_user/TopLinkGridApp/6df6x4/APP-INF/classes/tangosol-coherence-override.xml"
    2011-03-07 10:17:45.148/50.233 Oracle Coherence 3.6.0.0 <D5> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.6.0.0 Build 17229
    Grid Edition: Development mode
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    <Mar 7, 2011 10:17:45 AM CST> <Warning> <EclipseLink> <BEA-2005000> <2011-03-07 10:17:45.491--Exception [EclipseLink-38] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): 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: Exception [EclipseLink-80000] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): oracle.eclipselink.coherence.exceptions.IntegrationException
    Exception Description: Unable to connect to Coherence Cache by name: Dept.
    Internal Exception: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
    Descriptor: RelationalDescriptor(test.gridlink.Dept --> [DatabaseTable(DEPT)])>
    <Mar 7, 2011 10:17:45 AM CST> <Warning> <EclipseLink> <BEA-2005000> <2011-03-07 10:17:45.502--Exception [EclipseLink-38] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): 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: Exception [EclipseLink-80000] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): oracle.eclipselink.coherence.exceptions.IntegrationException
    Exception Description: Unable to connect to Coherence Cache by name: Dept.
    Internal Exception: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
    Descriptor: RelationalDescriptor(test.gridlink.Dept --> [DatabaseTable(DEPT)])>
    <Mar 7, 2011 10:17:45 AM CST> <Warning> <EclipseLink> <BEA-2005000> <2011-03-07 10:17:45.584--Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete. The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
    Exception Description: Accessor or its connection has been set to null. This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.]>
    <Mar 7, 2011 10:17:45 AM CST> <Warning> <JTA> <BEA-110401> <Ignoring error in afterCompletion. Object=[email protected]6e18, Exception=Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete. The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
    Exception Description: Accessor or its connection has been set to null. This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.]
    Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete. The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
    Exception Description: Accessor or its connection has been set to null. This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.]
         at org.eclipse.persistence.exceptions.TransactionException.inactiveUnitOfWork(TransactionException.java:118)
         at org.eclipse.persistence.transaction.AbstractSynchronizationListener.afterCompletion(AbstractSynchronizationListener.java:203)
         at org.eclipse.persistence.transaction.JTASynchronizationListener.afterCompletion(JTASynchronizationListener.java:79)
         at weblogic.transaction.internal.ServerSCInfo.doAfterCompletion(ServerSCInfo.java:1048)
         at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(ServerSCInfo.java:1023)
         Truncated. see log file for complete stacktrace
    >
    weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=[email protected]6e18
    Exception Description: Identity map constructor failed because an invalid identity map was specified.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: Exception [EclipseLink-80000] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): oracle.eclipselink.coherence.exceptions.IntegrationException
    Exception Description: Unable to connect to Coherence Cache by name: Dept.
    Internal Exception: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
    Descriptor: RelationalDescriptor(test.gridlink.Dept --> [DatabaseTable(DEPT)])
         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.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:300)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:294)
         at test.gridlink.servlet.Test.process(Test.java:89)
         at test.gridlink.servlet.Test.doGet(Test.java:52)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
         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.execute(ServletStubImpl.java:184)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
         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:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): 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: Exception [EclipseLink-80000] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): oracle.eclipselink.coherence.exceptions.IntegrationException
    Exception Description: Unable to connect to Coherence Cache by name: Dept.
    Internal Exception: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
    Descriptor: RelationalDescriptor(test.gridlink.Dept --> [DatabaseTable(DEPT)])
         at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:822)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:362)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:327)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:902)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:160)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
         at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:412)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:284)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1601)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:340)
         at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
         at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
         at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1239)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1214)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:116)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1316)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2132)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:272)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:239)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:299)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:293)
         at test.gridlink.servlet.Test.process(Test.java:89)
         at test.gridlink.servlet.Test.doGet(Test.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         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.execute(ServletStubImpl.java:183)
         ... 9 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:350)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:357)
         ... 36 more
    Caused by: Exception [EclipseLink-80000] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): oracle.eclipselink.coherence.exceptions.IntegrationException
    Exception Description: Unable to connect to Coherence Cache by name: Dept.
    Internal Exception: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
         at oracle.eclipselink.coherence.exceptions.IntegrationException.unableToFindCoherenceCache(IntegrationException.java:76)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:84)
         ... 42 more
    Caused by: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:419)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getSingletonFactory(DefaultCacheFactoryBuilder.java:113)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getFactory(DefaultCacheFactoryBuilder.java:173)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getConfigurableCacheFactory(DefaultCacheFactoryBuilder.java:149)
         at oracle.eclipselink.coherence.integrated.internal.cache.Coherence35Adaptor.getNamedCache(Coherence35Adaptor.java:34)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:240)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
         ... 42 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 com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:662)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:381)
         ... 48 more
    Caused by: (Wrapped: Failed to load cache configuration: coherence-cache-config.xml) java.io.IOException: The cache configuration is missing: "coherence-cache-config.xml", loader=null
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.tangosol.run.xml.XmlHelper.loadResourceInternal(XmlHelper.java:330)
         at com.tangosol.run.xml.XmlHelper.loadFileOrResource(XmlHelper.java:281)
         at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:396)
         at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:382)
         at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfigurableCacheFactory.java:148)
         ... 54 more
    Caused by: java.io.IOException: The cache configuration is missing: "coherence-cache-config.xml", loader=null
         at com.tangosol.run.xml.XmlHelper.loadResourceInternal(XmlHelper.java:316)
         at com.tangosol.run.xml.XmlHelper.loadFileOrResource(XmlHelper.java:281)
         at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:396)
         at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:382)
         at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfigurableCacheFactory.java:148)
         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 com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:662)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:381)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getSingletonFactory(DefaultCacheFactoryBuilder.java:113)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getFactory(DefaultCacheFactoryBuilder.java:173)
         at com.tangosol.net.DefaultCacheFactoryBuilder.getConfigurableCacheFactory(DefaultCacheFactoryBuilder.java:149)
         at oracle.eclipselink.coherence.integrated.internal.cache.Coherence35Adaptor.getNamedCache(Coherence35Adaptor.java:34)
         at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:240)
         at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
         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:350)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:357)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:327)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:902)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:160)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
         at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:412)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:285)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1601)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:342)
         at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
         at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:69)
         at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1239)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1214)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:116)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1318)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2136)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:272)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:240)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:300)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:294)
         at test.gridlink.servlet.Test.process(Test.java:89)
         at test.gridlink.servlet.Test.doGet(Test.java:52)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
         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.execute(ServletStubImpl.java:184)
         ... 9 more
    #### Finding dept
    2011-03-07 10:17:45.783/50.868 Oracle Coherence GE 3.6.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded cache configuration from "file:/C:/Oracle/Middleware_1034/user_projects/domains/base_domain/servers/ManagedServer01/tmp/_WL_user/TopLinkGridApp/6df6x4/APP-INF/classes/coherence-cache-config.xml"
    2011-03-07 10:17:46.746/51.831 Oracle Coherence GE 3.6.0.0 <D4> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): TCMP bound to /10.222.60.143:8088 using SystemSocketProvider
    2011-03-07 10:17:48.288/53.373 Oracle Coherence GE 3.6.0.0 <Info> (thread=Cluster, member=n/a): Failed to satisfy the variance: allowed=16, actual=60
    2011-03-07 10:17:48.288/53.373 Oracle Coherence GE 3.6.0.0 <Info> (thread=Cluster, member=n/a): Increasing allowable variance to 21
    2011-03-07 10:17:49.355/54.440 Oracle Coherence GE 3.6.0.0 <Info> (thread=Cluster, member=n/a): This Member(Id=2, Timestamp=2011-03-07 10:17:49.299, Address=10.222.60.143:8088, MachineId=59535, Location=site:corp.oocl.com,machine:WONGST3-W7-TEST,process:2952, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=1) joined cluster "CoherenceClusterRock" with senior Member(Id=1, Timestamp=2011-03-07 09:53:59.431, Address=10.222.60.143:8098, MachineId=59535, Location=site:corp.oocl.com,machine:WONGST3-W7-TEST,process:1204,member:CacheServerRock01, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=1)
    2011-03-07 10:17:49.419/54.504 Oracle Coherence GE 3.6.0.0 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1
    2011-03-07 10:17:49.421/54.506 Oracle Coherence GE 3.6.0.0 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
    2011-03-07 10:17:49.421/54.506 Oracle Coherence GE 3.6.0.0 <D5> (thread=Cluster, member=n/a): Member 1 joined Service EclipseLinkJPAReadWrite with senior member 1
    2011-03-07 10:17:49.437/54.522 Oracle Coherence GE 3.6.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Started cluster Name=CoherenceClusterRock
    Group{Address=224.3.6.0, Port=36000, TTL=4}
    MasterMemberSet
    ThisMember=Member(Id=2, Timestamp=2011-03-07 10:17:49.299, Address=10.222.60.143:8088, MachineId=59535, Location=site:corp.oocl.com,machine:WONGST3-W7-TEST,process:2952, Role=WeblogicServer)
    OldestMember=Member(Id=1, Timestamp=2011-03-07 09:53:59.431, Address=10.222.60.143:8098, MachineId=59535, Location=site:corp.oocl.com,machine:WONGST3-W7-TEST,process:1204,member:CacheServerRock01, Role=CoherenceServer)
    ActualMemberSet=MemberSet(Size=2, BitSetCount=2
    Member(Id=1, Timestamp=2011-03-07 09:53:59.431, Address=10.222.60.143:8098, MachineId=59535, Location=site:corp.oocl.com,machine:WONGST3-W7-TEST,process:1204,member:CacheServerRock01, Role=CoherenceServer)
    Member(Id=2, Timestamp=2011-03-07 10:17:49.299, Address=10.222.60.143:8088, MachineId=59535, Location=site:corp.oocl.com,machine:WONGST3-W7-TEST,process:2952, Role=WeblogicServer)
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0, BitSetCount=0
    TcpRing{Connections=[1]}
    IpMonitor{AddressListSize=0}
    2011-03-07 10:17:49.578/54.664 Oracle Coherence GE 3.6.0.0 <D5> (thread=Invocation:Management, member=2): Service Management joined the cluster with senior service member 1
    2011-03-07 10:17:49.996/55.081 Oracle Coherence GE 3.6.0.0 <D5> (thread=DistributedCache:EclipseLinkJPAReadWrite, member=2): Service EclipseLinkJPAReadWrite joined the cluster with senior service member 1
    #### em: test.gridlink.Dept@bebae9
    #### em: TEST DEPT

    It seems Coherence is unable to load the config files using the application class loader. You could try placing the config files in a location that gives them the same visibility as your PersistenceUnit.

Maybe you are looking for

  • PS CS4 crashing when brushes changed - OSX Lion

    Have just installed Photoshop CS4 on a brand new MacBook Pro supplied with Lion. PS keep crashing when brushes changed in brush selectore with following error report. Have installed Java runtime and deleted preferences file without any resolution. An

  • Mail "this message has no content" for random Exchange messages

    Are other people still having this issue with Mavericks Mail?  I saw many old threads for previous OS X versions. I have a new MBP (supplied with Mavericks installed - now 10.9.2 Build 13C64) which connects to a local MS Exchange (Small Business Serv

  • Oracle BPM Admin Center Configuration

    Hi All, I am trying to configure the Oracle BPM Admin Center but i am getting the following error.plz can any one reply if you have any idea..... Configuring Oracle BPM..... Could not create Schema. fuego Detail Cause :An error occured while executin

  • Neither Reader nor Flash Player will download on my mac

    Every time I try to start up the installation on my computer they always stop at a certain percent--so far it's been 40%, 44%, and 25% I can leave my computer for hours and it still won't move. I've gone through all the troubleshooting already, and I

  • Samsung ST1000 GeoTag not working

    iphoto 11 is depicting the pictures I upload from my Samsung ST1000 in the wrong location. The actual geotag on the pic is correct. I've verified that in two different ways. I then upload a pic from my LG Rumor Touch Cell phone and the location is co