GWT Mysql Error - java.net.InetAddress is a restricted class.

178 views
Skip to first unread message

Muthukumaran Balan

unread,
Nov 17, 2009, 4:01:35 AM11/17/09
to Google Web Toolkit
Hi All,

I am getting " java.net.InetAddress is a restricted class." error when
trying to get a Hibernate Session for MySQL DB as below. I seached the
internet for help and couldn't find any such error.

GWT Version - 1.7.1
AppEngine Version - 1.2.6

Anyone is facing the same error?

WARNING: Nested in java.lang.ExceptionInInitializerError:
java.lang.NoClassDefFoundError: java.net.InetAddress is a restricted
class. Please see the Google App Engine developer's guide for more
details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject
(Runtime.java:51)
at com.mysql.jdbc.StandardSocketFactory.connect
(StandardSocketFactory.java:137)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection
(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings
(SettingsFactory.java:84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:
2009)
at org.hibernate.cfg.Configuration.buildSessionFactory
(Configuration.java:1292)
at com.gt.billing.dao.ManagerFactory.<clinit>(ManagerFactory.java:13)
at com.gt.billing.web.service.WarehouseServiceImpl.<init>
(WarehouseServiceImpl.java:22)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at org.mortbay.jetty.servlet.ServletHolder.getServlet
(ServletHolder.java:339)
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:121)
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:342)
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)

Regards,
Muthu

Chris Ramsdale

unread,
Nov 17, 2009, 5:08:18 PM11/17/09
to google-we...@googlegroups.com
You may want to post this on the general App Engine forum, but the net net is that certain APIs and classes are white listed (and subsequently black listed) within App Engine. 


--

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.



Muthukumaran Balan

unread,
Nov 18, 2009, 3:01:05 AM11/18/09
to Google Web Toolkit
Thanks for the reply chris.

The code for accessing the database is running on the server-side of
the RPC[servlet].
Moreover, if mysql-jdbc-driver cant use these inetaddress class, then
we cannot access the database even @ server side? is there anyother
way or my configuration is wrong?

thanks and regards,
Muthu



On Nov 18, 2:08 am, Chris Ramsdale <cramsd...@google.com> wrote:
> You may want to post this on the general App Engine forum, but the net net
> is that certain APIs and classes are white listed (and subsequently black
> listed) within App Engine.
>
> List of white listed JRE classes:http://code.google.com/appengine/docs/java/jrewhitelist.html
>
> App Engine Group:http://groups.google.com/group/google-appengine
>
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs­cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=.- Hide quoted text -
>
> - Show quoted text -

Sripathi Krishnan

unread,
Nov 18, 2009, 3:25:48 AM11/18/09
to google-we...@googlegroups.com
If you are using Google App Engine,  you cannot access databases even @ server side. You are tied to the persistence approach that GAE provides.

--Sri


2009/11/18 Muthukumaran Balan <nbmk...@gmail.com>
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

Muthukumaran Balan

unread,
Nov 18, 2009, 6:25:27 AM11/18/09
to Google Web Toolkit
Hi Sri,

I am using Hibernate to access the database and used the example from
http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html.
When i create a hibernate session from rpc servlet, it throws error
"INetAddress is a restricted class". :(

Even i tried GiLead library, even in that when i tried to create a
hibernate session and set it to persistance manager it throws the same
error. :(

regards,
Muthu

On Nov 18, 12:25 pm, Sripathi Krishnan <sripathi.krish...@gmail.com>
wrote:
> If you are using Google App Engine,  you cannot access databases even @
> server side. You are tied to the persistence approach that GAE provides.
>
> --Sri
>
> 2009/11/18 Muthukumaran Balan <nbmku...@gmail.com>
> > > >http://groups.google.com/group/google-web-toolkit?hl=.-Hide quoted

Sripathi Krishnan

unread,
Nov 18, 2009, 6:44:13 AM11/18/09
to google-we...@googlegroups.com
Short Answer : Just disable Google App Engine for your project, and things should start working. Its a setting in the Google Eclipse Plugin.

Long Answer :
GWT and Google App Engine (GAE) are two separate projects, and you don't have to use them together.
If you enable GAE  - you cannot use any other database.
If you disable GAE and only use GWT - you can use whatever you want on the server side. Client side restrictions still apply.

Many, many users have accidentally enabled GAE (or is it enabled by default?) and have faced this issue, so this isn't new.

--Sri


2009/11/18 Muthukumaran Balan <nbmk...@gmail.com>
Hi Sri,
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

Muthukumaran Balan

unread,
Nov 19, 2009, 2:40:00 AM11/19/09
to Google Web Toolkit
Hi Sri,

Its working fine after disabling the appengine.

Thanks sri.

regards,
Muthu

On Nov 18, 3:44 pm, Sripathi Krishnan <sripathi.krish...@gmail.com>
wrote:
> Short Answer : Just disable Google App Engine for your project, and things
> should start working. Its a setting in the Google Eclipse Plugin.
>
> Long Answer :
> GWT and Google App Engine (GAE) are two separate projects, and you don't
> have to use them together.
> If you enable GAE  - you cannot use any other database.
> If you disable GAE and only use GWT - you can use whatever you want on the
> server side. Client side restrictions still apply.
>
> Many, many users have accidentally enabled GAE (or is it enabled by
> default?) and have faced this issue, so this isn't new.
>
> --Sri
>
> 2009/11/18 Muthukumaran Balan <nbmku...@gmail.com>
Reply all
Reply to author
Forward
0 new messages