file-type

利用jQuery.ajax自动填充下拉菜单的高级技巧

下载需积分: 8 | 147KB | 更新于2025-05-21 | 84 浏览量 | 0 下载量 举报 收藏
download 立即下载
在Web开发过程中,经常会遇到需要动态填充下拉菜单内容的场景。这可以通过多种方法实现,其中一种有效的方式是使用jQuery结合Ajax技术来实现。本知识点将详细介绍如何利用jQuery的ajax方法,在用户选择第一个下拉列表的某个选项后,根据该选项的值动态填充第二个下拉菜单。 ### jQuery和Ajax概述 **jQuery** 是一个快速、小型且功能丰富的JavaScript库。它使得HTML文档遍历和操作、事件处理、动画和Ajax变得很容易,极大地简化了JavaScript编程。 **Ajax (Asynchronous JavaScript and XML)** 是一种使用现有技术创建更动态网页的技术。它允许网页做到无需重新加载整个页面就能更新网页的部分内容。这主要通过XmlHttpRequest对象来实现,该对象在浏览器中可用,并允许Web应用与服务器交换数据。 ### 动态填充下拉菜单 使用jQuery的ajax方法动态填充下拉菜单的过程大致可以分为以下几个步骤: 1. **HTML结构准备**:首先需要准备两个下拉列表的基本HTML结构,并为它们分别设置合适的id,以便后续使用jQuery选择器进行选取。 2. **定义事件处理器**:在第一个下拉菜单上定义一个事件处理器,通常是`change`事件。这个事件会在用户更改选择时触发。 3. **发起Ajax请求**:在事件处理器中,根据第一个下拉菜单的选择值,使用jQuery的`$.ajax`方法向服务器发起异步请求。请求的URL、数据和回调函数等参数需要根据实际情况进行设置。 4. **处理服务器响应**:服务器响应数据后,回调函数会被执行。在回调函数中处理从服务器返回的数据,并根据这些数据更新第二个下拉菜单的内容。 5. **更新第二个下拉菜单**:使用jQuery对第二个下拉菜单进行操作,可以是清空原有选项并添加新选项,或者是直接追加新选项。 ### 示例代码分析 以下是一个简单的示例代码,用于说明如何使用jQuery的ajax方法根据第一个下拉菜单的选择动态填充第二个下拉菜单: ```html <!-- 第一个下拉菜单 --> <select id="firstDropdown"> <option value="">选择一个选项</option> <option value="1">选项1</option> <option value="2">选项2</option> </select> <!-- 第二个将要填充的下拉菜单 --> <select id="secondDropdown"> <option value="">选择一个选项</option> </select> ``` ```javascript $(document).ready(function() { // 绑定change事件到第一个下拉菜单 $('#firstDropdown').change(function() { var selectedValue = $(this).val(); // 获取选中的值 // 使用ajax向服务器发送请求,这里假设返回的是JSON格式的数据 $.ajax({ url: 'path/to/server/endpoint', // 服务器端点URL type: 'GET', // 请求类型 data: { 'selectedValue': selectedValue // 传递选中的值 }, dataType: 'json', // 预期服务器返回的数据类型 success: function(response) { // 清空第二个下拉菜单 $('#secondDropdown').empty(); // 假设response是一个包含新选项的数组 $.each(response, function(index, item) { // 对于response中的每一个项目,创建新的option并添加到第二个下拉菜单中 $('#secondDropdown').append($('<option></option>').val(item.value).html(item.text)); }); }, error: function(xhr, status, error) { // 请求失败时的处理逻辑 console.error("请求失败:" + status + ", " + error); } }); }); }); ``` ### 实际应用注意事项 在实际开发中,进行Ajax请求时,需要确保服务器端点能够正确响应并返回预期格式的数据。此外,还应当考虑网络延迟、跨域请求、数据安全性等问题,并采取相应的措施进行处理。 - **跨域问题**:如果Ajax请求需要跨域,那么服务器端需要支持CORS(跨源资源共享)。 - **数据安全性**:传输敏感数据时,应使用HTTPS来保证数据传输过程的安全。 - **错误处理**:在实际应用中,除了请求成功后的处理逻辑,也应完善错误处理逻辑,对请求失败进行相应的用户提示。 - **用户体验优化**:在发起Ajax请求时,可能需要显示加载指示器给用户反馈,避免用户在等待响应过程中感到困惑。 以上就是利用jQuery的ajax方法动态填充下拉菜单的知识点总结。熟练掌握并应用这些技术,可以有效提升Web应用的交互性和用户体验。

