Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Hello and question about Connector

Hello! EclipseLink commiters

Some guys already know me, but I'd like to introduce me first.
I am Wonseok working at TmaxSoft (South Korea) and also a committer of TopLink Essentials.
Finally I got time to look into EclipseLink code and I would like to participate and contribute to EclipseLink project. Also our AS product(JEUS) which now includes TLE has plan to incorporate/support EclipseLink as a default provider. I'm happy to see this project is already mature (documentation also).

Apparently I will have numerous questions about code or anything. So please, please shed light on me even I ask silly questions. :-)

Okay, here my first question goes.
While I'm setting up my test environment (transition from TLE), I got the following NPE and this is definitely my mistake of not setting eclipselink.jdbc.driver correctly - it was toplink.jdbc.driver :-)

Exception in thread "main" java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:154)
    at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:91)
    at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:164)
    at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:578)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:214)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:234)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:69)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:118)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:112)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:100)

This is misleading error(I met this error several time before). Looking into Connector code, I don't understand two things.
First, why is JDBC-ODBC bridge driver used when there is no driver setting? I don't believe this is useful default. IMO just throwing proper error is more helpful.

In addition, why is a dummy DefaultConnector(with default ODBC driver setting) set to DatasourceLogin at predeployment time? It doen't seem being used at all. Then the DefaultConnector is updated with real properties with EntityManagerSetupImpl#updateLogins and updateLoginDefaultConnector() at deployment. Isn't it clear and better to create and set DefaultConnector at deployment if JDBC properties are used while checking them(error could be thrown at this time)? I had no problem when I modified code like this. Is this right way?

P.S. I really appreciate your commitment and efforts toward open source! It's a really win-win to everyone.

Best Regards
-Wonseok

Back to the top