打包問題總結(jié)

錯誤一:

[2020-02-13 13:49:16 下午]:DEBUG org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.getHandlerMappings(DefaultNamespaceHandlerResolver.java:157)Loaded NamespaceHandler mappings: {http://code.alibabatech.com/schema/dubbo=org.apache.dubbo.config.spring.schema.DubboNamespaceHandler, http://dubbo.apache.org/schema/dubbo=org.apache.dubbo.config.spring.schema.DubboNamespaceHandler}
[2020-02-13 13:49:16 下午]:WARN io.netty.channel.ChannelInitializer.exceptionCaught(ChannelInitializer.java:97)Failed to initialize a channel. Closing: [id: 0xe5580ae0, L:/127.0.0.1:54000 - R:/127.0.0.1:52912]
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [spring/spring.xml]

    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:110)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:301)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1407)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1400)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:172)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:142)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:614)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:515)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at com.genlot.web.server.core.service.DubboConsumer.init(DubboConsumer.java:72)
    at com.genlot.web.server.core.BaseServerInitializer.initChannel(BaseServerInitializer.java:59)
    at com.genlot.web.server.core.BaseServerInitializer.initChannel(BaseServerInitializer.java:26)
    at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
    at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
    at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:969)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:610)
    at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
    at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1461)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1126)
    at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:651)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:515)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:428)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:487)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:405)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
[2020-02-13 13:49:16 下午]:ERROR com.genlot.common.utils.Logger.e(Logger.java:83)ERROR > Request URL[ Request{method=GET, url=http://127.0.0.1:54000/, tags={}} ] Cost[2192791301]
[2020-02-13 13:49:16 下午]:ERROR com.genlot.common.utils.Logger.e(Logger.java:85)java.io.IOException: unexpected end of stream on http://127.0.0.1:54000/...
java.io.IOException: unexpected end of stream on http://127.0.0.1:54000/...
    at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:233)
    at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
    at okhttp3.RealCall.execute(RealCall.java:81)
    at com.genlot.common.utils.HTTPUtil.execute(HTTPUtil.java:61)
    at com.genlot.web.server.core.BaseServer.start(BaseServer.java:96)
    at cn.gov.cwl.vlt.channel.app.ChannelServerStarter.main(ChannelServerStarter.java:63)
Caused by: java.io.EOFException: \n not found: limit=0 content=…
    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:240)
    at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:238)
    at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
    ... 19 more

這個錯誤是跟打包方式有關(guān),以Artifacts打成的jar恳邀,運行會出現(xiàn)這個錯誤惊暴。 這個工程需要用maven-assembly-plugin的方式打包。

改了打包方式后笼恰,運到了另外一個問題。

錯誤二:

