Re: MySQL Connection

2009-09-22 Thread Chamira Fernando
Hi,
Im Using GWT + AppEng is that the problem here?

Lets say I have an existing database which I want to use for my GWT
application what is the possible solution you reckon ?

On Tue, Sep 22, 2009 at 7:08 AM, Sripathi Krishnan <
sripathi.krish...@gmail.com> wrote:

> If you are using Google App Engine (separate from GWT), you *cannot* use
> an external database. App Engine doesn't allow you to open socket
> connections, and that is exactly what the getConnection() method does.
>
> --Sri
>
>
> 2009/9/21 Chamira Fernando 
>
>
>> Hi All,
>>
>> I have the same problem when I connect to MySQL database,
>>
>> What I understand from the GWT doc, whatever server side scripts we
>> have to in .server package and this will be on server side on host
>> mode when we debug the application.
>>
>> here is the scenario
>>
>> I can get the data from the server side if there is no database
>> connection, everything works fine, the moment I run database
>> connection method
>>
>> I get errors! narrowing the problem i tried to load the class
>> (Class.forName(DRIVER)) only.. it seems class is loaded (i get no
>> errors) but the moment I run
>> connection = DriverManager.getConnection(URL,USER,PASS); method will
>> cause the problem .. if this is an sql error, should be caught ??
>>
>> mind you
>> my mysql connector is in proper dirs (otherwise I can't load DRIVER ).
>>
>> Do I need to set $catalina.home for hosted mode? then can someone help
>> to do it (im using eclipse plugin)
>>
>> Can someone come up with an answer, prefer small script to
>> understand...
>>
>> here is the stack trace I got
>>
>> Sep 21, 2009 12:05:02 PM
>> com.google.appengine.tools.development.ApiProxyLocalImpl log
>> SEVERE: [1253534702085000] 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.pro.student.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.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: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
>> (HttpConnect

Re: MySQL Connection

2009-09-21 Thread Chamira Fernando

Hi All,

I have the same problem when I connect to MySQL database,

What I understand from the GWT doc, whatever server side scripts we
have to in .server package and this will be on server side on host
mode when we debug the application.

here is the scenario

I can get the data from the server side if there is no database
connection, everything works fine, the moment I run database
connection method

I get errors! narrowing the problem i tried to load the class
(Class.forName(DRIVER)) only.. it seems class is loaded (i get no
errors) but the moment I run
connection = DriverManager.getConnection(URL,USER,PASS); method will
cause the problem .. if this is an sql error, should be caught ??

mind you
my mysql connector is in proper dirs (otherwise I can't load DRIVER ).

Do I need to set $catalina.home for hosted mode? then can someone help
to do it (im using eclipse plugin)

Can someone come up with an answer, prefer small script to
understand...

here is the stack trace I got

Sep 21, 2009 12:05:02 PM
com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1253534702085000] 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.pro.student.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.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: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: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.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect
(NonRegisteringDriver.java:283)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at com.pro.student.server.GreetingServiceImpl.db
(GreetingServiceImpl.java:52)
at com.pro.student.server.GreetingServiceImpl.greetServer
(GreetingServiceImpl.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
... 27 more
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimeP