Hello,
Je suis entrain de développer un bundle web utilisant le framework jsf et dans lequel je veux consommer un service osgi appelé à partir d'un bundle externe. Pour faire, j'ai trouvé des tutos sur internet qui demandaient d'ajouter ces lignes dans le fichier configuration faces-config :
Après, j'ai juste déclaré, dans le fichier applicationContext, mon bean qui fait référene à un service osgi déclaré dans ce même fichier, comme suit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <application> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver> </application>
Malheureusement, quand j'essaie de démarrer mon bundle sur le serveur spring, il échoue en me présentant le message d'erreur suivant (pas très explicite...):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"> <bean id="xentityView" class="org.cynapsys.cssf.em.view.XEntityView"> </bean> <osgi:reference id="xentityService" interface="org.cynapsys.cssf.em.service.Xentity_Service"></osgi:reference> </beans>
Mais après, j'ai réalisé que seulement le balise osgi-reference cause problème. Lorsque je l'enlève,, mon web bundle se déploie et fonctionne normalement!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 [2010-09-20 13:03:04.034] Thread-3 <WE0005E> Failed to start web bundle 'org.cynapsys.cssf.web.em' version '1.0.0': consult the serviceability log for further details. [2010-09-20 13:03:04.041] start-signalling-5 <DE0006E> Start failed for bundle 'org.cynapsys.cssf.web.em' version '1.0.0'. com.springsource.kernel.deployer.core.DeploymentException: Web application failed to start at com.springsource.server.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:139) at com.springsource.kernel.install.artifact.internal.ArtifactStateMonitor.onStarted(ArtifactStateMonitor.java:215) at com.springsource.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:281) at com.springsource.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:278) at com.springsource.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:231) at com.springsource.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:150) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: com.springsource.osgi.webcontainer.core.WebApplicationStartFailedException: com.springsource.osgi.webcontainer.core.spi.ServletContainerException: Web application at '/cssfem' failed to start. Check the logs for more details. at com.springsource.osgi.webcontainer.internal.StandardWebApplication.start(StandardWebApplication.java:106) at com.springsource.server.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:130) ... 8 common frames omitted Caused by: com.springsource.osgi.webcontainer.core.spi.ServletContainerException: Web application at '/cssfem' failed to start. Check the logs for more details. at com.springsource.osgi.webcontainer.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:122) at com.springsource.osgi.webcontainer.internal.StandardWebApplication.start(StandardWebApplication.java:89) ... 9 common frames omitted
J'ai essayé de trouver sur internet un moyen d'intégrer les services osgi comme des beans dans un bundle web jsf, mais sans succès.
Quelqu'un pourrait - il m'aider?!
Merci d'avance infiniment!
Partager