xiaowei1118 / java_server

基于SpringMVC+spring+Mybatis的校园o2o电商项目的后台和管理平台
MIT License
365 stars 220 forks source link

没数据库文件,另外我把他换成了Idea项目,新建了一个仓库。 #34

Open windli93 opened 8 years ago

windli93 commented 8 years ago

没数据库文件,启动不了。

xiaowei1118 commented 8 years ago

你好,谢谢你的关注,sql文件已经传上去了。另外,eclipse转idea项目的时候,请注意classpath在eclipse和idea上有差异,除此之外,项目是可以正常运行的,谢谢。

windli93 commented 8 years ago

谢谢。

windli93 commented 8 years ago

运行出错,tomcat找不到module。

/home/deepin-linux/tomcat/apache-tomcat-8.0.36/bin/catalina.sh run Using CATALINA_BASE: /home/deepin-linux/.IntelliJIdea15/system/tomcat/Unnamed_Wechat_Ssm_2 Using CATALINA_HOME: /home/deepin-linux/tomcat/apache-tomcat-8.0.36 Using CATALINA_TMPDIR: /home/deepin-linux/tomcat/apache-tomcat-8.0.36/temp Using JRE_HOME: /usr/lib/jvm/java-8-openjdk-amd64 Using CLASSPATH: /home/deepin-linux/tomcat/apache-tomcat-8.0.36/bin/bootstrap.jar:/home/deepin-linux/tomcat/apache-tomcat-8.0.36/bin/tomcat-juli.jar Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp [2016-07-05 09:45:36,225] Artifact unnamed: Server is not connected. Deploy is not available. 05-Jul-2016 09:45:38.522 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.36 05-Jul-2016 09:45:38.526 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 9 2016 13:55:50 UTC 05-Jul-2016 09:45:38.528 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.36.0 05-Jul-2016 09:45:38.528 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux 05-Jul-2016 09:45:38.529 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-2-deepin-amd64 05-Jul-2016 09:45:38.529 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 05-Jul-2016 09:45:38.530 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre 05-Jul-2016 09:45:38.530 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_77-Debian-8u77-b03-3+b1-b1 05-Jul-2016 09:45:38.531 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 05-Jul-2016 09:45:38.531 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /home/deepin-linux/.IntelliJIdea15/system/tomcat/Unnamed_Wechat_Ssm_2 05-Jul-2016 09:45:38.532 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /home/deepin-linux/tomcat/apache-tomcat-8.0.36 05-Jul-2016 09:45:38.532 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/deepin-linux/.IntelliJIdea15/system/tomcat/Unnamed_Wechat_Ssm_2/conf/logging.properties 05-Jul-2016 09:45:38.532 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 05-Jul-2016 09:45:38.534 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 05-Jul-2016 09:45:38.535 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099 05-Jul-2016 09:45:38.538 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 05-Jul-2016 09:45:38.538 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false 05-Jul-2016 09:45:38.542 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 05-Jul-2016 09:45:38.543 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 05-Jul-2016 09:45:38.543 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/home/deepin-linux/tomcat/apache-tomcat-8.0.36/endorsed 05-Jul-2016 09:45:38.543 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/deepin-linux/.IntelliJIdea15/system/tomcat/Unnamed_Wechat_Ssm_2 05-Jul-2016 09:45:38.543 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/home/deepin-linux/tomcat/apache-tomcat-8.0.36 05-Jul-2016 09:45:38.544 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/home/deepin-linux/tomcat/apache-tomcat-8.0.36/temp 05-Jul-2016 09:45:38.544 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dawt.useSystemAAFontSettings=gasp 05-Jul-2016 09:45:38.545 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2. 05-Jul-2016 09:45:38.545 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 05-Jul-2016 09:45:38.702 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2d 9 Jul 2015) 05-Jul-2016 09:45:39.062 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"] 05-Jul-2016 09:45:39.097 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"] 05-Jul-2016 09:45:39.102 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1893 ms 05-Jul-2016 09:45:39.178 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 05-Jul-2016 09:45:39.183 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.36 05-Jul-2016 09:45:39.226 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"] 05-Jul-2016 09:45:39.262 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"] 05-Jul-2016 09:45:39.281 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 177 ms Connected to server [2016-07-05 09:45:39,460] Artifact unnamed: Artifact is being deployed, please wait... [2016-07-05 09:45:39,533] Artifact unnamed: Error during artifact deployment. See server log for details. [2016-07-05 09:45:39,534] Artifact unnamed: com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: /home/deepin-linux/IdeaProjects/Copy_JavaSever/Java_Server/out/artifacts/unnamed not found for the web module. 05-Jul-2016 09:45:49.247 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/deepin-linux/tomcat/apache-tomcat-8.0.36/webapps/manager 05-Jul-2016 09:45:50.128 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/deepin-linux/tomcat/apache-tomcat-8.0.36/webapps/manager has finished in 882 ms

