Bonjour,
nous opérons actuellement une migration de nos Web Services d'Axis1 1.4 vers Axis2 1.4.1, mais je ne parviens pas à démarrer les services sous WebSphere 5.1 .
Bref récapitulatif de l'environnement utilisé:
- Java 1.4.1 (JRE IBM)
- Websphere 5.1
- Axis2 1.4.1, utilisé simplement en embarquant la servlet et le code généré par wsdl2java dans notre WAR applicatif.
Le problème qui se pose est que WebSphere embarque un déployeur de WebServices, basé sur Axis, et des librairies entrent donc en conflit de version lors du démarrage de l'application :
J'ai pu déterminer que c'est la version de wsdl4j qui est en cause:version 1.0 pour WebSphere, version 1.6.2
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83 [11/18/08 10:00:14:812 CET] 3a19a2e4 DeploymentEng I org.apache.axis2.deployment.DeploymentEngine org.apache.axis2.deployment.DeploymentException: java.lang.NoSuchMethodError: javax.wsdl.PortType: method getExtensionAttributes()Ljava/util/Map; not found [11/18/08 10:00:14:843 CET] 3a19a2e4 ServiceDeploy I org.apache.axis2.deployment.ServiceDeployer The MyService service, which is not valid, caused java.lang.NoSuchMethodError: javax.wsdl.PortType: method getExtensionAttributes()Ljava/util/Map; not found at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortType(WSDL11ToAxisServiceBuilder.java:572) at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpoints(WSDL11ToAxisServiceBuilder.java:469) at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:363) at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:107) at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLFile(ArchiveReader.java:248) at org.apache.axis2.deployment.repository.util.ArchiveReader.processFilesInFolder(ArchiveReader.java:469) at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:292) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:67) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131) at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:82) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436) at org.apache.axis2.transport.http.AxisAdminServlet.init(AxisAdminServlet.java:55) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147) at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113) at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:876) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542) at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1394) at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:299) at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:408) at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:212) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:1019) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:517) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:808) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:578) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:311) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:588) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code)) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code)) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at com.tivoli.jmx.modelmbean.MMBInvoker.invoke(MMBInvoker.java:46) at com.tivoli.jmx.modelmbean.MMBInvoker.invokeOperation(MMBInvoker.java:115) at com.tivoli.jmx.modelmbean.DynamicModelMBeanSupport.invoke(DynamicModelMBeanSupport.java:409) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:323) at com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178) at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113) at com.tivoli.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:290) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:659) at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:141) at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.perform(ApplicationDeploymentCollectionAction.java:315) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java(Inlined Compiled Code)) at org.apache.struts.action.ActionServlet.process(ActionServlet.java(Compiled Code)) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code)) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code)) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code)) at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code)) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code)) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code)) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code)) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code)) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code)) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
La configuration du classloader WAS est définie en PARENT_FIRST pour le module Web et pour l'application, et le chargeur de classes WAR suit la règle Module, ce sont donc les classes fournies par WebSphere qui sont chargées en premier.
Il n'est bien sûr pas envisageable de remplacer le jar fourni dans WebSphere.
J'ai alors tenté de modifier la politique de chargement en PARENT_LAST afin de donner la main à mon WAR pour charger les librairies, mais je rencontre alors les exceptions suivantes:
Cette fois-ci j'ai identifié deux problèmes, mais je commence à être un peu paumé:
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 [11/18/08 9:11:31:912 CET] 48df22f0 WebAppServlet E Servlet [upload]: not a servlet class [11/18/08 9:11:31:927 CET] 48df22f0 WebGroup E SRVE0020E: [Servlet Error]-[maServlet]: Failed to load servlet: java.lang.ClassCastException: mon.package.maServlet at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:188) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542) at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1394) at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:299) at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:408) at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:212) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:1019) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:517) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:808) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:578) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:311) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:588) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code)) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code)) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at com.tivoli.jmx.modelmbean.MMBInvoker.invoke(MMBInvoker.java:46) at com.tivoli.jmx.modelmbean.MMBInvoker.invokeOperation(MMBInvoker.java:115) at com.tivoli.jmx.modelmbean.DynamicModelMBeanSupport.invoke(DynamicModelMBeanSupport.java:409) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:323) at com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178) at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113) at com.tivoli.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:290) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:659) at com.ibm.ws.management.application.sync.AppBinThread.startDeployments(AppBinaryProcessor.java:1453) at com.ibm.ws.management.application.sync.AppBinThread.run(AppBinaryProcessor.java:975) at com.ibm.ws.management.application.sync.AppBinaryProcessor.postProcess(AppBinaryProcessor.java:698) at com.ibm.ws.management.application.sync.AppBinaryProcessor.onChangeCompletion(AppBinaryProcessor.java:276) at com.ibm.ws.management.repository.FileRepository.postNotify(FileRepository.java:1964) at com.ibm.ws.management.repository.FileRepository.update(FileRepository.java:1429) at com.ibm.ws.management.repository.client.LocalConfigRepositoryClient.update(LocalConfigRepositoryClient.java:189) at com.ibm.ws.sm.workspace.impl.WorkSpaceMasterRepositoryAdapter.update(WorkSpaceMasterRepositoryAdapter.java:515) at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.update(RepositoryContextImpl.java:1192) at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.synch(RepositoryContextImpl.java:1148) at com.ibm.ws.sm.workspace.impl.WorkSpaceImpl.synch(WorkSpaceImpl.java:309) at com.ibm.ws.console.core.action.SyncWorkSpaceAction.perform(SyncWorkSpaceAction.java:164) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java(Inlined Compiled Code)) at org.apache.struts.action.ActionServlet.process(ActionServlet.java(Compiled Code)) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java(Compiled Code)) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code)) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code)) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code)) at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code)) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code)) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code)) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code)) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code)) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code)) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937) Caused by: org.apache.commons.logging.LogConfigurationException: The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'com.ibm.ws.commons.logging.TrLogFactory' cannot be converted to 'org.apache.commons.logging.LogFactory'. The conflict is caused by the presence of multiple LogFactory classes in incompatible classloaders. Background can be found in http://commons.apache.org/logging/tech.html. If you have not explicitly specified a custom LogFactory then it is likely that the container has set one without your knowledge. In this case, consider using the commons-logging-adapters.jar file or specifying the standard LogFactory from the command line. Help can be found @http://commons.apache.org/logging/troubleshooting.html.) at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1271) at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:1065) at java.security.AccessController.doPrivileged1(Native Method) at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code)) at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1062) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:612) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685) at org.apache.axis2.transport.http.AxisServlet.<clinit>(AxisServlet.java:78) ... 73 more Caused by: java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'com.ibm.ws.commons.logging.TrLogFactory' cannot be converted to 'org.apache.commons.logging.LogFactory'. The conflict is caused by the presence of multiple LogFactory classes in incompatible classloaders. Background can be found in http://commons.apache.org/logging/tech.html. If you have not explicitly specified a custom LogFactory then it is likely that the container has set one without your knowledge. In this case, consider using the commons-logging-adapters.jar file or specifying the standard LogFactory from the command line. Help can be found @http://commons.apache.org/logging/troubleshooting.html. at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1220) ... 80 more
- je ne sais pas si les deux exceptions sont liées (la seconde semble la cause : Caused by, mais n'apparait pas pour toutes les servlets chargées)
- Pour l'exception de commons-logging, j'essaie d'utiliser un adapter, comme le suggère le lien donné dans le message de l'exception
- Pour l'exception de servlet, c'est apparemment du au fait qu'une implantation différente de la classe servlet utilisée par WebSphere se trouve dans le dossier WEB-INF/lib, mais je n'ai pas encore déterminé dans quel jar
Au final, je voudrais savoir si quelqu'un a déjà eu ce genre de problème de conflit et connaitrait une solution efficace pour gérer les classpath et classloader sous WebSphere (quelle stratégie utiliser, FIRST ou LAST?), ou un moyen de donner exactement le chemin à utiliser pour certains jar.
Merci d'avance pour votre aide!
Partager