第一次用MAVEN..求指教
[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4: Could not transfer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.4 from/to nutzcn (https://jfrog.nutz.cn/artifactory/snapshots): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
不是的。是pom.xml报错。错误如下:
Failure to transfer org.apache.maven.plugins:maven-shade-plugin:pom:3.0.0 from https://jfrog.nutz.cn/artifactory/snapshots was cached in the local
repository, resolution will not be reattempted until the update interval of nutzcn has elapsed or updates are forced. Original error: Could not transfer
artifact org.apache.maven.plugins:maven-shade-plugin:pom:3.0.0 from/to nutzcn (https://jfrog.nutz.cn/artifactory/snapshots):
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target
C:\Users\YaHtoB>java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
还不行。是不是有什么重要步骤我忽略了。我从官网下的maven,然后我就配了PATH环境变量和settings文件镜像库地址:
nutzcn
central
super mavem mirror for nutz users
http://jfrog.nutz.cn/artifactory/snapshots
我down了nutzbookproject3.x之后直接eclipse导入maven项目。是不是少了什么步骤?
<mirror>
<id>nutzcn</id>
<mirrorOf>central</mirrorOf>
<name>super mavem mirror for nutz users</name>
<url>http://maven.nutz.cn/nexus/content/repositories/central</url>
</mirror>
pom.xml是这个地址要不要改
<repository>
<id>nutz</id>
<url>https://jfrog.nutz.cn/artifactory/jcenter</url>
</repository>
访问不了。。。已经启动成功了
[INFO ] 12:39:45.066 org.nutz.boot.NbApp.execute(NbApp.java:213) - wk-nb-dubbo-sys started : 5479ms
老大,我跑nutzbook-project2.x报错
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/nutzbook]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/nutzbook]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
... 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@7d170ec3]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4927)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5057)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@3f70d9c6]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:136)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 9 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:139)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(Unknown Source)
at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at sun.misc.IOUtils.readFully(Unknown Source)
at java.util.jar.JarFile.getBytes(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:137)
... 13 more
还有MainSetup.java ioc.get(Configuration.class).setAutoImports(new NutMap().setv("p", "/ftl/pony/index.ftl").setv("s", "/ftl/spring.ftl"));代码报错
The type freemarker.core.Configurable cannot be resolved. It is indirectly referenced from required .class files
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
有个jar损坏了, 要么找出是哪个jar, 要么把 ~/.m2 删掉重新下载
不行哎。兽哥。我把隐藏文件夹.m2删了。然后update maven project又报错
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/nutzbook]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/nutzbook]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
... 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@3f87849a]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4927)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5057)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@1805d915]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:136)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 9 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:139)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(Unknown Source)
at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at sun.misc.IOUtils.readFully(Unknown Source)
at java.util.jar.JarFile.getBytes(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:137)
... 13 more
五月 09, 2018 10:11:22 上午 org.apache.catalina.core.ContainerBase startInternal
严重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 more
五月 09, 2018 10:11:22 上午 org.apache.catalina.startup.Catalina start
严重: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8007]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 11 more
启动后,在后台加个处理器,并启用
var key = arg;
var topicSearchService = ioc.get(null, "topicSearchService");
var results = topicSearchService.search(key, 3);
if (results == null || results.size() == 0) {
return "关键字(" + key + ")找不到匹配的结果 发帖或者换个关键字 https://" + req.getHeader("Host") + "/yvr/add";
}
var dao = ioc.get(null, "dao");
var msg = "";
var Class = Java.type("java.lang.Class");
var Topic = Class.forName("net.wendal.nutzbook.yvr.bean.Topic");
var String = Java.type("java.lang.String");
var StringEscapeUtils = Java.type("org.apache.commons.lang.StringEscapeUtils");
for (var i=0;i<results.size();i++) {
var result = results[i];
var topic = dao.fetch(Topic, result.getId());
if (topic == null)
continue;
msg += String.format("%s https://%s/yvr/t/%s\r\n",
StringEscapeUtils.unescapeHtml(result.getResult()),
req.getHeader("Host"),
topic.getId().substring(0, 6));
}
msg += String.format("完整结果 : https://%s/yvr/search?q=%s", req.getHeader("Host"), encodeURI(key));
return msg;
设置编码信息了
For example:> "INSERT INTO t_syslog_201805(uu32,t,tg,src,u_id,u_name,ip,msg,ct) VALUES('1056b10743e745d5be6b5917fd79a454','aop.after','用户管理,用户登录','net.wendal.nutzbook.module.UserModule#login',3,'3','0:0:0:0:0:0:0:1','用户[admin] ok=true','2018-05-10 12:08:02') "
用户管理,用户登录到库里就是????,????
12:17:46.228 INFO (NutLoading.java:55) load - Nutz Version : 1.r.61-SNAPSHOT
12:17:46.228 INFO (NutLoading.java:56) load - Nutz.Mvc[nutz] is initializing ...
12:17:46.228 DEBUG (NutLoading.java:60) load - Web Container Information:
12:17:46.230 DEBUG (NutLoading.java:61) load - - Default Charset : UTF-8
12:17:46.231 DEBUG (NutLoading.java:62) load - - Current . path : E:\SogouWallPaper\.
12:17:46.231 DEBUG (NutLoading.java:63) load - - Java Version : 1.8.0_171
12:17:46.231 DEBUG (NutLoading.java:64) load - - File separator : \
12:17:46.231 DEBUG (NutLoading.java:65) load - - Timezone : Asia/Shanghai
12:17:46.231 DEBUG (NutLoading.java:66) load - - OS : Windows 10 amd64
12:17:46.232 DEBUG (NutLoading.java:67) load - - ServerInfo : Apache Tomcat/8.0.33
12:17:46.232 DEBUG (NutLoading.java:68) load - - Servlet API : 3.1
12:17:46.232 DEBUG (NutLoading.java:73) load - - ContextPath : /nutzbook
12:17:46.232 DEBUG (NutLoading.java:74) load - - context.tempdir : D:\nb2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\nutzbook
12:17:46.233 DEBUG (NutLoading.java:75) load - - MainModule : net.wendal.nutzbook.MainModule
看来是mysql字符集有问题
12:23:28.211 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_client=latin1
12:23:28.212 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_connection=latin1
12:23:28.212 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_database=utf8
12:23:28.212 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_filesystem=binary
12:23:28.212 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_results=
12:23:28.212 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_server=latin1
12:23:28.213 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_set_system=utf8
12:23:28.213 DEBUG (MysqlJdbcExpert.java:212) checkDataSource - Mysql : character_sets_dir=D:\mysql5.6\share\charsets\
12:23:28.214 DEBUG (MysqlJdbcExpert.java:219) checkDataSource - Mysql : binlog_format=STATEMENT
12:23:28.215 DEBUG (MysqlJdbcExpert.java:226) checkDataSource - Mysql : database=nbv2
12:23:28.216 DEBUG (MysqlJdbcExpert.java:232) checkDataSource - Mysql : user=root@localhost
12:23:28.268 DEBUG (MysqlJdbcExpert.java:240) checkDataSource - Mysql : 't_user_message' engine=MyISAM
12:23:28.269 DEBUG (DaoSupport.java:222) setDataSource - Database info --> MYSQL:[MySQL - 5.6.24]
为什么我的机器人回复的不带链接点击效果,就是一段文本,是因为机器人软件的问题吗:发帖问问吧 http://127.0.0.1:9999/nutzbook/yvr/add