在eclipse关联的tomcat下add了一个项目后,tomcat启动报错

当tomcat下没有项目时,tomcat可以正常启动,如下

图片说明

图片说明

将项目添加到tomcat下,并且点击publish后,启动tomcat就会失败,如下

图片说明
图片说明

四处百度无果,希望有大佬能帮忙看看,谢谢

以下是错误信息

六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.5.42
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Jun 4 2019 20:29:04 UTC
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.5.42.0
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 10.0
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1.8.0_201\jre
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_201-b09
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\apache-tomcat-8.5.42
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\apache-tomcat-8.5.42
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\apache-tomcat-8.5.42
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\apache-tomcat-8.5.42
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\apache-tomcat-8.5.42\webapps
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-8.5.42\endorsed
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
六月 16, 2019 2:56:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5].
六月 16, 2019 2:56:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
六月 16, 2019 2:56:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
六月 16, 2019 2:56:06 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018]
六月 16, 2019 2:56:06 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
六月 16, 2019 2:56:06 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
六月 16, 2019 2:56:06 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
六月 16, 2019 2:56:06 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
六月 16, 2019 2:56:06 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1301 ms
六月 16, 2019 2:56:07 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
六月 16, 2019 2:56:07 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.42
六月 16, 2019 2:56:07 下午 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].StandardContext[/jwtest]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:882)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jwtest]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
... 6 more
Caused by: java.lang.IllegalArgumentException: The servlets named [AServlet] and [yan.ibbie.servlet.AServlet] are both mapped to the url-pattern [/AServlet] which is not permitted
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:339)
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:332)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2395)
at org.apache.catalina.startup.ContextConfig.processClass(ContextConfig.java:2071)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2060)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1952)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1220)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1134)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5134)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

六月 16, 2019 2:56:07 下午 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(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:688)
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.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:882)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jwtest]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
... 8 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jwtest]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
... 6 more
Caused by: java.lang.IllegalArgumentException: The servlets named [AServlet] and [yan.ibbie.servlet.AServlet] are both mapped to the url-pattern [/AServlet] which is not permitted
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:339)
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:332)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2395)
at org.apache.catalina.startup.ContextConfig.processClass(ContextConfig.java:2071)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2060)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1952)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1220)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1134)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5134)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

六月 16, 2019 2:56:07 下午 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[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.startup.Catalina.start(Catalina.java:688)
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.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
... 13 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:882)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jwtest]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
... 8 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jwtest]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
... 6 more
Caused by: java.lang.IllegalArgumentException: The servlets named [AServlet] and [yan.ibbie.servlet.AServlet] are both mapped to the url-pattern [/AServlet] which is not permitted
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:339)
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:332)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2395)
at org.apache.catalina.startup.ContextConfig.processClass(ContextConfig.java:2071)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2060)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1952)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1220)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1134)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5134)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

六月 16, 2019 2:56:07 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["http-nio-8080"]
六月 16, 2019 2:56:07 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["ajp-nio-8009"]
六月 16, 2019 2:56:07 下午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service [Catalina]
六月 16, 2019 2:56:07 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["http-nio-8080"]
六月 16, 2019 2:56:07 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["ajp-nio-8009"]

更新一下web.xml的内容

图片说明

1个回答

是不是项目的web.xml文件的问题?

