gpt4 book ai didi

java - 如何在 WINDOWS 中更改 TOMCAT 的默认区域设置?

转载 作者:行者123 更新时间:2023-12-01 10:34:50 24 4
gpt4 key购买 nike

从照片中可以看出,伊朗已确定位置。

enter image description here

我在“%CATALINA_HOME%\conf\server.xml”中使用了领域标记。

 <Realm  className="org.apache.catalina.realm.JDBCRealm"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@localhost:1521:xe"
connectionName="Arash" connectionPassword="who"
userTable="users" userNameCol="USER_NAME" userCredCol="USER_PASS"
userRoleTable="USER_ROLES" roleNameCol="ROLE_NAME" />

当TOMCAT运行并连接数据库时,出现以下错误。

java.sql.SQLException: Locale not recognized
at oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:1059)
at oracle.jdbc.driver.T4CTTIoauthenticate.<init>(T4CTTIoauthenticate.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:565)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:715)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:385)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:564)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:663)
at org.apache.catalina.realm.JDBCRealm.startInternal(JDBCRealm.java:726)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:155)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:899)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:155)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:155)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:155)
at org.apache.catalina.startup.Catalina.start(Catalina.java:649)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

我将此代码放在“%CATALINA_HOME%\bin\catalina.bat”中

set -Duser.language=en -Duser.country=US

仍然出现错误。

最佳答案

您不需要设置国家/地区,而是需要设置用户的区域。所以正确的 Java 选项是:-Duser.language=en -Duser.region=US

关于java - 如何在 WINDOWS 中更改 TOMCAT 的默认区域设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34827948/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com