相关推荐

filetype

C:\Users\Administrator\.jdks\ms-17.0.15\bin\java.exe -XX:TieredStopAtLevel=1 -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:C:\Users\Administrator\AppData\Local\Programs\IntelliJ IDEA Ultimate 2025.1.3\lib\idea_rt.jar=63069" -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\IdeaProjects\demo1\target\classes;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-starter-jdbc\2.6.13\spring-boot-starter-jdbc-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-starter\2.6.13\spring-boot-starter-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot\2.6.13\spring-boot-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-autoconfigure\2.6.13\spring-boot-autoconfigure-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-starter-logging\2.6.13\spring-boot-starter-logging-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;D:\apache-maven-3.9.10\maven-repository\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;D:\apache-maven-3.9.10\maven-repository\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;D:\apache-maven-3.9.10\maven-repository\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;D:\apache-maven-3.9.10\maven-repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;D:\apache-maven-3.9.10\maven-repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\apache-maven-3.9.10\maven-repository\org\yaml\snakeyaml\1.29\snakeyaml-1.29.jar;D:\apache-maven-3.9.10\maven-repository\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;D:\apache-maven-3.9.10\maven-repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-jdbc\5.3.23\spring-jdbc-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-beans\5.3.23\spring-beans-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-tx\5.3.23\spring-tx-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-starter-web\2.6.13\spring-boot-starter-web-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-starter-json\2.6.13\spring-boot-starter-json-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\com\fasterxml\jackson\core\jackson-databind\2.13.4.2\jackson-databind-2.13.4.2.jar;D:\apache-maven-3.9.10\maven-repository\com\fasterxml\jackson\core\jackson-annotations\2.13.4\jackson-annotations-2.13.4.jar;D:\apache-maven-3.9.10\maven-repository\com\fasterxml\jackson\core\jackson-core\2.13.4\jackson-core-2.13.4.jar;D:\apache-maven-3.9.10\maven-repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.4\jackson-datatype-jdk8-2.13.4.jar;D:\apache-maven-3.9.10\maven-repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.4\jackson-datatype-jsr310-2.13.4.jar;D:\apache-maven-3.9.10\maven-repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.4\jackson-module-parameter-names-2.13.4.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\boot\spring-boot-starter-tomcat\2.6.13\spring-boot-starter-tomcat-2.6.13.jar;D:\apache-maven-3.9.10\maven-repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.68\tomcat-embed-core-9.0.68.jar;D:\apache-maven-3.9.10\maven-repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.68\tomcat-embed-el-9.0.68.jar;D:\apache-maven-3.9.10\maven-repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.68\tomcat-embed-websocket-9.0.68.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-web\5.3.23\spring-web-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-webmvc\5.3.23\spring-webmvc-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-aop\5.3.23\spring-aop-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-context\5.3.23\spring-context-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-expression\5.3.23\spring-expression-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.2.2\mybatis-spring-boot-starter-2.2.2.jar;D:\apache-maven-3.9.10\maven-repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.2.2\mybatis-spring-boot-autoconfigure-2.2.2.jar;D:\apache-maven-3.9.10\maven-repository\org\mybatis\mybatis\3.5.9\mybatis-3.5.9.jar;D:\apache-maven-3.9.10\maven-repository\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\apache-maven-3.9.10\maven-repository\com\h2database\h2\1.4.200\h2-1.4.200.jar;D:\apache-maven-3.9.10\maven-repository\com\mysql\mysql-connector-j\8.0.31\mysql-connector-j-8.0.31.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-core\5.3.23\spring-core-5.3.23.jar;D:\apache-maven-3.9.10\maven-repository\org\springframework\spring-jcl\5.3.23\spring-jcl-5.3.23.jar com.example.demo.Demo1Application . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.6.13) 2025-07-11 15:49:04.751 INFO 11328 --- [ main] com.example.demo.Demo1Application : Starting Demo1Application using Java 17.0.15 on 闫晓强 with PID 11328 (C:\Users\Administrator\IdeaProjects\demo1\target\classes started by Administrator in C:\Users\Administrator\IdeaProjects\demo1) 2025-07-11 15:49:04.753 INFO 11328 --- [ main] com.example.demo.Demo1Application : No active profile set, falling back to 1 default profile: "default" 2025-07-11 15:49:05.202 WARN 11328 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.example.demo]' package. Please check your configuration. 2025-07-11 15:49:05.483 INFO 11328 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2025-07-11 15:49:05.490 INFO 11328 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2025-07-11 15:49:05.490 INFO 11328 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.68] 2025-07-11 15:49:05.561 INFO 11328 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2025-07-11 15:49:05.561 INFO 11328 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 772 ms 2025-07-11 15:49:05.583 INFO 11328 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2025-07-11 15:49:05.701 INFO 11328 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2025-07-11 15:49:05.707 INFO 11328 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:mysql://localhost:3306/mysqlservicedbone?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8' 2025-07-11 15:49:05.860 INFO 11328 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] 2025-07-11 15:49:05.967 WARN 11328 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.UncategorizedScriptException: Failed to execute database script from resource [class path resource [schema.sql]]; nested exception is java.lang.IllegalArgumentException: 'script' must not be null or empty 2025-07-11 15:49:05.968 INFO 11328 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2025-07-11 15:49:05.974 INFO 11328 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2025-07-11 15:49:05.976 INFO 11328 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-07-11 15:49:05.983 INFO 11328 --- [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-07-11 15:49:05.995 ERROR 11328 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.UncategorizedScriptException: Failed to execute database script from resource [class path resource [schema.sql]]; nested exception is java.lang.IllegalArgumentException: 'script' must not be null or empty at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.23.jar:5.3.23] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.6.13.jar:2.6.13] at com.example.demo.Demo1Application.main(Demo1Application.java:10) ~[classes/:na] Caused by: org.springframework.jdbc.datasource.init.UncategorizedScriptException: Failed to execute database script from resource [class path resource [schema.sql]]; nested exception is java.lang.IllegalArgumentException: 'script' must not be null or empty at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:305) ~[spring-jdbc-5.3.23.jar:5.3.23] at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:254) ~[spring-jdbc-5.3.23.jar:5.3.23] at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:54) ~[spring-jdbc-5.3.23.jar:5.3.23] at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.runScripts(DataSourceScriptDatabaseInitializer.java:90) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.runScripts(AbstractScriptDatabaseInitializer.java:145) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyScripts(AbstractScriptDatabaseInitializer.java:107) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applySchemaScripts(AbstractScriptDatabaseInitializer.java:97) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:75) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65) ~[spring-boot-2.6.13.jar:2.6.13] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar:5.3.23] ... 18 common frames omitted Caused by: java.lang.IllegalArgumentException: 'script' must not be null or empty at org.springframework.util.Assert.hasText(Assert.java:289) ~[spring-core-5.3.23.jar:5.3.23] at org.springframework.jdbc.datasource.init.ScriptUtils.splitSqlScript(ScriptUtils.java:636) ~[spring-jdbc-5.3.23.jar:5.3.23] at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:252) ~[spring-jdbc-5.3.23.jar:5.3.23] ... 28 common frames omitted 进程已结束,退出代码为 1 解释是什么意思并给出解决方法

