-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Migrating to Hibernate 3.0
PostPosted: Fri Jan 05, 2007 4:51 am 
Newbie

Joined: Wed Jan 03, 2007 5:09 am
Posts: 15
Am migrating my application from Hibernate 2 to hibernate 3.0 .

I have three classes named

HibernateUtil.java
HibernateCommand.java
HibernateCommandExecutor.java

when i change all the necessary changes needed am getting the following error.
plz help me.. Thanks in advance



<org.hibernate.cfg.Configuration: Could not configure datastore from input stream

org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1177)
at com.wamu.dashboard.util.hibernate.HibernateUtil.init(HibernateUtil.java:295)
at com.wamu.dashboard.util.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:75)
at com.wamu.dashboard.util.hibernate.HibernateCommandExecutor.getSession(HibernateCommandExecutor.java:76)
at com.wamu.dashboard.util.hibernate.HibernateCommand.this(HibernateCommand.java:26)
at com.wamu.dashboard.util.hibernate.HibernateCommand.<init>(HibernateCommand.java:31)
at com.wamu.dashboard.security.permission.GetUserTargetedContentCommand.<init>(GetUserTargetedContentCommand.java:30)
at com.wamu.dashboard.security.permission.web.GetUserTargetedContentServlet.myService(GetUserTargetedContentServlet.java:49)
at com.wamu.dashboard.util.web.BaseServlet.service(BaseServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:626)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:412)
at jsp_servlet._admin._hotlinks.__index._jspService(__index.java:276)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6456)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Nested exception:
java.net.UnknownHostException: hibernate.sourceforge.net
at java.net.InetAddress.getAllByName0(InetAddress.java:1016)
at java.net.InetAddress.getAllByName0(InetAddress.java:981)
at java.net.InetAddress.getAllByName(InetAddress.java:975)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:263)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:329)
at weblogic.net.http.HttpClient.<init>(HttpClient.java:128)
at weblogic.net.http.HttpURLConnection.getHttpClient(HttpURLConnection.java:129)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:331)
at weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:28)
at java.net.URL.openStream(URL.java:913)
at weblogic.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:836)
at weblogic.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:796)
at weblogic.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:275)
at weblogic.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:841)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1177)
at com.wamu.dashboard.util.hibernate.HibernateUtil.init(HibernateUtil.java:295)
at com.wamu.dashboard.util.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:75)
at com.wamu.dashboard.util.hibernate.HibernateCommandExecutor.getSession(HibernateCommandExecutor.java:76)
at com.wamu.dashboard.util.hibernate.HibernateCommand.this(HibernateCommand.java:26)
at com.wamu.dashboard.util.hibernate.HibernateCommand.<init>(HibernateCommand.java:31)
at com.wamu.dashboard.security.permission.GetUserTargetedContentCommand.<init>(GetUserTargetedContentCommand.java:30)
at com.wamu.dashboard.security.permission.web.GetUserTargetedContentServlet.myService(GetUserTargetedContentServlet.java:49)
at com.wamu.dashboard.util.web.BaseServlet.service(BaseServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:626)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:412)
at jsp_servlet._admin._hotlinks.__index._jspService(__index.java:276)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6456)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)[url][/url]


my hibernate.cfg.xml file is given below

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">weblogic.jdbc.jts.WAMUPool</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<!-- <property name="show_sql">true</property> -->
<mapping resource="/com/wamu/dashboard/addressbook/Contact.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/addressbook/EmailAddress.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/addressbook/Group.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/crm/APCampaign.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/crm/APCollateral.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/crm/APLead.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/crm/APTreatment.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/crm/RTIntent.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/doforms/BrokerLfcInfo.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/hotlinks/HotLink.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/pricing/ProductPriceSheet.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/security/permission/Permission.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/security/permission/UserTargetedContent.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/newsflash/Newsflash.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/newsflash/Audience.hbm.xml"/>
<mapping resource="com/wamu/dashboard/subscriptions/DashboardEmailRecord.hbm.xml"/>
<mapping resource="com/wamu/dashboard/subscriptions/DashboardEmailRecordAM.hbm.xml"/>
<mapping resource="com/wamu/dashboard/subscriptions/DashboardEmailRecordCompany.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Any my mappging xml file is given below

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-cascade="none">
<class name="com.wamu.dashboard.hotlinks.HotLink" table="HOT_LINK">
<id name="hotLinkId" type="integer" unsaved-value="null" >
<column name="HOT_LINK_ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">HOT_LINK_SEQ</param>
</generator>
</id>
<property name="displayName">
<column name="DISPLAY_NAME" sql-type="varchar(60)" />
</property>
<property name="userPermissionCode">
<column name="USER_PERMISSION_CODE" sql-type="varchar(20)" />
</property>
<property name="link">
<column name="LINK" sql-type="varchar(60)" not-null="true"/>
</property>
</class>
<query name="getHotLinksByPermissionCode"><![CDATA[select link, userTargetedContent.displayName from HotLink link, UserTargetedContent userTargetedContent where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode in (:userPermissionCode) order by link.userPermissionCode, link.displayName]]></query>
</hibernate-mapping>