重点再这里:

Artifact unnamed: com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: /home/deepin-linux/IdeaProjects/Copy_JavaSever/Java_Server/out/artifacts/unnamed not found for the web module.

这个

Artifact unnamed: Server is not connected. Deploy is not available.

windli93 commented 8 years ago

没有有效的解决办法,stackoverflow上写着缺了debian包,但我把包安上了,artifacts也是正确的设置,还是无法解决。

xiaowei1118 commented 8 years ago

我确定不是缺少jar包的问题,看输出的话,应该是你没有设置idea的项目输出目录为maven target下的classes目录

xiaowei1118 commented 8 years ago

image

xiaowei1118 commented 8 years ago

最好设置成 项目路径+/target/classes

windli93 commented 8 years ago

我自己重新弄建了maven项目,然后把源码加了进去,启动没问题,但是spring初始化失败。

windli93 commented 8 years ago

[org.springframework.core.env.StandardEnvironment]Initializing new StandardEnvironment [org.springframework.core.env.StandardEnvironment]Adding [systemProperties] PropertySource with lowest search precedence [org.springframework.core.env.StandardEnvironment]Adding [systemEnvironment] PropertySource with lowest search precedence [org.springframework.core.env.StandardEnvironment]Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning [org.springframework.core.io.support.PathMatchingResourcePatternResolver]Looking for matching resources in directory tree [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl] [org.springframework.core.io.support.PathMatchingResourcePatternResolver]Searching directory [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl] for files matching pattern [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/springartifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/**/.class] [org.springframework.core.io.support.PathMatchingResourcePatternResolver]Resolved location pattern [classpath_:com/changyu/foryou/serviceImpl/*/.class] to resources [file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PushServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/FoodServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/OrderServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/KeyServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/UserServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PayServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/ReceiverServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PreferentialServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/CampusServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/SellerServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/NewsServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PackageServiceImpl.class], file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/HotSearchServiceImpl.class]] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PushServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/FoodServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/OrderServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/KeyServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/UserServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PayServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/ReceiverServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PreferentialServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/CampusServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/SellerServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/NewsServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/PackageServiceImpl.class] [org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Identified candidate component class: file [/home/deepin-linux/IdeaProjects/Copy_JavaSever/java_server_practice/target/spring_artifact/WEB-INF/classes/com/changyu/foryou/serviceImpl/HotSearchServiceImpl.class] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loaded 18 bean definitions from location pattern [classpath:spring.xml] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loading XML bean definitions from class path resource [spring-mybatis.xml] [org.springframework.beans.factory.xml.DefaultDocumentLoader]Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] [org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/beans/spring-beans-3.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-3.0.xsd [org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/tx/spring-tx-3.0.xsd] in classpath: org/springframework/transaction/config/spring-tx-3.0.xsd [org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/tool/spring-tool-3.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-3.0.xsd [org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/aop/spring-aop-3.0.xsd] in classpath: org/springframework/aop/config/spring-aop-3.0.xsd [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader]Loading bean definitions [org.springframework.beans.factory.xml.BeanDefinitionParserDelegate]Neither XML 'id' nor 'name' specified - using generated bean name [org.mybatis.spring.mapper.MapperScannerConfigurer#0] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loaded 12 bean definitions from location pattern [classpath:spring-mybatis.xml] [org.springframework.web.context.support.XmlWebApplicationContext]Bean factory for Root WebApplicationContext: org.springframework.beans.factory.support.DefaultListableBeanFactory@3eca5b6b: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,pushService,/foodService,orderService,keyService,userService,payService,receiverService,preferentialService,campusService,sellerService,/newsService,packageService,/hotSearchService,dataSource,jdbcTemplate,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,transactionAdvice,org.springframework.aop.config.internalAutoProxyCreator,transactionPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,druid-stat-interceptor,druid-stat-pointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1]; root of factory hierarchy [org.springframework.beans.factory.support.DefaultListableBeanFactory]Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' [org.springframework.beans.factory.support.DefaultListableBeanFactory]Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' [org.springframework.beans.factory.support.DefaultListableBeanFactory]Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references [org.springframework.beans.factory.support.DefaultListableBeanFactory]Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' [org.springframework.beans.factory.support.DefaultListableBeanFactory]Creating shared instance of singleton bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' [org.springframework.beans.factory.support.DefaultListableBeanFactory]Creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' [org.springframework.beans.factory.support.DefaultListableBeanFactory]Eagerly caching bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' to allow for resolving potential circular references [org.springframework.beans.factory.support.DefaultListableBeanFactory]Invoking afterPropertiesSet() on bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' [org.springframework.beans.factory.support.DefaultListableBeanFactory]Finished creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' [org.springframework.web.context.ContextLoader]Context initialization failed java.lang.IllegalArgumentException at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:52) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298) at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300) at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1696) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 05-Jul-2016 18:30:10.864 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 05-Jul-2016 18:30:10.865 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors [org.springframework.web.context.support.XmlWebApplicationContext]Closing Root WebApplicationContext: startup date [Tue Jul 05 18:30:09 CST 2016]; root of context hierarchy [org.springframework.web.context.support.XmlWebApplicationContext]Exception thrown from ApplicationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue Jul 05 18:30:09 CST 2016]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4889) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5526) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1696) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [org.springframework.web.context.support.XmlWebApplicationContext]Exception thrown from LifecycleProcessor on context close java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue Jul 05 18:30:09 CST 2016]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4889) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5526) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1696) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [org.springframework.beans.factory.support.DefaultListableBeanFactory]Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3eca5b6b: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,pushService,/foodService,orderService,keyService,userService,payService,receiverService,preferentialService,campusService,sellerService,/newsService,packageService,/hotSearchService,dataSource,jdbcTemplate,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,transactionAdvice,org.springframework.aop.config.internalAutoProxyCreator,transactionPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,druid-stat-interceptor,druid-stat-pointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy [2016-07-05 06:30:10,961] Artifact java_server_practice:war exploded: Error during artifact deployment. See server log for details.

映射的问题

windli93 commented 8 years ago

上面太多了,看这里。

org.springframework.beans.factory.support.DefaultListableBeanFactory]Finished creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' [org.springframework.web.context.ContextLoader]Context initialization failed java.lang.IllegalArgumentException at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:52) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)

windli93 commented 8 years ago

找到原因了,3.2的spring不能使用jdk8/openjdk8,修改spring版本解决问题。
外国友人的解决办法:

One cause could be the spring incompatibility with java version. spring 3.2.0 doesnt work with java 8. Solution: Upgrade to 3.2.16 or above

windli93 commented 8 years ago

大兄弟,终于把你的项目给运行起来了,有几个问题要解决。

1.pom.xml 加找文件路劲的代码,不然很容易找不到文件路径。

2.数据库配置文件引入不进来只能手敲,我自己搭过,没出现这种问题

<bean id="propertyConfigurer"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="classpath:jdbc.properties" />
</bean>

<!-- 配置数据源 -->
<bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
    init-method="init" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/foryou" />
    <property name="username" value="root" />
    <property name="password" value="1234" />
    <!-- 初始化连接大小 -->
    <property name="initialSize" value="0"></property>
    <!-- 连接池最大数量 -->
    <property name="maxActive" value="20"></property>
    <!-- 连接池最大空闲 -->
    <property name="maxIdle" value="20"></property>
    <!-- 连接池最小空闲 -->
    <property name="minIdle" value="1"></property>
    <!-- 获取连接最大等待时间 -->
    <property name="maxWait" value="6000"></property>
</bean> <br />

3.控制层好多的map集合里没加 new HashMap String, Object();
运行一片错,希望能帮助你完善,我近期会看完你的代码,要不就是接着你的项目完善,要不就是自己重新做一个项目,不过,先看完代码再说吧。

xiaowei1118 commented 8 years ago

map运行出错时因为你要设置编译版本在1.7以上。我做这个项目的时候确实是使用的1.7的jdk,谢谢你的提醒。

windli93 commented 8 years ago

markdown 这语法我也是醉了,xml里面include和html里面的标签重复了。