Две ошибки с конфликтными решениями
Я не очень хорош в GWT. Я успешно подключил затмение к базе данных хост-сервера с точки зрения разработки баз данных. Я могу видеть таблицы моей базы данных хостинга из окна затмения. Затем я попытался запустить программу Blob Example в следующем блоге.(Код такой же)
http://www.fishbonecloud.com/2010/12/tutorial-gwt-application-for-storing.html
здесь, в методе getPicture() объекта BlobServiceImpl, я попытался сохранить значение 'l' в моей таблице базы данных хостинга.
public Picture getPicture(String id) {
long l = Long.parseLong(id);
Picture picture = ofy.get(Picture.class, l);
PreparedStatement imageURLstmt = null;
try{
Class.forName("com.mysql.jdbc.Driver");
Connection userregcon = DriverManager.getConnection("jdbc:mysql://69.162.121.114:3306/ayushcar_AyushCareDB?"
+ "user=xxxx&password=yyyyy");
/*Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection userregcon=DriverManager.getConnection("jdbc:odbc:AyushCare_DSN");*/
String stmt = "update UserProfilesTable2 set ImageURL=?";System.out.println("Ima1:"+l);
imageURLstmt = userregcon.prepareStatement(stmt);System.out.println("Ima2");
imageURLstmt.setString(1,String.valueOf(l) );System.out.println("Ima3");
@SuppressWarnings("unused")
int execute = imageURLstmt.executeUpdate(); System.out.println("Ima4");
System.out.println("Image insertion status:"+imageURLstmt.getUpdateCount());
}
но я получаю следующую ошибку:
Jul 10, 2013 6:12:30 PM com.google.appengine.api.datastore.dev.LocalDatastoreService init
INFO: Local Datastore initialized:
Type: High Replication
Storage: E:\sireesha\ProjectWorkSpace\BlobExample\war\WEB-INF\appengine- generated\local_db.bin
Jul 10, 2013 6:12:30 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: Time to load datastore: 410 ms
Jul 10, 2013 6:12:33 PM com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract blob.example.client.Picture blob.example.client.BlobService.getPicture(java.lang.String)' threw an unexpected exception: java.lang.ExceptionInInitializerError
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:123)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:61)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.DevAppServerServersFilter.doFilter(DevAppServerServersFilter.java:106)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:94)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:421)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at blob.example.server.BlobServiceImpl.getPicture(BlobServiceImpl.java:53)
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.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:115)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
... 38 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:289)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkAccess(DevAppServerFactory.java:314)
at java.lang.ThreadGroup.checkAccess(Unknown Source)
at java.lang.Thread.init(Unknown Source)
at java.lang.Thread.<init>(Unknown Source)
at com.mysql.jdbc.AbandonedConnectionCleanupThread.<init>(AbandonedConnectionCleanupThread.java:33)
at com.mysql.jdbc.NonRegisteringDriver.<clinit>(NonRegisteringDriver.java:117)
... 47 more
com.google.gwt.user.client.rpc.StatusCodeException: 500 The call failed on the server; see server log for details
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:209)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
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.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
***********************************
слышал, я получил две ошибки
java.security.AccessControlException:
доступ запрещен (java.lang.RuntimePermission modifyThreadGroup)com.google.gwt.user.client.rpc.StatusCodeException:
500 Ошибка вызова на сервере; см. журнал сервера для деталей
Для первого я искал решение в Google. Там написано, выключить движок приложения Google. Поэтому я отключил через свойства проекта.
После этого я запускаю как RunAs-> веб-приложение. Это использовало сервис регистрации причала. просто я выключил GAE. снова я работаю как обычно.. Запустите as-> веб-приложение. Это только я. он работает на сервере кода GWT.
в URL веб-браузера, так что я думаю, что он работает на сервере кода GWT. Но после этого я попробовал это, я создал BlobExample.war и развернул на локальном сервере Tomcat через менеджер. даже это не работает. консоль показывает WARn, как это:
[WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String blob.example.client.BlobService.getBlobStoreUploadUrl()' threw an unexpected exception: com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'blobstore' or call 'CreateUploadURL()' was not found.
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
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:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
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: com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'blobstore' or call 'CreateUploadURL()' was not found.
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:100)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:55)
at com.google.appengine.api.blobstore.BlobstoreServiceImpl.createUploadUrl(BlobstoreServiceImpl.java:68)
at com.google.appengine.api.blobstore.BlobstoreServiceImpl.createUploadUrl(BlobstoreServiceImpl.java:43)
at blob.example.server.BlobServiceImpl.getBlobStoreUploadUrl(BlobServiceImpl.java:42)
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:561)
... 22 more
ERROR: 500 - POST /blobexample/blobservice (127.0.0.1) 57 bytes
Request headers
Host: 127.0.0.1:8888
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
Referer: http://127.0.0.1:8888/index.html?gwt.codesvr=127.0.0.1:9997
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Content-Length: 138
X-GWT-Module-Base: http://127.0.0.1:8888/blobexample/
X-GWT-Permutation: HostedMode
Origin: http://127.0.0.1:8888
Content-Type: text/x-gwt-rpc; charset=UTF-8
Response headers
Content-Type: text/plain
Ошибка отображения файла журнала сервера tomcat:
Jul 11, 2013 12:22:37 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jul 11, 2013 12:22:37 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Jul 11, 2013 12:22:37 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@11013d6')
Jul 11, 2013 12:27:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet blobServlet as unavailable
Jul 11, 2013 12:27:40 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet blobServlet
java.lang.ClassNotFoundException: blob.example.server.BlobServiceImpl
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
так что слушайте, сервер не может найти BlobServiceImpl внутри пакета. Мой код файла web.xml:
<servlet>
<servlet-name>blobServlet</servlet-name>
<servlet-class>blob.example.server.BlobServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>blob.example.server.UploadServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>blobServlet</servlet-name>
<url-pattern>/blobexample/blobservice</url-pattern>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/blobexample/uploadservice</url-pattern>
</servlet-mapping>
я публикую файл localhost_accesess_log на сервере:
127.0.0.1 - - [11/Jul/2013:12:22:42 +0530] "GET / HTTP/1.1" 200 11444
127.0.0.1 - - [11/Jul/2013:12:22:49 +0530] "GET /manager/html HTTP/1.1" 401 2550
127.0.0.1 - root [11/Jul/2013:12:23:01 +0530] "GET /manager/html HTTP/1.1" 200 20917
127.0.0.1 - root [11/Jul/2013:12:23:16 +0530] "POST /manager/html/undeploy? path=/BlobExample&org.apache.catalina.filters.CSRF_NONCE=B32B69B40BCFB089A470FBFBDEC8F263 HTTP/1.1" 200 19247
127.0.0.1 - root [11/Jul/2013:12:27:07 +0530] "POST /manager/html/upload?org.apache.catalina.filters.CSRF_NONCE=F1E8DF0FA23DE56DF7C794EDED7DE094 HTTP/1.1" 200 20917
127.0.0.1 - - [11/Jul/2013:12:27:23 +0530] "GET /BlobExample HTTP/1.1" 302 -
127.0.0.1 - - [11/Jul/2013:12:27:23 +0530] "GET /BlobExample/ HTTP/1.1" 304 -
127.0.0.1 - - [11/Jul/2013:12:27:23 +0530] "GET /BlobExample/blobexample/blobexample.nocache.js HTTP/1.1" 200 7212
127.0.0.1 - - [11/Jul/2013:12:27:24 +0530] "GET /BlobExample/blobexample/EDB6C692B33D6F87EC48FBD829DCDC98.cache.html HTTP/1.1" 200 113731
127.0.0.1 - - [11/Jul/2013:12:27:40 +0530] "POST /BlobExample/blobexample/blobservice HTTP/1.1" 500 3190
Я понял ошибку услышать. Моя серверная программа недоступна для сервера. но это WAR-файл с необработанными файлами в выходной папке. поэтому я не могу измениться.
Я использую версию Eclipse-JUNO 4.2, JRE6, SDK 1.6(это использует наш хостинг-сервер), GWT 2.5.1. где я могу увидеть журнал сервера в затмении. Нужен ли какой-нибудь плагин? Если кто-нибудь даст лучший ответ на мою проблему, спасибо им заранее.