0

eclipselink を使用して JPA アプリケーションを実装していますが、アプリを実行するたびに次の例外がスローされます

例外:

[EL Severe]: ejb: 2013-06-24 14:11:05.079--ServerSession(1867873711)--java.lang.UnsupportedOperationException

Persistent.xml

<property name="javax.persistence.jdbc.password" value="test"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/test"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.logging.level" value="INFO"/>

繋がり:

public void init(ServletConfig config) throws ServletException {
Connection connection = null;
    System.out.println("calling intizlaing method");
    try {
        System.out.println("starat intizlaing context");
        InitialContext ctx = new InitialContext();
        System.out.println("done context");
        ds = (DataSource) ctx.lookup("java:comp/env/jdbc/DefaultDB");
        System.out.println("start intialising ds");
        connection = ds.getConnection();

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, ds);
        String databaseProductName = connection.getMetaData()
        .getDatabaseProductName();
        if (databaseProductName.equals("HDB")) {
            properties.put("eclipselink.target-database",
                    "com.sap.persistence.platform.database.HDBPlatform");
        }
        emf = Persistence.createEntityManagerFactory(
                "db", properties);

        System.out.println("got EntityManagerFactory");
        em = emf.createEntityManager();
        System.out.println("calling intizlaing finisged method");
    } catch (NamingException e) {
        System.out.println(e.toString());
        throw new ServletException(e);
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        System.out.println(e.toString());
    }
4

0 に答える 0