zhegexiaohuozi / SeimiCrawler

一个简单、敏捷、分布式的支持SpringBoot的Java爬虫框架;An agile, distributed crawler framework.
http://seimicrawler.org
Apache License 2.0
1.98k stars 679 forks source link

java.lang.NumberFormatException: For input string: "${redis.port:6379}" #5

Closed RunnningSnail closed 8 years ago

RunnningSnail commented 8 years ago

When i run the demo,the console throws this error,how to fix that?Thanks

zhegexiaohuozi commented 8 years ago

try this, cd /dir/or/demo and execute:

mvn -U clean compile
mvn exec:java -Dexec.mainClass="cn.wanghaomiao.main.Boot" -Dexec.classpathScope=runtime
RunnningSnail commented 8 years ago

Thanks for your quick reply! I cd to my own project directory and run the order.It shows exception: java.lang.ClassNotFoundException: cn.wanghaomiao.main.Boot at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281) at java.lang.Thread.run(Thread.java:744) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE

zhegexiaohuozi commented 8 years ago

mvn -U clean compile

zhegexiaohuozi commented 8 years ago

then

mvn exec:java -Dexec.mainClass="cn.wanghaomiao.main.Boot" -Dexec.classpathScope=runtime

RunnningSnail commented 8 years ago

D:\PersonalTest\workspace\TestWebApplication>mvn -U clean compile [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building TestWebApplication 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestWebApplication ---

[INFO] Deleting D:\PersonalTest\workspace\TestWebApplication\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestWebApp lication --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ TestWebApplicat ion --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. b uild is platform dependent! [INFO] Compiling 2 source files to D:\PersonalTest\workspace\TestWebApplication\ target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.533 s [INFO] Finished at: 2016-07-04T18:32:44+08:00 [INFO] Final Memory: 17M/222M [INFO] ------------------------------------------------------------------------

D:\PersonalTest\workspace\TestWebApplication>mvn exec:java -Dexec.mainClass="cn. wanghaomiao.main.Boot" -Dexec.classpathScope=runtime [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building TestWebApplication 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ TestWebApplication --- [WARNING] java.lang.ClassNotFoundException: cn.wanghaomiao.main.Boot at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281) at java.lang.Thread.run(Thread.java:744) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.036 s [INFO] Finished at: 2016-07-04T18:32:58+08:00 [INFO] Final Memory: 12M/222M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (d efault-cli) on project TestWebApplication: An exception occured while executing the Java class. cn.wanghaomiao.main.Boot -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE xception

zhegexiaohuozi commented 8 years ago

Are you sure that you hava the source code of cn.wanghaomiao.main.Boot and you are using the official demo?

RunnningSnail commented 8 years ago

Ah,My package hierarchy is not right.What's more i does not config the seimi.properties file.There is a 'redis.port=6379' config. Thanks for your reply!