1

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.

Harsh Kumrawat
  • 160
  • 1
  • 2
  • 16

1 Answers1

2

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

  • If that is the problem then why same ".war" is able to deployed successfully on CentOS and also the previous version of the file was able to deploy on windows too and I didn't do the changes in lib. – Harsh Kumrawat Aug 31 '18 at 11:37
  • Maybe your war had this issue all the time and now it taken into effect. It is just an assumption but I've had this experience myself many times. – Andreas Hauschild Aug 31 '18 at 11:43
  • So It's the same solution you have done to overcome those problems which you have faced? To check different versions of the jar. – Harsh Kumrawat Aug 31 '18 at 11:51
  • Unfortunately there is no general solution for this issue. You can try to track the class loading of tomcat on linux and windows. For this you need it with a special vm paramter (-verbose:class). take a look here: https://stackoverflow.com/questions/10230279/java-verbose-class-loading – Andreas Hauschild Aug 31 '18 at 11:56