微信公众号(服务号)配置服务器
前言
在微信公众号(服务号)开发的准备阶段需要我们配置自己的服务器。
文档地址:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html
下载运行官方示例
下载示例代码后解压如下:
把 src 的代码复制到项目并解决完包路径问题后运行 demo 的 main 方法。提示如下
1 | D:\Java\jdk1.8.0_144\bin\java.exe "-javaagent:D:\Program Files\ideaIU-2019.2win\lib\idea_rt.jar=1346:D:\Program Files\ideaIU-2019.2win\bin" -Dfile.encoding=UTF-8 -classpath "D:\Java\jdk1.8.0_144\jre\lib\charsets.jar;D:\Java\jdk1.8.0_144\jre\lib\deploy.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_144\jre\lib\javaws.jar;D:\Java\jdk1.8.0_144\jre\lib\jce.jar;D:\Java\jdk1.8.0_144\jre\lib\jfr.jar;D:\Java\jdk1.8.0_144\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_144\jre\lib\jsse.jar;D:\Java\jdk1.8.0_144\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_144\jre\lib\plugin.jar;D:\Java\jdk1.8.0_144\jre\lib\resources.jar;D:\Java\jdk1.8.0_144\jre\lib\rt.jar;D:\IdeaProjects\qingyun\plantform\target\classes;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-data-jdbc\2.4.0\spring-boot-starter-data-jdbc-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-jdbc\2.1.1\spring-data-jdbc-2.1.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-relational\2.1.1\spring-data-relational-2.1.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-commons\2.4.1\spring-data-commons-2.4.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-tx\5.3.1\spring-tx-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-context\5.3.1\spring-context-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-beans\5.3.1\spring-beans-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-jdbc\2.4.0\spring-boot-starter-jdbc-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter\2.4.0\spring-boot-starter-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-logging\2.4.0\spring-boot-starter-logging-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\Program Files\apache-maven-3.5.3\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\Program Files\apache-maven-3.5.3\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Program Files\apache-maven-3.5.3\repository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;D:\Program Files\apache-maven-3.5.3\repository\com\zaxxer\HikariCP\3.4.5\HikariCP-3.4.5.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-jdbc\5.3.1\spring-jdbc-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-web\2.4.0\spring-boot-starter-web-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-json\2.4.0\spring-boot-starter-json-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-core\2.11.3\jackson-core-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.3\jackson-datatype-jdk8-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.3\jackson-datatype-jsr310-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.3\jackson-module-parameter-names-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-tomcat\2.4.0\spring-boot-starter-tomcat-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;D:\Program Files\apache-maven-3.5.3\repository\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-web\5.3.1\spring-web-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-webmvc\5.3.1\spring-webmvc-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-aop\5.3.1\spring-aop-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-expression\5.3.1\spring-expression-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.4\mybatis-spring-boot-starter-2.1.4.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.4\mybatis-spring-boot-autoconfigure-2.1.4.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\mybatis\3.5.6\mybatis-3.5.6.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\mybatis-spring\2.0.6\mybatis-spring-2.0.6.jar;D:\Program Files\apache-maven-3.5.3\repository\org\thymeleaf\extras\thymeleaf-extras-springsecurity5\3.0.4.RELEASE\thymeleaf-extras-springsecurity5-3.0.4.RELEASE.jar;D:\Program Files\apache-maven-3.5.3\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-devtools\2.4.0\spring-boot-devtools-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot\2.4.0\spring-boot-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-autoconfigure\2.4.0\spring-boot-autoconfigure-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\mysql\mysql-connector-java\8.0.22\mysql-connector-java-8.0.22.jar;D:\Program Files\apache-maven-3.5.3\repository\org\projectlombok\lombok\1.18.16\lombok-1.18.16.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-core\5.3.1\spring-core-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-jcl\5.3.1\spring-jcl-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\commons-codec\commons-codec\1.13\commons-codec-1.13.jar" com.wzy.plantform.weixin.demo.Program |
1 | <dependency> |
百度了下 说是包的版本问题。
于是参照 readme.txt 更改了 commons-codec 包的版本为 1.9 再次运行:
1 | D:\Java\jdk1.8.0_144\bin\java.exe "-javaagent:D:\Program Files\ideaIU-2019.2win\lib\idea_rt.jar=1447:D:\Program Files\ideaIU-2019.2win\bin" -Dfile.encoding=UTF-8 -classpath "D:\Java\jdk1.8.0_144\jre\lib\charsets.jar;D:\Java\jdk1.8.0_144\jre\lib\deploy.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_144\jre\lib\javaws.jar;D:\Java\jdk1.8.0_144\jre\lib\jce.jar;D:\Java\jdk1.8.0_144\jre\lib\jfr.jar;D:\Java\jdk1.8.0_144\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_144\jre\lib\jsse.jar;D:\Java\jdk1.8.0_144\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_144\jre\lib\plugin.jar;D:\Java\jdk1.8.0_144\jre\lib\resources.jar;D:\Java\jdk1.8.0_144\jre\lib\rt.jar;D:\IdeaProjects\qingyun\plantform\target\classes;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-data-jdbc\2.4.0\spring-boot-starter-data-jdbc-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-jdbc\2.1.1\spring-data-jdbc-2.1.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-relational\2.1.1\spring-data-relational-2.1.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-commons\2.4.1\spring-data-commons-2.4.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-tx\5.3.1\spring-tx-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-context\5.3.1\spring-context-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-beans\5.3.1\spring-beans-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-jdbc\2.4.0\spring-boot-starter-jdbc-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter\2.4.0\spring-boot-starter-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-logging\2.4.0\spring-boot-starter-logging-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\Program Files\apache-maven-3.5.3\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\Program Files\apache-maven-3.5.3\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Program Files\apache-maven-3.5.3\repository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;D:\Program Files\apache-maven-3.5.3\repository\com\zaxxer\HikariCP\3.4.5\HikariCP-3.4.5.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-jdbc\5.3.1\spring-jdbc-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-web\2.4.0\spring-boot-starter-web-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-json\2.4.0\spring-boot-starter-json-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-core\2.11.3\jackson-core-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.3\jackson-datatype-jdk8-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.3\jackson-datatype-jsr310-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.3\jackson-module-parameter-names-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-tomcat\2.4.0\spring-boot-starter-tomcat-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;D:\Program Files\apache-maven-3.5.3\repository\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-web\5.3.1\spring-web-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-webmvc\5.3.1\spring-webmvc-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-aop\5.3.1\spring-aop-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-expression\5.3.1\spring-expression-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.4\mybatis-spring-boot-starter-2.1.4.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.4\mybatis-spring-boot-autoconfigure-2.1.4.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\mybatis\3.5.6\mybatis-3.5.6.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\mybatis-spring\2.0.6\mybatis-spring-2.0.6.jar;D:\Program Files\apache-maven-3.5.3\repository\org\thymeleaf\extras\thymeleaf-extras-springsecurity5\3.0.4.RELEASE\thymeleaf-extras-springsecurity5-3.0.4.RELEASE.jar;D:\Program Files\apache-maven-3.5.3\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-devtools\2.4.0\spring-boot-devtools-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot\2.4.0\spring-boot-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-autoconfigure\2.4.0\spring-boot-autoconfigure-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\mysql\mysql-connector-java\8.0.22\mysql-connector-java-8.0.22.jar;D:\Program Files\apache-maven-3.5.3\repository\org\projectlombok\lombok\1.18.16\lombok-1.18.16.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-core\5.3.1\spring-core-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-jcl\5.3.1\spring-jcl-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar" com.wzy.plantform.weixin.demo.Program |
readme 里说了 要去下个什么文件放在 jre 下面。由于我 java 用的是 jdk8 所以我把下面的 jce-7 改成 jce-8 后下载文件。
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
参照 readme 把下下来的 jar 包放在 jdk/jre/lib/security 下 替换后 再次运行如下:ok了
1 | D:\Java\jdk1.8.0_144\bin\java.exe "-javaagent:D:\Program Files\ideaIU-2019.2win\lib\idea_rt.jar=1655:D:\Program Files\ideaIU-2019.2win\bin" -Dfile.encoding=UTF-8 -classpath "D:\Java\jdk1.8.0_144\jre\lib\charsets.jar;D:\Java\jdk1.8.0_144\jre\lib\deploy.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_144\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_144\jre\lib\javaws.jar;D:\Java\jdk1.8.0_144\jre\lib\jce.jar;D:\Java\jdk1.8.0_144\jre\lib\jfr.jar;D:\Java\jdk1.8.0_144\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_144\jre\lib\jsse.jar;D:\Java\jdk1.8.0_144\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_144\jre\lib\plugin.jar;D:\Java\jdk1.8.0_144\jre\lib\resources.jar;D:\Java\jdk1.8.0_144\jre\lib\rt.jar;D:\IdeaProjects\qingyun\plantform\target\classes;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-data-jdbc\2.4.0\spring-boot-starter-data-jdbc-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-jdbc\2.1.1\spring-data-jdbc-2.1.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-relational\2.1.1\spring-data-relational-2.1.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\data\spring-data-commons\2.4.1\spring-data-commons-2.4.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-tx\5.3.1\spring-tx-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-context\5.3.1\spring-context-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-beans\5.3.1\spring-beans-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-jdbc\2.4.0\spring-boot-starter-jdbc-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter\2.4.0\spring-boot-starter-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-logging\2.4.0\spring-boot-starter-logging-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\Program Files\apache-maven-3.5.3\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\Program Files\apache-maven-3.5.3\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Program Files\apache-maven-3.5.3\repository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;D:\Program Files\apache-maven-3.5.3\repository\com\zaxxer\HikariCP\3.4.5\HikariCP-3.4.5.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-jdbc\5.3.1\spring-jdbc-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-web\2.4.0\spring-boot-starter-web-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-json\2.4.0\spring-boot-starter-json-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\core\jackson-core\2.11.3\jackson-core-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.3\jackson-datatype-jdk8-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.3\jackson-datatype-jsr310-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.3\jackson-module-parameter-names-2.11.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-starter-tomcat\2.4.0\spring-boot-starter-tomcat-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;D:\Program Files\apache-maven-3.5.3\repository\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;D:\Program Files\apache-maven-3.5.3\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-web\5.3.1\spring-web-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-webmvc\5.3.1\spring-webmvc-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-aop\5.3.1\spring-aop-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-expression\5.3.1\spring-expression-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.4\mybatis-spring-boot-starter-2.1.4.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.4\mybatis-spring-boot-autoconfigure-2.1.4.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\mybatis\3.5.6\mybatis-3.5.6.jar;D:\Program Files\apache-maven-3.5.3\repository\org\mybatis\mybatis-spring\2.0.6\mybatis-spring-2.0.6.jar;D:\Program Files\apache-maven-3.5.3\repository\org\thymeleaf\extras\thymeleaf-extras-springsecurity5\3.0.4.RELEASE\thymeleaf-extras-springsecurity5-3.0.4.RELEASE.jar;D:\Program Files\apache-maven-3.5.3\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-devtools\2.4.0\spring-boot-devtools-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot\2.4.0\spring-boot-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\boot\spring-boot-autoconfigure\2.4.0\spring-boot-autoconfigure-2.4.0.jar;D:\Program Files\apache-maven-3.5.3\repository\mysql\mysql-connector-java\8.0.22\mysql-connector-java-8.0.22.jar;D:\Program Files\apache-maven-3.5.3\repository\org\projectlombok\lombok\1.18.16\lombok-1.18.16.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-core\5.3.1\spring-core-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\org\springframework\spring-jcl\5.3.1\spring-jcl-5.3.1.jar;D:\Program Files\apache-maven-3.5.3\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar" com.wzy.plantform.weixin.demo.Program |
发布服务
把代码整理下发布一个 http 的服务。并把 url 地址填写到 微信的配置(url)里,提交即可。
1 |
|
其中 pc.verifyUrl 方法就是 示例代码中 WXBizMsgCrypt 类的 verifyUrl 方法。
踩坑
配置完后一直验证失败!通过打印输出 发现签名一直不对!后百度到 echoStr 参数填写 “” (空串)。最终结果如下:
1 | public String verifyUrl(String msgSignature, String timeStamp, String nonce, String echoStr) |
文档:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html