我正在使用kill -3命令在unix中查看JVM的线程转储.但是我在哪里可以找到此kill命令的输出?我搞不清楚了!!
好的,我是第500个用户问这个问题,我读了很多答案,但仍然没有运气.
父模块pom包含:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.framework.version}</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
子模块有maven-jetty-plugin,我运行我的webapp模块jetty:run.
web.xml 定义标准调度程序模块:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
我有文件dispatcher-servlet.xml下WEB-INF,虽然启动失败:
FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
Run Code Online (Sandbox Code Playgroud)
怎么了?文档和每个人都说Spring MVC将搜索XX-servlet.xml,其中XX是servlet的名称.为什么要搜索applicationContext.xml?
我只是想知道是否有办法为LOG4J中的属性替换提供默认值?
我想在java系统属性中传递文件路径,然后将其与"$ {env:mySystemProperty}"一起使用.但是如果开发人员忘记设置此属性呢?然后我想在log4j2.xml中定义一些有意义的默认值.
知道如何实现这个功能吗?
编辑:
env替换对我不起作用:
standalone.conf
-DoauthLoginLogPath=/path/oauth2.log
Run Code Online (Sandbox Code Playgroud)
log44j2.xml
<Appender type="File" name="File" fileName="${env:oauthLoginLogPath}" immediateFlush="true">
<Appender type="File" name="File" fileName="${sys:oauthLoginLogPath}" immediateFlush="true">
Run Code Online (Sandbox Code Playgroud)
我可以在wildfly控制台中看到该属性,我重新启动了服务器,但我无法完成它.
我已经开发了一个Facebook画布应用程序,可以在网络上正常工作,iOS(移动网络视图)但在Android上,特别是Galaxy S4,该应用程序将无法加载,Facebook应用程序发出消息说:
"[AppName] is incompatible with your device. Please visit the App Centre to find apps for this device."
Run Code Online (Sandbox Code Playgroud)
设置了移动网址,它在iOS设备上正常运行HTTPS证书正确并且设置正确.
Facebook自己的文档声明,如果设置了移动URL,它将在Web视图中打开应用程序.但是,我甚至没有通过手机向我的服务器请求.
有任何想法吗??
再一次,SSLPeerUnverified的沉闷问题,但我没有使用自签名证书.我尝试使用https连接到主机.该主机具有正确的证书,Firefox和HttpsUrlConnection都没有任何问题.无论如何尝试使用HttpClient进行连接,我都会遇到可怕的异常.
有线索吗?或者提示哪里看得更近?
谢谢!
编辑:调试输出
main,处理异常:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)
main,getSession()中的IOException:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud) 我已经接管了未记录的 Mongo 4.4.8 集群(PSA)。我正在努力整理它并彻底测试。
\n原始连接字符串:
\nMONGODB_URI=mongodb://${USER}:${PASS}@10.0.0.3:27017,10.0.0.6:27017,10.0.0.2:27017/bud?replicaSet=bud-replica&authSource=admin\nRun Code Online (Sandbox Code Playgroud)\n我已启用本地主机和套接字连接。我可以从 cmdline 登录
\nmongo -u ${USER} -p ${PASS}\nMongoDB shell version v4.4.8\nconnecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb\nImplicit session: session { "id" : UUID("492e331b-417e-458a-83c7-9db6eaae0869") }\nMongoDB server version: 4.4.8\nRun Code Online (Sandbox Code Playgroud)\n我可以将 db 切换到bud并执行查询。但如果我只是跑
\nmongo\nRun Code Online (Sandbox Code Playgroud)\n那么使用相同凭据的身份验证将不起作用:
\nbud-replica:PRIMARY> db.auth('admin','admin');\nError: Authentication failed.\n0\nRun Code Online (Sandbox Code Playgroud)\n我尝试搜索用户,但显示没有:
\nbud-replica:PRIMARY> db.getUsers()\n[ ]\nbud-replica:PRIMARY> use bud\nswitched to db bud\nbud-replica:PRIMARY> db.getUsers()\n[ ]\nRun Code Online (Sandbox Code Playgroud)\n这是mongod.conf安全部分:
security:\n authorization: enabled\n keyFile: "/etc/bud-rs"\nRun Code Online (Sandbox Code Playgroud)\n最后我需要在做实验之前导出数据。尽管命令行界面看起来相似,但 mongoexport 无法获取数据,无论我设置用户/密码还是跳过这些参数。
\nmongoexport -h localhost --db=bud …Run Code Online (Sandbox Code Playgroud) 我在WildFly 8中运行Web应用程序,由于某种原因它不会记录.我使用SLF4J和LOGBACK.日志文件是在部署时创建的,但它是空的.我也没有在wildfly日志中看到我的日志语句.
该课程包含:
package com.blah.oops;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
static final Logger log = LoggerFactory.getLogger(EndpointImpl.class);
log.debug("request called");
Run Code Online (Sandbox Code Playgroud)
战争包含:
配置文件logback.xml包含:
<configuration scan="true" scanPeriod="10 seconds">
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${LOG_PATH}/backend-main.log</file>
<encoder>
<pattern>%date %level [%thread] %logger{10} %msg%n</pattern>
</encoder>
</appender>
<!-- PROFILER configuration -->
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>PROFILER</Marker>
<OnMatch>ACCEPT</OnMatch>
<!-- <OnMatch>DENY</OnMatch> -->
</turboFilter>
<logger name="org.eclipse.jetty.util.log" level="info"/>
<logger name="com.blah" level="debug"/>
<logger name="org.apache.cxf" level="warn"/>
<root level="info">
<appender-ref ref="FILE"/>
</root>
</configuration>
Run Code Online (Sandbox Code Playgroud)
console.log包含logback初始化:
.[0m.[0m10:19:52,716 INFO [stdout] (MSC service thread 1-2) 10:19:52,489 |-INFO in …Run Code Online (Sandbox Code Playgroud) 我在某些设备上遇到了非常奇怪的情况(Nexus 5x与Android 7):当我清理数据并卸载它,然后用Studio安装时,应用程序不是单元化的,但它使用的是1月24日的数据!我尝试使用平板电脑进行相同的操作,但应用程序没有数据.
我已经多次重复这个过程,我清理了我的项目,重建了多次,它始终以24th january数据(数据库和共享首选项)开始.
我甚至尝试过adb shell并运行以清理数据:
bullhead:/data/data/lelisoft.com.lelimath.debug $ ls -l databases/
total 232
-rw-rw---- 1 u0_a259 u0_a259 98304 2017-02-05 11:03 lelimath.sqlite
-rw------- 1 u0_a259 u0_a259 16928 2017-02-05 11:03 lelimath.sqlite-journal
Run Code Online (Sandbox Code Playgroud)
我删除了它们,应用程序似乎是空的 - 直到我删除它并再次安装 - 1月24日又回来了.
这是一个如何开始的日志:
$ adb shell am start -n "lelisoft.com.lelimath.debug/lelisoft.com.lelimath.activities.DashboardActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: lelisoft.com.lelimath.debug | lelisoft.com.lelimath.debug.test
I/InstantRun: Instant Run Runtime started. Android package is lelisoft.com.lelimath.debug, real application class is lelisoft.com.lelimath.helpers.LeliMathApp.
D/l.c.l.h.LeliMathApp: onCreate()
D/l.c.l.h.BalanceHelper: Current points balance: 234
Run Code Online (Sandbox Code Playgroud)
这是从调试器获取的数据库的位置:
/data/user/0/lelisoft.com.lelimath.debug/databases/lelimath.sqlite …Run Code Online (Sandbox Code Playgroud) 我想要一个具有以下特征的水平标尺:
align:left
noshade
size:2
width:50%
color:#000000
Run Code Online (Sandbox Code Playgroud)
如果上面的属性没有被弃用,我会使用:
<hr size="2" width="50%" noshade style="color:#000000" align="left" />
Run Code Online (Sandbox Code Playgroud)
我现在只考虑使用style属性.是否有任何技巧可以使HR在多个浏览器中呈现相同的效果?
编辑:
从答案中,我将我的<hr />标记重新制作为:
<hr style='background-color:#000000;border-width:0;color:#000000;height:2px;line-height:0;text-align:left;width:50%;'/>
Run Code Online (Sandbox Code Playgroud)
但是,在Firefox中,text-align:left属性似乎没有效果,因为水平规则显示为居中.但它在Opera和IE中运行良好.我在这里试验了我的代码:
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_hr_test
任何让它左对齐的技巧?
我正在使用 Google 跟踪代码管理器,其中的单个标记引用了默认的 Google Analytics 脚本。我的解决方案基于以下资源中的信息:
代码很简单(提交):
index.html:定义gtag()并将拒绝设置为所有存储的默认值
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { window.dataLayer.push(arguments); }
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
personalization_storage: 'denied',
functionality_storage: 'granted',
security_storage: 'granted',
wait_for_update: 400,
});
Run Code Online (Sandbox Code Playgroud)
然后从加载用户配置localStorage并调用更新:
handleCookies(preferences) {
console.log('handleCookies callback');
gtag('consent', 'update', {
ad_storage: preferences.ad,
analytics_storage: preferences.analytics,
personalization_storage: preferences.personalization,
});
console.log(window.dataLayer);
},
Run Code Online (Sandbox Code Playgroud)
到目前为止一切顺利,因为我看到事件队列已更新dataLayer:
同意后,我预计现在将为 Google Analytics 设置 cookie。但他们失踪了。我犯了什么愚蠢的错误?
java ×6
android ×2
css ×1
dump ×1
facebook ×1
google-talk ×1
html ×1
httpclient ×1
javascript ×1
log4j ×1
log4j2 ×1
logback ×1
logging ×1
mongodb ×1
spring ×1
spring-mvc ×1
wildfly ×1
xhtml ×1