filetype

:-1: error: CMake project configuration failed. No CMake configuration for build type "Debug" found. Check General Messages for more information. :-1: error: The command "C:\Program Files\CMake\bin\cmake.exe -S D:/folderD/Git/qgroundcontrol -B D:/folderD/Git/qgroundcontrol/build/Desktop_Qt_6_8_3_MSVC2022_64bit-Debug "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.8.3/msvc2022_64" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=D:\folderD\Git\qgroundcontrol\build\Desktop_Qt_6_8_3_MSVC2022_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.8.3/msvc2022_64/bin/qmake.exe" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/cl.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/cl.exe"" terminated with exit code 1. D:\folderD\Git\qgroundcontrol\src\MAVLink\CMakeLists.txt:36: error: Build step for mavlink failed: 1 Call stack: D:/folderD/Git/qgroundcontrol/src/MAVLink/CMakeLists.txt:36 (CPMAddPackage) D:/folderD/Git/qgroundcontrol/cmake/modules/CPM.cmake:917 (cpm_fetch_package) D:/folderD/Git/qgroundcontrol/cmake/modules/CPM.cmake:1136 (FetchContent_MakeAvailable) C:/Program Files/CMake/share/cmake-4.0/Modules/FetchContent.cmake:2384 (__FetchContent_Populate) C:/Program Files/CMake/share/cmake-4.0/Modules/FetchContent.cmake:2145 (cmake_language) C:/Program Files/CMake/share/cmake-4.0/Modules/FetchContent.cmake:2145:EVAL:2 (__FetchContent_doPopulation) C:/Program Files/CMake/share/cmake-4.0/Modules/FetchContent.cmake:1609 (__FetchContent_populateSubbuild) C:/Program Files/CMake/share/cmake-4.0/Modules/FetchContent.cmake:1918 (message) :-1: error: ninja: build stopped: subcommand failed. D:\folderD\Git\qgroundcontrol\build\Desktop_Qt_6_8windows

