简体   繁体   中英

Java doesnt extract war files and throws exception when deploying on windows tomcat

I deployed have build the .war file on centos with eclipse and then deployed it on tomcat 8.5 on centos(Linux). It is working with that. But when I deployed the same ".war" or build a new ".war" file with eclipse on windows It is not working on Tomcat8.5 and it throws BeansInCreation Exception. Having the same Java1.7 and Tomcat8.5 version windows7. The build was also working on windows on the previous version(before updating) and there are nothing major changes done in the latest code.

Here are the logs from localhost :

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name '': Bean with name '' has been injected into other beans ['','',''] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:268)
... 98 more

I think the problem may be because of "large file path" as Linux support more large file path than windows. I have changed in the regedit also to support but that doesn't need to have changed.

If it works on linux but not on windows i assume that there is a class loading issue (order of classes) while your war is deployed. I would recommend to check /lib directory inside your .war file.

Maybe it contains different versions from the same jar.

Edited:

You can track the class loading of tomcat (or any java application) on linux and windows. For this you need to start it with a special vm paramter (-verbose:class). take a look here: Java verbose class loading

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM