Topic
1 reply Latest Post - ‏2011-10-05T16:19:05Z by leealber
logzyy
logzyy
6 Posts
ACCEPTED ANSWER

Pinned topic Exception loading eclipselink jpa application on websphere 7

‏2011-10-05T15:43:25Z |
Hi all,

I have a working restful application working on glassfish. i have successfully
deployed the application on websphere 7 and i have done some configuration necessary
but i am getting some exception that i can't just figure out.

Here is my persistence.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="BACPOnlineAPPPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/infopool</jta-data-source>
<properties/>
</persistence-unit>
</persistence>

And below is my persistenceService utility class
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.tavia.service;

import java.util.Hashtable;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.transaction.UserTransaction;

/**
* Utility class for dealing with persistence.
*
* @author folahan
*/
public class PersistenceService {

private static String DEFAULT_PU = "BACPOnlineAPPPU";
private static ThreadLocal<PersistenceService> instance = new ThreadLocal<PersistenceService>() {

@Override
protected PersistenceService initialValue() {
return new PersistenceService();
}
};
private EntityManager em;
private UserTransaction utx;

private PersistenceService() {
try {
this.em = (EntityManager) new InitialContext().lookup("java:comp/env/persistence/"+DEFAULT_PU);
this.utx = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
} catch (NamingException ex) {
throw new RuntimeException(ex);
}
}

/**
* Returns an instance of PersistenceService.
*
* @return an instance of PersistenceService
*/
public static PersistenceService getInstance() {
return instance.get();
}

private static void removeInstance() {
instance.remove();
}

/**
* Returns an instance of EntityManager.
*
* @return an instance of EntityManager
*/
public EntityManager getEntityManager() {
return em;
}

/**
* Begins a resource transaction.
*/
public void beginTx() {
try {
utx.begin();
em.joinTransaction();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}

/**
* Commits a resource transaction.
*/
public void commitTx() {
try {
utx.commit();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}

/**
* Rolls back a resource transaction.
*/
public void rollbackTx() {
try {
utx.rollback();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}

/**
* Closes this instance.
*/
public void close() {
removeInstance();
}
}
I have attached my error log
from system.out.

I am so lost. Can anyone please help me out?
Updated on 2011-10-05T16:19:05Z at 2011-10-05T16:19:05Z by leealber
  • leealber
    leealber
    19 Posts
    ACCEPTED ANSWER

    Re: Exception loading eclipselink jpa application on websphere 7

    ‏2011-10-05T16:19:05Z  in response to logzyy
    From the last set of server start long in SystemOut.log, just before the first RollbackException, you will find

    10/5/11 16:34:02:814 WAT 0000001a FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_55b655b6_11.10.05_16.34.02.8145495808074799172901.txt com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getInt 1451

    Take a look at this FFDC log, it should give you more details on the full stack to look for the root cause.

    Albert Lee.