Error was Port already in use: 40001

遇到下面错误,解决方法:关掉相关进程,重新启动服务器,重新部署

--------------------------------------------------------

[WARN][2014-09-03 21:38:28,130][net.sf.ehcache.distribution.RMICacheManagerPeerListener]Explicitly setting the listener hostname to 'localhost' is not recommended. It will only work if all CacheManager peers are on the same machine.

[ERROR][2014-09-03 21:38:28,273][net.sf.ehcache.distribution.RMICacheManagerPeerListener]Exception starting RMI registry. Error was Port already in use: 40001; nested exception is: 
java.net.BindException: Address already in use
java.rmi.server.ExportException: Port already in use: 40001; nested exception is: 
java.net.BindException: Address already in use
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:330)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:238)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:208)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:152)
at sun.rmi.registry.RegistryImpl.(RegistryImpl.java:137)
at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
at net.sf.ehcache.distribution.RMICacheManagerPeerListener.startRegistry(RMICacheManagerPeerListener.java:326)
at net.sf.ehcache.distribution.RMICacheManagerPeerListener.init(RMICacheManagerPeerListener.java:205)
at net.sf.ehcache.event.CacheManagerEventListenerRegistry.init(CacheManagerEventListenerRegistry.java:104)
at net.sf.ehcache.CacheManager.init(CacheManager.java:365)
at net.sf.ehcache.CacheManager.(CacheManager.java:299)
at net.sf.ehcache.CacheManager.create(CacheManager.java:697)
at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:717)
at org.jeecgframework.web.cgform.engine.TempletContext.(TempletContext.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4750)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5170)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1704)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:382)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.(ServerSocket.java:237)
at java.net.ServerSocket.(ServerSocket.java:128)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:45)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:345)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:319)
... 48 more
[INFO][2014-09-03 21:38:28,407][org.springframework.beans.factory.support.DefaultListableBeanFactory]Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5f1a0bb1: defining beans [jdbcDao,commonDao,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,commonService,dictDataTag,templetContext,templetLoader,MigrateForm,cgformenhanceJsService,cgTableService,configService,dataBaseService,cgFormFieldService,cgformFtlService,cgformButtonService,cgformButtonSqlService,cgUploadService,jeecgBlobDataService,tFinanceService,jeecgDemoCkfinderService,jeecgDemoService,jeecgMatterBomService,jeecgMinidaoService,jeecgNoteService,webOfficeService,jeecgOrderMainService,optimisticLockingService,courseService,jpPersonService,taskDemoService,jeecgJdbcService,userService,declareService,menuInitService,timeTaskService,systemService,repairService,cgReportExcelService,cgReportService,cgreportConfigHeadService,adService,weixinCmsSiteService,weixinCmsStyleService,cmsMenuService,cmsArticleService,weixinMenuService,weixinAccountService,wechatService,autoResponseService,newsItemService,receiveTextService,textTemplateService,newsTemplateService,customerMessageService,subscribeService,weixinExpandconfigService,prizeRecordService,hdRecordService,huodongService,weixinPhotoAlbumService,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource_jeecg,dataSource,sessionFactory,jdbcTemplate,namedParameterJdbcTemplate,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,validator,logInterceptor,job,dynamicTask,executor,scheduler,org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,taskDemoServiceTaskJob,taskDemoServiceTaskCronTrigger,schedulerFactory,userRestController,cgformEnhanceJsController,cgAutoListController,excelTempletController,generateController,cgFormBuildController,cgformSqlController,cgFormHeadController,cgformFtlController,cgformTransController,cgformButtonController,cgformButtonSqlController,cgUploadController,TFinanceController,jpPersonController,jeecgMatterBomController,webOfficeController,fileUploadController,jeecgBlobDataController,demoController,jeecgDemoController,reportDemoController,userNoPageController,jeecgEasyUIController,jeecgNoteController,courseController,jeecgOrderMainNoTagController,jeecgDemoCkfinderController,jeecgOrderMainController,jeecgDemoTransDataForXml,jeecgJdbcController,optimisticLockingController,jeecgMinidaoController,functionController,timeTaskController,departController,roleController,systemController,userController,loginController,repairController,commonController,iconController,dataSourceController,logController,territoryController,configController,duplicateCheckAction,cgExportExcelController,cgReportController,cgreportConfigHeadController,weixinCmsStyleController,cmsController,adController,cmsArticleController,cmsMenuController,weixinCmsSiteController,menuManagerController,weixinAccountController,wechatController,ckeUploadController,weixinArticleController,autoResponseController,newsItemController,textTemplateController,uppicController,receiveTextController,newsTemplateController,subscribeController,weixinExpandconfigController,hdRecordController,huodongController,prizeRecordController,zpController,weixinPhotoAlbumController,frontPhotoAlbumController,org.jeecgframework.core.util.ApplicationContextUtil#0,mappingJacksonHttpMessageConverter,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,defaultViewResolver,multipartResolver,beanNameViewResolver,jeecgExcelView,dialect,exceptionHandler,org.springframework.web.servlet.handler.SimpleMappingExceptionResolver#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.handler.MappedInterceptor#1,hiberAspect,ehcacheAspect,miniDaoHiberCommonDao,miniDaoHandler,org.jeecgframework.minidao.factory.MiniDaoBeanFactory#0,freemarker,org.springframework.web.servlet.handler.MappedInterceptor#2,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
[INFO][2014-09-03 21:38:28,419][org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler]Shutting down ExecutorService 'scheduler'
[INFO][2014-09-03 21:38:28,420][org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor]Shutting down ExecutorService
[INFO][2014-09-03 21:38:28,423][com.alibaba.druid.pool.DruidDataSource]{dataSource-1} closed
[ERROR][2014-09-03 21:38:28,424][org.springframework.web.context.ContextLoader]Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'templetContext' defined in file [/usr/local/tomcat/webapps/jeewx/WEB-INF/classes/spring-mvc-cgform.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4750)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5170)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1704)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
... 26 more
Caused by: net.sf.ehcache.CacheException: Problem starting listener for RMICachePeer //localhost:40001/eternalCache. Initial cause was Error unmarshaling return header; nested exception is: 
java.net.SocketException: Broken pipe
at net.sf.ehcache.distribution.RMICacheManagerPeerListener.notifyCacheAdded(RMICacheManagerPeerListener.java:538)
at net.sf.ehcache.event.CacheManagerEventListenerRegistry.notifyCacheAdded(CacheManagerEventListenerRegistry.java:159)
at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1104)
at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:656)
at net.sf.ehcache.CacheManager.init(CacheManager.java:374)
at net.sf.ehcache.CacheManager.(CacheManager.java:299)
at net.sf.ehcache.CacheManager.create(CacheManager.java:697)
at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:717)
at org.jeecgframework.web.cgform.engine.TempletContext.(TempletContext.java:49)
... 33 more
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: 
java.net.SocketException: Broken pipe
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:229)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:379)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at net.sf.ehcache.distribution.RMICacheManagerPeerListener.bind(RMICacheManagerPeerListener.java:234)
at net.sf.ehcache.distribution.RMICacheManagerPeerListener.notifyCacheAdded(RMICacheManagerPeerListener.java:536)
... 41 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.ObjectOutputStream$BlockDataOutputStream.flush(ObjectOutputStream.java:1823)
at java.io.ObjectOutputStream.flush(ObjectOutputStream.java:719)
at sun.rmi.transport.StreamRemoteCall.releaseOutputStream(StreamRemoteCall.java:115)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:213)
... 46 more

你可能感兴趣的:(Error was Port already in use: 40001)