• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

WebSphere 6.0 evaluation with Hibernate

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to deploy my applicaiton in WebSphere v6.0 eval and I am having problems with JDBC connections.

I have configured a datasource using the WebSphere embeded SQL Server drivers and it test fine in the admin console but I get an exception when I try to access the datasource from my applicaiton.

I am using Hibernate 3.0 and the Sql Server is 2000.
The exception I am getitng is

[8/25/05 8:31:42:422 EDT] 0000003c WebApp E SRVE0026E: [Servlet Error]-[action]: java.lang.ExceptionInInitializerError
at com.nationwide.util.HibernateUtils.<clinit>(HibernateUtils.java:33)
at com.nationwide.dao.StatusDAO.getStatusList(StatusDAO.java:163)
at com.nationwide.bo.StatusBO.getStatusList(StatusBO.java:32)
at com.nationwide.facade.SSEFacade.getStatusList(SSEFacade.java:64)
at com.nationwide.tags.StatusTag.doEndTag(StatusTag.java:27)
at com.ibm._jsp._SearchPackage._jspx_meth_sse_statusList_0(_SearchPackage.java:408)
at com.ibm._jsp._SearchPackage._jspService(_SearchPackage.java:131)
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.forward(WebAppRequestDispatcher.java:250)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
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:2841)
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.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
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))
Caused by: org.hibernate.MappingException: Error reading resource: com/nationwide/dto/PackageDTO.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:452)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at com.nationwide.util.HibernateUtils.<clinit>(HibernateUtils.java:27)
... 40 more
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:408)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
... 47 more
Caused by: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
... 48 more


Here is my hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE hibernate-configuration PUBLIC<br /> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"<br /> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<property name="show_sql">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.datasource">jdbc/MSSQLDS</property>

<mapping resource="com/nationwide/dto/PackageDTO.hbm.xml"/>
<mapping resource="com/nationwide/dto/StatusDTO.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Any ideas?
 
David Sparks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like my message got cut off.. here is the hibernate.cfg.xml again.

<?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE hibernate-configuration PUBLIC<br /> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"<br /> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<property name="show_sql">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.datasource">jdbc/MSSQLDS</property>

<mapping resource="com/nationwide/dto/PackageDTO.hbm.xml"/>
<mapping resource="com/nationwide/dto/StatusDTO.hbm.xml"/>
</session-factory>
</hibernate-configuration>
 
David Sparks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have found the fix for this problem. The problem was not with accessing the datasource the problem was in the mapping and config files. The mapping and config files specify the DTD to use. These DTD files were outside a firewall and the code was not able to access these DTD files.

I temporarily solved this by putting the DTD files (hibernate-configuration-3.0.dtd and hibernate-mapping-2.0.dtd) on my web server and pointing the mapping and config files to them.

I am looking into a long term solution for the future.

Thanks

Dave
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello David,

are you behind a firewall or so? Because in your DOCTYPE you are reffering to a DTD that will be retrieved from the internet:

<?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE hibernate-configuration PUBLIC<br /> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"<br /> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">



It will try to get the http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd. Change the URL to hibernate-configuration-3.0.dtd and put the DTD in the same directory as your hibernate config file. This will probably work.

Lars
 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay you were just one minute earlier.... :-)
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even cleaner is to add xml catalog entries (http to filesystem mappings) using window->preferences->xml (bottom) and add the mappings.
or add/edit the file:
<yourearproject>/.metadata/.plugins/com.ibm.etools.xmlbuilder/default.xmlcatalog

and add something like: (hibernate 2)
<XMLCatalogSettings>a
<UserEntries>
<UserEntry TYPE="SYSTEM" ID="http://jbpm.org/dtd/processdefinition-2.0-beta2.dtd" URI="file :/programs/wsadv5.1.2/catalog/processdefinition-2.0-beta2.dtd"/>
<UserEntry TYPE="SYSTEM" ID="http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd" URI="file :/programs/wsadv5.1.2/catalog/hibernate-configuration-2.0.dtd"/>
<UserEntry TYPE="SYSTEM" ID="http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" URI="file :/programs/wsadv5.1.2/catalog/hibernate-mapping-2.0.dtd"/>
<UserEntry TYPE="SYSTEM" ID="http://jbpm.org/dtd/processdefinition-2.0-beta3.dtd" URI="file :/programs/wsadv5.1.2/catalog/processdefinition-2.0-beta3.dtd"/>
</UserEntries>
</XMLCatalogSettings>
[ August 26, 2005: Message edited by: jeroen dijkmeijer ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic