NutzCN Logo
问答 NutzWk导入后出现错误
发布于 2824天前 作者 Leo Yang 3191 次浏览 复制 上一个帖子 下一个帖子
标签:

NutzWk导入后出现错误 2016-07-25_123247_jpg

14 回复

不要发截图!!!! 用文字详细描述

1,src main/resources/config/chai、ioc的json文件都提示错:Expected value at 1:0
2,weapp/views/layouts/private.html:

Multiple annotations found at this line:
- Start tag () not closed properly, expected '>'.
- Invalid character used in text string (<%if(@string.startWith(secondMenu.target,'_')){%>target="${secondMenu.target!}"<%}
else{%>${secondMenu.target!}<%}%>> <% if(!isEmpty(@secondMenus.get(secondMenu.path))){ %>).

3,web.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

1)The content of element type "web-app" must match "(icon?,display-
name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-
mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-
ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".

2)Attribute "xmlns" must be declared for element type "web-app".

3)Attribute "xmlns:xsi" must be declared for element type "web-app".
4)Attribute "xsi:schemaLocation" must be declared for element type "web-app".
5)Attribute "version" must be declared for element type "web-app".

4,pom.xml

Missing artifact commons-beanutils-core:1.8.3(Click for 62 more)

5,在views的private/mcs、sys、wx有许多html文件提示错误错误,例如:private/mcs/article下的edit.html:
1)第1行Invalid character used in text string (<% layout("/layouts/private.html"){ %> ).
2)M第77行ultiple annotations found at this line:
- Start tag () not closed properly, expected '>'.
- Invalid character used in text string (<%if(obj.disabled){%>checked<%}%>> ).
3)第87行Undefined attribute value (false).
4)第90行Invalid character used in text string ( <%if(!isEmpty(obj.picurl)){%> ).
5)第93行Invalid character used in text string ( <%}%> ).
6)第130行Attribute (language) is obsolete. Its use is discouraged in HTML5 documents.
7)第235行Invalid character used in text string ( <%}%>).

全是eclipse的误报而已, 除了maven那个. 把eclipse的校验功能全关掉完事.

至于maven, 网络问题,右键, maven, update project, force update.

@wendal 我的maven 也一直下不下来...能不能给个好用的镜像?

@frenzy917 wizzer.cn 第一条,改一下hosts即可

来自炫酷的 NutzCN

过几天可能就不是第一条了,发个绝对地址吧:http://www.wizzer.cn/archives/3281
其实这是兽给的解决办法……

@wendal 已经改了host update 的时候nutz的几个包还是下不下来...

pom文件这几个地方一直报错

    <dependency>
        <groupId>org.nutz</groupId>
        <artifactId>nutzwx</artifactId>
        <version>1.r.57-SNAPSHOT</version>
    </dependency>
    <dependency>
       <groupId>cn.wizzer</groupId>
       <artifactId>nutzwk</artifactId>
    </dependency>
    <dependency>
    <groupId>cn.enilu</groupId>
    <artifactId>nutzwk-code-generator</artifactId>
    <version>1.0</version>
</dependency>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.0.1</version>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <archiveClasses>true</archiveClasses>
                <packagingExcludes>WEB-INF/web.xml</packagingExcludes>
                <warSourceExcludes>WEB-INF/classes/cn/**</warSourceExcludes>
                <webResources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <targetPath>WEB-INF/classes</targetPath>
                        <includes>
                            <include>**</include>
                        </includes>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

@frenzy917 不是最新的代码?

        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutzwx</artifactId>
            <version>1.r.57</version>
        </dependency>

但这个nutzwx的pom有问题,正在解决中,预计1小时内搞定.

@wendal ok,我等等~~谢谢

@wendal 依然有4个错误,maven版本不对吗?

Description Resource Path Location Type
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) pom.xml /nutzwk line 1 Maven Configuration Problem
Cannot refer to a non-final variable wxid inside an inner class defined in a different method WxUserController.java /nutzwk/src/main/java/cn/wizzer/modules/back/wx/controllers line 93 Java Problem
Cannot refer to a non-final variable wxApi2 inside an inner class defined in a different method WxUserController.java /nutzwk/src/main/java/cn/wizzer/modules/back/wx/controllers line 81 Java Problem
Cannot refer to a non-final variable wxid inside an inner class defined in a different method WxUserController.java /nutzwk/src/main/java/cn/wizzer/modules/back/wx/controllers line 92 Java Problem

@frenzy917 什么版本

来自炫酷的 NutzCN

@wendal 重新编译之后maven的问题解决了, 这个代码里面报的错是正常的吗?
提示是需要把wxApi2 和 wxid 都标成 final
@At("/down/?")
@Ok("json")
@RequiresPermissions("wx.user.list.sync")
@SLog(tag = "同步微信会员", msg = "公众号:${args[1].getAttribute('appname')}")
public Object down(String wxid, HttpServletRequest req) {
try {
Wx_config config = wxConfigService.fetch(wxid);
req.setAttribute("appname", config.getAppname());
WxApi2 wxApi2 = wxConfigService.getWxApi2(wxid);
wxApi2.user_get(new Each() {
public void invoke(int index, String _ele, int length)
throws ExitLoop, ContinueLoop, LoopException {
WxResp resp = wxApi2.user_info(_ele, "zh_CN");
log.info(Json.toJson(resp));
log.debug(index
+ " : "
+ _ele
+ ", nickname: "
+ resp.user().getNickname());
Wx_user usr = Json.fromJson(Wx_user.class, Json.toJson(resp.user()));
usr.setOpAt((int) (System.currentTimeMillis() / 1000));
usr.setNickname(EmojiParser.parseToAliases(usr.getNickname(), EmojiParser.FitzpatrickAction.REMOVE));
usr.setSubscribeAt((int) (resp.user().getSubscribe_time()));
usr.setWxid(wxid);
if (wxUserService.fetch(Cnd.where("wxid", "=", wxid).and("openid", "=", usr.getOpenid())) == null)
wxUserService.insert(usr);
}
});
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}

JDK8的语法, 不需要的. 如果是JDK7的话,才会报错

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