今天开发遇到下面问题,贴出部分异常信息,如下:

[WARNING] failed [email protected]:
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.Net.bind(Net.java:)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:)
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:)
at org.mortbay.jetty.Server.doStart(Server.java:)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:)
at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:)
at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:)
[WARNING] failed Server@3bca1fe2 [INFO] Shutdown hook executing
[INFO] Destroying Spring FrameworkServlet 'springmvc'
-- ::, INFO XmlWebApplicationContext: - Closing WebApplicationContext for namespace 'springmvc-servlet': startup date [Wed Oct :: CST ]; parent: Root WebApplicationContext
-- ::, INFO DefaultListableBeanFactory: - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@551b8762: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,accountAO,accountController,AccountBuzLogAO,accountBuzLogController,accountAmountAO,flowAO,flowController,accountOpenLogAO,accountOpenLogController,RechargeAO,rechargeController,accountRequestLogAO,accountRequestLogController,supplementAO,supplementController,acctransferAO,acctransferController,advForShopAO,advForShopController,billManageAO,billManageController,blockLogAO,blockController,buyerGoodsAO,buyerGoodsController,changeAcountAO,changeAcountController,adminController,compareAO,accountCompareController,cycleSettlementAO,cycleSettlementItemAO,cycleSettItemController,cycleSettlementController,inputInvoiceAccAO,inputInvoiceAccountController,inputInvoiceAccCloseAO,inputInvoiceAccountCloseController,inputInvoiceRecordAO,invoiceRecordController,inputInvoiceAO,invoiceController,/settlementLogAO,settlementLogController,mallDealAO,mallDealController,logisticsAO,logisticsController,processAO,processController,ordersDetailController,orderDetailController,goodsAO,goodsController,payAO,payController,payCancelAO,payCancelController,permissController,proceedsAO,proceedsController,rechargeRefundAO,rechargeRefundController,refundLogAO,refundLogController,secondSettlementAO,secondSettlementController,serviceFeeAO,serviceFeeController,suplierlogisticAO,suplierlogisticController,suplierprocessAO,suplierProcessController,accountAmtAO,fixInvoiceAO,fixPayAO,logisticProcessTempAO,payDBCompletingAO,accountAmtController,invoiceFixController,logisticProcessTempController,payFixController,testSellerGoodsController,testSendMQ,withdrawalsAO,withdrawalsController,contentNegotiationManager,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#,stringHttpMessageConverter,fastJsonHttpMessageConverter,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#,org.springframework.format.support.FormattingConversionServiceFactoryBean#,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#,org.springframework.web.servlet.handler.MappedInterceptor#,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,velocityConfig,velocityViewResolver,exceptionResolver,multipartResolver,localeResolver,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@39ced71b
[ERROR] failed jsp
java.lang.NoClassDefFoundError: org/apache/jasper/runtime/JspApplicationContextImpl
at org.apache.jasper.servlet.JspServlet.destroy(JspServlet.java:)
at org.mortbay.jetty.servlet.ServletHolder.destroyInstance(ServletHolder.java:)
at org.mortbay.jetty.servlet.ServletHolder.doStop(ServletHolder.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.servlet.ServletHandler.doStop(ServletHandler.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:)
at org.mortbay.jetty.servlet.SessionHandler.doStop(SessionHandler.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:)
at org.mortbay.jetty.handler.ContextHandler.doStop(ContextHandler.java:)
at org.mortbay.jetty.webapp.WebAppContext.doStop(WebAppContext.java:)
at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStop(Jetty6PluginWebAppContext.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:)
at org.mortbay.jetty.Server.doStop(Server.java:)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:)
at org.mortbay.jetty.Server$ShutdownHookThread.run(Server.java:)
Caused by: java.lang.ClassNotFoundException: org.apache.jasper.runtime.JspApplicationContextImpl
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:)
... more
[ERROR] failed ServletHandler@19d31463

刚看到这个异常以为是启动了两个jetty,结果按照解决办法不行,重启eclipse也不行,到任务管理器里也没有发现占用端口的进程。

最终网上找到解决办法:

1、进入命令窗口,输入命令 :tasklist

其实这显示的就是任务管理器里服务那个页面内容,但是要比任务管理器里展示内容更多,就如我遇到的这个问题,其实是有个pid在任务管理器中是没有显示的。

2、输入命令:taskkill /im 要杀死的进程名称 /f

提示杀死成功,重启eclipse,启动项目,ok。

下面贴图 :

解决 eclipse出现 Address already in use: bind-LMLPHP

查询taskkill命令的使用方法:

“taskkill /im 映像名称.exe /f” 其中,“/im”后面接映像名称,“/f”的意思的强制结束如想看taskkill的更多用法,可用命令“taskkill /?”进行查看

05-11 17:43