NutzCN Logo
问答 maven install wk根目录
发布于 18天前 作者 yahtob 355 次浏览 复制 上一个帖子 下一个帖子
标签:

第一次用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]

73 回复

JDK8 update 112 以上

老大再问个问题。nutz-book-project-3.x这个我maven导入eclipse后,项目上都是红X,后面该咋玩,我每次写完代码都要用maven打包发布才能预览吗

html的红叉?那是beetl模板文件,eclipse不认识,去掉校验就清净了

propterties文件里面有个本地目录设置,会优先从那个目录找模板文件,设置好绝对路径,改完就能生效

不是的。是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

jdk 8 update 112以上

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)

你的jdk版本达不到要求

那升到jdk10试试?

报那个错误就是jdk版本不对,估计是你安装了多个版本的jdk,然后一直引用着老版本

老大。我已经把installed JREs都改为jre171了。还不行。怎么办

把https改成http

还不行。是不是有什么重要步骤我忽略了。我从官网下的maven,然后我就配了PATH环境变量和settings文件镜像库地址:
nutzcn
central
super mavem mirror for nutz users
http://jfrog.nutz.cn/artifactory/snapshots

我down了nutzbookproject3.x之后直接eclipse导入maven项目。是不是少了什么步骤?

你把镜像库配成快照库地址了,怪不得会死

snapshots是快照库地址 lib-releases才是镜像库

<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>

这个地址对吗

你填的这个地址是哪里查出来的? 这种地址不能靠猜的啊

http://nutzam.com/core/basic/maven.html

mirror要么不填,要么填对,不能瞎写一个的

。。。 原来是以前的老地址,我的锅

pom.xml是这个地址要不要改

<repository>
			<id>nutz</id>
			<url>https://jfrog.nutz.cn/artifactory/jcenter</url>
		</repository>

改成lib-releases会快一些咯

好啦。启动redis,tomcat跑nutzcn-webapp就行了吧?

这项目是模块化的。我看已经有微服务了。是不是比模块化更好

nutzcn的微服务改造正在进行中。。。

好的。感谢老大耐心解答。我先研究研究

nutzwk5.0能用tomcat运行吗

基本上是不能

我用IDEA的RUN倒是跑起来了。但是我不知道怎么访问。。。。IDEA的RUN是什么容器。有端口吗。。。

run是走main方法的

一般就是8080端口咯

访问不了。。。已经启动成功了

[INFO ] 12:39:45.066 org.nutz.boot.NbApp.execute(NbApp.java:213) - wk-nb-dubbo-sys started : 5479ms

里面有好几个服务,需要全部启动的

哦。全部启动才行是吧。就是把所有的带service的启动

web也需要啊

那这生产环境要怎么玩

会打包成jar

老大,我跑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

启动成功了,找到损坏的jar包了。。freemaker jar包

老大,群里的机器人关键词检索我看代码好像有个QQRobotHandler 这块如何处理写入这个表里的。然后对这个表查询

启动后,在后台加个处理器,并启用

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;

为什么我本地项目发帖插入mysql库中文乱码了。我后台打印不乱码,tomcat字符集utf8 ,mysql建库默认的

eclipse的编码设置了没? eclipse.ini里面设置编码信息,nutz文档有

设置编码信息了

  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的数据库编码和表编码吧

看来是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]

终于好啦。页面布局看的我有点懵。。老大能说说比如那个发帖按钮,应该登陆后才能显示,我看页面你就写了一个div没有看到哪里写权限判断,能简单说说嘛

老大,页面怎么给前台数据的啊。没看懂

后台怎么给前台数据。。

beetl模板, ajax, 了解一下?

ajax我熟悉。我之前都是在module里写req.setAttr给前台传参,现在看你没用这种方式,就像问问怎么传的

返回值在模板里面就叫obj

行。我学学beetl

老大, topic = dao.fetch(Topic.class, id);这句能查出content内容,但我在mysql表里看是null啊。。。怎么做的

后面还有查询,从BigContent表查出具体的内容

群里的机器人怎么换行的?我用\r\n就不回复消息了。

机器人用的就是我给的那段js,里面的换行就是\r\n呢

我用的免费机器人。不给钱就是不行啊

额,长期用的话还是买一下吧

为什么我的机器人回复的不带链接点击效果,就是一段文本,是因为机器人软件的问题吗:发帖问问吧 http://127.0.0.1:9999/nutzbook/yvr/add

是否显示成链接是qq客户端的事

一般来说 前后带空格 网址格式合法,都能显示成链接

试了下,localhst和127.0.0.1都会识别为文本

兽哥,我用谷歌登陆我本地社区项目,subject.isAuthenticated()返回true,但是页面获取用户信息为空的

是不是在OauthModule基础上做的?还是说自己写了一套入口方法?

前者的话,配好oauth.properties就完事啦

不是。我就用你写的admin用户登录的,之前登陆完,我把库删了重建的,后来就subject.isAuthenticated()一直返回true

清除谷歌缓存都不好使。是写到文件里吗

兽哥,我只是在其他模块没走YvrModule 直接用YvrService.add(topic,uid),然后刷列表时就报着个错,topic里有标题,内容,还有tp=share

redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value

添加回复
请先登陆
回到顶部