facebook

Oracle DB Server not configurable in Java E Dev Perspective

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #273736 Reply

    emoc
    Member

    I am using MyEclipse Enterprise Workbench Version: 5.5.1 GA Build id: 20070521-5.5.1-GA.

    I have done the JPA Tutorial’s Sample JPA Project using the Derby built in DB and now want to do something similiar with an Oracle DB. My remote Oracle DB is connected in the Java Persistent perspective (Thin Driver & ojdbc14.jar) and when a select SQL query is run in the SQL Editor it returns the expected results. But the (generated) Java code produces the following error.

    SEVERE: save failed
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Io exception:
    Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    Error Code: 17002

    The tutorial describes this error as occuring when the DB Server is not running. However I cannot configure an Oracle DB Server. The method I use is:
    1 from Java Enterprise Development Perspecrtive
    2 Configure
    3 Home Directory = C:\ora92\bin, Port = 1521
    4 <apply> <ok>

    No Oracle server appears in the Servers window. Can you tell me what is supposed to happen? Thanks in advance, Eileen.

    #273766 Reply

    Scott Anderson
    Participant

    Eileen,

    I think I see what’s going on here and it’s nothing more than a bit of confusion. Since MyEclipse ships the Derby database instance you used for testing, we also allow you to start and stop it using the Servers View, as you’ve noted. However, the Derby instance we ship is unique in this regard. For other database servers our connectors only allow you to connect to a running instance of the database, either on your machine or externally. So there is not a mechanism in MyEclipse to control database servers other than Derby, only connect to them. It’s a bit of a different model than with the embedded server.

    So, to resolve your issue you simply need to go outside of MyEclipse and use Oracle’s tools to start your Oracle database instance. Once it’s started you should be able to connect to it properly.

    #273799 Reply

    emoc
    Member

    Hello Scott,

    thanks for your suggestion. I have checked the Oracle DB connection and it behaves as expected, and the SQL select statement run inside MyEclipse’s Java Persistent perspective also runs ok and returns the expected data set. However when running the Java classes generated by the MyEclipse Persistence Tools it fails in the EntityManagerHelper.java class provided by the MyEclipse Tutorial, when doing the line emf.createEntityManager();

    public static EntityManager getEntityManager() {
    EntityManager manager = threadLocal.get();
    if (manager == null || !manager.isOpen()) {
    manager = emf.createEntityManager();
    threadLocal.set(manager);
    }
    return manager;
    }

    The stack trace is attached below.

    13/08/2007 10:05:54 com.myeclipseide.jpa.EntityManagerHelper log
    INFO: finding Tafusr instance with usr: EOCALL
    [TopLink Info]: 2007.08.13 10:06:42.530–ServerSession(20910958)–TopLink, version: Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    Error Code: 17002
    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.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
    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 com.myeclipseide.jpa.EntityManagerHelper.getEntityManager(EntityManagerHelper.java:29)
    at com.myeclipseide.jpa.TafUsrDAO.getEntityManager(TafUsrDAO.java:18)
    at com.myeclipseide.jpa.TafUsrDAO.findById(TafUsrDAO.java:59)
    at com.myeclipseide.jpa.TafUserClient.main(TafUserClient.java:50)
    Caused by: java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:85)
    … 12 more
    [TopLink Info]: 2007.08.13 10:06:55.218–ServerSession(20910958)–TopLink, version: Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))
    13/08/2007 10:07:07 com.myeclipseide.jpa.EntityManagerHelper log
    SEVERE: find failed

    Can you help me find why this happens? Thanks again, Eileen.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Oracle DB Server not configurable in Java E Dev Perspective

You must be logged in to post in the forum log in