I've been searching everywhere and cant seem to find a solution:
Using Windows XP, JTDS, SQL Server 2000, and Tomcat 4.1.27, Hibernate 2.0.3.
I have a servlet that i call during when i first start tomcat:
The follogin code is used to initiate Hibernate:
private static Properties goDatabaseProperties = null;
private static SessionFactory goSessionFactory = null;
goDatabaseProperties = new Properties();
goDatabaseProperties.setProperty
( "hibernate.connection.datasource", "java:comp/env/jdbc/ReportMill" );
goDatabaseProperties.setProperty
( "hibernate.dialect", "net.sf.hibernate.dialect.SybaseDialect" );
goDatabaseProperties.setProperty( "hibernate.show_sql", "true" );
Configuration config = new Configuration();
config.addClass( com.database.UserAccounts.class);
config.addProperties( goDatabaseProperties );
goSessionFactory = config.buildSessionFactory();
Its seems to works b/c even in the sql profiler i see the validating query i
put in tomcat being executed:
But here is the output:
Sep 22, 2003 11:25:10 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.3
Sep 22, 2003 11:25:10 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Sep 22, 2003 11:25:10 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Sep 22, 2003 11:25:10 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: JVM proxy support: true
Sep 22, 2003 11:25:10 AM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: com/report_mill/database/UserAccounts.hbm.xml
Sep 22, 2003 11:25:11 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.report_mill.database.UserAccounts -> User_Accounts
Sep 22, 2003 11:25:11 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Sep 22, 2003 11:25:11 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Sep 22, 2003 11:25:11 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Sep 22, 2003 11:25:12 AM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.SybaseDialect
Sep 22, 2003 11:25:12 AM net.sf.hibernate.util.NamingHelper getInitialContext
INFO: JNDI InitialContext properties:{}
Sep 22, 2003 11:25:12 AM
net.sf.hibernate.connection.DatasourceConnectionProvider configure
INFO: Using datasource: java:comp/env/jdbc/ReportMill
Sep 22, 2003 11:25:12 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Use outer join fetching: true
DBCP borrowObject failed: java.sql.SQLException: Address already in use: connect
Error
org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Address already
in use: connect
I cant seem to find any solution for the "Address already in use" error. This
doesnt seem to be a tomcat port issue its more of a database issue.
Has anyone ever seen this problem and fixed it.
Code:
Code: