This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes GWT and the fly likes GWT and Hibernate - Issue with Dom4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT and Hibernate - Issue with Dom4j" Watch "GWT and Hibernate - Issue with Dom4j" New topic
Author

GWT and Hibernate - Issue with Dom4j

ajay krishna
Greenhorn

Joined: Jan 27, 2010
Posts: 2
Hi,

Iam writing a small program to integrate GWT and Hibernate.

GWT RPC works fine by itself, tested it by hardcoding some data on server and sending the object back to client.

My standalone Hibernate program works fine. But when I try to integrate it with GWT, I get an error stating

"Initial SessionFactory creation failed. java.lang.NoClassDefFoundError: java.net.Socket is a restricted class. Please see the Google App Engine developer's guide for more details. "

I had read on one of the forums that the above class isn't permitted for GWT. Iam assuming the problem has to do with Dom4j's use of the above class. Is there any implementation of DOM4J which doesn't use this class?

Iam using the jar dom4j-1.6.1.jar; Below is the source for Server Implementation.

Any help would be greatly appreciated.

Thanks,
Ajay

Class - FetchPlgplfServiceImpl.java (Server side implementation)

Class - MyApplicationHibernateUtil

gwt.xml





Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I would be surprised if Dom4J were explicitly using a socket. It's just an XML parser after all. But it's possible that something in your XML document refers to a URL, and therefore the parser tries to read the document at that URL. Culprits could be DTD or schema references, for example.
ajay krishna
Greenhorn

Joined: Jan 27, 2010
Posts: 2
Thanks a lot Paul. I found out the problem. Iam trying to connect to DB2 database sitting on a AS/400.

Iam using the jt400.jar as the jdbc driver and that seems to be referencing the socket class.

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

That's right, JDBC almost always communicates via socket (except for non-standard databases like MS Access).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GWT and Hibernate - Issue with Dom4j
 
Similar Threads
hbm file version working but annotation not
problem with hibernate and struts
Hibernate Helper Class
Problem with Hibernate Cache
Hibernate+GWT problem related to slf4j