Joined: Wed Dec 13, 2006 4:32 pm Posts: 1
|
I am new to hibernate and i kind of got the application working with a local MS Access database but couldn't get it working with a remote MSSQL server. I have created a datasource with name EOL2 and with a JNDI name EOL2Datasource
I am working on Rational Application Developer (RAD) and tested the datasource's connection there and the connection is successful.
I am pasting the details of the hibernate.cfg.xml file below. Please help me getting thsi stuff to run. It will help a lot to my morale.
Hibernate version: hibernate 2
Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory name="java:hibernate/SessionFactory">
<property name="hibernate.connection.datasource">EOL2datasource</property>
<property name="hibernate.connection.username">A486768</property>
<property name="hibernate.connection.password">cl1en-var</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="show_sql">true</property>
<!--
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
-->
<mapping resource="Country.hbm.xml"/>
<mapping resource="StateProvince.hbm.xml"/>
<mapping resource="School.hbm.xml"/>
<mapping resource="Campus.hbm.xml"/>
<mapping resource="CampusMessage.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
[12/13/06 11:10:29:514 PST] 00000043 DSConfigurati I DSRA8205I: JDBC driver name : SQLServer
[12/13/06 11:10:29:529 PST] 00000043 DSConfigurati I DSRA8206I: JDBC driver version : 3.40.6 (012712.007203.008710)
[12/13/06 11:10:29:545 PST] 00000043 DSConfigurati I DSRA8025I: Successfully connected to DataSource.
[12/13/06 11:30:28:990 PST] 0000004a ServletWrappe A SRVE0242I: [/index.jsp]: Initialization successful.
[12/13/06 11:30:29:490 PST] 0000004a TilesRequestP I Tiles definition factory found for request processor ''.
[12/13/06 11:30:29:615 PST] 0000004a ServletWrappe A SRVE0242I: [/entCounsTileLayout.jsp]: Initialization successful.
[12/13/06 11:30:29:834 PST] 0000004a ServletWrappe A SRVE0242I: [/entCslHeader.jsp]: Initialization successful.
[12/13/06 11:30:29:928 PST] 0000004a ServletWrappe A SRVE0242I: [/beginEntranceBody.jsp]: Initialization successful.
[12/13/06 11:30:30:334 PST] 0000004a ServletWrappe A SRVE0242I: [/contact.jsp]: Initialization successful.
[12/13/06 11:30:30:584 PST] 0000004a ServletWrappe A SRVE0242I: [/seminarFooter.jsp]: Initialization successful.
[12/13/06 11:30:45:646 PST] 00000043 ServletWrappe A SRVE0242I: [/question1Body.jsp]: Initialization successful.
[12/13/06 11:30:56:975 PST] 00000040 ServletWrappe A SRVE0242I: [/question2Body.jsp]: Initialization successful.
[12/13/06 11:31:01:600 PST] 0000004a ServletWrappe A SRVE0242I: [/question3Body.jsp]: Initialization successful.
[12/13/06 11:31:04:740 PST] 0000004b ServletWrappe A SRVE0242I: [/question4Body.jsp]: Initialization successful.
[12/13/06 11:31:07:428 PST] 0000003f ServletWrappe A SRVE0242I: [/question5Body.jsp]: Initialization successful.
[12/13/06 11:31:09:443 PST] 00000044 ServletWrappe A SRVE0242I: [/question6Body.jsp]: Initialization successful.
[12/13/06 11:31:13:006 PST] 0000004c ServletWrappe A SRVE0242I: [/question7Body.jsp]: Initialization successful.
[12/13/06 11:31:17:475 PST] 0000003f ServletWrappe A SRVE0242I: [/question8Body.jsp]: Initialization successful.
[12/13/06 11:31:23:350 PST] 00000044 ServletWrappe A SRVE0242I: [/demographicsBody.jsp]: Initialization successful.
[12/13/06 11:31:23:928 PST] 00000044 Environment I Hibernate 2.1.4
[12/13/06 11:31:23:944 PST] 00000044 Environment I hibernate.properties not found
[12/13/06 11:31:23:975 PST] 00000044 Environment I using CGLIB reflection optimizer
[12/13/06 11:31:24:115 PST] 00000044 Configuration I configuring from resource: /hibernate.cfg.xml
[12/13/06 11:31:24:147 PST] 00000044 Configuration I Configuration resource: /hibernate.cfg.xml
[12/13/06 11:31:25:506 PST] 00000044 Configuration I Mapping resource: Country.hbm.xml
[12/13/06 11:31:26:209 PST] 00000044 Binder I Mapping class: com.wef.seminar.entrance.dto.CountryDTO -> Country
[12/13/06 11:31:26:928 PST] 00000044 Configuration I Mapping resource: StateProvince.hbm.xml
[12/13/06 11:31:27:006 PST] 00000044 Binder I Mapping class: com.wef.seminar.entrance.dto.StateProvinceDTO -> StateProvince
[12/13/06 11:31:27:022 PST] 00000044 Configuration I Mapping resource: School.hbm.xml
[12/13/06 11:31:27:100 PST] 00000044 Binder I Mapping class: com.wef.seminar.entrance.dto.SchoolDTO -> School
[12/13/06 11:31:27:162 PST] 00000044 Configuration I Mapping resource: Campus.hbm.xml
[12/13/06 11:31:27:256 PST] 00000044 Binder I Mapping class: com.wef.seminar.entrance.dto.CampusDTO -> Campus
[12/13/06 11:31:27:256 PST] 00000044 Configuration I Mapping resource: CampusMessage.hbm.xml
[12/13/06 11:31:27:319 PST] 00000044 Binder I Mapping class: com.wef.seminar.entrance.dto.CampusMessageDTO -> CampusMessage
[12/13/06 11:31:27:350 PST] 00000044 Configuration I Configured SessionFactory: null
[12/13/06 11:31:27:397 PST] 00000044 Configuration I processing one-to-many association mappings
[12/13/06 11:31:27:397 PST] 00000044 Binder I Mapping collection: com.wef.seminar.entrance.dto.CountryDTO.stateProvinces -> StateProvince
[12/13/06 11:31:27:412 PST] 00000044 Binder I Mapping collection: com.wef.seminar.entrance.dto.SchoolDTO.campuses -> Campus
[12/13/06 11:31:27:444 PST] 00000044 Configuration I processing one-to-one association property references
[12/13/06 11:31:27:444 PST] 00000044 Configuration I processing foreign key constraints
[12/13/06 11:31:27:615 PST] 00000044 Dialect I Using dialect: net.sf.hibernate.dialect.SQLServerDialect
[12/13/06 11:31:27:647 PST] 00000044 SettingsFacto I Use outer join fetching: true
[12/13/06 11:31:27:694 PST] 00000044 NamingHelper I JNDI InitialContext properties:{}
[12/13/06 11:31:28:115 PST] 00000044 DatasourceCon F Could not find datasource: EOL2datasource
[12/13/06 11:31:28:147 PST] 00000044 DatasourceCon F TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Context: EDU-10162346Node01Cell/nodes/EDU-10162346Node01/servers/server1, name: EOL2datasource: First component in name EOL2datasource not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:969)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1435)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4045)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1776)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1737)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1444)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1324)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at com.wef.seminar.entrance.util.HibernateUtil.<clinit>(HibernateUtil.java:22)
at com.wef.seminar.entrance.hb.CampusHB.getCampusList(CampusHB.java:29)
at com.ibm._jsp._demographicsBody._jspService(_demographicsBody.java:179)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtensionProcessor.java:230)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:552)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1034)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:475)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
at com.ibm._jsp._entCounsTileLayout._jspx_meth_tiles_insert_1(_entCounsTileLayout.java:124)
at com.ibm._jsp._entCounsTileLayout._jspx_meth_html_html_0(_entCounsTileLayout.java:184)
at com.ibm._jsp._entCounsTileLayout._jspService(_entCounsTileLayout.java:82)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:250)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2837)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Name and version of the database you are using:
MS SQL Server 2000
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|
|