dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

incubator-dubbo-2.6.x 版本下的demo在linux运行失败(急急急!!!!)

Open llx206 opened this issue 8 years ago • 6 comments

dubbo-demo-provider在window下能正常启动,但是将整个工程打依赖包放在linux下面 启动方式:java -cp dubbo-demo-provider-2.6.3-SNAPSHOT-jar-with-dependencies.jar com.alibaba.dubbo.demo.provider.Provider -server -Xms256m -Xmx512m -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Dfile.encoding=UTF-8

运行错误如下:()

[06/06/18 03:35:45:045 CST] main  INFO xml.XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [META-INF/spring/dubbo-demo-provider.xml]
[06/06/18 03:35:46:046 CST] main  INFO logger.LoggerFactory: using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
[06/06/18 03:35:46:046 CST] main  WARN support.ClassPathXmlApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.alibaba.dubbo.demo.DemoService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.alibaba.dubbo.demo.DemoService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1159)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1103)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
        at com.alibaba.dubbo.demo.provider.Provider.main(Provider.java:39)
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:422)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1151)
        ... 13 more
Caused by: java.lang.IllegalStateException: fail to create adaptive instance: java.lang.IllegalStateException: Can not create adaptive extension interface com.alibaba.dubbo.common.extension.ExtensionFactory, cause: No adaptive method on extension com.alibaba.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
        at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:448)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.<init>(ExtensionLoader.java:98)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:119)
        at com.alibaba.dubbo.config.ServiceConfig.<clinit>(ServiceConfig.java:74)
        ... 20 more

llx206 avatar Jun 06 '18 08:06 llx206

Caused by: java.lang.IllegalStateException: fail to create adaptive instance: java.lang.IllegalStateException: Can not create adaptive extension interface com.alibaba.dubbo.common.extension.ExtensionFactory, cause: No adaptive method on extension com.alibaba.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
at 

You packaged dubbo-demo-provider-2.6.3-SNAPSHOT-jar-with-dependencies.jar by yourself? Would you please give me the .jar file? I cannot reproduce the problem.

Feel free to send .jar to [email protected] if if cannot attach a file here.

chickenlj avatar Jun 07 '18 02:06 chickenlj

Feel free to send .jar to [email protected] if if cannot attach a file here.

@chickenlj It is not recommend to do so, the jar file maybe too large to be accepted.

The recommended way is to post the source code on some github repo, so that it can be built locally.

ralf0131 avatar Jun 07 '18 03:06 ralf0131

@ralf0131 ,不采用打依赖包的方式是可以运行,将所有的jar放到lib文件下面,再通过jar -jar的方式,加载lib中的jar包,这样运行可以正常执行

llx206 avatar Jun 07 '18 07:06 llx206

The recommended way is to post the source code on some github repo, so that it can be built locally.

Thanks, this seems to be a better way of cooperating.

chickenlj avatar Jun 11 '18 02:06 chickenlj

@llx206 Seems most likely your packaging is not right. But I am still wondering if you can share your project with a github repo, including the package script so that I can repeat the problem. Thanks.

chickenlj avatar Jun 11 '18 02:06 chickenlj

Long time no feedback, so close it. Feel free to reopen if necessary.

diecui1202 avatar Sep 03 '18 08:09 diecui1202