GWT 1.6.4: Exception in DriverManager.getConnection

633 views
Skip to first unread message

martin

unread,
Apr 9, 2009, 7:52:06 AM4/9/09
to Google Web Toolkit
Hi!

I created a very simple test application with the Eclipse PlugIn from
a freshly installed GWT 1.6.4. When trying to connect to the database,
I get a java.lang.ExceptionInInitializerError calling getConnection:

public ServiceImplementation()
{
try
{
Class.forName("com.mysql.jdbc.Driver");
} catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}

try
{
connection = DriverManager.getConnection("jdbc:mysql://localhost/
testdatabase", "root", "pwd");
} catch (SQLException e)
{
e.printStackTrace();
System.exit(1);
}
}

I am able to connect to the database using the MySQL Query Browser.
Also, the same server code worked with previous GWT versions. I use
Ubuntu 8.10, Eclipse 3.4.2.

Any help is appreciated!

Thanks,
Martin.



The server is running at http://localhost:8080/
Apr 9, 2009 1:27:20 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Nested in javax.servlet.ServletException: init:
java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.testproject.server.ServiceImplementation.<init>
(ServiceImplementation.java:41)
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:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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 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:306)
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:211)
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)
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:323)
at java.security.AccessController.checkPermission
(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkAccess(DevAppServerFactory.java:98)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.<init>(Thread.java:377)
at java.util.TimerThread.<init>(Timer.java:456)
at java.util.Timer.<init>(Timer.java:71)
at java.util.Timer.<init>(Timer.java:122)
at com.mysql.jdbc.ConnectionImpl.<clinit>(ConnectionImpl.java:208)
... 33 more
Apr 9, 2009 1:27:20 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Nested in java.lang.ExceptionInInitializerError:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:323)
at java.security.AccessController.checkPermission
(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkAccess(DevAppServerFactory.java:98)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.<init>(Thread.java:377)
at java.util.TimerThread.<init>(Timer.java:456)
at java.util.Timer.<init>(Timer.java:71)
at java.util.Timer.<init>(Timer.java:122)
at com.mysql.jdbc.ConnectionImpl.<clinit>(ConnectionImpl.java:208)
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.testproject.server.ServiceImplementation.<init>
(ServiceImplementation.java:41)
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:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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 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:306)
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:211)
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)
Apr 9, 2009 1:27:20 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: /testproject/testprojectservlet
java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.testproject.server.ServiceImplementation.<init>
(ServiceImplementation.java:41)
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:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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 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:306)
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:211)
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)
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:323)
at java.security.AccessController.checkPermission
(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkAccess(DevAppServerFactory.java:98)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.<init>(Thread.java:377)
at java.util.TimerThread.<init>(Timer.java:456)
at java.util.Timer.<init>(Timer.java:71)
at java.util.Timer.<init>(Timer.java:122)
at com.mysql.jdbc.ConnectionImpl.<clinit>(ConnectionImpl.java:208)
... 33 more
Apr 9, 2009 1:27:20 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Nested in java.lang.ExceptionInInitializerError:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:323)
at java.security.AccessController.checkPermission
(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkAccess(DevAppServerFactory.java:98)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.<init>(Thread.java:377)
at java.util.TimerThread.<init>(Timer.java:456)
at java.util.Timer.<init>(Timer.java:71)
at java.util.Timer.<init>(Timer.java:122)
at com.mysql.jdbc.ConnectionImpl.<clinit>(ConnectionImpl.java:208)
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.testproject.server.ServiceImplementation.<init>
(ServiceImplementation.java:41)
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:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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 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:306)
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:211)
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)

martin

unread,
Apr 11, 2009, 1:59:25 PM4/11/09
to Google Web Toolkit
Ok, I am still stuck :-(
Anybody got Mysql working with GWT 1.6.4? It worked fine for GWT 1.5
for me, but something seems to have changed with GWT 1.6.4.
Maybe it is due to Jetty and security settings, since I get a
"java.security.AccessControlException"... All I did was to add the "/
usr/share/java/mysql-connector-java-5.1.6.jar" to the referenced
libraries.

Please help me out!
Thanks,
Martin.

Vitali Lovich

unread,
Apr 11, 2009, 3:46:07 PM4/11/09
to Google-We...@googlegroups.com
I don't think so.  It worked fine for me.  Don't see how GWT has anything to do with the server side code that does the mysql call.  Just drop that file into war/WEB-INF/lib.

IvanRdz

unread,
Apr 12, 2009, 9:16:27 AM4/12/09
to Google Web Toolkit
I have the same problem and I am sure it´s due to Jetty and security
settings as you have mentioned. Are you using google plugin?

martin

unread,
Apr 12, 2009, 2:08:06 PM4/12/09
to Google Web Toolkit
Yes, I am using the google eclipse plugin. The project was freshly
generated by the plugin, I just added the database connection stuff.
@Vitali: I did also try to put the mysql-connecter jar file into the
war/WEB-INF/lib directory, that did not change anything (with or
without changing the reference to the WEB-INF/lib directory).

So, any expert who can help us out?

martin

unread,
Apr 13, 2009, 7:46:15 AM4/13/09
to Google Web Toolkit
Ok, I solved the problem ;-)

Go to the project's properties and uncheck "Use Google App Engine".
Additionally, as vitali mentioned, the mysql-connector jar has to be
in the war/WEB-INF/lib directory.
Cheers,

Martin.

On Apr 12, 3:16 pm, IvanRdz <ivan.rd...@gmail.com> wrote:

Seattle_Dave

unread,
Apr 17, 2009, 11:18:14 PM4/17/09
to Google Web Toolkit
Thanks a million. How on earth did you figure that out? I was going
crazy. My app worked fine on the server, but failed with a
permissions error on my dev box, connecting to localhost.

Churky

unread,
Apr 22, 2009, 2:36:04 PM4/22/09
to Google Web Toolkit
If you unselect Google App Enginee. Does that me you disable the
google Gears Options?

I have google app 1.2.0 which correspond to the same version as the
gwt-gear that I have installed. Please verify because I do need the
use of gears. and If I need to disable gears in order to fix the my
mysql problem. Then it is not a solution.

Thank you.

Churk

Miguel Méndez

unread,
Apr 22, 2009, 2:51:14 PM4/22/09
to Google-We...@googlegroups.com
Removing App Engine just means that you don't plan on running the project on appengine.  That should not impact Gears at all.
--
Miguel

Starney ni

unread,
Apr 28, 2009, 2:38:06 AM4/28/09
to Google Web Toolkit
Thanks a lot Martin. :)

outlaw19jd

unread,
Apr 28, 2009, 3:25:00 PM4/28/09
to Google Web Toolkit
I am having a similar problem. It's very weird. The test code I
wrote works fine when I execute it directly, but when run from within
the GWT framework I get a weird NullPointer exception thrown all
seemingly caused by the exception below.

Have you had any lucky solving your problem?

Thanks.
Jeff