plz help me... tell me the exact reason where its failing.. Its working fine in hibernate 2.0 . when i change the cfg.xml to hibernate 3.0 like this

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

its throwing error.. thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 6:42 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
First, the big thing between Hibernate 2 and Hibernate 3 is that the packages to be used are not net.sf.hibernate anymore, but org.hibernate. So I guess your problem is mainly related to this. Replace this everywhere.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 7:30 am 
Newbie

Joined: Wed Jan 03, 2007 5:09 am
Posts: 15
batmat wrote:
First, the big thing between Hibernate 2 and Hibernate 3 is that the packages to be used are not net.sf.hibernate anymore, but org.hibernate. So I guess your problem is mainly related to this. Replace this everywhere.



I've completely changed all the changes which u've mentioned earlier and still the problem exists... plz dont send the generic answer.... send it clearly whats the problem and what i've do now....?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 7:33 am 
Newbie

Joined: Wed Jan 03, 2007 5:09 am
Posts: 15
sasikala wrote:
batmat wrote:
First, the big thing between Hibernate 2 and Hibernate 3 is that the packages to be used are not net.sf.hibernate anymore, but org.hibernate. So I guess your problem is mainly related to this. Replace this everywhere.



Even after changing all my classses from net.sf.hibernate to org.hibernate the same problem exists.........


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 7:55 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
sasikala wrote:
batmat wrote:
First, the big thing between Hibernate 2 and Hibernate 3 is that the packages to be used are not net.sf.hibernate anymore, but org.hibernate. So I guess your problem is mainly related to this. Replace this everywhere.



I've completely changed all the changes which u've mentioned earlier and still the problem exists... plz dont send the generic answer.... send it clearly whats the problem and what i've do now....?

Speaking like this won't help you getting helped...

Did you read your stacktrace? Ok, I'll copy the interesting part imo:
Code:
Nested exception:
java.net.UnknownHostException: hibernate.sourceforge.net
at java.net.InetAddress.getAllByName0(InetAddress.java:1016)
at java.net.InetAddress.getAllByName0(InetAddress.java:981)

Can you access Internet from your place? I guess it's not finding the dtd locally, so it tries to access the specified place given at the beginning of the hibernate.cfg.xml file.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject: Migation from Hibernate 2.0 to Hibernate 3.0
PostPosted: Fri Jan 05, 2007 7:56 am 
Newbie

Joined: Wed Jan 03, 2007 5:09 am
Posts: 15
sasikala wrote:
sasikala wrote:
batmat wrote:
First, the big thing between Hibernate 2 and Hibernate 3 is that the packages to be used are not net.sf.hibernate anymore, but org.hibernate. So I guess your problem is mainly related to this. Replace this everywhere.


Its not working even after changing all the java files from net.sf to org.hibernate.....? what is ur answer for this...? do u know hibernate or not..?


Top
 Profile  
 
 Post subject: Re: Migation from Hibernate 2.0 to Hibernate 3.0
PostPosted: Fri Jan 05, 2007 8:21 am 
Newbie

Joined: Wed Jan 03, 2007 5:09 am
Posts: 15
[size=18]This is the error when i migrate my application from hibernate 2.0 to hibernate 3.0... [/size]<org.hibernate.cfg.Configuration: problem parsing configurationfile:/export/home/saraveer/r20_1/dashnext/build/domain/hibernate.cfg.xml

org.dom4j.DocumentException: Error on line 4 of document : The document type declaration for root element type "hibernate-configuration" must end with '>'. Nested exception: The document type declaration for root element type "hibernate-configuration" must end with '>'.

This is my hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">weblogic.jdbc.jts.WAMUPool</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

<mapping resource="/com/wamu/dashboard/hotlinks/HotLink.hbm.xml"/>

</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject: Re: Migation from Hibernate 2.0 to Hibernate 3.0
PostPosted: Fri Jan 05, 2007 9:17 am 
Newbie

Joined: Wed Jan 03, 2007 5:09 am
Posts: 15
This is the error when i migrate my application from hibernate 2.0 to hibernate 3.0...

<org.hibernate.cfg.Configuration: problem parsing configurationfile:/export/home/saraveer/r20_1/dashnext/build/domain/hibernate.cfg.xml

org.dom4j.DocumentException: Error on line 4 of document : The document type declaration for root element type "hibernate-configuration" must end with '>'. Nested exception: The document type declaration for root element type "hibernate-configuration" must end with '>'.

This is my hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">weblogic.jdbc.jts.WAMUPool</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

<mapping resource="/com/wamu/dashboard/hotlinks/HotLink.hbm.xml"/>

</session-factory>
</hibernate-configuration>[/quote]


Top
 Profile  
 
 Post subject: Re: Migrating to Hibernate 3.0
PostPosted: Tue Mar 19, 2013 9:32 pm 
Newbie

Joined: Tue Mar 19, 2013 9:09 pm
Posts: 3
this sound like Dtd can not connect with www.hibernate.org, you can try mapping to dtd inside jar on hibernateXXX.jar with the following lines:


Code:
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "classpath://org/hibernate/hibernate-mapping-3.0.dtd">



it will depends of jar version, but for 3.0 version this should be the solution.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.