Description of problem: WSProvide Version-Release number of selected component (if applicable): Snowdrop Sportsclub example 3.1 How reproducible: Always Steps to Reproduce: 1. Find a class which implements a 2. Prepare a classpath, like extract all jars into a single directory or make a classpath string 3. Execute wsprovide.sh Actual results: Failed to invoke JavaToWS java.lang.NoClassDefFoundError: org/springframework/beans/BeansException at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120) at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54) at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:98) at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:164) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:154) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:139) at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.getBus(JavaToWSDLProcessor.java:315) at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.getServiceBuilder(JavaToWSDLProcessor.java:207) at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToWSDLProcessor.java:100) at org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer.java:110) at org.apache.cxf.tools.java2ws.JavaToWSContainer.execute(JavaToWSContainer.java:75) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:45) at org.apache.cxf.tools.java2ws.JavaToWS.run(JavaToWS.java:82) at org.jboss.wsf.stack.cxf.tools.CXFProviderImpl.provide(CXFProviderImpl.java:190) at org.jboss.wsf.stack.cxf.tools.CXFProviderImpl.provide(CXFProviderImpl.java:103) at org.jboss.ws.tools.cmd.WSProvide.generate(WSProvide.java:207) at org.jboss.ws.tools.cmd.WSProvide.main(WSProvide.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.modules.Module.run(Module.java:260) at org.jboss.modules.Main.main(Main.java:291) Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @65b60280 (roots: /opt/eap6/modules)] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) ... 24 more Expected results: It generates source and resources based on code. Additional info: Executed command: [kpiwko@kapy-ntb spring-3_1]$ /opt/eap6/bin/wsprovide.sh -w -k -c /home/kpiwko/devel/wfk/wfk-qa/spring/demo/target/sportsclub-2.0.0.ER1/spring-3.1/sportsclub-invoicing-webmvc/target/classes -o jaxws-target -r jaxws-resources -s jaxws-sources org.jboss.snowdrop.samples.sportsclub.ws.PaymentNotificationService Could not find log4j.xml configuration, logging to console. java2ws -s /home/kpiwko/devel/wfk/jboss-wfk-2.0.0.ER1-demo/examples/sportsclub-2.0.0.ER1/spring-3_1/jaxws-sources -classdir /home/kpiwko/devel/wfk/jboss-wfk-2.0.0.ER1-demo/examples/sportsclub-2.0.0.ER1/spring-3_1/jaxws-target -d /home/kpiwko/devel/wfk/jboss-wfk-2.0.0.ER1-demo/examples/sportsclub-2.0.0.ER1/spring-3_1/jaxws-resources -verbose -wsdl -cp /home/kpiwko/devel/wfk/wfk-qa/spring/demo/target/sportsclub-2.0.0.ER1/spring-3.1/sportsclub-invoicing-webmvc/target/classes/: -wrapperbean -createxsdimports org.jboss.snowdrop.samples.sportsclub.ws.PaymentNotificationService java2ws - Apache CXF 2.4.6-redhat-1 Related part of CXF: public Bus createBus(String cfgFiles[], boolean includeDefaults) { try { String userCfgFile = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME); String sysCfgFileUrl = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_URL); Resource r = BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE); if (context == null && userCfgFile == null && cfgFiles == null && sysCfgFileUrl == null && (r == null || !r.exists()) && includeDefaults) { return new org.apache.cxf.bus.CXFBusFactory().createBus(); } return finishCreatingBus(createApplicationContext(cfgFiles, includeDefaults)); } catch (BeansException ex) { LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null); throw new RuntimeException(ex); } }
Description of the problem: WSProvide finds a Spring Context as a part of the classpath, however Spring is not a part of the wsprovide.sh classpath, e.g. Spring module is not reachable from within CXF module. Classpath seems to be isolated.
Works if org/apache/cxf/main/module.xml module is modified in following way: <module name="org.springframework.spring" slot="snowdrop" export="true" optional="true" />
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Snowdrop module, which provides Spring for other modules has it's dependencies not broadly exported. In order to have them exported, modify $JBOSS_HOME/modules/org/apache/cxf/main/module.xml to have correct Snowdrop module version and export it's dependencies to make it a part of classpath for other modules via: <module name="org.springframework.spring" slot="snowdrop" export="true" optional="true" />
Alessio Soldano <asoldano> made a comment on jira JBPAPP-8346 This requires backporting of JBWS-3453.
Agree with note.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,5 +1,2 @@ -Snowdrop module, which provides Spring for other modules has it's dependencies not broadly exported. +The dependencies for the Snowdrop module, which provides Spring for other modules, are not broadly available. This means some modules such as WSProvide cannot access them when needed. To workaround this issue, change the Snowdrop module version to export its dependencies and make it part of the classpath for other modules. To do this, add <module name="org.springframework.spring" slot="snowdrop" export="true" - +optional="true" /> to $JBOSS_HOME/modules/org/apache/cxf/main/module.xml.-In order to have them exported, modify $JBOSS_HOME/modules/org/apache/cxf/main/module.xml to have correct Snowdrop module version and export it's dependencies to make it a part of classpath for other modules via: - -<module name="org.springframework.spring" slot="snowdrop" export="true" optional="true" />
Mod'd to: The Snowdrop module, which provides Spring for other modules, and its dependencies are not made available by default to other modules. This means some modules such as WSProvide cannot access them when needed. To workaround this issue, modify the Apache CXF module to access Snowdrop and its dependencies and make them part of the classpath for other modules that depend on it. To do this, add <module name="org.springframework.spring" slot="snowdrop" export="true" optional="true" /> to $JBOSS_HOME/modules/org/apache/cxf/main/module.xml.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,2 +1,2 @@ -The dependencies for the Snowdrop module, which provides Spring for other modules, are not broadly available. This means some modules such as WSProvide cannot access them when needed. To workaround this issue, change the Snowdrop module version to export its dependencies and make it part of the classpath for other modules. To do this, add <module name="org.springframework.spring" slot="snowdrop" export="true" +The Snowdrop module, which provides Spring for other modules, and its dependencies are not made available by default to other modules. This means some modules such as WSProvide cannot access them when needed. To workaround this issue, modify the Apache CXF module to access Snowdrop and its dependencies and make them part of the classpath for other modules that depend on it. To do this, add <module name="org.springframework.spring" slot="snowdrop" export="true" optional="true" /> to $JBOSS_HOME/modules/org/apache/cxf/main/module.xml.
Alessio Soldano <asoldano> updated the status of jira JBPAPP-8346 to Resolved
Check if that is already fixed in EAP6
Check if that is already fixed in EAP6 ER5
Karel Piwko <kpiwko> updated the status of jira JBPAPP-8346 to Closed
Karel Piwko <kpiwko> made a comment on jira JBPAPP-8346 Verified in WFK 2.0.0.ER4 and EAP 6.0.0.ER6 via {code} /opt/eap6/bin/wsprovide.sh -e -w -k -c `classpathgen /home/kpiwko/devel/wfk/wfk-qa/spring/demo/target/sportsclub/spring-3.1/sportsclub-invoicing-webmvc/target/sportsclub-invoicing-webmvc /home/kpiwko/devel/wfk/maven-local-repository/org/springframework/spring-web/3.1.1.RELEASE/ /home/kpiwko/devel/wfk/maven-local-repository/org/springframework/spring-beans/3.1.1.RELEASE/ /home/kpiwko/devel/wfk/maven-local-repository/javax/servlet/servlet-api/2.5/` -o jaxws-target -r jaxws-resources -s jaxws-sources org.jboss.snowdrop.samples.sportsclub.ws.PaymentNotificationService {code}
Verified in WFK ER4 and EAP ER5. Also, technical_note? flag flag was removed.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,2 +1 @@ -The Snowdrop module, which provides Spring for other modules, and its dependencies are not made available by default to other modules. This means some modules such as WSProvide cannot access them when needed. To workaround this issue, modify the Apache CXF module to access Snowdrop and its dependencies and make them part of the classpath for other modules that depend on it. To do this, add <module name="org.springframework.spring" slot="snowdrop" export="true" +The Snowdrop module, which provides Spring for other modules, and its dependencies are not made available by default to other modules. This means some modules such as WSProvide cannot access them when needed. This issue is now fixed with the JBoss Web Framework Kit 2 GA release.-optional="true" /> to $JBOSS_HOME/modules/org/apache/cxf/main/module.xml.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -The Snowdrop module, which provides Spring for other modules, and its dependencies are not made available by default to other modules. This means some modules such as WSProvide cannot access them when needed. This issue is now fixed with the JBoss Web Framework Kit 2 GA release.+The Snowdrop module, which provides Spring for other modules, and its dependencies are not made available by default to other modules. This means some modules such as WSProvide cannot access them when needed. This issue is now fixed with the JBoss Web Framework Kit 2 GA release, and the Snowdrop dependencies are available by default.
Fixed in WFK 2.0.0.GA.