刚来公司。从公司的svn资源库上检出maven项目后,一直运行不起来。但是公司上一批开发人员全走了,剩下了都是才来的,也没有留下任何的资料。
下面是我认为项目中一些关于环境的代码。谁能指点我一下,怎样才能把项目在本地上运行起来。
感激不尽
报的都是js校验上的错
弄成了这样的效果之后开始尝试运行:(tomcat:run)
但是项目启动不起来,下面是(连上公司vpn和不连公司vpn)时启动时控制台打印的信息
没连vpn:
给了访问的地址,访问时404,同时也报错
SEVERE: Exception sending context initialized event to listener instance of class com.htz.config.HtzContextLoaderListener
The web application [/htz] registered the JBDC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Error listenerStart
Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run (default-cli) on project htz: Could not start Tomcat: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind <null>:8080 -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
下面是连接上vpn 运行(tomcat:run)
情况基本相同,只有这一行错误不同:
SEVERE: Exception sending context initialized event to listener instance of class com.htz.config.HtzContextLoaderListener
再之后我发现工程的pom.xml文件中配置了jetty插件
然后我就使用jetty:run运行项目,错误如下
出现了非常多这样的信息:
Caused by: com.github.diamond.client.ConfigurationRuntimeException: 本地没有备份配置数据,PropertiesConfiguration 初始化失败。
以及这些提示:
No Spring WebApplicationInitializer types detected on classpath
Failed connect to server localhost:8283 from Netty4Client 169.254.166.171
Start Netty4Client Luo/169.254.166.171 connect to the server localhost
然后我想,是不是我因该要去连接Netty4Client 169.254.166.171的一个服务器,或者Netty4Client Luo/169.254.166.171这个。但问了公司开发的同事之后我绝望了。没有人知道,全公司没有一台电脑可以把项目在本地运行起来。
我感觉非常的难受,但我不想放弃,直到我又发现项目中的一个文档中写着:
工程的结构我也觉的好像和之前我做过的项目不大一样
我开始在电脑上安装grunt和jenkins,现在暂时还没什么头绪。
有没有好心人能指点我一下,我感觉快要崩溃了。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
估计是加载配置文件出错
你先把superdiamond这个服务启动起来
https://github.com/melin/super-diamond这个是项目地址
这个项目采用maven分模块开发目录格式,找到htz执行一次mvncleaninstall-Dmaven.test.skip=true.需要把依赖包映射进去.当然没这么简单还有其它环境加载问题,你沿着maven构建这条思路找问题吧好的谢谢。我尝试一下,至少有方向了。只有回家熬夜弄你还是先学习下maven吧,这个没在本人面前,没法跟你说清楚。如果人在面前,当面说,分分钟。就好比我一眼就知道男人和女人的区别,但我一个小时也没法用文字或算法描述出来
这是maven多模块项目,通常有父项目和子项目之分。你可以单独运行子项目,也可以看POM文件,找到父项目,直接编译父项目即可。但是,随机应变。
另外,grunt是前端的构建工具,和你这个java项目无关的。
或者你尝试把父项目POM贴出来,以及maven的完整报错
另外,你也完全可以直接在eclipse按照传统的方式添加一个server的方式来部署,不是非要mvntomcat:run这样。
然后去编译后的目录看看哪些文件没有编译出来
好吧,当时学习maven是为了公司的项目。就只是简单的入了个门,基本上能够操作就没有继续深入了。明天研究一下,然后再把pom文件贴出来。您受累帮我看一下吧,公司给我下了一个新功能,项目跑不起来急死人了。感激不尽这是完整的pom文件:
<projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd"></project>
只要是有依赖关系以及父工程都倒了呀:
难道是版本号有问题?我只有从头把maven看一遍了
com.github.diamond.client.ConfigurationRuntimeException
这个错误是一个开源项目的错误,远程加载配置文件的服务,你先看看你们内网这太机器的服务起来没有.
去找下这个项目,把服务起来,这个错误就不会有了.
话说这个项目还不错,主动推送配置文件给客户端,客户端连接不上服务端还可以调用本地缓存的.
嗯,我去问一下运维的知不知道com.github.diamond.client.ConfigurationRuntimeException相关的服务器搞p2p?都溜了你去填坑么。
贴报错。本地配置maven环境。查看jar包是否完整了。
没有显式缺少jar包,js校验之类的还在出红叉。本地仓库都1.8G了使用传统添加Servers方式运行所报的错:
SEVERE:Exceptionsendingcontextinitializedeventtolistenerinstanceofclasscom.htz.config.HtzContextLoaderListener
java.lang.ExceptionInInitializerError
atcom.htz.config.Global.<clinit>(Global.java:63)
atcom.htz.config.HtzContextLoaderListener.contextInitialized(HtzContextLoaderListener.java:43)
atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
atjava.util.concurrent.FutureTask.run(FutureTask.java:166)
atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
atjava.lang.Thread.run(Thread.java:722)
Causedby:com.github.diamond.client.ConfigurationRuntimeException:本地没有备份配置数据,PropertiesConfiguration初始化失败。
atcom.github.diamond.client.PropertiesConfiguration.connectServer(PropertiesConfiguration.java:117)
atcom.github.diamond.client.PropertiesConfiguration.<init>(PropertiesConfiguration.java:54)
atcom.github.diamond.client.OverridablePropertiesConfiguration.<init>(OverridablePropertiesConfiguration.java:9)
atcom.htz.common.HtzConfig.<init>(HtzConfig.java:19)
atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:50)
atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:46)
athtz.core.common.Global.<clinit>(Global.java:18)
...12more
Causedby:com.github.diamond.client.ConfigurationRuntimeException:本地没有备份配置数据,PropertiesConfiguration初始化失败。
atcom.github.diamond.client.PropertiesConfiguration.connectServer(PropertiesConfiguration.java:87)
...18more
四月22,201611:10:54上午org.apache.catalina.core.StandardContextstartInternal
SEVERE:ErrorlistenerStart
四月22,201611:10:54上午org.apache.catalina.core.StandardContextstartInternal
SEVERE:Context[/htz]startupfailedduetopreviouserrors
四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoaderclearReferencesThreads
SEVERE:Thewebapplication[/htz]appearstohavestartedathreadnamed[ClientReconnectTimer-thread-1]buthasfailedtostopit.Thisisverylikelytocreateamemoryleak.
四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoaderclearReferencesThreads
SEVERE:Thewebapplication[/htz]appearstohavestartedathreadnamed[pool-1-thread-1]buthasfailedtostopit.Thisisverylikelytocreateamemoryleak.
四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoadercheckThreadLocalMapForLeaks
SEVERE:Thewebapplication[/htz]createdaThreadLocalwithkeyoftype[java.lang.ThreadLocal](value[java.lang.ThreadLocal@323b0ead])andavalueoftype[io.netty.util.internal.InternalThreadLocalMap](value[io.netty.util.internal.InternalThreadLocalMap@4340999e])butfailedtoremoveitwhenthewebapplicationwasstopped.Threadsaregoingtoberenewedovertimetotryandavoidaprobablememoryleak.
四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoadercheckThreadLocalMapForLeaks
SEVERE:Thewebapplication[/htz]createdaThreadLocalwithkeyoftype[java.lang.ThreadLocal](value[java.lang.ThreadLocal@323b0ead])andavalueoftype[io.netty.util.internal.InternalThreadLocalMap](value[io.netty.util.internal.InternalThreadLocalMap@46257690])butfailedtoremoveitwhenthewebapplicationwasstopped.Threadsaregoingtoberenewedovertimetotryandavoidaprobablememoryleak.
四月22,201611:10:54上午org.apache.coyote.AbstractProtocolstart
INFO:StartingProtocolHandler["http-bio-8080"]
四月22,201611:10:54上午org.apache.coyote.AbstractProtocolstart
INFO:StartingProtocolHandler["ajp-bio-8009"]
四月22,201611:10:54上午org.apache.catalina.startup.Catalinastart
INFO:Serverstartupin9752ms
四月22,201611:10:56上午org.apache.catalina.loader.WebappClassLoaderloadClass
INFO:Illegalaccess:thiswebapplicationinstancehasbeenstoppedalready. Couldnotloadio.netty.util.concurrent.DefaultPromise$2. Theeventualfollowingstacktraceiscausedbyanerrorthrownfordebuggingpurposesaswellastoattempttoterminatethethreadwhichcausedtheillegalaccess,andhasnofunctionalimpact.
java.lang.IllegalStateException
atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1610)
atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
atio.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:589)
atio.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:397)
atio.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:155)
atjava.lang.Thread.run(Thread.java:722)
Exceptioninthread"pool-1-thread-1"java.lang.NoClassDefFoundError:io/netty/util/concurrent/DefaultPromise$2
atio.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:589)
atio.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:397)
atio.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:155)
atjava.lang.Thread.run(Thread.java:722)
Causedby:java.lang.ClassNotFoundException:io.netty.util.concurrent.DefaultPromise$2
atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
...4more
使用jetty:run方式所报的错误:
使用jetty:run方式运行,报的错误(太长我去掉了一些重复的):
[INFO]NoSpringWebApplicationInitializertypesdetectedonclasspath
2016-04-2211:14:56ERROR[main](com.github.diamond.client.netty.Netty4Client.java:141)Failedconnecttoserverlocalhost:8283fromNetty4Client169.254.166.171
2016-04-2211:14:56INFO[main](com.github.diamond.client.netty.Netty4Client.java:71)StartNetty4ClientLuo/169.254.166.171connecttotheserverlocalhost
[WARNING]FAILEDo.e.j.m.p.JettyWebAppContext@473cf652{/,file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/,STARTING}{file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/}:java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
atcom.htz.config.Global.<clinit>(Global.java:63)
atcom.htz.config.HtzContextLoaderListener.contextInitialized(HtzContextLoaderListener.java:43)
atorg.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:798)
atorg.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)
atorg.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:789)
atorg.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
atorg.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1343)
atorg.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:296)
atorg.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1336)
atorg.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
atorg.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
atorg.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365)
atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
atorg.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
atorg.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
atorg.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
atorg.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
atorg.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
atorg.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
atorg.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
atorg.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
atorg.eclipse.jetty.server.Server.start(Server.java:387)
atorg.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
atorg.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
atorg.eclipse.jetty.server.Server.doStart(Server.java:354)
atorg.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:73)
atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
atorg.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:534)
atorg.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:357)
atorg.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:167)
atorg.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
atorg.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
atorg.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
atorg.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
atorg.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
atorg.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
atorg.apache.maven.cli.MavenCli.main(MavenCli.java:199)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
atjava.lang.reflect.Method.invoke(Method.java:601)
atorg.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
atorg.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
atorg.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
atorg.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Causedby:com.github.diamond.client.ConfigurationRuntimeException:本地没有备份配置数据,PropertiesConfiguration初始化失败。
atcom.github.diamond.client.PropertiesConfiguration.connectServer(PropertiesConfiguration.java:117)
atcom.github.diamond.client.PropertiesConfiguration.<init>(PropertiesConfiguration.java:54)
atcom.github.diamond.client.OverridablePropertiesConfiguration.<init>(OverridablePropertiesConfiguration.java:9)
atcom.htz.common.HtzConfig.<init>(HtzConfig.java:19)
atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:50)
atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:46)
athtz.core.common.Global.<clinit>(Global.java:18)
...54more
FAILEDorg.eclipse.jetty.server.handler.HandlerCollection@210ea83d[org.eclipse.jetty.server.handler.ContextHandlerCollection@7ec0c236[o.e.j.m.p.JettyWebAppContext@473cf652{/,file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/,STARTING}{file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/}],org.eclipse.jetty.server.handler.DefaultHandler@49474dbf,org.eclipse.jetty.server.handler.RequestLogHandler@68415c2e]:java.lang.ExceptionInInitializerError
FAILEDorg.eclipse.jetty.maven.plugin.JettyServer@580bdd96:java.lang.ExceptionInInitializerError
Failedtoexecutegoalorg.eclipse.jetty:jetty-maven-plugin:9.2.4.v20141103:run(default-cli)onprojecthtz:Executiondefault-cliofgoalorg.eclipse.jetty:jetty-maven-plugin:9.2.4.v20141103:runfailed:AnAPIincompatibilitywasencounteredwhileexecutingorg.eclipse.jetty:jetty-maven-plugin:9.2.4.v20141103:run:java.lang.ExceptionInInitializerError:null