2020-02-13 14:02:07 PM [Thread: epollEventLoopGroup-3-1][ Class:io.netty.channel.ChannelInitializer >> Method: io.netty.channel.ChannelInitializer.exceptionCaught(ChannelInitializer.java:97) ]
WARN:Failed to initialize a channel. Closing: [id: 0x07d55f5c, L:/127.0.0.1:54000 - R:/127.0.0.1:31466]
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.ProcessEnvironment$Variable
    at java.lang.ProcessEnvironment$StringEntry.getKey(ProcessEnvironment.java:307)
    at java.lang.ProcessEnvironment$StringEntry.getKey(ProcessEnvironment.java:302)
    at java.util.AbstractMap.toString(AbstractMap.java:532)
    at java.util.Collections$UnmodifiableMap.toString(Collections.java:1493)
    at java.lang.String.valueOf(String.java:2994)
    at java.lang.StringBuilder.append(StringBuilder.java:131)
    at org.springframework.core.env.PropertySource.toString(PropertySource.java:158)
    at java.lang.String.valueOf(String.java:2994)
    at java.util.Arrays.toString(Arrays.java:4571)
    at java.util.concurrent.CopyOnWriteArrayList.toString(CopyOnWriteArrayList.java:1011)
    at org.springframework.core.env.MutablePropertySources.toString(MutablePropertySources.java:185)
    at java.lang.String.valueOf(String.java:2994)
    at java.lang.StringBuilder.append(StringBuilder.java:131)
    at org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:124)
    at org.springframework.core.env.StandardEnvironment.<init>(StandardEnvironment.java:54)
    at org.springframework.context.support.AbstractApplicationContext.createEnvironment(AbstractApplicationContext.java:316)
    at org.springframework.context.support.AbstractApplicationContext.getEnvironment(AbstractApplicationContext.java:305)
    at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath(AbstractRefreshableConfigApplicationContext.java:122)
    at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations(AbstractRefreshableConfigApplicationContext.java:80)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:137)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at com.genlot.web.server.core.service.DubboConsumer.init(DubboConsumer.java:72)
    at com.genlot.web.server.core.BaseServerInitializer.initChannel(BaseServerInitializer.java:59)
    at com.genlot.web.server.core.BaseServerInitializer.initChannel(BaseServerInitializer.java:26)
    at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
    at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
    at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:969)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:610)
    at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
    at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1461)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1126)
    at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:651)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:515)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:428)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:487)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:405)
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:338)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:745)
2020-02-13 14:02:07 PM [Thread: main][ Class:com.genlot.common.utils.HTTPUtil >> Method: com.genlot.common.utils.Logger.e(Logger.java:83) ]
ERROR:ERROR > Request URL[ Request{method=GET, url=http://127.0.0.1:54000/, tags={}} ] Cost[142222570]
2020-02-13 14:02:07 PM [Thread: main][ Class:com.genlot.common.utils.HTTPUtil >> Method: com.genlot.common.utils.Logger.e(Logger.java:85) ]
ERROR:java.net.SocketException: Connection reset

最后解決這個問題是:刪除了本地所有的依賴包歇终,重新拉去一次挖腰,就可以了。

猜測是某個依賴jar版本不一致導致的练湿。

現(xiàn)在問題已經(jīng)解決了猴仑,能正常運行,和成功啟動dubbo了肥哎。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末辽俗,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子篡诽,更是在濱河造成了極大的恐慌崖飘,老刑警劉巖,帶你破解...
    沈念sama閱讀 206,214評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件杈女,死亡現(xiàn)場離奇詭異朱浴,居然都是意外死亡吊圾,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,307評論 2 382
  • 文/潘曉璐 我一進店門翰蠢,熙熙樓的掌柜王于貴愁眉苦臉地迎上來项乒,“玉大人,你說我怎么就攤上這事梁沧√春危” “怎么了?”我有些...
    開封第一講書人閱讀 152,543評論 0 341
  • 文/不壞的土叔 我叫張陵廷支,是天一觀的道長频鉴。 經(jīng)常有香客問我,道長恋拍,這世上最難降的妖魔是什么垛孔? 我笑而不...
    開封第一講書人閱讀 55,221評論 1 279
  • 正文 為了忘掉前任,我火速辦了婚禮施敢,結(jié)果婚禮上周荐,老公的妹妹穿的比我還像新娘。我一直安慰自己悯姊,他們只是感情好,可當我...
    茶點故事閱讀 64,224評論 5 371
  • 文/花漫 我一把揭開白布贩毕。 她就那樣靜靜地躺著悯许,像睡著了一般。 火紅的嫁衣襯著肌膚如雪辉阶。 梳的紋絲不亂的頭發(fā)上先壕,一...
    開封第一講書人閱讀 49,007評論 1 284
  • 那天,我揣著相機與錄音谆甜,去河邊找鬼垃僚。 笑死,一個胖子當著我的面吹牛规辱,可吹牛的內(nèi)容都是我干的谆棺。 我是一名探鬼主播,決...
    沈念sama閱讀 38,313評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼罕袋,長吁一口氣:“原來是場噩夢啊……” “哼改淑!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起浴讯,我...
    開封第一講書人閱讀 36,956評論 0 259
  • 序言:老撾萬榮一對情侶失蹤朵夏,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后榆纽,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體仰猖,經(jīng)...
    沈念sama閱讀 43,441評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡捏肢,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,925評論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了饥侵。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片鸵赫。...
    茶點故事閱讀 38,018評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖爆捞,靈堂內(nèi)的尸體忽然破棺而出奉瘤,到底是詐尸還是另有隱情,我是刑警寧澤煮甥,帶...
    沈念sama閱讀 33,685評論 4 322
  • 正文 年R本政府宣布盗温,位于F島的核電站,受9級特大地震影響成肘,放射性物質(zhì)發(fā)生泄漏卖局。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,234評論 3 307
  • 文/蒙蒙 一双霍、第九天 我趴在偏房一處隱蔽的房頂上張望砚偶。 院中可真熱鬧,春花似錦洒闸、人聲如沸染坯。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,240評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽单鹿。三九已至,卻和暖如春深纲,著一層夾襖步出監(jiān)牢的瞬間仲锄,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,464評論 1 261
  • 我被黑心中介騙來泰國打工湃鹊, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留儒喊,地道東北人。 一個月前我還...
    沈念sama閱讀 45,467評論 2 352
  • 正文 我出身青樓币呵,卻偏偏與公主長得像怀愧,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子余赢,可洞房花燭夜當晚...
    茶點故事閱讀 42,762評論 2 345

推薦閱讀更多精彩內(nèi)容