Generic problem
There is a generic problem. Team server runs fine on localhost, so I've tried to deploy in on another box. This another box does not have a permanent IP address, just DHCP. And when I try to access the server, it forwards me to a non-existing IP address.
Let's say the box has a subnet suffix "myorg.com", computer name "mybox", and IP 192.168.0.1
When I try to open http://192.168.0.1:8111/ it forwards me to http://mybox.myorg.com:8111/overview.html - but mybox.myorg.com is non-existing host, so I cannot reach the server!
(Response 302 with Location: http://mybox.myorg.com:8111/overview.html)
Is that a Tomcat behavior? I've looked thru its conf files but haven't noticed anything to disable this forwarding... How to make it use only numeric addresses? Otherwise it's just not usable....
Please sign in to leave a comment.
Hello,
No, this isn't Tomcat behavior. However, we can disable this redirect for
the case if you're going to the server using IP address.
I've attached a compiled class to this message, which contains fix for this
problem.
You should replace the original class located in the directory
WEB-INF/classes/jetbrains/buildServer/controllers with this one
and then restart Tomcat. Please let me know if this fix works for you.
--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Attachment(s):
UrlSaverInterceptor.class
I'm experiencing a similar situation. I'm going to:
http://interface-02.dev.office:8081/buildserver/
And then keep getting redirected to http://interface-02.dev:8081/buildserver/overview.html (notice the missing .office). When I try to go to http://interface-02.dev.office:8081/buildserver/overview.html I get redirected to http://interface-02.dev:8081/buildserver/overview.html
I've also tried using the class you had attached. Any thoughts?
Thanks,
Steve
It helped, thanks!
Will it be included in next builds?
Hello Steve,
Could you please check hostname of the server where Tomcat is installed? It
looks like the hostname is interface-02.dev.
Basically this redirect occurs if name specified in the request does not
match the local server name, so in your case
I think the hostname should be changed to interface-02.dev.office if latter
is correct name and is registered in DNS or
other name resolution service.
--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Hello,
Yes, of course.
--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
The hostname of the machine is actually something else entirely as interface-02 is the hostname of a secondary IP of the machine. Why is the redirect occurring to a different host? Shouldn't the redirect be a relative redirect from /buildserver/ to /buildserver/overview.html ? As Tomcat is listening on port 8081 of ALL interface ips, then any hostname that resolved to IPs that the machine listened on should work, right?
Thanks,
Steve
Hello Steve,
You're right, however it is difficult and time consuming task to detect
correct host name in your case.
I removed the redirect and attached modified class to this message. I hope
it will fix the problem you encountered.
Place the attached class into the
WEB-INF/classes/jetbrains/buildServer/controllers directory.
Thanks for your feedback.
--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Attachment(s):
UrlSaverInterceptor.class
Hey Pavel,
Thanks for the file. I put the class you attached in place and restarted Tomcat, but I am now experiencing problems:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/buildServe
rSpring.xml]: Can't resolve reference to bean 'urlSaverInterceptor' while setting property 'interceptors[0]'; nested exception is org.springframework.beans
.factory.BeanCreationException: Error creating bean with name 'urlSaverInterceptor' defined in ServletContext resource : Er
ror setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'fullRedirectDisabledPaths' of be
an class : Bean property 'fullRedirectDisabledPaths' is not writable or has an invalid setter method
: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlSaverInterceptor' defined in ServletContext resource [/WEB-INF/b
uildServerSpring.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'fullRed
irectDisabledPaths' of bean class : Bean property 'fullRedirectDisabledPaths' is not writable or has
an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.NotWritablePropertyException: Invalid property 'fullRedirectDisabledPaths' of bean class [jetbrains.buildServer.controllers.UrlSa
verInterceptor]: Bean property 'fullRedirectDisabledPaths' is not writable or has an invalid setter method: Does the parameter type of the setter match the
return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:831)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:733)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:890)
at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:917)
at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:906)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1022)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:823)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1012)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:823)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:203)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:192)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:204)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findMatchingBeans(DefaultListableBeanFactory.java:355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:767)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:639)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:329)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:203)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:192)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:204)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findMatchingBeans(DefaultListableBeanFactory.java:355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:767)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:639)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:329)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
Let me know if you need more information.
Thanks,
Steve
Sorry, that was my fault. Try the attached class, it should work.
--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Attachment(s):
UrlSaverInterceptor.class
Pavel,
Much better! Thanks. Will this change make it into the next build also?
Thanks,
Steve
Hello,
Yes, we will include it in the next EAP.
--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"