Multi-projects Maven compilation issue - maven

I'm experiencing trouble trying to build a maven project with a multi-modules project.
In the main pom I have the following modules :
<modules>
<module>moduleA</module>
<module>moduleB</module>
<module>moduleC</module>
</modules>
When it comes to build the third module (that includes the two others) where I'd like to generate a wsdl with a java2ws goal I get a ClassNotFoundException error (trace below)
I guess it occurs because the class is contained into a package from the moduleA. How can I specify in the java2ws command that the class is contained in another module ?
...
<execution>
<id>process-classes-reclamacion</id>
<phase>process-classes</phase>
<configuration>
<className>com.classX</className>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
...
GRAVE: Failed to execute goal org.apache.cxf:cxf-java2ws-plugin:2.2.6:java2ws on project moduleC: Fail to load class : com.classX -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-java2ws-plugin:2.2.6:java2ws on project moduleC : Fail to load class : com.classX
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
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.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to load class : com.calculo.gestconv.webservices.reclamacion.sdm.IReclamacionSDMWS
at org.apache.cxf.maven_plugin.Java2WSMojo.processJavaClass(Java2WSMojo.java:268)
at org.apache.cxf.maven_plugin.Java2WSMojo.execute(Java2WSMojo.java:154)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 31 more
Caused by: org.apache.cxf.tools.common.ToolException: Fail to load class : com.classX
at org.apache.cxf.tools.util.AnnotationUtil.loadClass(AnnotationUtil.java:83)
at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.getServiceClass(JavaToWSDLProcessor.java:307)
at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.getServiceBuilder(JavaToWSDLProcessor.java:204)
at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToWSDLProcessor.java:127)
at org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer.java:109)
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:58)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:40)
at org.apache.cxf.tools.java2ws.JavaToWS.run(JavaToWS.java:77)
at org.apache.cxf.maven_plugin.Java2WSMojo.processJavaClass(Java2WSMojo.java:265)
... 34 more
Caused by: java.lang.ClassNotFoundException: com.classX
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.cxf.tools.util.AnnotationUtil.loadClass(AnnotationUtil.java:80)
... 44 more
Thank you for your help.

Related

SonarQube is throwing DirectoryNotEmptyException during the report analysis?

<b>INFO] Analysis reports compressed in 1466ms, zip size=1 MB<br/>
[ERROR] Failed to delete temp folder <br/>
java.nio.file.DirectoryNotEmptyException:
D:\MyModule\target\sonar\.sonartmp</b><br/>
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileVisitor.postVisitDirectory(DefaultTempFolder.java:121)
at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileVisitor.postVisitDirectory(DefaultTempFolder.java:110)
at java.nio.file.Files.walkFileTree(Files.java:2688)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at org.sonar.api.utils.internal.DefaultTempFolder.clean(DefaultTempFolder.java:97)
at org.sonar.api.utils.internal.DefaultTempFolder.stop(DefaultTempFolder.java:106)
at org.sonar.scanner.analysis.AnalysisTempFolderProvider.stop(AnalysisTempFolderProvider.java:61)
at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1048)
at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:803)
at org.sonar.core.platform.ComponentContainer.stopComponents(ComponentContainer.java:165)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:124)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy26.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:65)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Try the same in Linux machine, it will execute flawlessly. This error comes when you don't have enough privileges (R/W) to the .sonartmp folder. This usually occurs in windows box.

Mavenized Mule project but Munit test run is failing

I have an existing Mule project (which has MUnit's also) and now we are trying to mavenize this project. I have used Anypoint studio only to mavenize and project building is success and I am able to get target/test-classes and target/classes folder but when I am trying to run Munit test (tried to run specific test case also) that time it is failing with below error.
[WARNING] Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber: 49; columnNumber: 73; schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mu
le/ee/tracking/current/mule-tracking-ee.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the do
cument is not <xsd:schema>.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.mule.munit.runner.spring.config.document.MunitDocumentLoader.loadDocument(MunitDocumentLoader.java:52)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.
java:229)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:186)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:171
)
at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:56)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.jav
a:144)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:
100)
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.handleSpringElements(MuleHierarchicalBeanDefinitionParserDelegate.java:
180)
at org.mule.munit.runner.spring.config.reader.MunitBeanDefinitionParserDelegate.parseCustomElement(MunitBeanDefinitionParserDelegate.java:41)
at org.mule.munit.runner.spring.config.reader.MunitBeanDefinitionParserDelegate.parseCustomElement(MunitBeanDefinitionParserDelegate.java:82)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1417)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:180
)
at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:56)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.jav
a:144)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:
100)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:510)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.mule.munit.runner.spring.config.MunitApplicationContext.communicateMuleContextToParsers(MunitApplicationContext.java:123)
at org.mule.munit.runner.spring.config.MunitApplicationContext.loadBeanDefinitions(MunitApplicationContext.java:96)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129
)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:108)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:104)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:172)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:95)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69)
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89)
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81)
at org.mule.munit.runner.MunitMuleContextFactory.createMuleContext(MunitMuleContextFactory.java:85)
at org.mule.munit.runner.MuleContextManager.createMule(MuleContextManager.java:97)
at org.mule.munit.runner.MuleContextManager.startMule(MuleContextManager.java:56)
at org.mule.munit.runner.mule.MunitSuiteRunner.<init>(MunitSuiteRunner.java:42)
at org.mule.MUnitMojo.buildRunnerFor(MUnitMojo.java:311)
at org.mule.MUnitMojo.doExecute(MUnitMojo.java:173)
at org.mule.MUnitMojo.execute(MUnitMojo.java:122)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Munit test run works perfectly when executing in Anypoint studio but fails when executing using maven command.
[ERROR] Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.1.0:test (test) on project MuleFlowProject: Execution test of goal com.mulesoft.
nit.tools:munit-maven-plugin:1.1.0:test failed: org.mule.api.config.ConfigurationException: Configuration problem: Failed to import bean definitions
rom URL location [classpath:processFile.xml]
[ERROR] Offending resource: URL [file:/C:/Learning/CodeBase/MuleFlowProject/target/test-classes/processFile-test-suite.xml]; nested exception is org.spr
gframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 107 in XML document from class path resource [processFile.xml] is invalid; n
ted exception is org.xml.sax.SAXParseException; lineNumber: 107; columnNumber: 89; cvc-complex-type.2.4.a: Invalid content was found starting with e
ment 'db:select'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":abstract-message-proce
or, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message
rocessor}' is expected. (org.mule.api.lifecycle.InitialisationException)
I googled it and found related issue logged in Mule Jira which is stating that it has been solved in version 3.5
Reference : https://www.mulesoft.org/jira/browse/MULE-7338
I am using Mule server 3.7.3 EE and Maven version is 3.3.9
Any help is most welcome.
I resolved this problem after modifying schemaLocation in mule configuration xml from http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd to http://www.mulesoft.org/schema/mule/db/3.7/mule-db.xsd
Thanks to #anupambhusari for giving me hint that issue with namespace.
Try using this Dependency
<dependency>
<groupId>com.mulesoft.muleesb.modules</groupId>
<artifactId>mule-module-tracking-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>

How do I disable jacoco-agent after jacoco:report?

I have a maven-project, using "test"-phase as well as "integration-test"-phase. In the test-phase, JUnit-Tests are executed, in integration-test there are HTMLUnit-tests. I am using Jacoco[1]-maven-plugin in purpose to measure the codecoverage done by the JUnit-tests of my project. When doing integration-test, I am using maven-embedded-glassfish-plugin to start a glassfish-server and deploy my app before executing the tests.
Sad but true, I have to disable jacoco for time being, as it does not harmony with "integration-test"-phase.
Jacoco's report goal is / should be exceucted at prepare-package-phase, so I assume that it should not influence integration-test-phase. But when I enable jacoco:report, my integration-tests do not run any more because of memory-size problems[2].
How do I stop jacoco:report influencing the integration-test-phase?
[1] http://www.eclemma.org/jacoco/
[2]
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class com/steadystate/css/parser/SACParserCSS21TokenManager.
at org.jacoco.agent.rt_6l8m50.CoverageTransformer.transform(CoverageTransformer.java:91)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at com.steadystate.css.parser.SACParserCSS21.<init>(SACParserCSS21.java:2196)
at com.steadystate.css.parser.SACParserCSS21.<init>(SACParserCSS21.java:23)
at com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.parseCSS(CSSStyleSheet.java:530)
at com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.<init>(CSSStyleSheet.java:152)
at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLStyleElement.getSheet(HTMLStyleElement.java:73)
at com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList.item(StyleSheetList.java:129)
at com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle(Window.java:1591)
at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getCurrentStyle(HTMLElement.java:2465)
at com.gargoylesoftware.htmlunit.html.DomNode.isDisplayed(DomNode.java:688)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.isVisible(HtmlSerializer.java:377)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendText(HtmlSerializer.java:371)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendNode(HtmlSerializer.java:126)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendChildren(HtmlSerializer.java:249)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendNode(HtmlSerializer.java:198)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendChildren(HtmlSerializer.java:249)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendNode(HtmlSerializer.java:198)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendChildren(HtmlSerializer.java:249)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendNode(HtmlSerializer.java:198)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendChildren(HtmlSerializer.java:249)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendNode(HtmlSerializer.java:198)
at com.gargoylesoftware.htmlunit.html.HtmlSerializer.asText(HtmlSerializer.java:57)
at com.gargoylesoftware.htmlunit.html.DomNode.asText(DomNode.java:740)
at webappTest.IndexIT.index(IndexIT.java:24)
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:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
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:601)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
Caused by: java.lang.RuntimeException: Method code too large!
at org.jacoco.agent.rt_6l8m50.asm.MethodWriter.a(Unknown Source)
at org.jacoco.agent.rt_6l8m50.asm.ClassWriter.toByteArray(Unknown Source)
at org.jacoco.agent.rt_6l8m50.core.instr.Instrumenter.instrument(Instrumenter.java:70)
at org.jacoco.agent.rt_6l8m50.core.instr.Instrumenter.instrument(Instrumenter.java:82)
at org.jacoco.agent.rt_6l8m50.CoverageTransformer.transform(CoverageTransformer.java:89)
... 67 more
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.313 sec
Exception in thread "ThreadedStreamConsumer" Exception in thread "Thread-25" Exception in thread "Thread-26" Exception in thread "DynamicReloader"
Ok, so I see the problem.
The method jjMoveNfa_0 of class
http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.cssparser/cssparser/0.9.5/com/steadystate/css/parser/SACParserCSS21TokenManager.java
is insanely long with 4203 loc. So the solution for you should be to avoid instrumentation on this class.
You can exclude package "com.steadystate", which includes the class, by telling the jacoco-maven-plugin to do so:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>**com.steadystate*</exclude>
</excludes>
...
</plugin>

jenkins-1.489 maven-3.0.3 & sonar-3.3.1

I have upgraded Sonar to version 3.3.1 from 3.0.1,
and my code analisys jobs has been broken.
all projects with code analisys jobs are multimodule maven projects with hierarchical structure
on previous version of sonar (3.0.1), job was configured with one maven build step:
org.codehaus.sonar:sonar-maven3-plugin:3.0.1:sonar -P sonar -X
(sonar server information is stored in maven profile named "sonar")
now i've changed the this build step to
org.codehaus.sonar:sonar-maven3-plugin:3._3_.1:sonar -P sonar -X
and now builds are failing.
Does anyone know the solution ?
There is a stackTrace:
6:48:21 Waiting for Jenkins to finish collecting data
16:48:21 mavenExecutionResult exceptions not empty
16:48:21 message : Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar (default-cli) on project proj-parent: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value
16:48:21 cause : Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value
16:48:21 Stack trace :
16:48:21 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar (default-cli) on project proj-parent: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value
16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
16:48:21 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
16:48:21 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
16:48:21 at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
16:48:21 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
16:48:21 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
16:48:21 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
16:48:21 at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
16:48:21 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:48:21 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
16:48:21 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:48:21 at java.lang.reflect.Method.invoke(Method.java:601)
16:48:21 at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
16:48:21 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
16:48:21 at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
16:48:21 at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
16:48:21 at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
16:48:21 at hudson.remoting.UserRequest.perform(UserRequest.java:118)
16:48:21 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
16:48:21 at hudson.remoting.Request$2.run(Request.java:326)
16:48:21 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
16:48:21 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
16:48:21 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
16:48:21 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
16:48:21 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
16:48:21 at java.lang.Thread.run(Thread.java:722)
16:48:21 Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value
16:48:21 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
16:48:21 ... 27 more
16:48:21 Caused by: java.lang.NullPointerException: null value
16:48:21 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
16:48:21 at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:139)
16:48:21 at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:178)
16:48:21 at com.google.common.collect.Maps.fromProperties(Maps.java:594)
16:48:21 at org.sonar.batch.bootstrapper.Batch.(Batch.java:50)
16:48:21 at org.sonar.batch.bootstrapper.Batch.(Batch.java:38)
16:48:21 at org.sonar.batch.bootstrapper.Batch$Builder.build(Batch.java:148)
16:48:21 at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:133)
16:48:21 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
16:48:21 ... 28 more
16:48:21 Sending e-mails to: *****
16:48:21 channel stopped
The solution that work for me:
1) add pre -build step - build maven project with goals celan install
2) main build step is the same
org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar -P sonar -X

surefire 2.7.2 in maven 3.0.3

i used to use 'compile' and 'package' my project with maven2.2.1 without problem. But when i've switched to maven3.0.3, i've been faced with this error:
java.lang.NoClassDefFoundError: org/apache/maven/surefire/booter/SurefireExecutionException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:835)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:769)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:254)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:843)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:957)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:990)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:951)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.surefire.booter.SurefireExecutionException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
and also this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project yaghut-core: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test failed: Unable to load the mojo 'test' in the plugin 'org.apache.maven.plugins:maven-surefire-plugin:2.7.2'. A required class is missing: org/apache/maven/surefire/booter/SurefireExecutionException
[ERROR] realm = plugin>org.apache.maven.plugins:maven-surefire-plugin:2.7.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Program_Files_Java/repository/org/apache/maven/plugins/maven-surefire-plugin/2.7.2/maven-surefire-plugin-2.7.2.jar
[ERROR] urls[1] = file:/C:/Program_Files_Java/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
org.apache.maven.surefire.booter.SurefireExecutionException
[ERROR] -> [Help 1]
[ERROR]
does anyone has got any idea about this problem ?
Update to newer version of maven-surefire-plugin (2.12 most up-to-date). 2.7.2 is a little bit out of date.
I guess that was happend because of maven3.0.3's bug ! my problem was solved by upgrading to mave3.0.4

Resources