filetype

发生crash的原因,通俗易懂的方式 03-24 02:03:30.588411 1442 1442 I emdlogger: mtk-brm-commit-id:04ab5bd912477cf2320dee54df9ac8b535476f2d 03-24 02:03:30.588544 1442 1442 I emdlogger: mtk-brm-change-id:Ib405363e450403587f3a66bbe5b353966c086aba 03-24 02:03:30.588549 1442 1442 I emdlogger: mtk-brm-merge-id:none 03-24 02:03:31.227364 1380 1380 I libimsma_adapt: mtk-brm-commit-id:8783a29bae0ae84a456239f3212f27bdafa94c91 03-24 02:03:31.227383 1380 1380 I libimsma_adapt: mtk-brm-change-id:Iee598bb542f5de895a4b71649fbc79b2d93bc3de 03-24 02:03:31.227386 1380 1380 I libimsma_adapt: mtk-brm-merge-id:none 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: FATAL EXCEPTION: main 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: Process: com.ss.android.article.news, PID: 32732 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at androidx.fragment.app.FragmentTransaction.doAddOp(SourceFile:67502080) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at androidx.fragment.app.BackStackRecord.doAddOp(SourceFile:67174400) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at androidx.fragment.app.FragmentTransaction.add(SourceFile:50462721) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at com.bytedance.mediachooser.utils.FragmentPagerAdapter.instantiateItem(SourceFile:33816623) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at com.ss.android.article.base.feature.main.CateAdapter.instantiateItem(SourceFile:33816576) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at androidx.viewpager.widget.ViewPager.addNewItem(SourceFile:33816585) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at androidx.viewpager.widget.ViewPager.populate(SourceFile:17301881) 03-26 09:44:41.575243 32732 32732 E AndroidRuntime: at androidx.viewpager.widget.ViewPager.populate(SourceFile:655

filetype

| WARNING: Backtrace (BB generated script): | #1: do_configure, /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/temp/run.do_configure.1013554, line 152 | #2: main, /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/temp/run.do_configure.1013554, line 156 ERROR: Task (/home/tisdk/tisdk/sources/oe-core/meta/recipes-devtools/qemu/qemu-native_8.2.2.bb:do_configure) failed with exit code '1' WARNING: qemu-native-8.2.2-r0 do_populate_lic: Could not copy license file /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/qemu-8.2.2/COPYING to /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/license-destdir/x86_64/qemu-native/COPYING: [Errno 2] No such file or directory: '/home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/qemu-8.2.2/COPYING' WARNING: qemu-native-8.2.2-r0 do_populate_lic: Could not copy license file /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/qemu-8.2.2/COPYING.LIB to /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/license-destdir/x86_64/qemu-native/COPYING.LIB: [Errno 2] No such file or directory: '/home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/qemu-8.2.2/COPYING.LIB' ERROR: qemu-native-8.2.2-r0 do_populate_lic: QA Issue: qemu-native: LIC_FILES_CHKSUM points to an invalid file: /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/qemu-8.2.2/COPYING [license-checksum] ERROR: qemu-native-8.2.2-r0 do_populate_lic: QA Issue: qemu-native: LIC_FILES_CHKSUM points to an invalid file: /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/qemu-8.2.2/COPYING.LIB [license-checksum] ERROR: qemu-native-8.2.2-r0 do_populate_lic: Fatal QA errors were found, failing task. ERROR: Logfile of failure stored in: /home/tisdk/tisdk/build/arago-tmp-default-glibc/work/x86_64-linux/qemu-native/8.2.2/temp/log.do_populate_lic.1121716 ERROR: Task (/home/tisdk/tisdk/sources/oe-core/meta/recipes-devtools/qemu/qemu-native_8.2.2.bb:do_populate_lic) failed with exit code '1'

filetype

--------------------------------------------------------------------------- HttpError Traceback (most recent call last) File d:\shutu\envs\gee\lib\site-packages\ee\data.py:408, in _execute_cloud_call(call, num_retries) 407 try: --> 408 return call.execute(num_retries=num_retries) 409 except googleapiclient.errors.HttpError as e: File d:\shutu\envs\gee\lib\site-packages\googleapiclient\_helpers.py:130, in positional.<locals>.positional_decorator.<locals>.positional_wrapper(*args, **kwargs) 129 logger.warning(message) --> 130 return wrapped(*args, **kwargs) File d:\shutu\envs\gee\lib\site-packages\googleapiclient\http.py:938, in HttpRequest.execute(self, http, num_retries) 937 if resp.status >= 300: --> 938 raise HttpError(resp, content, uri=self.uri) 939 return self.postproc(resp, content) HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1/projects/624023639568/value:compute?prettyPrint=false&alt=json returned "User memory limit exceeded.". Details: "User memory limit exceeded."> During handling of the above exception, another exception occurred: EEException Traceback (most recent call last) Cell In[36], line 59 51 water_area_dict = water_area.reduceRegion( 52 reducer=ee.Reducer.sum(), 53 geometry=roi, 54 scale=30, 55 maxPixels=1e13 56 ) 58 # 提取面积值 ---> 59 keys = list(water_area_dict.getInfo().keys()) # 确保获取正确 key 60 if keys: 61 key_name = keys[0] # 获取 key File d:\shutu\envs\gee\lib\site-packages\ee\computedobject.py:107, in ComputedObject.getInfo(self) 101 def getInfo(self) -> Optional[Any]: 102 """Fetch and return information about this object. 103 104 Returns: 105 The object can evaluate to anything. 106 """ --> 107 return data.computeValue(self) File d:\shutu\envs\gee\lib\site-packages\ee\data.py:1128, in computeValue(obj) 1125 body = {'expression': serializer.encode(obj, for_cloud_api=True)} 1126 _maybe_populate_workload_tag(body) -> 1128 return _execute_cloud_call( 1129 _get_cloud_projects() 1130 .value() 1131 .compute(body=body, project=_get_projects_path(), prettyPrint=False) 1132 )['result'] File d:\shutu\envs\gee\lib\site-packages\ee\data.py:410, in _execute_cloud_call(call, num_retries) 408 return call.execute(num_retries=num_retries) 409 except googleapiclient.errors.HttpError as e: --> 410 raise _translate_cloud_exception(e) EEException: User memory limit exceeded.

Ruin-鸣
  • 粉丝: 32
上传资源 快速赚钱