Hibernate VERSION 2.1
TOMCAT 5.0.24
Sybase 12
I am trying to run the HIBERNATE EXAMPLE in
http://www.hibernate.org/hib_docs/refer ... rt-mappingPlease let me know if you have come across this error and what you did to solve it??
Thanks!!!
I think I have set everything up correctly. I tried running and got the following error:
java.lang.AbstractMethodError
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:75)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at net.sf.hibernate.examples.quickstart.HibernateUtil.<clinit>(HibernateUtil.java:27)
at net.sf.hibernate.examples.quickstart.HibernateCatServlet.doGet(HibernateCatServlet.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:479)
Code:
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory
[b] sessionFactory = new Configuration().configure().buildSessionFactory();[/b] } catch (HibernateException ex) {
throw new RuntimeException("Configuration problem: " + ex.getMessage());
}
}
public static final ThreadLocal session = new ThreadLocal();
public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}
public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
DEBUG LOG:
IN DO GET
BEFORE GET SESSION
10:18:53,804 INFO Environment:462 - Hibernate 2.1.3
10:18:53,824 INFO Environment:491 - hibernate.properties not found
10:18:53,844 INFO Environment:519 - using CGLIB reflection optimizer
10:18:53,854 INFO Environment:530 - JVM does not support Statement.getGenerated
Keys()
10:18:53,854 INFO Environment:541 - JVM does not support LinkedHasMap, LinkedHa
shSet - ordered maps and sets disabled
10:18:53,854 INFO Environment:544 - using workaround for JVM bug in java.sql.Ti
mestamp
10:18:53,894 INFO Configuration:872 - configuring from resource: /hibernate.cfg
.xml
10:18:53,894 INFO Configuration:844 - Configuration resource: /hibernate.cfg.xm
l
10:18:54,274 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sour
ceforge.net/hibernate-configuration-2.0.dtd in classpath under net/sf/hibernate/
10:18:54,375 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net
/hibernate-configuration-2.0.dtd in classpath
10:18:54,555 DEBUG Configuration:830 - connection.datasource=java:comp/env/jdbc/
quickstart
10:18:54,555 DEBUG Configuration:830 - show_sql=false
10:18:54,555 DEBUG Configuration:830 - dialect=net.sf.hibernate.dialect.SybaseDi
alect
10:18:54,565 DEBUG Configuration:989 - null<-org.dom4j.tree.DefaultAttribute@3b4
94b [Attribute: name resource value "Cat.hbm.xml"]
10:18:54,575 INFO Configuration:328 - Mapping resource: Cat.hbm.xml
10:18:54,595 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sour
ceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
10:18:54,605 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net
/hibernate-mapping-2.0.dtd in classpath
10:18:55,146 INFO Binder:229 - Mapping class: net.sf.hibernate.examples.quickst
art.Cat -> CAT
10:18:55,596 DEBUG Binder:475 - Mapped property: id -> CAT_ID, type: string
10:18:55,716 DEBUG Binder:475 - Mapped property: name -> NAME, type: string
10:18:55,716 DEBUG Binder:475 - Mapped property: sex -> sex, type: character
10:18:55,726 DEBUG Binder:475 - Mapped property: weight -> weight, type: float
10:18:55,736 INFO Configuration:1030 - Configured SessionFactory: null
10:18:55,746 DEBUG Configuration:1031 - properties: {java.runtime.name=Java(TM)
2 Runtime Environment, Standard Edition, sun.boot.library.path=T:\LegalApps\JDK\
1.3.1_06\jre\bin, java.vm.version=1.3.1_06-b01, shared.loader=${catalina.base}/s
hared/classes,${catalina.base}/shared/lib/*.jar, connection.datasource=java:comp
/env/jdbc/quickstart, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http
://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, fil
e.encoding.pkg=sun.io, java.vm.specification.name=Java Virtual Machine Specifica
tion, user.dir=C:\jakarta\jakarta-tomcat-5.0.24\bin, java.runtime.version=1.3.1_
06-b01, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dir
s=C:\jakarta\jakarta-tomcat-5.0.24\common\endorsed, os.arch=x86, java.io.tmpdir=
C:\jakarta\jakarta-tomcat-5.0.24\temp, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., java.awt.fonts=, java.nami
ng.factory.url.pkgs=org.apache.naming, os.name=Windows XP, log4j.configuration=f
ile:C:/jakarta/jakarta-tomcat-5.0.24/webapps/quickstart/WEB-INF/lib/log4j.proper
ties, hibernate.connection.datasource=java:comp/env/jdbc/quickstart, java.librar
y.path=T:\LegalApps\JDK\1.3.1_06\bin;.;C:\WINDOWS\System32;C:\WINDOWS;c:\Progra~
1\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program F
iles\Support Tools\;c:\Program Files\Perl\bin;c:\WINDOWS\System32\;c:\WINDOWS\;c
:\Program Files\Support Tools;i:\jre\1.3.1_06\bin;C:\Progra~1\Perl\bin;c:\Progra
m Files\sybase\OCS-12_0\dll\;c:\Program Files\sybase\OCS-12_0\bin;c:\Program Fil
es\sybase\asep;c:\Program Files\sybase\sqlremote\dll;I:\rv\bin;I:\JMSforETXandRV
\5.1.1\NT40_JDK1.3.0\bin;I:\JMSforETXandRV\5.1.1\NT40_JDK1.3.0\lib;c:\Program Fi
les\Microsoft Visual Studio\Common\Tools\WinNT;c:\Program Files\Microsoft Visual
Studio\Common\MSDev98\Bin;c:\Program Files\Microsoft Visual Studio\Common\Tools
;c:\Program Files\Microsoft Visual Studio\VC98\bin;T:\LegalApps\jakarta\apache-a
nt-1.5.2\bin, java.specification.name=Java Platform API Specification, java.clas
s.version=47.0, os.version=5.1, user.home=C:\Documents and Settings\sanchk, user
.timezone=America/New_York, catalina.useNaming=true, java.awt.printerjob=sun.awt
.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.3, show
_sql=false, catalina.home=C:\jakarta\jakarta-tomcat-5.0.24, user.name=sanchk, ja
va.class.path=T:\LegalApps\JDK\1.3.1_06\lib\tools.jar;C:\jakarta\jakarta-tomcat-
5.0.24\bin\bootstrap.jar, hibernate.show_sql=false, java.naming.factory.initial=
org.apache.naming.java.javaURLContextFactory, package.definition=sun.,java.,org.
apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., java.
vm.specification.version=1.0, java.home=T:\LegalApps\JDK\1.3.1_06\jre, hibernate
.dialect=net.sf.hibernate.dialect.SybaseDialect, user.language=en, java.specific
ation.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibern
ate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1
.3.1_06, java.ext.dirs=T:\LegalApps\JDK\1.3.1_06\jre\lib\ext, sun.boot.class.pat
h=T:\LegalApps\JDK\1.3.1_06\jre\lib\rt.jar;T:\LegalApps\JDK\1.3.1_06\jre\lib\i18
n.jar;T:\LegalApps\JDK\1.3.1_06\jre\lib\sunrsasign.jar;T:\LegalApps\JDK\1.3.1_06
\jre\classes, server.loader=${catalina.home}/server/classes,${catalina.home}/ser
ver/lib/*.jar, java.vendor=Sun Microsystems Inc., catalina.base=C:\jakarta\jakar
ta-tomcat-5.0.24, file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-
bin/bugreport.cgi, common.loader=${catalina.home}/common/classes,${catalina.home
}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, sun.io.unicode.encodi
ng=UnicodeLittle, sun.cpu.endian=little, package.access=sun.,org.apache.catalina
.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., user.regi
on=US, dialect=net.sf.hibernate.dialect.SybaseDialect, sun.cpu.isalist=pentium i
486 i386}
10:18:55,807 INFO Configuration:613 - processing one-to-many association mappin
gs
10:18:55,817 INFO Configuration:622 - processing one-to-one association propert
y references
10:18:55,817 INFO Configuration:647 - processing foreign key constraints
10:18:55,957 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.SybaseDi
alect
10:18:55,967 INFO SettingsFactory:62 - Use outer join fetching: true
10:18:56,007 INFO NamingHelper:26 - JNDI InitialContext properties:{}
10:18:56,097 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp
/env/jdbc/quickstart
10:18:56,317 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLoo
kup configured (in JTA environment, use of process level read-write cache is not
recommended)
[url][/url]