1. 程式人生 > >sonar使用Oracle資料庫時報org.elasticsearch.transport.BindTransportException: Failed to bind to [9001]的錯誤

sonar使用Oracle資料庫時報org.elasticsearch.transport.BindTransportException: Failed to bind to [9001]的錯誤

最近專案使用sonar,之前使用3.1.1,報localhost:9000/index/bootstram not found的錯誤,翻了好些資料都沒解決問題。到官網去看,發現最新版本5了,於是放棄了3下了個4,沒想到還是報錯。

錯誤如下

sea[o.s.p.ProcessEntryPoint]  Fail to start search
org.elasticsearch.transport.BindTransportException: Failed to bind to [9001]
	at org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:381) ~[elasticsearch-1.1.2.jar:na]
	at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) ~[elasticsearch-1.1.2.jar:na]
	at org.elasticsearch.transport.TransportService.doStart(TransportService.java:92) ~[elasticsearch-1.1.2.jar:na]
	at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) ~[elasticsearch-1.1.2.jar:na]
	at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:229) ~[elasticsearch-1.1.2.jar:na]
	at org.sonar.search.SearchServer.start(SearchServer.java:135) [sonar-search-4.5.6.jar:na]
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) ~[sonar-process-4.5.6.jar:na]
	at org.sonar.search.SearchServer.main(SearchServer.java:261) [sonar-search-4.5.6.jar:na]                                                             java.net.BindException: Address already in use: bind

看了錯誤,以為是埠被佔用了,去查端口占用情況,結果並沒佔用,然後接著往下看
org.sonar.api.utils.SonarException: Unable to start database
	at org.sonar.server.db.EmbeddedDatabase.start(EmbeddedDatabase.java:71) ~[sonar-server-4.5.6.jar:na]
	at org.sonar.server.db.EmbeddedDatabaseFactory.start(EmbeddedDatabaseFactory.java:41) ~[sonar-server-4.5.6.jar:na]
後檢查配置發現是驅動包的問題,我資料庫用的11g,然後放的10的包,換了包之後就好了。

但是我的web程式用10的包是可以的,具體原因瞭解的同事解答。