Google App EngineにWebアプリケーションを配備しました。配備自体は成功したのですが、サイトにアクセスすると下記のようなエラーが出てしまいます。JDK7を使用、JDBCはojdbc7.jarとmysql-connector-java-5.1.34-bin.jarを試しましたが、いずれも同じエラーが発生してしまいます。
DBはGoogle Cloud SQLにMySQLのデータベースを配備してあります。
どなたかお分かりになる方いらっしゃいましたら、アドバイスお願いします。よろしくお願いいたします。
oracle.jdbc.driver.OracleDriver registerMBeans: Error while registering Oracle JDBC Diagnosability MBean.
java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
at >com.google.apphosting.runtime.security.shared.stub.java.lang.management.ManagementFactory.(ManagementFactory.java)
at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:327)
at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:209)
at >com.google.apphosting.runtime.security.shared.intercept.java.security.AccessController_.doPrivileged(AccessController_.java:34)
at oracle.jdbc.driver.OracleDriver.(OracleDriver.java:205)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at >sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at >sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:370)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
at java.sql.DriverManager$2.run(DriverManager.java:510)
at java.sql.DriverManager$2.run(DriverManager.java:490)
at java.security.AccessController.doPrivileged(Native Method)
at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:490)
at java.sql.DriverManager.(DriverManager.java:100)
at com.mysql.jdbc.Driver.(Driver.java:63)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at >com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.loadClassOrStub(Class_.java:536)
at >com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.access$100(Class_.java:42)
at >com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_$2.run(Class_.java:128)
at >com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_$2.run(Class_.java:123)
at java.security.AccessController.doPrivileged(Native Method)
at >com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.forName(Class_.java:123)
at utility.DAO.connect(DAO.java:31)
at anki_note.AnkiNote.doPost(AnkiNote.java:76)
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.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
at >org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at >com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at >org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at >com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
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 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.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:254)
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.headerComplete(HttpConnection.java:923)
at >com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at >com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
at >com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:527)
at >com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
at >com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
at >com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
at >com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
at >com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
at >com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:724)
Here is my source code to connect to my database.
public static final String DB_URL = "jdbc:google:mysql://caramel-clover-813:myapplication?user=root";
public static final String DB_USER = "user";
public static final String DB_PASSWORD = "xxxx";
public boolean connect()
{
boolean is_connect = false;
try
{
Class.forName("com.mysql.jdbc.GoogleDriver");
this.conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);
this.stmt = this.conn.createStatement();
is_connect = true;
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
return is_connect;
}