[JPA + Hibernate + GWT + MySQL ] Looking for a hand to solve my trouble

68 views
Skip to first unread message

tolga ozdemir

unread,
Aug 13, 2009, 9:00:14 AM8/13/09
to Google Web Toolkit
Hi guys, I started playing with those technology just for two weeks
ago. So, I can ask some dummy questions... forgive me pls..

Here is my questions.. I am trying to connect GWT with a database I am
familiar.. Namely, MySQL.. I have a sample project with some errors
that I have no idea to fix it.. I would be appritiate if someone look
at it and tells me my faults..

I have a just a simple DB -> gwtDemo and a table tblEntry [ id,
entry ]

Below, is the error I recieved

WARNING: Nested in javax.servlet.ServletException: init:
java.lang.ExceptionInInitializerError
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:25)
at net.tolgaozdemir.gwt.server.EntryRemoteService.init
(EntryRemoteService.java:27)
at javax.servlet.GenericServlet.init(GenericServlet.java:215)
at org.mortbay.jetty.servlet.ServletHolder.initServlet
(ServletHolder.java:433)
.......

This is my project zip. http://www.sendspace.com/file/6gpbtj about 4MB

Regards,

Tolga

tolga ozdemir

unread,
Aug 13, 2009, 5:00:00 PM8/13/09
to Google Web Toolkit
guys, is there anybody had the same problem before??

Paul Robinson

unread,
Aug 14, 2009, 3:46:37 AM8/14/09
to Google-We...@googlegroups.com
By the looks of the exception, there may be more information in the
stack trace that you've not posted. Does it say further down that the
exception was caused by another exception? Presumably it failed when
trying to build a hibernate SessionFactory, which may mean hibernate
couldn't find its config files or there was a fault in them (or in
annotations). More of the stack trace would help work this out.

It might also help if you posted some of the relevant code directly here
to make it easier for people to help you...some might be more willing to
look at a short code snippet posted here than to download a zip file.

Paul

tolga ozdemir

unread,
Aug 14, 2009, 3:49:50 AM8/14/09
to Google Web Toolkit
This is my HibernateContext.java.. Something wrong in it?




import org.apache.commons.logging.*;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;


public class HibernateContext {

private final static String CONFIGURATION_FILE = "hibernate.cfg.xml";

private static Log log = LogFactory.getLog(HibernateContext.class);

private static SessionFactory sessionFactory;

public static SessionFactory getSessionFactory(){

if(sessionFactory == null){

try{
sessionFactory = new Configuration()
.addResource(CONFIGURATION_FILE)
.configure()
.buildSessionFactory();

}catch (Throwable th) {
log.error("Initial SessionFactory creation failed.", th);
throw new ExceptionInInitializerError(th);
}

}

return sessionFactory;
}

}


ERROR:

WARNING: Nested in javax.servlet.ServletException: init:
java.lang.ExceptionInInitializerError
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:29)
at net.tolgaozdemir.gwt.server.EntryRemoteService.init
(EntryRemoteService.java:27)
at javax.servlet.GenericServlet.init(GenericServlet.java:215)
at org.mortbay.jetty.servlet.ServletHolder.initServlet
(ServletHolder.java:433)
at org.mortbay.jetty.servlet.ServletHolder.getServlet
(ServletHolder.java:342)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
463)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at com.google.appengine.tools.development.StaticFileFilter.doFilter
(StaticFileFilter.java:124)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle
(DevAppEngineWebAppContext.java:54)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:313)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
at org.mortbay.jetty.HttpConnection$RequestHandler.content
(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run
(BoundedThreadPool.java:442)

tolga ozdemir

unread,
Aug 14, 2009, 3:58:08 AM8/14/09
to Google Web Toolkit
This is a screenshot for my folder structure

http://www.tolgaozdemir.net/wp-content/uploads/2009/08/tolgaozdemirnet.gif



HİBERNATE.CFG
<!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="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</
property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:
3306/gwtDemo</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">1557</property>
<mapping resource="Entry.hbm.xml"/>
</session-factory>
</hibernate-configuration>


ENTRY.HBM.XML
<?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>
<class name="net.tolgaozdemir.gwt.client.domain.Entry"
table="tblentry"/>
</hibernate-mapping>

Paul Robinson

unread,
Aug 14, 2009, 4:16:22 AM8/14/09
to Google-We...@googlegroups.com
It looks fine. I would expect a hibernate error message as
well...something to say that it's not happy with your hibernate.cfg.xml
for some reason.

The exception you've shown seems to be the one you created in your catch
clause. We're not seeing the exception you caught. I would expect that
you've already got that, but if not, maybe you can add something to show
its contents?

Also, is your src directory (where your hibernate files are) in your
classpath?

tolga ozdemir

unread,
Aug 14, 2009, 5:18:19 AM8/14/09
to Google Web Toolkit
Yea I caught where the error is.. exactly in buildSessionFactory()
method.. How can I add something to show the contents?? I am new at
GWT and Hibernate :)))

Src in my classpath yes..

Paul Robinson

unread,
Aug 14, 2009, 5:30:16 AM8/14/09
to Google-We...@googlegroups.com
I see you've got apache commons logging used in there...have you got it
working? Does the error message you log in your catch statement generate
any output you can see? If so, then it ought to have shown the details
of the error.

If not, try to work around this by putting in a th.printStackTrace();

tolga ozdemir

unread,
Aug 14, 2009, 5:40:44 AM8/14/09
to Google Web Toolkit
I put th.printStackTrace(); Now I have this...

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/GOOGLE_WEB_TOOLKIT/workspaces/
gwt/JPAGWT/war/WEB-INF/lib/slf4j-jdk14-1.5.8.jar!/org/slf4j/impl/
StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/GOOGLE_WEB_TOOLKIT/workspaces/
gwt/JPAGWT/war/WEB-INF/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/
StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
Aug 14, 2009 9:43:59 AM org.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: XML InputStream(4) The content of element
type "class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".
log4j:WARN No appenders could be found for logger
(net.tolgaozdemir.gwt.server.HibernateContext).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.InvalidMappingException: Could not parse mapping
document from resource Entry.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
616)
at org.hibernate.cfg.Configuration.parseMappingElement
(Configuration.java:1635)
at org.hibernate.cfg.Configuration.parseSessionFactory
(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:24)
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
549)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
613)
... 34 more
Caused by: org.xml.sax.SAXParseException: The content of element type
"class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
546)
... 35 more
Aug 14, 2009 9:43:59 AM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Nested in javax.servlet.ServletException: init:
java.lang.ExceptionInInitializerError
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:30)
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from resource Entry.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
616)
at org.hibernate.cfg.Configuration.parseMappingElement
(Configuration.java:1635)
at org.hibernate.cfg.Configuration.parseSessionFactory
(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:24)
... 27 more
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
549)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
613)
... 34 more
Caused by: org.xml.sax.SAXParseException: The content of element type
"class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
546)
... 35 more
Aug 14, 2009 9:43:59 AM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Nested in java.lang.ExceptionInInitializerError:
org.hibernate.InvalidMappingException: Could not parse mapping
document from resource Entry.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
616)
at org.hibernate.cfg.Configuration.parseMappingElement
(Configuration.java:1635)
at org.hibernate.cfg.Configuration.parseSessionFactory
(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:24)
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
549)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
613)
... 34 more
Caused by: org.xml.sax.SAXParseException: The content of element type
"class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
546)
... 35 more
Aug 14, 2009 9:43:59 AM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: /jpagwt/EntryRemote
java.lang.ExceptionInInitializerError
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:30)
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from resource Entry.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
616)
at org.hibernate.cfg.Configuration.parseMappingElement
(Configuration.java:1635)
at org.hibernate.cfg.Configuration.parseSessionFactory
(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:24)
... 27 more
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
549)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
613)
... 34 more
Caused by: org.xml.sax.SAXParseException: The content of element type
"class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
546)
... 35 more
Aug 14, 2009 9:43:59 AM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Nested in java.lang.ExceptionInInitializerError:
org.hibernate.InvalidMappingException: Could not parse mapping
document from resource Entry.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
616)
at org.hibernate.cfg.Configuration.parseMappingElement
(Configuration.java:1635)
at org.hibernate.cfg.Configuration.parseSessionFactory
(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:
1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at net.tolgaozdemir.gwt.server.HibernateContext.getSessionFactory
(HibernateContext.java:24)
Caused by: org.hibernate.InvalidMappingException: Could not parse
mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
549)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:
613)
... 34 more
Caused by: org.xml.sax.SAXParseException: The content of element type
"class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
546)
... 35 more

Paul Robinson

unread,
Aug 14, 2009, 5:52:18 AM8/14/09
to Google-We...@googlegroups.com
That's more like it.

If you look closely at what it's telling you, you should see this:

org.hibernate.InvalidMappingException: Could not parse mapping
document from resource Entry.hbm.xml


and this:

Caused by: org.xml.sax.SAXParseException: The content of element type
"class" is incomplete, it must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|
composite-id),discriminator?,natural-id?,(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|
properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-
insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)
*)".


It's telling you that there's an error in your Entry.hbm.xml file. Your
<class> element is not legal according to its schema.

According to the schema extract shown (above), you must have an <id> or
<composite-id> element in there. Something like:
<class name="net.tolgaozdemir.gwt.client.domain.Entry" table="tblentry">
<id name="ID" column="id">
<generator class="native"/>
</id>
</class>

depending on what property name you use for a primary key on your Entry
class.

This isn't really GWT related, and if you have problems configuring
this, it's probably better done on a hibernate forum.

Paul

tolga ozdemir

unread,
Aug 14, 2009, 6:17:43 AM8/14/09
to Google Web Toolkit
Thanks a lot.. it did not worked, I recieve same error.. So, I am
moving onto the hibernate forum
> > SLF4J: Seehttp://www.slf4j.org/codes.html#multiple_bindingsfor an
> ...
>
> read more »

tolga ozdemir

unread,
Aug 15, 2009, 7:50:35 AM8/15/09
to Google Web Toolkit
Folks problem solved.. This issue caused by google application
engine.. Here is some posts about the solution on my blog

http://www.tolgaozdemir.net/2009/08/15/weird-error-with-gwt-caused-by-google-application-engine/
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages