Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5015

Deploy entity beans in Oracle 11g on JBoss 4.2.1 and JBoss 4.2.1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Deferred
    • Affects Version/s: JBossAS-4.2.1.GA, JBossAS-4.2.2.GA
    • Fix Version/s: JBossAS-4.2.3.GA
    • Component/s: JPA / Hibernate
    • Labels:
      None
    • Environment:

      JAva 1.5
      JBoss 4.2.1 and JBoss4.2.2

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      explicitly specify the appropriate 'hibernate.dialect' config setting (what setting is TBD, but use o.h.dialect.Oracle10gDialect for the time being)

      Show
      explicitly specify the appropriate 'hibernate.dialect' config setting (what setting is TBD, but use o.h.dialect.Oracle10gDialect for the time being)
    • Estimated Difficulty:
      Low

      Description

      It is not possible to deploy entity beans to an Oracle 11g Datasource because the HibernateException :
      unknown Oracle major version [11] occurs

      If I check in the hibernate 3.2.4sp1 distribution the class org.hibernate.dialect.DialectFactory there I find the following definition which is correct (in my eyes)

      private static final Map MAPPERS = new HashMap();
      static {
      // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
      MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
      MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
      MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
      MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
      MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
      MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
      MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
      MAPPERS.put( "Informix Dynamic Server", new VersionInsensitiveMapper( "org.hibernate.dialect.InformixDialect" ) );
      MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );

      MAPPERS.put(
      "Oracle",
      new DatabaseDialectMapper() {
      public String getDialectClass(int majorVersion)

      { return majorVersion > 8 ? "org.hibernate.dialect.Oracle9Dialect" : "org.hibernate.dialect.OracleDialect"; }

      }
      );
      }

      The JBoss 4.2.2 distribution shows during startup the usage of hibernate 3.2.4sp1 (also according the Manifest file in the jar) but when I decompile the class org.hibernate.dialect.DialectFactory in the JBoss distribution it shows the old implementation:

      static
      {
      MAPPERS = new HashMap();
      MAPPERS.put("HSQL Database Engine", new VersionInsensitiveMapper("org.hibernate.dialect.HSQLDialect"));
      MAPPERS.put("DB2/NT", new VersionInsensitiveMapper("org.hibernate.dialect.DB2Dialect"));
      MAPPERS.put("DB2/LINUX", new VersionInsensitiveMapper("org.hibernate.dialect.DB2Dialect"));
      MAPPERS.put("MySQL", new VersionInsensitiveMapper("org.hibernate.dialect.MySQLDialect"));
      MAPPERS.put("PostgreSQL", new VersionInsensitiveMapper("org.hibernate.dialect.PostgreSQLDialect"));
      MAPPERS.put("Microsoft SQL Server Database", new VersionInsensitiveMapper("org.hibernate.dialect.SQLServerDialect"));
      MAPPERS.put("Microsoft SQL Server", new VersionInsensitiveMapper("org.hibernate.dialect.SQLServerDialect"));
      MAPPERS.put("Sybase SQL Server", new VersionInsensitiveMapper("org.hibernate.dialect.SybaseDialect"));
      MAPPERS.put("Adaptive Server Enterprise", new VersionInsensitiveMapper("org.hibernate.dialect.SybaseDialect"));
      MAPPERS.put("Informix Dynamic Server", new VersionInsensitiveMapper("org.hibernate.dialect.InformixDialect"));
      MAPPERS.put("Apache Derby", new VersionInsensitiveMapper("org.hibernate.dialect.DerbyDialect"));
      MAPPERS.put("Oracle", new DatabaseDialectMapper() {

      public String getDialectClass(int majorVersion)
      {
      switch(majorVersion)

      { case 8: // '\b' return (DialectFactory.class$org$hibernate$dialect$Oracle8iDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle8iDialect : (DialectFactory.class$org$hibernate$dialect$Oracle8iDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle8iDialect"))).getName(); case 9: // '\t' return (DialectFactory.class$org$hibernate$dialect$Oracle9iDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle9iDialect : (DialectFactory.class$org$hibernate$dialect$Oracle9iDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle9iDialect"))).getName(); case 10: // '\n' return (DialectFactory.class$org$hibernate$dialect$Oracle10gDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle10gDialect : (DialectFactory.class$org$hibernate$dialect$Oracle10gDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle10gDialect"))).getName(); }

      throw new HibernateException("unknown Oracle major version [" + majorVersion + "]");
      }

      });
      }

      Perhaps there is something wrong by integration the different components in JBoss during packaging.

      Replacing the hibernate3.jar in the JBoss distribution by the hibernate3.jar from the hibernate 3.2.4sp1 distribution solved the problem.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                sebersole Steve Ebersole
                Reporter:
                georges.goebel Georges Goebel
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: