google-code-export / red5

Automatically exported from code.google.com/p/red5
0 stars 0 forks source link

1.0.2-RELEASE startup issue using Tomcat with SSL enabled (possible patch provided) #497

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Clean install of red5 1.0.2-RELEASE
2.  Change conf/jee-container.xml to use Tomcat with SSL (i.e. comment out 
"Tomcat Without SSL enabled" bean, uncomment "Tomcat With SSL enabled" bean).
3.  Attempt to start red5 with red5.sh or red5-debug.sh script

What is the expected output? What do you see instead?
Red5 startup process aborts with an error during Spring property injection of 
TomcatConnector.connectionProperties for bean "httpsConnector" defined in 
jee-container.xml (see error below).  I spent some time tracking the problem 
down through source, and believe the issue is that the "connectionProperties" 
member of TomcatConnector is not allocated/initialized in the class.  I have 
attached a patch file which initializes "connectionProperties" and seems to fix 
the issue for me once I rebuilt and tested with patched tomcatplugin-1.6.jar

What version of the product are you using? On what operating system?
red5 1.0.2-RELEASE, Ubuntu 12.04.4 LTS w/ OpenJDK 1.7, kernel 3.2.0-60-generic

Please provide any additional information below.

Thank you for reviewing this... I believe the attached patch file fixes this 
issue.  Patch applied to 
svn/java/plugins/trunk/tomcat/src/main/java/org/red5/server/tomcat/TomcatConnect
or.java r4749.  Startup error message follows:

Bootstrap exception: null
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.red5.server.Bootstrap.bootStrap(Bootstrap.java:123)
    at org.red5.server.Bootstrap.main(Bootstrap.java:48)
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'context.loader' defined in class path resource 
[red5.xml]: Invocation of init method failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'tomcat.server' defined in class path resource [jee-container.xml]: 
Cannot create inner bean 'httpsConnector' of type 
[org.red5.server.tomcat.TomcatConnector] while setting bean property 
'connectors' with key [1]; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'httpsConnector' defined in class path resource [jee-container.xml]: 
Error setting property values; nested exception is 
org.springframework.beans.PropertyBatchUpdateException; nested 
PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'connectionProperties' threw exception; nested exception is 
java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
    at org.red5.server.Launcher.launch(Launcher.java:66)
    ... 6 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'tomcat.server' defined in class path resource 
[jee-container.xml]: Cannot create inner bean 'httpsConnector' of type 
[org.red5.server.tomcat.TomcatConnector] while setting bean property 
'connectors' with key [1]; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'httpsConnector' defined in class path resource [jee-container.xml]: 
Error setting property values; nested exception is 
org.springframework.beans.PropertyBatchUpdateException; nested 
PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'connectionProperties' threw exception; nested exception is 
java.lang.NullPointerException
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:121)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:354)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:270)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1113)
    at org.red5.server.ContextLoader.afterPropertiesSet(ContextLoader.java:113)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'httpsConnector' defined in class path resource 
[jee-container.xml]: Error setting property values; nested exception is 
org.springframework.beans.PropertyBatchUpdateException; nested 
PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'connectionProperties' threw exception; nested exception is 
java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271)
    ... 32 more
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested 
PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'connectionProperties' threw exception; nested exception is 
java.lang.NullPointerException
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
    ... 36 more
Bootstrap exit

Original issue reported on code.google.com by eschmidt...@gmail.com on 18 Apr 2014 at 9:37

Attachments:

GoogleCodeExporter commented 9 years ago
This was fixed in head with a similar patch; however, RTMPS still seems to be 
broken. Follow the issue here: https://github.com/Red5/red5-server/issues/6

Original comment by mondain on 21 Apr 2014 at 1:56