GWT 项目开发 1.6.4 本地开发 appengine-tools-api 突破限制
2023-09-11 14:21:14 时间
就可以再本地环境适应 hibernate 连接数据库。创建线程,创建文件等操作。(当然你改的是本地环境。google服务器上的是没有办法了。)
这样做主要是为了开发 gwt 应用的。
修改类如下:
/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. package com.google.appengine.tools.development; import com.google.apphosting.utils.security.SecurityManagerInstaller; import java.io.File; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.security.Permission; import java.security.Permissions; import java.util.*; // Referenced classes of package com.google.appengine.tools.development: // DevAppServerClassLoader, DevAppServer, AppContext public class DevAppServerFactory { private static class CustomSecurityManager extends SecurityManager { private synchronized boolean appHasPermission(Permission perm) { return true; /** 直接返回 */ public void checkPermission(Permission perm) { return; /** 直接返回 */ public void checkPermission(Permission perm, Object context) { return; /** 直接返回 */ public void checkAccess(ThreadGroup g) { return; /** 直接返回 */ public void checkAccess(Thread t) { return; /** 直接返回 */ public boolean isDevAppServerThread() { return true; /** 直接返回 */ private StackTraceElement getCallerFrame() { StackTraceElement frames[] = Thread.currentThread().getStackTrace(); for (int i = 1; i frames.length; i++) if (!"checkAccess".equals(frames[i].getMethodName()) !getClass().getName().equals( frames[i].getClassName())) return frames[i]; throw new IllegalStateException( "Unable to determine calling frame."); private static final RuntimePermission PERMISSION_MODIFY_THREAD_GROUP = new RuntimePermission( "modifyThreadGroup"); private static final RuntimePermission PERMISSION_MODIFY_THREAD = new RuntimePermission( "modifyThread"); private static final String KEYCHAIN_JNILIB = "/libkeychain.jnilib"; private static final Object PERMISSION_LOCK = new Object(); private final DevAppServer devAppServer; public CustomSecurityManager(DevAppServer devAppServer) { this.devAppServer = devAppServer; public DevAppServerFactory() { public DevAppServer createDevAppServer(File appDir, String address, int port) { return createDevAppServer(appDir, null, null, address, port, true); private DevAppServer createDevAppServer(File appDir, File webXmlLocation, File appEngineWebXmlLocation, String address, int port, boolean useCustomStreamHandler) { return createDevAppServer(appDir, webXmlLocation, appEngineWebXmlLocation, address, port, useCustomStreamHandler, true, ((Map) (new HashMap()))); public DevAppServer createDevAppServer(File appDir, File webXmlLocation, File appEngineWebXmlLocation, String address, int port, boolean useCustomStreamHandler, boolean installSecurityManager, Collection classpath) { Map containerConfigProps = newContainerConfigPropertiesForTest(classpath); return createDevAppServer(appDir, webXmlLocation, appEngineWebXmlLocation, address, port, useCustomStreamHandler, installSecurityManager, containerConfigProps); private Map newContainerConfigPropertiesForTest(Collection classpath) { Map containerConfigProps = new HashMap(); Map userCodeClasspathManagerProps = new HashMap(); userCodeClasspathManagerProps.put( "devappserver.userCodeClasspathManager.classpath", classpath); userCodeClasspathManagerProps.put( "devappserver.userCodeClasspathManager.requiresWebInf", Boolean.valueOf(false)); containerConfigProps.put("devappserver.userCodeClasspathManager", userCodeClasspathManagerProps); return containerConfigProps; private DevAppServer createDevAppServer(File appDir, File webXmlLocation, File appEngineWebXmlLocation, String address, int port, boolean useCustomStreamHandler, boolean installSecurityManager, Map containerConfigProperties) { if (installSecurityManager) SecurityManagerInstaller.install(new URL[0]); DevAppServerClassLoader loader = DevAppServerClassLoader .newClassLoader(com.google.appengine.tools.development.DevAppServerFactory.class .getClassLoader()); testAgentIsInstalled(); DevAppServer devAppServer; try { Class devAppServerClass = Class.forName( "com.google.appengine.tools.development.DevAppServerImpl", true, loader); Constructor cons = devAppServerClass .getConstructor(DEV_APPSERVER_CTOR_ARG_TYPES); cons.setAccessible(true); devAppServer = (DevAppServer) cons.newInstance(new Object[] { appDir, webXmlLocation, appEngineWebXmlLocation, address, Integer.valueOf(port), Boolean.valueOf(useCustomStreamHandler), containerConfigProperties }); } catch (Exception e) { Throwable t = e; if (e instanceof InvocationTargetException) t = e.getCause(); throw new RuntimeException("Unable to create a DevAppServer", t); if (installSecurityManager) System.setSecurityManager(new CustomSecurityManager(devAppServer)); return devAppServer; private void testAgentIsInstalled() { try { // AppEngineDevAgent.getAgent(); } catch (Throwable t) { String msg = "Unable to locate the App Engine agent. Please use dev_appserver, KickStart, or set the jvm flag: \"-javaagent: sdk_root /lib/agent/appengine-agent.jar\""; throw new RuntimeException(msg, t); static final String DEV_APP_SERVER_CLASS = "com.google.appengine.tools.development.DevAppServerImpl"; private static final Class DEV_APPSERVER_CTOR_ARG_TYPES[]; private static final String USER_CODE_CLASSPATH_MANAGER_PROP = "devappserver.userCodeClasspathManager"; private static final String USER_CODE_CLASSPATH = "devappserver.userCodeClasspathManager.classpath"; private static final String USER_CODE_REQUIRES_WEB_INF = "devappserver.userCodeClasspathManager.requiresWebInf"; static { DEV_APPSERVER_CTOR_ARG_TYPES = (new Class[] { java.io.File.class, java.io.File.class, java.io.File.class, java.lang.String.class, Integer.TYPE, Boolean.TYPE, java.util.Map.class }); * DECOMPILATION REPORT * Decompiled from: * D:\soft\eclipse_3.7.2\plugins\com.google.appengine.eclipse.sdkbundle_1 * .6.4.v201203300216r37\appengine-java-sdk-1.6.4\lib\appengine-tools-api.jar * Total time: 174 ms Jad reported messages/errors: Overlapped try statements * detected. Not all exception handlers will be resolved in the method * appHasPermission Couldnt fully decompile method appHasPermission Couldnt * resolve all exception handlers in method appHasPermission Exit status: 0 * Caught exceptions: */
附件是 appengine-java-sdk-1.6.4\lib\appengine-tools-api.jar 的jar包。替换就可以了。
jar 文件大于 10 MB 所以压缩了下。解压缩再替换。
APICloud-Tools-Core-APICloud 开发工具核心库 APICloud 开发工具核心库,支持新建页面模板,新建应用模板,WiFi 同步等核心功能。 开发者可基于此核心库,定制各种编辑器插件或者将 APICloud 的开发调试功能与已有的自动化业务流程结合,提升开发效率。
模板工程搭建:Web-SDK/Library 此系列会与时俱进的不断更新 包含Node/Web SDK,单组件,组件库,Eslint插件,Webpack插件,Vite插件,MonoRepo等等工程化相关能力的模板建设
相关文章
- jsp中【<%=request.getContextPath()%>】项目路径
- c# asp.net mvc API接口安全过滤,api域名过滤,api域名+端口过滤,权限,鉴权
- 能源项目xml文件标签释义--DefaultAdvisorAutoProxyCreator
- iview+vue 项目中使用树结构
- “三招“破idea创建maven项目速度慢问题
- Spring Boot 之 RESTfull API简单项目的快速搭建(三)
- 103分布式电商项目 - JVM调优(实战篇)
- 05分布式电商项目 - 注册中心 Zookeeper
- C++第9周项目2参考——个人所得税计算器
- 《精通Python网络爬虫:核心技术、框架与项目实战》——1.4 网络爬虫的类型
- Vue项目--尚品汇(axios重写,代理服务器、API统一管理)
- 对一个前端使用AngularJS后端使用ASP.NET Web API项目的理解(1)
- 《Python极客项目编程 》——2.2 所需模块
- 《JavaScript开发框架权威指南》——2.3 将Grunt添加到项目中
- 基于Python实现(Web)项目管理信息系统【100010632】
- Vue项目中使用svg图标
- kotlin anko 第一个项目
- ThinkPHP6项目基操(5.封装API数据格式及业务状态码统一管理)
- laravel 5.5 api接口开发:JWT安装+实现API token 认证
- 【Hadoop学习项目】2. 数据去重
- Codeigniter项目使用phpDocumentor生成api文档
- Android 百度地图开发(一)--- 申请API Key和在项目中显示百度地图
- GE在越南签署800兆瓦风力发电项目协议
- 英特尔为RRP物联网平台项目预留1亿美元开发资金