The server is running at http://localhost:8080/
Apr 28, 2009 3:20:42 PM
com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1240946442913000] javax.servlet.ServletContext log: Exception
while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract java.lang.String
com.onenine.products.timekeeper.client.GreetingService.greetServer
(java.lang.String)' threw an unexpected exception:
java.lang.ExceptionInInitializerError
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure
(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
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)
Caused by: java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
com.onenine.products.timekeeper.server.GreetingServiceImpl.testLogin
(GreetingServiceImpl.java:54)
at
com.onenine.products.timekeeper.server.GreetingServiceImpl.greetServer
(GreetingServiceImpl.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
... 25 more
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkAccess(DevAppServerFactory.java:98)
at java.lang.ThreadGroup.checkAccess(Unknown Source)
at java.lang.Thread.init(Unknown Source)
at java.lang.Thread.<init>(Unknown Source)
at java.util.TimerThread.<init>(Unknown Source)
at java.util.Timer.<init>(Unknown Source)
at java.util.Timer.<init>(Unknown Source)
at com.mysql.jdbc.ConnectionImpl.<clinit>(ConnectionImpl.java:208)
... 35 more



On Apr 9, 7:52 am, martin <hotston...@googlemail.com> wrote:
> Hi!
>
> I created a very simple test application with the Eclipse PlugIn from
> a freshly installed GWT 1.6.4. When trying to connect to the database,
> I get a java.lang.ExceptionInInitializerError calling getConnection:
>
> public ServiceImplementation()
> {
>         try
>         {
>                 Class.forName("com.mysql.jdbc.Driver");
>         } catch (Exception e)
>         {
>                 e.printStackTrace();
>                 System.exit(1);
>         }
>
>         try
>         {
>                 connection = DriverManager.getConnection("jdbc:mysql://localhost/
> testdatabase", "root", "pwd");
>         } catch (SQLException e)
>         {
>                 e.printStackTrace();
>                 System.exit(1);
>         }
>
> }
>
> I am able to connect to the database using the MySQL Query Browser.
> Also, the same server code worked with previous GWT versions. I use
> Ubuntu 8.10, Eclipse 3.4.2.
>
> Any help is appreciated!
>
> Thanks,
> Martin.
>
> The server is running athttp://localhost:8080/

David

unread,
May 13, 2009, 2:40:22 AM5/13/09
to Google Web Toolkit
This is indeed a great finding. I have a similar problem when I tried
the slicr GWT tutorial from IBM. At last, I managed to reduce the
problem to putting a statement "new
org.apache.derby.jdbc.EmbeddedDriver();" inside the
GreetingServiceImpl.java file generated by webAppCreator. I did some
tracing and found that the objects inside the servlet are loaded by
different classloaders. It seems that there are non-trivial
classloadings done by Eclipse and Google App Engine that cause the
problem.

It's great that you found the solution : uncheck the "Use Google App
Engine" checkbox.

Thanks,

david

Marcos Robson

unread,
May 21, 2009, 1:08:15 PM5/21/09
to Google Web Toolkit
You saved my life, the weeks I'm trying to solve this problem.
> > > Martin.- Ocultar texto das mensagens anteriores -
>
> - Mostrar texto das mensagens anteriores -

MM

unread,
Jun 2, 2009, 1:17:20 AM6/2/09
to Google Web Toolkit
Nice! This com.mysql.jdbc.ConnectionImpl exception error was driving
me crazy also. Thanks!

Mark

unread,
Jun 5, 2009, 2:25:29 PM6/5/09
to Google Web Toolkit
This post is a gold mine.

On Jun 2, 1:17 am, MM <mmea...@gmail.com> wrote:
> Nice! This com.mysql.jdbc.ConnectionImpl exception error was driving
> me crazy also. Thanks!
>
> On Apr 13, 6:46 am, martin <hotston...@googlemail.com> wrote:
>
>
>
> > Ok, I solved the problem  ;-)
>
> > Go to the project's properties and uncheck "Use Google App Engine".
> > Additionally, as vitali mentioned, themysql-connector jar has to be
> > in the war/WEB-INF/lib directory.
> > Cheers,
>
> > Martin.
>
> > On Apr 12, 3:16 pm, IvanRdz <ivan.rd...@gmail.com> wrote:
>
> > > I have the same problem and I am sure it´s due toJettyand security
> > > settings as you have mentioned. Are you using google plugin?
>
> > > On Apr 11, 7:59 pm, martin <hotston...@googlemail.com> wrote:
>
> > > > Ok, I am still stuck :-(
> > > > Anybody gotMysqlworking with GWT 1.6.4? It worked fine for GWT 1.5
> > > > for me, but something seems to have changed with GWT 1.6.4.
> > > > Maybe it is due toJettyand security settings, since I get a

aydogdu

unread,
Jun 7, 2009, 8:34:47 AM6/7/09
to Google Web Toolkit
god bless you

Khoa

unread,
Jun 16, 2009, 3:35:35 PM6/16/09
to Google Web Toolkit
Another soul is saved -- thank you

puddlesofjoy

unread,
Jul 7, 2009, 10:37:12 PM7/7/09
to Google Web Toolkit
Additional information for those who have this same problem and find
this post like I did.
Using Eclipse 3.4.2, Google Eclipse Plugin 1.0.1.v200905131143, GWT
1.6.4, App Engine Java SDK 1.2.1

I faced two issues when trying to develop my JSP web application
(which uses JDBC and is not intended to be deployed on Google App
Engine; it just uses GWT)

- With App Engine enabled for the project it would compile my JSPs
correctly but give the security errors noted above
- With App Engine disabled (only gwt enabled) the JSP files would not
compile with the error "org.apache.jasper.JasperException: Unable to
compile class for JSP" and referencing me to the Compile Error Output
which does not seem to be available anywhere I can find...

My work around hack:
Extract appengine-java-sdk-1.2.1\libappengine-tools-api.jar
Use JBE (Java Bytecode Editor) to edit com\google\appengine\tools
\development\DevAppServerFactory$CustomSecurityManager.class
Empty out the check* functions so they only contain a 'return'
Jar back up and replace the original libappengine jar

I can now leave App Engine enabled and have no more security errors
AND my JSP files compile correctly! Huzzah!!
Note that of course this app could NOT be deployed to google app
engine. The App engine is just enabled since it allows my JSPs to
compile correctly.

Regards

Rajeev Dayal

unread,
Jul 8, 2009, 2:54:11 PM7/8/09
to Google-We...@googlegroups.com
Hi,

When you say that the JSP files would not compile, how were you trying to compile them? Were you hitting the JSP in a browser?


Rajeev

puddlesofjoy

unread,
Jul 8, 2009, 8:02:53 PM7/8/09
to Google Web Toolkit
Hey Rajeev,
Yes when I went to hit my JSP files in the google hosted browser it
would fail with the message "Unable to compile class for JSP". There
was nothing descriptive in the hosted browser log about why it had
failed to compile. All of the error messages said to refer to the
compiler error output, which as far as I can tell isn't logged
anywhere accessible.

Note that the JSP would compile correctly if I avoided any scriptlet
references to my classes (despite having proper imports), so I would
guess it had something to do with the classpath being used for the Ant
compiler invoked for compiling the JSP-> java generated files.

With App Engine enabled for the project I could compile correctly, so
whatever classpath issue might have affected the GWT-only compilation
did not have any effect here. But then of course I was left with the
issue which started this discussion, so I made my little workaround
(which is working beautifully so far).

With App Engine unchecked, the most interesting log message I see in
my hosted mode console is the following:

[SPAM] EXCEPTION
org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.compiler.DefaultErrorHandler.javacError
(DefaultErrorHandler.java:97)
at org.apache.jasper.compiler.ErrorDispatcher.javacError
(ErrorDispatcher.java:346)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:
414)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile
(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:362)
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:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle
(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:320)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run
(QueuedThreadPool.java:488)
Caused by: org.apache.tools.ant.BuildException: Compile failed; see
the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:
382)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile
(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:362)
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:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle
(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:320)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run
(QueuedThreadPool.java:488)

On Jul 8, 11:54 am, Rajeev Dayal <rda...@google.com> wrote:
> Hi,
> When you say that the JSP files would not compile, how were you trying to
> compile them? Were you hitting the JSP in a browser?
>
> Rajeev
>
Reply all
Reply to author
Forward
0 new messages