我真的认为在各种平台上安装大约200个或更多tomcat之后,我已经准备好迎接任何挑战,但这个很棘手.
我创建了一个vanilla Ubunutu 14_04图像,并在该系统上从oracle安装了Java 8 TGZ.此外,我在游戏中添加了一个tomcat 8.然后我启动了vanilla服务器安装.
在暂停部署tomcat附带的默认应用程序后不久,我想知道那里发生了什么,并做了一些线程.这个是阻止tomcat启动的糟糕线程:
"localhost-startStop-1" #15 daemon prio=5 os_prio=0 tid=0x00007f37c8004800 nid=0x4d6 runnable [0x00007f37b38b3000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:246)
at sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedBytes(SeedGenerator.java:539)
at sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:144)
at sun.security.provider.SecureRandom$SeederHolder.<clinit>(SecureRandom.java:192)
at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:210)
- locked <0x00000000f06e6ce8> (a sun.security.provider.SecureRandom)
at java.security.SecureRandom.nextBytes(SecureRandom.java:457)
- locked <0x00000000f06e71c0> (a java.security.SecureRandom)
at java.security.SecureRandom.next(SecureRandom.java:480)
at java.util.Random.nextInt(Random.java:329)
at org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom(SessionIdGeneratorBase.java:234)
Run Code Online (Sandbox Code Playgroud)
经过更多谷歌和朋友,我发现SeedGeneratorJDK附带的是我的问题的根源.有趣的是,有时SeedGenerator会在几分钟后回来,有时它只是悬挂(熵耗尽?......通过检查cat /proc/sys/kernel/random/entropy_avail).经过更多研究后,我发现$JAVA_HOME$/lib/security/java.security调用中的配置变量securerandom.source定义了Random的源代码.在我的情况下,或者更好的oracle JDK 8安装Linux,它是/dev/random.我不是Linux专家(我是一名java开发人员),但我所理解的是,这/dev/random可能会耗尽熵(无论这意味着什么),但也许这意味着在某些时候它无法生成更多随机数).我切换到了/dev/urandom,我的tomcat一切都很好.
然后我检查了其他JDK安装在我的其他各种服务器上的外观,这些服务器是OpenJDK和旧的Oracle JDK安装的混合体.至少OpenJDK总是使用/dev/urandom可能的答案,为什么我之前从未遇到过这个问题.
现在我的问题是:从Oracle开始依赖于/dev/random何时可能存在操作系统无法生成更多数字的极端情况?我的意思是像Tomcat这样的服务器和许多其他服务器依赖于SeedGeneratorJDK并且调试这种错误是非常先进的.花了我2个小时才到达我现在的位置.
我有一个像这样的 JMS“端点”:
@JmsListener(destination = "TestQueue")
public void doSomething(MyJaxbAnnotatedClass myclass) {
}
Run Code Online (Sandbox Code Playgroud)
当然还有所需的 applicationContext 配置,例如 <jms:annotation-driven/> 等。当我的方法签名只是一个时,所有这一切都有效
public void doSomething(String xmlString)
Run Code Online (Sandbox Code Playgroud)
但我希望由 Spring 完成自动解组,就像我在 Spring-MVC 上下文中使用 JSON 那样。但不知何故 Spring 需要更多配置才能发生这种情况,因为我在尝试 MyJaxbAnnotatedClass 参数时得到以下堆栈跟踪:
Caused by: org.springframework.messaging.converter.MessageConversionException: No converter found to convert to class de.xxx.xxx.MyJaxbAnnotatedClass, message=GenericMessage [payload=<BRNArtikelStamm:EcomxProducts
xmlns:BRNfoo="http://www.xxx.xxx/foofoo"
Run Code Online (Sandbox Code Playgroud)
所以我想我必须以某种方式告诉 Spring 如何解组?由于 JAXB 是一种非常常见的序列化方式,因此我希望有一个需要应用的通用配置。
感谢您的任何意见。
在我将 firebase 分析实施到我的 flutter 应用程序中的过程中,我无法触发正确的事件,或者我不知道这应该如何工作。让我们使用以下代码:
firebaseAnalytics.setCurrentScreen(screenName: "Dashboard");
Run Code Online (Sandbox Code Playgroud)
当我触发此事件时,在 Firebase Analytics 调试视图中我看到:
当我通过以下方式自动触发屏幕更改时相同:
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: appState.firebaseAnalytics),
],
Run Code Online (Sandbox Code Playgroud)
所以我的问题是:为什么 Analytics 会打印“screen_view”而不是“Dashboard”或我在命名路由中的任何其他名称?
屏幕名称实际上已提交给 API 的内部工作,因为我在该位置调试了firebase_analytics.dart:
Future<void> setCurrentScreen(
{@required String screenName,
String screenClassOverride = 'Flutter'}) async {
if (screenName == null) {
throw ArgumentError.notNull('screenName');
}
await _channel.invokeMethod<void>('setCurrentScreen', <String, String>{
'screenName': screenName,
'screenClassOverride': screenClassOverride,
});
}
Run Code Online (Sandbox Code Playgroud) google-analytics firebase google-analytics-firebase flutter firebase-analytics
我有用户将在表单中填写的对象。我将这些对象解析为 json 并将该 json 添加到列表中以传递请求正文。但我不能这样做。
\n\n incrementListPaymentSlipes(PaymentSlipes objPayment) async {\n objPayment.name = "Douglas";\n objPayment.personalId = "00000000000";\n Map<String, dynamic> json = objPayment.toJson();\n listPaymentSlipes.add(jsonEncode(json));\n }\nRun Code Online (Sandbox Code Playgroud)\n\nvar response = await http.post(url, body: {\n"payment_slips": listPaymentSlipes,\n}\nRun Code Online (Sandbox Code Playgroud)\n\n正确身体的例子:
\n\n"payment_slips": [\n { \n "personal_id": "01888728680",\n "name": "Fulano da Silva"\n }\n ]\nRun Code Online (Sandbox Code Playgroud)\n\n {"error":"\'{{personal_id: 00000000000, name: Douglas}}\' \xc3\x83\xc2\xa9 invalido como \'payment_slips\'","code":"payment_slips_invalid"}```\nRun Code Online (Sandbox Code Playgroud)\n 我只是将我的 Mac OS 更新到 Catalina 版本并且我的 Hybris 服务器停止打开。所以在命令 ./hybrisserver.sh start 我得到这个
MacBook-Pro-Sasha:platform sashayukhimchuk$ ./hybrisserver.sh start 在 Tomcat 上启动 hybrisPlatform... /Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/wrapper388: line1 4614 阵亡:9
"/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/./wrapper-macosx-universal-64" "/Users/sashayukhimchuk/hybris/CXCOMM181178/platform/hybris / tomcat/conf/wrapper.conf" wrapper.syslog.ident="hybrisPlatform" wrapper.pidfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.pid" wrapper.daemonize =TRUE wrapper.name="hybrisPlatform" wrapper.displayname="hybrisPlatform on Tomcat" wrapper.statusfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.status" wrapper. java.statusfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.java.status" 包装器。script.version=3.5.29 -- 正在等待 Tomcat 上的 hybrisPlatform ...................... 警告:Tomcat 上的 hybrisPlatform 可能无法启动。
鉴于此枚举类型:
public enum PackageType {
BEHAELTER("BH", "Behälter")
String value;
String id;
String description;
PackageType(String id, String description) {
this.id = id;
this.description = description;
}
}
Run Code Online (Sandbox Code Playgroud)
使用这个枚举时,Behälter中的变音符号"ä"显示错误.即使我在构造函数中调试并观察属性"description",我也看错了.
有没有Java规范禁止像这样的结构中的任何特殊字符?在这一点上我很无能为力.
我注意到在将此枚举序列化为JSON并将其返回到我的前端时.
谢谢
我正在运行 Spring Boot 2 应用程序并添加了执行器 spring boot starter 依赖项。我启用了所有 Web 端点,然后调用:
http://localhost:8080/actuator/metrics
结果是:
{
"names": ["jdbc.connections.active",
"jdbc.connections.max",
"jdbc.connections.min",
"hikaricp.connections.idle",
"hikaricp.connections.pending",
"hikaricp.connections",
"hikaricp.connections.active",
"hikaricp.connections.creation",
"hikaricp.connections.max",
"hikaricp.connections.min",
"hikaricp.connections.usage",
"hikaricp.connections.timeout",
"hikaricp.connections.acquire"]
}
Run Code Online (Sandbox Code Playgroud)
但我缺少所有 JVM 统计信息和其他内置指标。我在这里缺少什么?我读到的所有内容都表明这些指标应该随时可用。
感谢您的任何提示。
java spring-boot spring-boot-actuator micrometer spring-micrometer
假设以下代码
ChipTheme(
data: theme.chipTheme.copyWith(
//labelStyle: TextStyle(color: Colors.black),
secondaryLabelStyle: TextStyle(color: Colors.black),
//selectedColor: Colors.black,
secondarySelectedColor: Colors.grey[300],
//brightness: Brightness.light
),
child:
Row(
children: <Widget>[
Chip(
//selected: currentLevel >= 1,
label: new Text("Level 1"),
avatar: new CircleAvatar(
backgroundColor: Colors.green,
child: Text("1")
),
),
ChoiceChip(
selected: currentLevel >= 2,
label: new Text("Level 2"),
avatar: new CircleAvatar(
backgroundColor: Colors.green,
child: Text("2")
),
),
ChoiceChip(
selected: currentLevel >= 3,
label: new Text("Level 3"),
avatar: new CircleAvatar(
backgroundColor: Colors.green,
child: Text("3")
),
),
],
),
),
Run Code Online (Sandbox Code Playgroud)
结果如下:
第一个是一个简单的 …
我正在为我的应用程序中的相关实体创建单表 DynamoDB 设计。我主要从这里借用了一些想法:https : //github.com/aws-samples/amazon-dynamodb-design-patterns/blob/master/data-models/an-online-shop/AnOnlineShop.md
虽然大多数事情对我来说都很清楚,但对我来说却缺少一件简单的事情。如何查询某种类型的所有实体?有关架构,请参见下图。
如您所见,主要实体记录的 PK 和 SK 具有相同的值。SK 仅在您希望与其他实体具有 1:N 关系时才会更改,如 entityType 仓库项中所示。
我的主要问题是:如何获得所有用户(当然无需扫描即可快速获得)?
我学到的是,我不能在 PartitionKey 上执行 begin_with。当然,我可以考虑做这样的记录:
PK SK
users u#logemann
users u#smith
Run Code Online (Sandbox Code Playgroud)
但这将需要额外的数据条目,并且会与我上面看到的主要用户记录重复。或者是否可以创建一个 GSI,其 PK 值为“users”,SK 值为 SK?
解决这个问题的最佳方法是什么?