Overview of the Boot.ini File

Overview of the Boot.ini File

The boot.ini file is a text file that contains the boot options for computers with x86 and x86-64 processors. It is located at the root of the system partition, typically c:/boot.ini.

The following sample shows the content of a typical boot.ini file.

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)/WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:/CMDCONS/BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons

The boot.ini file has two main sections:

  • The [boot loader] section contains option settings that apply to all boot entries on the system. The options include timeout, the boot menu time-out value, and default, the location of the default operating system.

    The following sample shows the [boot loader] section of a boot.ini file.

    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(1)/WINDOWS

  • The [operating systems] section is comprised of one or more boot entries for each operating system or bootable program installed on the computer.

    A boot entry is a set of options that defines a load configuration for an operating system or bootable program. The boot entry specifies an operating system or bootable program and the location of its files. It can also include parameters that configure the operating system or program.

    The following sample shows the [operating systems] section of a boot.ini file on a computer with two operating systems, Microsoft Windows XP and Microsoft Windows 2000. It has two boot entries, one for each operating system.

    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional" /fastdetect
    multi(0)disk(0)rdisk(0)partition(2)/WINNT="Microsoft Windows 2000 Professional" /fastdetect

     

 

Each boot entry includes the following elements:

  • The location of the operating system. The boot.ini file uses the Advanced RISC Computing (ARC) naming convention to display the path to the disk partition and directory where the operating system resides. For example:

    multi(0)disk(0)rdisk(0)partition(1)/WINDOWS

  • A friendly name for the boot entry. The friendly name represents the boot entry in the boot menu. The friendly name is surrounded by quotation marks and represents the boot entry in the boot menu. For example:

    "Microsoft Windows XP Professional"

  • Boot entry parameters, also known as boot parameters or load options enable, disable, and configure operating system features. Boot parameters resemble command-line parameters, each beginning with a forward slash (/), such as /debug. You can have zero or more boot parameters on each boot entry.

    For a list of boot parameters relevant to driver testing and debugging, see Boot Parameter Reference.

 

You can have multiple boot entries for the same operating system, each with a different set of boot parameters. Windows creates a standard boot entry when you install the operating system, and you can create additional, customized entries for an operating system by editing the boot.ini file.

Comment

This document describes aspects of the boot.ini file that are of special interest to driver developers and testers. For a more general description of the boot.ini file on x86-based systems, including a list of commonly used boot.ini file parameters, see  Reviewing and Correcting Boot.ini Settings on x86-based Systems in the Microsoft Windows XP Professional Resource Kit Documentation.

2025-07-09 14:59:56.686||||||main|WARN |org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext|591| Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createRestApi' defined in class path resource [com/zhoupu/framework/boot/autoconfiguration/swagger/Swagger2AutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [springfox.documentation.spring.web.plugins.Docket]: Factory method 'createRestApi' threw exception; nested exception is java.lang.NoSuchMethodError: 'com.google.common.base.Predicate springfox.documentation.builders.RequestHandlerSelectors.basePackage(java.lang.String)' 2025-07-09 14:59:56.713||||||main|INFO |org.apache.catalina.core.StandardService|173| Stopping service [Tomcat] 2025-07-09 14:59:56.729||||||main|INFO |org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener|136| Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-07-09 14:59:56.744||||||main|ERROR |org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter|40| *************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: com.zhoupu.framework.boot.autoconfiguration.swagger.Swagger2AutoConfiguration.createRestApi(Swagger2AutoConfiguration.java:57) The following method did not exist: 'com.google.common.base.Predicate springfox.documentation.builders.RequestHandlerSelectors.basePackage(java.lang.String)' The calling method's class, com.zhoupu.framework.boot.autoconfiguration.swagger.Swagger2AutoConfiguration, was loaded from the following location: jar:file:/Users/zhou/.m2/repository/com/zhoupu/zp-spring-boot-autoconfigure/5.0.9/zp-spring-boot-autoconfigure-5.0.9.jar!/com/zhoupu/framework/boot/autoconfiguration/swagger/Swagger2AutoConfiguration.class The called method's class, springfox.documentation.builders.RequestHandlerSelectors, is available from the following locations: jar:file:/Users/zhou/.m2/repository/io/springfox/springfox-core/2.10.5/springfox-core-2.10.5.jar!/springfox/documentation/builders/RequestHandlerSelectors.class The called method's class hierarchy was loaded from the following locations: springfox.documentation.builders.RequestHandlerSelectors: file:/Users/zhou/.m2/repository/io/springfox/springfox-core/2.10.5/springfox-core-2.10.5.jar Action: Correct the classpath of your application so that it contains compatible versions of the classes com.zhoupu.framework.boot.autoconfiguration.swagger.Swagger2AutoConfiguration and springfox.documentation.builders.RequestHandlerSelectors
07-10
在Spring Boot应用启动时遇到`NoSuchMethodError`异常,特别是在与`springfox.documentation.builders.RequestHandlerSelectors.basePackage`方法相关的上下文中,通常表明存在版本兼容性问题。这种错误可能发生在升级Spring Boot或相关依赖库后,由于不同组件之间的不兼容性导致。 ### 原因分析 1. **Swagger与Spring Boot版本不匹配**:`springfox-swagger2`和Spring Boot之间存在严格的版本依赖关系。如果使用的`springfox-swagger2`版本不支持当前的Spring Boot版本,则可能会出现`NoSuchMethodError`。 2. **依赖冲突**:项目中可能存在多个Swagger相关依赖,它们来自不同的来源并具有不同的版本号,这可能导致类路径冲突。 3. **旧版本的SpringFox**:某些旧版本的SpringFox(如低于2.9.2)并不支持较新的Spring Boot版本(如2.6.x及以上),因为`RequestHandlerSelectors.basePackage`方法的行为或签名可能已经改变[^1]。 ### 解决方案 #### 升级SpringFox版本 确保使用的是最新稳定版的SpringFox,以适配新版本的Spring Boot。例如,可以尝试将`springfox-swagger2`升级到`2.9.2`或更高,并且同时更新`springfox-swagger-ui`依赖: ```xml <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> ``` #### 使用SpringDoc替代SpringFox 考虑到SpringFox项目不再积极维护,推荐迁移到更现代的解决方案——[SpringDoc OpenAPI](https://springdoc.org/),它提供了对Spring Boot的良好支持并且持续更新。只需添加以下Maven依赖即可开始使用: ```xml <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>1.6.14</version> <!-- 请检查是否有更新版本 --> </dependency> ``` 此外,在application.properties中启用OpenAPI文档生成: ```properties springdoc.openapi.urls[0]=/v3/api-docs springdoc.openapi.ui.enabled=true ``` #### 检查Spring Boot和Spring Cloud版本对应关系 若项目还集成了Spring Cloud,请确认所用的Spring Boot和Spring Cloud版本是相互兼容的。可以参考官方文档提供的[版本兼容性指南](https://spring.io/projects/spring-cloud#overview)来选择合适的组合[^3]。 #### 清理构建工具缓存 有时候构建工具(如Maven或Gradle)本地仓库中的损坏或过期文件也可能引起此类问题。执行清理操作可以帮助解决由这些陈旧文件引发的问题: - 对于Maven用户,运行`mvn clean install -U`强制更新所有依赖。 - 对于Gradle用户,运行`gradle --refresh-dependencies build`刷新依赖项。 通过上述步骤应该能够有效地诊断并修复由于Swagger配置引起的`NoSuchMethodError`异常。如果问题依旧存在,则建议仔细审查项目的整个依赖树,查找潜在的版本冲突或其他隐藏的问题源。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值