4 Replies Latest reply on Mar 10, 2011 3:05 PM by Steve Friesen

    oracle connectivity problems

    Steve Friesen Newbie
      Hi. I am new to Seam and am having trouble connecting to an Oracle database. I am using Seam 2.2.1.Final on JBoss 6.0.0.Final.

      I am going through the Seam tutorial. I ran "seam setup", "seam new-project" and "seam generate-entities". Here are some of the results for "seam setup":

      settings:
           [echo] JBoss AS home: C:/jboss/jboss-6.0.0.Final
           [echo] GlassFish home: C:/Program Files/glassfish-v2.1
           [echo] Project name: helloworld
           [echo] Project location: C:/Develop/seam/helloworld
           [echo] Project type: ear
           [echo] IceFaces: y
           [echo] Action package: com.famoussoftware.helloworld
           [echo] Model package: com.famoussoftware.helloworld
           [echo] Test package: com.famoussoftware.helloworld.test
           [echo] JDBC driver class: oracle.jdbc.driver.OracleDriver
           [echo] JDBC DataSource class: oracle.jdbc.pool.OracleDataSource
           [echo] Hibernate dialect: org.hibernate.dialect.OracleDialect
           [echo] JDBC URL: jdbc:oracle:thin@dogbert:1521:famous
           [echo] Database username: [removed]
           [echo] Database password: [removed]
           [echo]
           [echo] Type 'seam create-project' to create the new project

      BUILD SUCCESSFUL
      Total time: 2 minutes 40 seconds

      When I ran "seam generate-entities" I got the following:

      generate-model:
           [echo] Reverse engineering database using JDBC driver C:\Develop\lib\ojdbc14.jar
           [echo] project=C:/Develop/seam/helloworld
           [echo] model=com.famoussoftware.helloworld
      [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
      [hibernate] log4j:WARN Please initialize the log4j system properly.
      [hibernate] An exception occurred while running exporter #2:hbm2java (Generates a set of .java files)
      [hibernate] To get the full stack trace run ant with -verbose
      [hibernate] org.hibernate.exception.GenericJDBCException: Getting database metadata
      [hibernate] java.sql.SQLException: Invalid Oracle URL specified

      BUILD FAILED
      C:\jboss\jboss-seam-2.2.1.Final\seam-gen\build.xml:1563: org.hibernate.exception.GenericJDBCException: Getting database metadata

      I have an existing Oracle schema and I can connect to it through SqlPlus, so I know the username, password, host, and sid. I have tried re-running seam setup with a few different jdbc urls, but without luck. I have the ojdbc14.jar driver in the directory specified above.

      Does anybody have any suggestions?

      Thanks,

      Steve
        • 1. Re: oracle connectivity problems
          xsa lefter Newbie

          jdbc:oracle:thin@dogbert:1521:famous

          AFAIK, you need to write:
          jdbc:oracle:thin:@dogbert:1521:famous


          You miss : in your config.

          • 2. Re: oracle connectivity problems
            Steve Friesen Newbie

            That worked, thanks. I actually tried to make that change, but I made it manually in the seam-gen.properties file to the hibernate.connection.url property. Obviously that didn't work. Re-running the seam setup with that change worked.


            Do you know if it is possible to make the changes manually to one or more files? Or do I always need to re-run the seam setup?


            Thanks again.

            • 3. Re: oracle connectivity problems
              xsa lefter Newbie

              AFAIK seam-gen.properties file is just backup file for every seam-gen based project. The real configuration file for seam-gen located at:


              <your-seam-directory>/seam-gen/build.properties



              seam-gen.properties is intent to ease you to replace current seam-gen build.properties from one project to another project. For example, if you have:



              • my-first-project with it seam-gen.properties

              • my-second-project with its seam-gen properties



              If you need to change behavior of my-first-project then you need to copy and rename seam-gen.properties file in my-first-project directory to


              <your-seam-directory>/seam-gen/build.properties



              and then edit its configuration value.


              Same step are applicable for my-second-project, and you don't need to run seam setup anymore.