weixin_41421743
_zoey_ 请问楼主的问题解决了吗?我和你遇到的问题很相似
3 个月之前 回复
Three_Y
Three-Y 回复ZhangShuiShou: 哈哈,我今天又犯了相同的错误,才搞明白,在web.xml中配置或者用注解进行配置,只能二选一,eclipse会自动生成注解,我没在意,所以重复配置了。
7 个月之前 回复
ZhangShuiShou
ZhangShuiShou 回复Three_Y: 你有没有改过tomcat原始文件的server.xml
8 个月之前 回复
ZhangShuiShou
ZhangShuiShou 回复Three_Y:我也是刚学这个的,互相讨论下。你将<servlet-maping>中的改成<url-pattern>/</url-pattern>试下
8 个月之前 回复
Three_Y
Three-Y 我把web.xml放上去啦,大佬帮忙瞧瞧,xml我也折腾过了,还是不知道哪里错了
8 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于eclipse中启动tomcat的方式疑问
![图片说明](https://img-ask.csdn.net/upload/201606/18/1466253443_721382.jpg) 请问eclipse中 1,直接点击tomcat插件启动tomcat 2,在server选项卡中先add一个项目进tomcat,再debug启动tomat 这两种方式有什么不同呢?
eclipse怎么配置Tomcat
我在window---preferences---server---Runtime Environment---ADD后 Apache选项出现的是![图片说明](https://img-ask.csdn.net/upload/201608/24/1472005977_785594.jpg) 为什么这里没有Tomcat选项呀?我应该怎么做? (附:我在浏览器输入hostlocal:8080是会出现网页的,这里说明我的Tomcat配置没有问题,但是为什么eclipse会出现这种情况呢,求大神解答。。)
关于eclipse中加入Tomcat插件
![![图片说明](https://img-ask.csdn.net/upload/201703/03/1488533193_906012.png)图片说明](https://img-ask.csdn.net/upload/201703/03/1488533186_81872.png) 在加入Tomcat插件后,本来是在 Windows - preferences - server - add - tomcat这样加的。但是我的Tomcat直接在preference下。这个怎么加到JSP中,或者怎么解决这个问题?请帮忙,谢谢
tomcat不同部署web项目方式的区别,新人求解惑
首先,两种方式用的IDE都是eclipse。 我自学的部署方式是在 tomcat Server 上右击“Add and Remove...”将web项目加入,启动tomcat,这也是网上最多的部署方法。 然而,在公司学到了另外一种部署方式: 公司的项目是一个总工程下面有三个maven项目,通过pom.xml文件进行继承 在tomcat Server的Modules标签下“Add External Web Module”添加了一个本地路径(师傅的手速太快,我都不知道是啥路径) ![图片说明](https://img-ask.csdn.net/upload/201704/15/1492246369_960694.jpg) 然后打开dos界面,路径转到eclipse-workspace的总工程文件夹下, 输入"mvn clean install -DskipTests -Pnewtest"命令,进行项目打包,最后再回到eclipse界面,启动tomcat。 请问大神们,这两种部署方式有什么区别,分别试用啥情况? Modules组件中加的路径是什么意思? maven命令中的“-DskipTests -Pnewtest”又是啥意思? 求大神们解惑~~
在My Eclipse配置tomcat出错
重启电脑后出现unable to open the service‘tomcat7’请问怎么解决? 还有在 myeclipse中add tomcat deployment出现了no projects are available for deployment to this server.Either they all have already been deployed to this server or no deployable projects have been found错误请问是怎么回事?
myeclipse部署web项目和tomcat下手动部署的区别?
详细描述:1.我用myeclipse运行web项目,下载图片后,将图片存储在外部磁盘,在tomcat下改变server.xml文件用虚拟路径映射,但是在myeclipse中直接run as myeclipse server application时,上传的图片就会清空,用myeclipse中server下的add deployment部署项目,图片便可以保留,不太懂原因。2.myeclipse部署web项目和手动在tomacat下部署有什么区别?刚刚接触web不久,希望大家出手相助~~~~非常感谢~~~
tomcat启动失败,不管是eclipse中还是MyEclipse中都是启动失败
2015-9-10 22:32:05 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8. 2015-9-10 22:32:05 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2015-9-10 22:32:05 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:helloDemo' did not find a matching property. 2015-9-10 22:32:05 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:denglu system' did not find a matching property. 2015-9-10 22:32:06 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013) 2015-9-10 22:32:06 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8080"] 2015-9-10 22:32:06 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8009"] 2015-9-10 22:32:06 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 707 ms 2015-9-10 22:32:06 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 2015-9-10 22:32:06 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.52 2015-9-10 22:32:06 org.apache.tomcat.websocket.server.WsSci onStartup 信息: JSR 356 WebSocket (Java WebSocket 1.0) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocketJARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available. 2015-9-10 22:32:06 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].StandardContext[/denglu_system]] at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222) at java.util.concurrent.FutureTask.get(FutureTask.java:83) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/denglu_system]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) ... 7 more Caused by: java.lang.NoClassDefFoundError: HttpServletRequest at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2436) at java.lang.Class.getDeclaredMethods(Class.java:1793) at org.apache.catalina.util.Introspection.getDeclaredMethods(Introspection.java:127) at org.apache.catalina.startup.WebAnnotationSet.loadMethodsAnnotation(WebAnnotationSet.java:279) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:141) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65) at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:400) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 7 more Caused by: java.lang.ClassNotFoundException: HttpServletRequest at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569) ... 21 more 2015-9-10 22:32:07 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$Sync.innerGet(FutureTask.java:222) at java.util.concurrent.FutureTask.get(FutureTask.java:83) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.startup.Catalina.start(Catalina.java:689) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 7 more 2015-9-10 22:32:07 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[8005]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.startup.Catalina.start(Catalina.java:689) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 7 more Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 9 more Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more 2015-9-10 22:32:07 org.apache.coyote.AbstractProtocol pause 信息: Pausing ProtocolHandler ["http-apr-8080"] 2015-9-10 22:32:07 org.apache.coyote.AbstractProtocol pause 信息: Pausing ProtocolHandler ["ajp-apr-8009"] 2015-9-10 22:32:07 org.apache.catalina.core.StandardService stopInternal 信息: Stopping service Catalina 2015-9-10 22:32:07 org.apache.coyote.AbstractProtocol destroy 信息: Destroying ProtocolHandler ["http-apr-8080"] 2015-9-10 22:32:07 org.apache.coyote.AbstractProtocol destroy 信息: Destroying ProtocolHandler ["ajp-apr-8009"] PS:环境变量没有问题!
关于java web问题,求帮助!!
为什么我将项目部署在tomcat后(通过右击Eclipse下方的tomcat后,点击add and remove),在网页却一直不能显示,连http://localhost:8080都不能显示,但是我之前放进去的项目还是可以显示?
myeclips 下tomcat导入jar
导入一个包需要 1.工程项目右键 build path-connfigure build path-add jars 2.工程项目右键 properties -myeclipse-deployment assermbly-add-java build path entries 怎样让在java包导入到工程是自动导入到tomcat
eclipse的web项目新建jsp文件出错
我已经配置好了tomcat环境,新建一个web项目后再创建一个jsp文件提示“The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path”,查了一下资料,也配置好了tomcat运行环境,但是还是无法正常运行这个jsp文件,直到我把这个jsp鼠标右键“add to build path",可以正常运行程序了,但是之前的那个error还在,请问这是什么原因呢?![![图片说明](https://img-ask.csdn.net/upload/201608/03/1470196417_195107.png)图片说明](https://img-ask.csdn.net/upload/201608/03/1470196407_774912.png)
Java Web开发新手请教个问题(eclipse第三方jar的正确导入方式)
比如我导入第三方jar包, 我在JSP页面用了这个包,eclipse编译倒是通过。但浏览器弹出来就显示XXX cannot be resolved to a type. 我是这样导入的:右击项目,Build Path-->Libraries-->Add External JARS,还有我把该jar包也放在项目中的WEB-INF的Lib文件下了,还是没用。 凡是用到第三方包,eclipse编译都通过,浏览器跳出来的都是XXX cannot be resolved to a type. 只要不用到第三方包,都不会出问题,我确定Tomcat没问题的。 <%page import=""%>方面确定没问题的。 ![图片说明](https://img-ask.csdn.net/upload/201603/02/1456914023_89851.png) 以上我导入了mail.jar和activation.jar包,在JSP页面写道: Session mailSession = Session.getDefaultInstance(properties); 最后eclipse编译没报错,但是浏览器却如下该结果: ![图片说明](https://img-ask.csdn.net/upload/201603/02/1456914236_797075.png)
myeclipse部署项目特别慢,buileing workspace一直卡住,add deployment也是只见加载但是一直部署不上
项目是从svn里检出的,用tomcat部署后就出现了这些问题
如何将sublist所有的结果放在一起,titlelist所有的结果放在一起?
如何将sublist所有的结果放在一起,titlelist所有的结果放在一起?麻烦各位大佬帮帮忙 代码如下: for(int h = 0;!Util.isEmpty(elementJsonArray)&&h<elementJsonArray.size();h++) { JSONObject elementJson = elementJsonArray.getJSONObject(h); String elementName = Util.toString(elementJson.getString("elementName")); String elementCode = Util.toString(elementJson.getString("elementCode")); String elementType = elementJson.getString("elementType").toString(); ArrayList <String> titlelist=new ArrayList<String>(); ArrayList <String> sublist=new ArrayList<String>(); if("titleElement".equals(elementType)){ titlelist.add(elementCode); } if("subElement".equals(elementType)){ sublist.add(elementCode); } } 输出结果: sublist+====0=[15708583044490011175] titlelist+====0=[] sublist+====1=[] titlelist+====1=[15708581312920005283] sublist+====2=[15708584021280013129] titlelist+====2=[] sublist+====3=[] titlelist+====3=[15708581991430007861] sublist+====0=[15725951021250002120] titlelist+====0=[] sublist+====1=[] titlelist+====1=[15725927648670002270] sublist+====2=[15730229370140002276] titlelist+====2=[]
怎么把数据库内容显示在网页table上?已有JAVA后台代码。求大佬帮忙
package com.lixing.tool; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; public class JDBC { private static String user="root"; private static String pwd="root"; private static String url="jdbc:mysql://127.0.0.1:3306/vido"; private static String driver="com.mysql.jdbc.Driver"; //��ȡ���ݿ����ӷ��� public static Connection getConnection() throws ClassNotFoundException, SQLException{ Class.forName(driver); return DriverManager.getConnection(url, user, pwd); } } package com.lixing.controller; import java.io.File; import java.io.IOException; import java.util.UUID; import javax.accessibility.AccessibleRelation; import javax.xml.ws.Response; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.lixing.dao.GameInfoDao; import com.lixing.dao.UserInfoDao; import com.lixing.pojo.PageData; import com.lixing.pojo.UserInfo; @Controller public class UserInfoController { //......................................中间省略部分是数据上传功能 @RequestMapping("/queryGameInfoList.do") public @ResponseBody PageData findGameInfo(int page,int limit){ System.out.println("==============="+page); System.out.println("==============="+limit); //��ѯ�û���Ϣ�����ݴ��������������������з�ҳ GameInfoDao dao=new GameInfoDao(); return dao.findGameInfo(page, limit); } @RequestMapping("deleGameInfo.do") public @ResponseBody int deleteGameInfo(int id){ System.out.println("ɾ���û��ķ���======"+id); GameInfoDao dao=new GameInfoDao(); return dao.deleGameInfoById(id); } } package com.lixing.pojo; public class PageData { private String code; private String msg; private int count; private Object data; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public int getCount() { return count; } public void setCount(int count) { this.count = count; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } } package com.lixing.pojo; public class GameInfo { private int id; private String game; private String type; public int getid() { return id; } public void setid(int id) { this.id = id; } public String getgame() { return game; } public void setgame(String game) { this.game = game; } public String gettype() { return type; } public void settype(String type) { this.type = type; } } package com.lixing.dao; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import com.lixing.pojo.GameInfo; import com.lixing.pojo.PageData; import com.lixing.pojo.UserInfo; import com.lixing.tool.JDBC; import java.sql.PreparedStatement; public class GameInfoDao { //中间省略部分为数据上传功能呢 public PageData findGameInfo(int page,int limit){ PageData p=new PageData(); List<GameInfo> list=new ArrayList<GameInfo>(); p.setCode("1"); p.setMsg("閿熸枻鎷烽敓鎹风》鎷烽敓鏂ゆ嫹閿熷眾甯�"); try { page = (page-1)*limit; //閿熸帴绗》鎷烽敓鏂ゆ嫹閿熸枻鎷峰 Connection con=JDBC.getConnection(); String sql="select * from czgame limit ?,?"; PreparedStatement ps=con.prepareStatement(sql); ps.setInt(1, page); ps.setInt(2, limit); ResultSet rs=ps.executeQuery(); boolean ifg=false; while(rs.next()){ //閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂竴閿熸枻鎷烽敓鏂ゆ嫹閿熸嵎锝忔嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂竴閿熸枻鎷穟serInfo閿熸枻鎷烽敓鏂ゆ嫹 GameInfo game=new GameInfo(); ifg=true; game.setid(rs.getInt(1)); game.setgame(rs.getString(2)); game.settype(rs.getString(3)); list.add(game); } if(ifg){ p.setCode("0"); p.setMsg("閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鎹锋垚鐧告嫹閿熸枻鎷�"); p.setCount(findGameInfoCount()); //閿熸枻鎷峰彇閿熺煫浼欐嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹 p.setData(list); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return p; } public int findGameInfoCount(){ Connection con; int num=0; try { con = JDBC.getConnection(); String sql="select count(*) from czgame "; PreparedStatement ps=con.prepareStatement(sql); ResultSet rs=ps.executeQuery(); if(rs.next()){ num=rs.getInt(1); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return num; } public int deleGameInfoById(int id){ int num=0; try { Connection con=JDBC.getConnection(); String sql="delete from czgame where id=?"; PreparedStatement ps=con.prepareStatement(sql); ps.setInt(1, id); num=ps.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } return num; } } 数据库表很简单 ID game type 用jquey.JS 只是不会在页面上使用这些后台JAVA代码显示网页页面上 最后能实现页面按钮对数据库数据进行删除 以及将数据库数据显示在页面上即可
Java web报错,Unknown database 'testdb'
在运行jsp插入数据一直报错Unknown database 'testdb',Mysql是8.0的,试过其他办法都没有用。页面报500错误 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>添加图书信息</title> </head> <body> <p>请输入图书信息</p> ${message}<br> <form action="addBook" method="post"> 书号:<input type="text" name="isbn"/><br> 书名:<input type="text" name="title"/><br> 价格:<input type="text" name="price"/><br> <input type="submit" value="确定"/><input type="reset" value="重置"/> </form> </body> </html> ``` ``` ``` package servlet; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.mysql.jdbc.Statement; @WebServlet("/addBook") public class BookServlet extends HttpServlet { private static final long serialVersionUID = 1L; Connection dbconn = null; @Override public void init() { try { Class.forName("com.mysql.cj.jdbc.Driver"); dbconn = DriverManager.getConnection( "jdbc:mysql://127.0.0.1:3306/testDB?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT&allowPublicKeyRetrieval=true", "root", "123456"); } catch (ClassNotFoundException el) { getServletContext().log("驱动程序类找不到"); } catch (SQLException e2) { System.out.println(e2); } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("utf-8"); String isbn = request.getParameter("isbn"); String title = request.getParameter("title"); float price = Float.parseFloat(request.getParameter("price")); String message = ""; try { String sql = "INSERT INTO books (isbn,title,price) VALUES(?,?,?)"; PreparedStatement pstmt = dbconn.prepareStatement(sql); pstmt.setString(1, isbn); pstmt.setString(2, title); pstmt.setFloat(3, price); int num = pstmt.executeUpdate(); if (num == 1) { message = "插入记录成功"; } else { message = "插入记录失败"; } request.setAttribute("message", message); request.getRequestDispatcher("jsp/add-book.jsp").forward(request, response); } catch (SQLException e) { message = e.getMessage(); request.setAttribute("message", message); request.getRequestDispatcher("jsp/add-book.jsp").forward(request, response); } } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub super.doGet(req, resp); } } ``` ``` <?xml version="1.0" encoding="UTF-8"?> <Context reloadable = "true"> <Resource name="jdbc/testDB" type="javax.sql.DataSource" maxActive="4" maxIdle="2" username="root" password="123456" maxwait="5000" driverClassName="com.mysql.cj.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/testdb?useSLL=true&amp;useUnicode=true&amp;allowPublicKeyRetrieval=true;characterEncoding=utf-8" /> </Context> ``
请大佬们看看我上传图片到本地项目然后数据库保存路劲为null是那部分出错了?
接收图片的jsp前端页面 ``` <form method="post" action="PicUpServlet" enctype="multipart/form-data"> <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;"> <legend>添加文章</legend> </fieldset> <div class="layui-form-item layui-form-text" > <div class="layui-input-block" style="margin-left: 0px;"> <textarea placeholder="请输入内容" class="layui-textarea"></textarea> </div> </div> <!-- <input type="text" name="content" /><br/> --> <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;" > <legend>添加图片</legend> </fieldset> <div style="margin-left: 8px;"> <input type="file" name="uploadFile"/> </div> <br/><br/> <div style="margin-left: 8px;"> <input type="submit" value="上传" /> </div> </form> ``` 文件保存 ``` package com.gugu.servlet; import java.io.File; import java.io.IOException; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.gugu.dao.WisUploadDao; import com.gugu.pojo.GgNote; import com.gugu.util.Upload; public class PicUpServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static final String UPLOAD_DIRECTORY = "C:\\MyBlog-master\\WebContent\\images"; public PicUpServlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().append("Served at: ").append(request.getContextPath()); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); String path = UPLOAD_DIRECTORY+"//images//"+File.separator ; Map<String, String> map = Upload.upload(request, 1024 * 1024 * 10, path); String newFileName ="images"+File.separator+ map.get("newFileName"); GgNote note = new GgNote(); note.setNoteContent(map.get("content")); note.setNotePhoto(newFileName); System.out.println(newFileName); System.out.println(map.get("content")); WisUploadDao add = new WisUploadDao(); add.addwis(note); response.sendRedirect("page/whisper/manage.jsp"); } } ``` 判断文字还是图片 ``` package com.gugu.util; import java.io.File; import java.io.IOException; import java.util.Date; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import com.oreilly.servlet.multipart.FilePart; import com.oreilly.servlet.multipart.MultipartParser; import com.oreilly.servlet.multipart.ParamPart; import com.oreilly.servlet.multipart.Part; public class Upload { public static Map<String, String> upload(HttpServletRequest request,int maxSize, String path) { //以map形式保存数据 key对应保存的是获取界面上的name名称 value保存的是获取界面上的name对应的值 Map<String, String> map = new HashMap<String, String>(); Part part = null; try { MultipartParser mrequest = new MultipartParser(request, maxSize); mrequest.setEncoding("utf-8"); //遍历所有的part组 while ((part = mrequest.readNextPart()) != null) { if (part.isFile()) { //判断是否是文件 FilePart filepart = (FilePart) part;//转化成文件组 String fileName = filepart.getFileName();//得到文件名 if (fileName != null && fileName.length() > 0) { // 取得扩展名 String fileExtName = fileName.substring( fileName.lastIndexOf(".") + 1).toLowerCase(); // 只上传图片 //判断图片上传的格式是否符合 后缀名是否有效 if (fileExtName.equalsIgnoreCase("jpeg") || fileExtName.equalsIgnoreCase("png") || fileExtName.equalsIgnoreCase("jpg") || fileExtName.equalsIgnoreCase("gif") || fileExtName.equalsIgnoreCase("ico") || fileExtName.equalsIgnoreCase("bmp") || fileExtName.equalsIgnoreCase("flv") || fileExtName.equalsIgnoreCase("mp4") || fileExtName.equalsIgnoreCase("mp3")) { /*String newFileName = new Date().getTime() + "."+ fileExtName;//重新改文件名 文件名+扩展名 */ String newFileName =new Date().getTime() +fileName;//不改图片名字 String newPath = path + "/" + newFileName; //文件处理文件上传的路径 File newFile = new File(newPath); filepart.writeTo(newFile); //将文件真正写入到对应的文件夹中 //filepart.getName() 得到 request 要接收的参数的名字 map.put("newFileName", newFileName); map.put(filepart.getName(), newFileName);//把文件信息保存到map中 map.put("newFile", newFile.toString()); } else { map.put("geshi", "geshi"); continue; }// 说明上传的不是图片 } else { map.put("yes","yes"); continue; // 说明没有选择上传图片 } } else if (part.isParam()) { //判断是否是参数 ParamPart paramPart = (ParamPart) part; map.put(paramPart.getName(), paramPart.getStringValue()); } } } catch (IOException e) { e.printStackTrace(); } return map; } } ``` 上传到数据库的文字内容为null 图片保存路劲也为null请问是那部分出错了 控制台报错 ``` java.io.FileNotFoundException: C:\Users\12874\Desktop\毕业设计\MyBlog-master\WebContent\images\images\1572883296157tony_tony_chopper-006.jpg (系统找不到指定的路径。) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(Unknown Source) at java.io.FileOutputStream.<init>(Unknown Source) at java.io.FileOutputStream.<init>(Unknown Source) at com.oreilly.servlet.multipart.FilePart.writeTo(FilePart.java:166) at com.gugu.util.Upload.upload(Upload.java:50) at com.gugu.servlet.PicUpServlet.doPost(PicUpServlet.java:40) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) images\null null ```
springMvc 项目运行问题 代码来自 汪云飞的《sping boot 实战》项目highlight_springmvc4
问题:项目运行,部署问题 ##highlight_springmvc4 这项目怎么跑起来 , 用的sts,开始是自己在pom.xml加上tomcat的插件 ![图片说明](https://img-ask.csdn.net/upload/201910/08/1570535149_824978.jpg) * 贴上代码 ```java package com.wisely.highlight_springmvc4.advice; import org.springframework.ui.Model; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.ModelAndView; @ControllerAdvice //1 public class ExceptionHandlerAdvice { @ExceptionHandler(value = Exception.class)//2 public ModelAndView exception(Exception exception, WebRequest request) { ModelAndView modelAndView = new ModelAndView("error");// error页面 modelAndView.addObject("errorMessage", exception.getMessage()); return modelAndView; } @ModelAttribute //3 public void addAttributes(Model model) { model.addAttribute("msg", "额外信息"); //3 } @InitBinder //4 public void initBinder(WebDataBinder webDataBinder) { webDataBinder.setDisallowedFields("id"); //5 } } ``` * 相关的配置 ```java package com.wisely.highlight_springmvc4; import java.util.List; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.multipart.MultipartResolver; import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.JstlView; import com.wisely.highlight_springmvc4.interceptor.DemoInterceptor; import com.wisely.highlight_springmvc4.messageconverter.MyMessageConverter; @Configuration @EnableWebMvc// 1 @EnableScheduling @ComponentScan("com.wisely.highlight_springmvc4") public class MyMvcConfig extends WebMvcConfigurerAdapter {// 2 @Bean public InternalResourceViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/classes/views/"); viewResolver.setSuffix(".jsp"); viewResolver.setViewClass(JstlView.class); return viewResolver; } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/assets/**").addResourceLocations( "classpath:/assets/");// 3 } @Bean // 1 public DemoInterceptor demoInterceptor() { return new DemoInterceptor(); } @Override public void addInterceptors(InterceptorRegistry registry) {// 2 registry.addInterceptor(demoInterceptor()); } @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/index").setViewName("/index"); registry.addViewController("/toUpload").setViewName("/upload"); registry.addViewController("/converter").setViewName("/converter"); registry.addViewController("/sse").setViewName("/sse"); registry.addViewController("/async").setViewName("/async"); } @Override public void configurePathMatch(PathMatchConfigurer configurer) { configurer.setUseSuffixPatternMatch(false); } @Bean public MultipartResolver multipartResolver() { CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(); multipartResolver.setMaxUploadSize(1000000); return multipartResolver; } @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { converters.add(converter()); } @Bean public MyMessageConverter converter(){ return new MyMessageConverter(); } } ``` * 运行 ![图片说明](https://img-ask.csdn.net/upload/201910/08/1570535574_511217.jpg) * 探索问题 **配置是这样** ![图片说明](https://img-ask.csdn.net/upload/201910/08/1570535626_70258.jpg) **目录是这样** ![图片说明](https://img-ask.csdn.net/upload/201910/08/1570535672_662725.jpg)![图片说明](https://img-ask.csdn.net/upload/201910/08/1570535682_755896.jpg) ###这个要怎么改动才能正确运行呢?困扰许久,期望相助,不胜感谢!!
Java Tomcat 突然运行很慢
2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/7.0.78 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: May 10 2017 15:02:19 UTC 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 7.0.78.0 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows Vista 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.1 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: D:\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.6.0_13-b03 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Sun Microsystems Inc. 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\setup\Java\apache-tomcat-7.0.78 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\setup\Java\apache-tomcat-7.0.78 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:50788 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=D:\setup\Java\apache-tomcat-7.0.78 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\setup\Java\apache-tomcat-7.0.78 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=D:\setup\Java\apache-tomcat-7.0.78/common/endorsed 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.io.tmpdir=D:\setup\Java\apache-tomcat-7.0.78\temp 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.library.path=D:\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;D:\setup\Java\apache-tomcat-7.0.78\bin 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dsun.io.useCanonCaches=false 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Xmx512m 2017-9-30 14:31:20 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -XX:MaxPermSize=256m 2017-9-30 14:31:20 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2. 2017-9-30 14:31:20 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2017-9-30 14:31:20 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.2k 26 Jan 2017) 2017-9-30 14:31:20 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8080"] 2017-9-30 14:31:20 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8009"] 2017-9-30 14:31:20 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1301 ms 2017-9-30 14:31:20 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 2017-9-30 14:31:20 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.78 2017-9-30 14:31:20 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\setup\Java\apache-tomcat-7.0.78\webapps\JBOA 2017-9-30 14:31:24 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 2017-9-30 14:31:24 org.apache.tomcat.websocket.server.WsSci onStartup 信息: JSR 356 WebSocket (Java WebSocket 1.1) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocket JARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available. 2017-9-30 14:31:24 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 2017-9-30 14:31:24 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 2017-9-30 14:31:31 com.sun.faces.config.ConfigureListener contextInitialized 信息: 初始化上下文 '/JBOA' 的 Mojarra 2.0.3 (FCS b03) 2017-9-30 14:31:55 com.sun.faces.spi.InjectionProviderFactory createInstance 信息: JSF1048:有 PostConstruct/PreDestroy 注释。标有这些注释的 ManagedBeans 方法将表示注释已处理。 2017-9-30 14:32:22 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\setup\Java\apache-tomcat-7.0.78\webapps\JBOA has finished in 61,358 ms 2017-9-30 14:32:22 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-apr-8080"] 2017-9-30 14:32:22 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-apr-8009"] 2017-9-30 14:32:22 org.apache.catalina.startup.Catalina start 信息: Server startup in 61578 ms
jfinal手册第一个快速入门的程序,如何通过tomcat发布到网上正常显示
我用的是java EE编程的 这是主程序 package projectTest; import com.jfinal.config.Constants; import com.jfinal.config.Handlers; import com.jfinal.config.Interceptors; import com.jfinal.config.JFinalConfig; import com.jfinal.config.Plugins; import com.jfinal.config.Routes; public class Test extends JFinalConfig { @Override public void configConstant(Constants me) { me.setDevMode(true); } @Override public void configRoute(Routes me) { me.add("/hello", HelloController.class); } @Override public void configPlugin(Plugins me) { } @Override public void configInterceptor(Interceptors me) { } @Override public void configHandler(Handlers me) { } } 这是HelloController程序 package projectTest; import com.jfinal.core.Controller; public class HelloController extends Controller { public void index() { renderText("Hello JFinal World."); } } 然后通过tomcat7.0发布(都是配置好了的),但是一直显示404错误,这是url:http://localhost:8080/hello 日志信息: 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/7.0.68 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Feb 8 2016 20:25:54 UTC 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 7.0.68.0 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 8.1 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.3 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Mine\Study\jdk7\jie7 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.7.0_80-b15 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: C:\Mine\Study\tomcat 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: C:\Mine\Study\tomcat 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=C:\Mine\Study\tomcat 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=C:\Mine\Study\tomcat 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=C:\Mine\Study\tomcat\webapps 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=C:\Mine\Study\tomcat\endorsed 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=GBK 四月 20, 2016 3:42:59 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Mine\Study\jdk7\jie7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Mine\Study\jdk7\bin;C:\Mine\Study\jdk7\jre\bin;. 四月 20, 2016 3:42:59 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-bio-8080"] 四月 20, 2016 3:42:59 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-bio-8009"] 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 585 ms 四月 20, 2016 3:42:59 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 四月 20, 2016 3:42:59 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.68 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor C:\Mine\Study\tomcat\conf\Catalina\localhost\jfinal_demo.xml 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.HostConfig deployDescriptor 警告: A docBase C:\Mine\Study\tomcat\webapps\jfinal_demo inside the host appBase has been specified, and will be ignored 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.SetContextPropertiesRule begin 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:jfinal_demo' did not find a matching property. 四月 20, 2016 3:42:59 下午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deployment of configuration descriptor C:\Mine\Study\tomcat\conf\Catalina\localhost\jfinal_demo.xml has finished in 669 ms 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory C:\Mine\Study\tomcat\webapps\docs 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory C:\Mine\Study\tomcat\webapps\docs has finished in 58 ms 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory C:\Mine\Study\tomcat\webapps\examples 四月 20, 2016 3:43:00 下午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 四月 20, 2016 3:43:00 下午 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 四月 20, 2016 3:43:00 下午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@2d4b90ff') 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory C:\Mine\Study\tomcat\webapps\examples has finished in 363 ms 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory C:\Mine\Study\tomcat\webapps\host-manager 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory C:\Mine\Study\tomcat\webapps\host-manager has finished in 63 ms 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory C:\Mine\Study\tomcat\webapps\manager 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory C:\Mine\Study\tomcat\webapps\manager has finished in 78 ms 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory C:\Mine\Study\tomcat\webapps\ROOT 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory C:\Mine\Study\tomcat\webapps\ROOT has finished in 53 ms 四月 20, 2016 3:43:00 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 四月 20, 2016 3:43:00 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 四月 20, 2016 3:43:00 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 1338 ms 四月 20, 2016 3:43:01 下午 com.jfinal.core.ActionHandler warn 警告: 404 Action Not Found: / 求大大帮帮忙
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
使用 Docker 部署 Spring Boot 项目
Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 S...
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
Android 9.0 init 启动流程
阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、启动流程概述一、 启动流程概述Android启动流程跟Linux启动类似,大致分为如下五个阶段。1.开机上电,加载固化的ROM。2.加载BootLoader,拉起Android OS。3.加载Uboot,初始外设,引导Kernel启动等。...
相关热词 c#委托 逆变与协变 c#新建一个项目 c#获取dll文件路径 c#子窗体调用主窗体事件 c# 拷贝目录 c# 调用cef 网页填表c#源代码 c#部署端口监听项目、 c#接口中的属性使用方法 c# 昨天
立即提问