Details
-
Bug
-
Resolution: Won't Do
-
Critical
-
JBossAS-4.2.1.GA, JBossAS-4.2.2.GA
-
None
-
Low
-
Workaround Exists
-
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)
}
);
}
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)
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.