jdk6:System.console()简介

本文探讨了SCJP认证过程中遇到的JDK6新增特性——Console类。通过示例代码解释了如何使用Console类与命令行交互,包括读取用户名和密码等操作。同时介绍了获取Console实例的条件及限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近再考SCJP的认证,看得资料是055的,想考065,结果在做试题的时候发现了一些新东西。是jdk6的新增东西,原题如下:

Given:
import java.io.Console;
public class TestThis implements Runnable {
	public static void main(String[] args) {
		Thread t=new Thread(new TestThis());
		t.start();
		Thread t2=new Thread(new TestThis());
		t2.start();
		Console c=System.console();
		String u=c.readLine("%s","m ");
		System.out.print(u+"");
	}
	public void run() {
		Console c=System.console();
		Console c=System.console();
		String u=c.readLine("%s","t ");
		System.out.print(u+"");
	}
}

What is the result?(Choose all that apply)
A:Compilation fails.
B:A NullPointerException is never thrown.
C:A NullPointerException is always thrown.
D:A NullPointerException is sometimes thrown.

 

其中的原因是控制台对象并不是每次都能分配得的到的,视具体的环境而定。

下面是转载的资料(http://developer.51cto.com/art/200907/135170.htm),看一下就明白了:

JDK 6中提供了java.io.Console类专用来访问基于字符的控制台设备。如果你的Java程序要与Windows下的cmd或者Linux下的Terminal交互,就可以用这个Java Console类代劳。

TestConsole.java 代码:

package com.simon.testjdk6.console;    
import java.io.Console;           
public class TestConsole {             
  /**          * @param args          */     
    public static void main(String[] args) {         
         Console console = System.console(); // 获得Console实例对象             
      if (console != null) { // 判断是否有控制台的使用权                  
          String user = new String(console.readLine("Enter username:"));// 读取整行字符                  
          String pwd = new String(console.readPassword("Enter passowrd:"));   // 读取密码,输入时不显示   
          console.printf("Username is: " + user + "\n");// 显示用户名                  
          console.printf("Password is: " + pwd + "\n");   // 显示密码     
      } else {     
                 System.out.println("Console is unavailable.");  // 提示无控制台使用权限            
      }            
   }        
}     

Java要与Console进行交互,不总是能得到可用的Java Console类的。一个JVM是否有可用的Console,依赖于底层平台和JVM如何被调用。如果JVM是在交互式命令行(比如Windows的cmd)中启动的,并且输入输出没有重定向到另外的地方,那么就我们可以得到一个可用的Console实例。

当你有Eclipse或NetBean中运行以上代码时Console中将会有以下文字输出:

Console is unavailable.

 表示Java程序无法获得Console实例,是因为JVM不是在命令行中被调用的,或者输入输出被重定向了。

在控制台中运行代码,效果将如下所示:

 

 

$ java com.simon.testjdk6.console.TestConsole 
Enter user:Simon  
Enter passowrd:  
User is:Simon  
Password is:12345 

我们可以看到:输入密码时,控制台时不显示我们所输入的密码字符。但是程序可以得到并输出的密码字符串。这就是JDK 6中新增的Java Console类的运行方式。

或者在这里也会看到相关资料:http://wangyu.iteye.com/blog/193466

排查结果如下: 1.使用mvn dependency:tree返回如下信息: [INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ zysygh --- [INFO] com.ghzy:zysygh:jar:0.1.196 [INFO] +- org.springframework.boot:spring-boot-starter-data-redis:jar:2.2.13.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.2.13.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot:jar:2.2.13.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.13.RELEASE:compile [INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile [INFO] | | \- org.yaml:snakeyaml:jar:1.25:runtime [INFO] | +- org.springframework.data:spring-data-redis:jar:2.2.12.RELEASE:compile [INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:2.2.12.RELEASE:compile [INFO] | | | \- org.springframework.data:spring-data-commons:jar:2.2.12.RELEASE:compile [INFO] | | +- org.springframework:spring-tx:jar:5.2.12.RELEASE:compile [INFO] | | +- org.springframework:spring-oxm:jar:5.2.12.RELEASE:compile [INFO] | | \- org.springframework:spring-aop:jar:5.2.12.RELEASE:compile [INFO] | \- io.lettuce:lettuce-core:jar:5.2.2.RELEASE:compile [INFO] | +- io.netty:netty-common:jar:4.1.58.Final:compile [INFO] | +- io.netty:netty-handler:jar:4.1.58.Final:compile [INFO] | | +- io.netty:netty-resolver:jar:4.1.58.Final:compile [INFO] | | +- io.netty:netty-buffer:jar:4.1.58.Final:compile [INFO] | | \- io.netty:netty-codec:jar:4.1.58.Final:compile [INFO] | +- io.netty:netty-transport:jar:4.1.58.Final:compile [INFO] | \- io.projectreactor:reactor-core:jar:3.3.13.RELEASE:compile [INFO] | \- org.reactivestreams:reactive-streams:jar:1.0.3:compile [INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:2.2.13.RELEASE:compile [INFO] | +- org.springframework:spring-context-support:jar:5.2.12.RELEASE:compile [INFO] | | +- org.springframework:spring-beans:jar:5.2.12.RELEASE:compile [INFO] | | \- org.springframework:spring-context:jar:5.2.12.RELEASE:compile [INFO] | \- com.sun.mail:jakarta.mail:jar:1.6.5:compile [INFO] | \- com.sun.activation:jakarta.activation:jar:1.2.2:compile [INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:2.2.13.RELEASE:compile [INFO] | +- org.thymeleaf:thymeleaf-spring5:jar:3.0.12.RELEASE:compile [INFO] | | \- org.thymeleaf:thymeleaf:jar:3.0.12.RELEASE:compile [INFO] | | +- org.attoparser:attoparser:jar:2.0.5.RELEASE:compile [INFO] | | \- org.unbescape:unbescape:jar:1.1.6.RELEASE:compile [INFO] | \- org.thymeleaf.extras:thymeleaf-extras-java8time:jar:3.0.4.RELEASE:compile [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.2.13.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.2.13.RELEASE:compile [INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.5:compile [INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.5:compile [INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.5:compile [INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.13.RELEASE:compile [INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.41:compile [INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.41:compile [INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.41:compile [INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.13.RELEASE:compile [INFO] | | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile [INFO] | | \- org.hibernate.validator:hibernate-validator:jar:6.0.22.Final:compile [INFO] | | +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile [INFO] | | \- com.fasterxml:classmate:jar:1.5.1:compile [INFO] | +- org.springframework:spring-web:jar:5.2.12.RELEASE:compile [INFO] | \- org.springframework:spring-webmvc:jar:5.2.12.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:5.2.12.RELEASE:compile [INFO] +- org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:2.3.2:compile [INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.13.RELEASE:compile [INFO] | | +- com.zaxxer:HikariCP:jar:3.4.5:compile [INFO] | | \- org.springframework:spring-jdbc:jar:5.2.12.RELEASE:compile [INFO] | +- org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:jar:2.3.2:compile [INFO] | \- org.mybatis:mybatis-spring:jar:2.1.2:compile [INFO] +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.13.RELEASE:compile [INFO] | +- ch.qos.logback:logback-classic:jar:1.2.3:compile [INFO] | | \- ch.qos.logback:logback-core:jar:1.2.3:compile [INFO] | \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile [INFO] +- mysql:mysql-connector-java:jar:8.0.26:runtime [INFO] +- org.projectlombok:lombok:jar:1.18.16:compile (optional) [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.2.13.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test:jar:2.2.13.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.13.RELEASE:test [INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test [INFO] | | \- net.minidev:json-smart:jar:2.3:test [INFO] | | \- net.minidev:accessors-smart:jar:1.2:test [INFO] | | \- org.ow2.asm:asm:jar:5.0.4:test [INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test [INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test [INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test [INFO] | | +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test [INFO] | | | +- org.opentest4j:opentest4j:jar:1.2.0:test [INFO] | | | \- org.junit.platform:junit-platform-commons:jar:1.5.2:test [INFO] | | +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test [INFO] | | \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test [INFO] | +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:test [INFO] | | +- org.apiguardian:apiguardian-api:jar:1.1.0:test [INFO] | | +- org.junit.platform:junit-platform-engine:jar:1.5.2:test [INFO] | | \- junit:junit:jar:4.12:test [INFO] | +- org.mockito:mockito-junit-jupiter:jar:3.1.0:test [INFO] | +- org.assertj:assertj-core:jar:3.13.2:test [INFO] | +- org.hamcrest:hamcrest:jar:2.1:test [INFO] | +- org.mockito:mockito-core:jar:3.1.0:test [INFO] | | +- net.bytebuddy:byte-buddy:jar:1.10.19:test [INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.10.19:test [INFO] | | \- org.objenesis:objenesis:jar:2.6:test [INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test [INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test [INFO] | +- org.springframework:spring-core:jar:5.2.12.RELEASE:compile [INFO] | | \- org.springframework:spring-jcl:jar:5.2.12.RELEASE:compile [INFO] | +- org.springframework:spring-test:jar:5.2.12.RELEASE:test [INFO] | \- org.xmlunit:xmlunit-core:jar:2.6.4:test [INFO] +- com.aliyun:aliyun-java-sdk-core:jar:4.5.3:compile [INFO] | +- com.google.code.gson:gson:jar:2.8.6:compile [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile [INFO] | | \- commons-codec:commons-codec:jar:1.13:compile [INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.14:compile [INFO] | +- commons-logging:commons-logging:jar:1.2:compile [INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.1:compile [INFO] | | \- javax.activation:javax.activation-api:jar:1.2.0:compile [INFO] | +- org.jacoco:org.jacoco.agent:jar:runtime:0.8.5:compile [INFO] | +- org.ini4j:ini4j:jar:0.5.4:compile [INFO] | +- org.slf4j:slf4j-api:jar:1.7.30:compile [INFO] | +- io.opentracing:opentracing-api:jar:0.33.0:compile [INFO] | \- io.opentracing:opentracing-util:jar:0.33.0:compile [INFO] | \- io.opentracing:opentracing-noop:jar:0.33.0:compile [INFO] +- com.aliyun:dysmsapi20170525:jar:4.1.0:compile [INFO] | +- com.aliyun:tea-util:jar:0.2.23:compile [INFO] | +- com.aliyun:endpoint-util:jar:0.0.7:compile [INFO] | +- com.aliyun:tea:jar:1.3.1:compile [INFO] | | \- com.squareup.okhttp3:okhttp:jar:3.14.9:compile [INFO] | | \- com.squareup.okio:okio:jar:1.17.2:compile [INFO] | +- com.aliyun:tea-openapi:jar:0.3.8:compile [INFO] | | +- com.aliyun:credentials-java:jar:1.0.1:compile [INFO] | | | \- com.aliyun:credentials-api:jar:1.0.0:compile [INFO] | | +- com.aliyun:alibabacloud-gateway-spi:jar:0.0.2:compile [INFO] | | \- com.aliyun:tea-xml:jar:0.1.6:compile [INFO] | | \- org.dom4j:dom4j:jar:2.0.3:compile [INFO] | \- com.aliyun:openapiutil:jar:0.2.2:compile [INFO] | \- org.bouncycastle:bcprov-jdk18on:jar:1.78.1:compile [INFO] +- com.alibaba:fastjson:jar:1.2.75:compile [INFO] +- org.mybatis:mybatis:jar:3.5.9:compile [INFO] +- org.jetbrains:annotations:jar:13.0:compile [INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:2.2.13.RELEASE:compile (optional) [INFO] +- redis.clients:jedis:jar:3.1.0:compile [INFO] | \- org.apache.commons:commons-pool2:jar:2.7.0:compile [INFO] +- io.jsonwebtoken:jjwt-api:jar:0.11.5:compile [INFO] +- io.jsonwebtoken:jjwt-impl:jar:0.11.5:runtime [INFO] \- io.jsonwebtoken:jjwt-jackson:jar:0.11.5:runtime [INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.10.5.1:compile [INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.5:compile [INFO] \- com.fasterxml.jackson.core:jackson-core:jar:2.10.5:compile [INFO] ------------------------------------------------------------------------ 2.applicaion.properties中的配置内容为logging.config=classpath:logback-spring.xml 3.src/main/resources目录下存在logback-spring.xml文件,但之前里面没有那两行<include>配置项,现已添加。
07-19
MD_BOOT_HOME: D:\ProjectCode\igix-shell-tool\tool\ ECHO 处于关闭状态。 ECHO 处于关闭状态。 Checking java home: D:\inBuilder\jdk Checking MD bootstrap: "D:\ProjectCode\igix-shell-tool\tool\lcm-metadata-shell-0.1.36.jar" "D:\inBuilder\jdk\bin\java" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar "D:\ProjectCode\igix-shell-tool\tool\lcm-metadata-shell-0.1.36.jar" Welcome to // .__ ________ .___ ____ ___ ______ // |__| / _____/ | |\ \/ / \ \ \ \ // | |/ \ ___ | | \ / \ \ \ \ // | |\ \_\ \| | / \ ) ) ) ) // |__| \______ /|___|/___/\ \ / / / / // ==============\/============\_/ /_/_/_/ iGIX Development Kit (0.1.0-SNAPSHOT) 2025-03-13 10:49:52.533[WARN][main]-未找到对应的部署模式 默认使用标准版模式启动 2025-03-13 10:49:52.541[INFO][main]-Starting ShellApplication using Java 1.8.0_211 on PC00130706 with PID 27468 (D:\ProjectCode\igix-shell-tool\tool\lcm-metadata-shell-0.1.36.jar started by makai05 in D:\ProjectCode\igix-shell-tool\tool) 2025-03-13 10:49:52.542[INFO][main]-No active profile set, falling back to default profiles: default 2025-03-13 10:49:53.636[INFO][main]-Post-processing PropertySource instances 2025-03-13 10:49:53.641[INFO][main]-Encryptor config not found for property jasypt.encryptor.password, using default value: password 2025-03-13 10:49:53.642[INFO][main]-Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES 2025-03-13 10:49:53.642[INFO][main]-Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000 2025-03-13 10:49:53.643[INFO][main]-Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1 2025-03-13 10:49:53.643[INFO][main]-Encryptor config not found for property jasypt.encryptor.providerName, using default value: null 2025-03-13 10:49:53.643[INFO][main]-Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null 2025-03-13 10:49:53.643[INFO][main]-Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator 2025-03-13 10:49:53.649[INFO][main]-Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64 2025-03-13 10:49:53.650[INFO][main]-Post-processing PropertySource instances 2025-03-13 10:49:53.708[INFO][main]-Converting PropertySource cafPropertySource [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper 2025-03-13 10:49:53.742[INFO][main]-Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy 2025-03-13 10:49:53.742[INFO][main]-Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper 2025-03-13 10:49:53.743[INFO][main]-Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper 2025-03-13 10:49:53.743[INFO][main]-Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper 2025-03-13 10:49:53.743[INFO][main]-Converting PropertySource Config resource 'class path resource [application.yaml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper 2025-03-13 10:49:53.804[INFO][main]-Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter 2025-03-13 10:49:54.743[INFO][main]-Started ShellApplication in 2.56 seconds (JVM running for 2.937) lcm-metadata-shell:> H2数据库启动了吗
03-14
F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\bin\catalina.bat run [2025-06-17 12:51:53,585] Artifact Shopping-Web:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\sunny\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\82d452a7-88a2-4557-a7c9-f7ed9538c91b" Using CATALINA_HOME: "F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42" Using CATALINA_TMPDIR: "F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\temp" Using JRE_HOME: "F:\jdk-17.0.15_windows-x64_bin\jdk-17.0.15" Using CLASSPATH: "F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\bin\bootstrap.jar;F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\bin\tomcat-juli.jar" Using CATALINA_OPTS: "" 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/10.1.42 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器构建: Jun 5 2025 22:35:46 UTC 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器版本号: 10.1.42.0 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 操作系统名称: Windows 11 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 架构: amd64 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: F:\jdk-17.0.15_windows-x64_bin\jdk-17.0.15 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java虚拟机版本: 17.0.15+9-LTS-241 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\sunny\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\82d452a7-88a2-4557-a7c9-f7ed9538c91b 17-Jun-2025 12:51:54.421 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.config.file=C:\Users\sunny\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\82d452a7-88a2-4557-a7c9-f7ed9538c91b\conf\logging.properties 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote= 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.port=1099 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.ssl=false 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.password.file=C:\Users\sunny\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\82d452a7-88a2-4557-a7c9-f7ed9538c91b\jmxremote.password 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.access.file=C:\Users\sunny\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\82d452a7-88a2-4557-a7c9-f7ed9538c91b\jmxremote.access 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.rmi.server.hostname=127.0.0.1 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djdk.tls.ephemeralDHKeySize=2048 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dsun.io.useCanonCaches=false 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.lang=ALL-UNNAMED 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.io=ALL-UNNAMED 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.util=ALL-UNNAMED 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcatalina.base=C:\Users\sunny\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\82d452a7-88a2-4557-a7c9-f7ed9538c91b 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcatalina.home=F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42 17-Jun-2025 12:51:54.434 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.io.tmpdir=F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\temp 17-Jun-2025 12:51:54.443 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent 使用APR版本[1.7.6]加载了基于APR的Apache Tomcat本机库[2.0.9]。 17-Jun-2025 12:51:54.443 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL成功初始化 [OpenSSL 3.5.0 8 Apr 2025] 17-Jun-2025 12:51:54.551 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"] 17-Jun-2025 12:51:54.572 信息 [main] org.apache.catalina.startup.Catalina.load 服务器在[311]毫秒内初始化 17-Jun-2025 12:51:54.626 信息 [main] org.apache.catalina.core.StandardService.startInternal 正在启动服务[Catalina] 17-Jun-2025 12:51:54.626 信息 [main] org.apache.catalina.core.StandardEngine.startInternal 正在启动 Servlet 引擎:[Apache Tomcat/10.1.42] 17-Jun-2025 12:51:54.651 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"] 17-Jun-2025 12:51:54.701 信息 [main] org.apache.catalina.startup.Catalina.start [126]毫秒后服务器启动 Connected to server [2025-06-17 12:51:54,777] Artifact Shopping-Web:war exploded: Artifact is being deployed, please wait... 17-Jun-2025 12:51:55.805 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths 在资源路径[/WEB-INF/]中找不到TLD文件。 17-Jun-2025 12:51:55.824 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/spring-beans-5.3.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.824 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/spring-jcl-5.3.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.824 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/mysql-connector-java-8.0.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.824 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/spring-expression-5.3.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.824 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/spring-core-5.3.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.859 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在JAR[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar]中找到了TLD文件。 17-Jun-2025 12:51:55.859 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/spring-context-5.3.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.867 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/protobuf-java-3.19.4.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.867 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan 在[file:/F:/Shopping-Web/Shopping-Web/target/ShoppingWeb-1.0-SNAPSHOT/WEB-INF/lib/spring-aop-5.3.30.jar]中找不到TLD文件。考虑将JAR添加到CATALINA_BASE/conf/CATALINA.properties文件中的tomcat.util.scan.StandardJarScanFilter.jarsToSkip属性。 17-Jun-2025 12:51:55.867 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 17-Jun-2025 12:51:55.952 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal 一个或多个筛选器启动失败。完整的详细信息将在相应的容器日志文件中找到 17-Jun-2025 12:51:55.952 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal 由于之前的错误,Context[/Shopping_Web_war_exploded]启动失败 [2025-06-17 12:51:55,962] Artifact Shopping-Web:war exploded: Error during artifact deployment. See server log for details. 17-Jun-2025 12:52:04.663 信息 [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\webapps\manager] 17-Jun-2025 12:52:04.715 详细 [Catalina-utility-2] org.apache.jasper.servlet.TldScanner.scanResourcePaths 在资源路径[/WEB-INF/jsp/]中找不到TLD文件。 17-Jun-2025 12:52:04.717 详细 [Catalina-utility-2] org.apache.jasper.servlet.TldScanner.scanResourcePaths 在资源路径[/WEB-INF/]中找不到TLD文件。 17-Jun-2025 12:52:04.724 信息 [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Web应用程序目录[F:\idea_java\apache-tomcat-10.1.42-windows-x64\apache-tomcat-10.1.42\webapps\manager]的部署已在[61]毫秒内完成
06-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值