Bonjour à tous,
Comme l'indique le tag du sujet, je débute dans spring, par le biais d'un projet que j'ai récupéré. Il s'agit de réaliser une application web permettant d'ajouter un module flash basé sur Red5 dans un autre conteneur HTTP Servlet (basé sur Jetty).
J'ai donc passé sous Maven le projet, obtenant ainsi l'architecture suivante :
sipphone
├───src
│ └───main
│ ├───java
│ │ ├───applications
│ │ ├───local
│ │ │ ├───media
│ │ │ ├───net
│ │ │ ├───server
│ │ │ └───ua
│ │ └───org
│ │ ├───red5
│ │ │ └───server
│ │ │ └───webapp
│ │ │ └───sip
│ │ └───zoolu
│ │ ├───net
│ │ ├───sdp
│ │ ├───sip
│ │ │ ├───address
│ │ │ ├───authentication
│ │ │ ├───call
│ │ │ ├───dialog
│ │ │ ├───header
│ │ │ ├───message
│ │ │ ├───provider
│ │ │ └───transaction
│ │ └───tools
│ ├───resources
| | |- red5-web.xml
│ └───webapp
│ ├───assets
│ │ └───codecs
│ │ └───src
│ ├───flex
│ │ └───assets
│ │ └───dtmf
│ ├───logs
│ ├───streams
│ └───WEB-INF
| +- web.xml
└───target
Lorsque je lance la compilation et le packaging avec maven, je n'ai aucun problème (Build successful, toutes les dépendances sont jointes), mais lors de l'exécution sous mon conteneur (cipango, www.cipango.org, basé sur JETTY et permet de déployer des servlets http ou sip sous forme de war ou de sar), je reçois l'exception suivante :
2008-05-26 09:52:37,421 INFO log [main] : Logging to org.slf4j.impl.Log4jLoggerAdapter(org.cipango.log) via org.cipango.log.Slf4jLogger
2008-05-26 09:52:37,609 INFO log [main] : cipango-0.1.x build unknown
2008-05-26 09:52:37,609 INFO log [main] : jetty-6.1.x
2008-05-26 09:52:37,734 INFO log [main] : Extract jar:file:/E:/Data%20Pierrick/cipango/sipapps/sipphone.war!/ to C:\DOCUME~1\NEXCOM~1\LOCALS~1\Temp\Jetty_0_0_0_0_8080_sipphone.war__sipphone__gv0gvf\webapp
2008-05-26 09:52:40,406 INFO ContextLoader [main] : Root WebApplicationContext: initialization started
2008-05-26 09:52:40,406 INFO /sipphone [main] : Loading Spring root WebApplicationContext
2008-05-26 09:52:40,421 INFO ContextLoader [main] : Getting parent context definition: using parent context key of 'default.context' with BeanFactoryLocator
2008-05-26 09:52:40,484 INFO CollectionFactory [main] : JDK 1.4+ collections available
2008-05-26 09:52:40,531 INFO ClassPathXmlApplicationContext [main] : Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=20012340]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans []; root of BeanFactory hierarchy
2008-05-26 09:52:40,531 INFO ClassPathXmlApplicationContext [main] : No beans defined in application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=20012340]
2008-05-26 09:52:40,546 INFO ClassPathXmlApplicationContext [main] : Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@f6438d]
2008-05-26 09:52:40,546 INFO ClassPathXmlApplicationContext [main] : Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@18825b3]
2008-05-26 09:52:40,546 INFO DefaultListableBeanFactory [main] : Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans []; root of BeanFactory hierarchy]
2008-05-26 09:52:40,546 ERROR ContextLoader [main] : Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [default.context], from group with resource name [classpath*:red5.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'default.context' is defined
Caused by:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'default.context' is defined
Après des recherches sur Internet, j'ai réussi à rattacher ça à Spring, mais je ne comprends pas l'origine du problème. Donc, si quelqu'un a la possibilité de me donner quelques pistes, ça m'aiderait beaucoup.
En pièces jointes :
- web.xml
- red5-web.xml
- Application.java, la classe liée dans le web handler (org.red5.server.webapp.sip.Application).
J'ai par contre remarqué que, quand je déploie mon package, red5-web.xml se retrouve au niveau du sous dossier classes plutot que dans le dossier web inf. J'ai essayé de modifié en conséquence, mais sans succès (j'ai joint ici les versions originales)
Pour info, ca donne un déploiement de cette façon dans le package :
WEB-INF/
|
+-- classes/
| +-- red5-web.xml
+-- lib/
|
+- web.xml
Si jamais vous avez besoin de plus de détails, n'hésitez pas à me demander.
Museum
Partager