3 Replies Latest reply on Feb 27, 2009 1:17 PM by obrienmi8

    NETBeans Diployment

    53880
      Dear all Experts

      I am new to netbeans IDE 6.5 and want to try this with simple destop application development. For that i make one jdbc connection Eg. scott. All the table are displaying , i select EMP table and made one IDE form. Smothly all the columns are displaying perfectly, i select some of them.
      Now time to run this form. When i run this form it takes long time and after that it give error.
      -----------------------------------------
      {color:#ff0000}init:
      deps-jar:
      Created dir: D:\Anwer\JAVA\Practice\DesktopApplication1\build\classes
      Compiling 4 source files to D:\Anwer\JAVA\Practice\DesktopApplication1\build\classes
      Copying 23 files to D:\Anwer\JAVA\Practice\DesktopApplication1\build\classes
      compile:
      run:
      [TopLink Info]: 2009.02.26 11:33:15.909--ServerSession(19475750)--TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
      Feb 26, 2009 11:36:01 AM org.jdesktop.application.Application$1 run
      SEVERE: Application class desktopapplication1.DesktopApplication1 failed to launch
      Local Exception Stack:
      Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
      Error Code: 17002
      at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
      at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)
      at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
      at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
      at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)
      at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
      at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
      at desktopapplication1.DesktopApplication1View.initComponents(DesktopApplication1View.java:295)
      at desktopapplication1.DesktopApplication1View.<init>(DesktopApplication1View.java:36)
      at desktopapplication1.DesktopApplication1.startup(DesktopApplication1.java:19)
      at org.jdesktop.application.Application$1.run(Application.java:171)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)
      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
      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:100)
      ... 19 more
      Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class desktopapplication1.DesktopApplication1 failed to launch
      at org.jdesktop.application.Application$1.run(Application.java:177)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
      Error Code: 17002
      at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
      at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)
      at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
      at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
      at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)
      at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
      at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
      at desktopapplication1.DesktopApplication1View.initComponents(DesktopApplication1View.java:295)
      at desktopapplication1.DesktopApplication1View.<init>(DesktopApplication1View.java:36)
      at desktopapplication1.DesktopApplication1.startup(DesktopApplication1.java:19)
      at org.jdesktop.application.Application$1.run(Application.java:171)
      ... 7 more
      Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)
      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
      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:100)
      ... 19 more
      BUILD SUCCESSFUL (total time: 3 minutes 8 seconds)

      {color}{color:#000000}------------------------------------------
      Now what to do .. i cant understand what it is asking and how to solve this, kindly give me any idea .. how to get rid of this problem .

      Regards

      Anwer Ali Rasool


      {color}

        • 1. Re: NETBeans Diployment
          obrienmi8
          Anwer,
          Hi, the exception "The Network Adapter could not establish the connection" most likely means one of the following is occuring...
          1) One of your jdbc url, user or password properties are wrong if you are using transaction-type RESOURCE_LOCAL
          2) Same as 1) above except your client cannot see the database because of a firewall issue (check your ide's proxy properties)
          3) If you are using transaction-type JTA - your datasource setup on the server or application managed datasource on the app is not setup properly or seeing the same issues as 1) and 2).

          To verify, turn logging up to finest or all and verify the ip, user, password and sid of your jdbc connection.

          Here is an extract of an example RESOURCE_LOCAL persistence.xml setup used for an SE JPA app.

          {color:#008000}<?xml version="1.0" encoding="UTF-8"?>
          <persistence version="1.0" 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 {color}[{color:#008000}http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd{color}|http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd]{color:#008000}">
          <persistence-unit name="dao.create.tables.oracle" transaction-type="RESOURCE_LOCAL">
          <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
          <class>org.eclipse.persistence.example.jpa.server.business.Cell</class>
          <properties>
          <property name="eclipselink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
          <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
          <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl"/>
          <property name="eclipselink.jdbc.user" value="scott"/>
          <property name="eclipselink.jdbc.password" value="youknowit"/>
          <property name="eclipselink.logging.level" value="ALL"/>
          <!-- ddl generation is for demo purposes outside of the container only -->
          <!--property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
          <property name="eclipselink.ddl-generation.output-mode" value="database"/-->
          </properties>
          </persistence-unit>
          </persistence>
          {color}
          thank you
          /michael
          [http://www.eclipselink.org|http://www.eclipselink.org/]
          • 2. Re: NETBeans Diployment
            53880
            dear
            Michale

            First of all thankyou for your reply

            As you said i check my IDE proxy setting and it set on no proxy. I tries one chance to check with manual proxy by giving 127.0.0.1:8080 but it doesnt work .

            Now can you tell me where i can get setting to change . One more thing i cant understand while making form my database is connected and all the tables are displaying it shows that database is working properly and i also tried to connect with SQLPLUS , SQLDeveloper and other tools are working fine .. Even i tried Dot.Net and Jdeveloper these also working fine. I think there is some issue with TOPLINK and i dont know what to do next. will you plese guide me where i make these changes to run this example form . Posting of screenshort is not allowed on this forum otherwise i send you screen shorts, so you better understand my problem .


            regards

            Now i change my PERSISTENCE SETTING AND RECREATE IT
            now the only change i feel is error come as early as before
            now the error is




            init:
            deps-jar:
            compile:
            run:
            Feb 27, 2009 4:06:06 PM org.jdesktop.application.Application$1 run
            SEVERE: Application class desktopapplication1.DesktopApplication1 failed to launch
            javax.persistence.PersistenceException: No Persistence provider for EntityManager named {color:#ff0000}jdbc:oracle:thin:@arwen-ems-anwer:1521:ORCLPU{color}: The following providers:
            oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
            oracle.toplink.essentials.PersistenceProvider
            Returned null to createEntityManagerFactory.


            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
            at desktopapplication1.DesktopApplication1View.initComponents(DesktopApplication1View.java:295)
            at desktopapplication1.DesktopApplication1View.<init>(DesktopApplication1View.java:36)
            at desktopapplication1.DesktopApplication1.startup(DesktopApplication1.java:19)
            at org.jdesktop.application.Application$1.run(Application.java:171)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
            Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class desktopapplication1.DesktopApplication1 failed to launch
            at org.jdesktop.application.Application$1.run(Application.java:177)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
            Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named {color:#ff0000}jdbc:oracle:thin:@arwen-ems-anwer:1521:ORCLPU{color}: The following providers:
            oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
            oracle.toplink.essentials.PersistenceProvider
            Returned null to createEntityManagerFactory.


            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
            at desktopapplication1.DesktopApplication1View.initComponents(DesktopApplication1View.java:295)
            at desktopapplication1.DesktopApplication1View.<init>(DesktopApplication1View.java:36)
            at desktopapplication1.DesktopApplication1.startup(DesktopApplication1.java:19)
            at org.jdesktop.application.Application$1.run(Application.java:171)
            ... 7 more
            BUILD SUCCESSFUL (total time: 2 seconds)




            Anwer

            Edited by: annu-agi on Feb 27, 2009 3:03 AM
            • 3. Re: NETBeans Diployment
              obrienmi8
              Annu-agi,
              Hi, it looks like you modified your persistence.xml. The following error looks like your db URL is in place of the persistence unit provider name - that will not work.

              "No Persistence provider for EntityManager named *jdbc:oracle:thin:@arwen-ems-anwer:1521:ORCLPU*: The following providers:
              oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider"

              The stuff in bold above is your db URL if should only be in your "*eclipselink.jdbc.url*" if you are running transaction-type RESOURCE_LOCAL, It looks like your app is finding the default Essentials provider - you can replace all "eclipselink" with "toplink" attribute names if you are not running EclipseLink. For an example of how to specify the persistence-unit name attribute and the provider element - refer to the following example, especially if you are running a container managed persistence unit (verify your target-server as well).

              http://wiki.eclipse.org/EclipseLink/Examples/JPA/GlassFishV2_Web_Tutorial#Persistence.xml

              Please refer to the following tutorials on setting up your persistence.xml file
              http://wiki.eclipse.org/EclipseLink/Examples/JPA/GlassFishV2_Web_Tutorial
              https://glassfish.dev.java.net/javaee5/persistence/entity-persistence-support.html

              You will need to modify (or add) the following provider to your persistence.xml - as in my previous post.
              EclipseLink:

              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

              Q) Can you post your persistence.xml if this does not work - so we can have a look at it, there are no problems with your proxy, it looks like your persistence.xml may be invalid.

              thank you
              /michael
              http://www.eclipselink.org

              Edited by: michael_obrien on Feb 27, 2009 7:10 AM

              Edited by: michael_obrien on Feb 27, 2009 7:16 AM

              Edited by: michael_obrien on Feb 27, 2009 7:17 AM