Unable to generate classes from JAXB in Maven environment - java

I'm using the xjc plugin in Maven environment and trying to generate classes from the Schema
I'm able to do this (Create classes) using xjc from command line, but unable to do the same using maven target generate-sources.
Getting the following exception
[ERROR] null[5,30]
org.xml.sax.SAXParseException: A class/interface with the same name "<className>" is already in use. Use a class customization
to resolve this conflict.
at com.sun.tools.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:100)
at com.sun.tools.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:61)
at com.sun.tools.xjc.generator.bean.ImplStructureStrategy$1.createClasses(ImplStructureStrategy.java:42)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassDef(BeanGenerator.java:371)
at com.sun.tools.xjc.generator.bean.BeanGenerator.getClazz(BeanGenerator.java:403)
at com.sun.tools.xjc.generator.bean.BeanGenerator$1.onBean(BeanGenerator.java:291)
at com.sun.tools.xjc.generator.bean.BeanGenerator$1.onBean(BeanGenerator.java:299)
at com.sun.tools.xjc.model.CClassInfo.accept(CClassInfo.java:352)
at com.sun.tools.xjc.generator.bean.BeanGenerator.getContainer(BeanGenerator.java:281)
at com.sun.tools.xjc.generator.bean.BeanGenerator.getUsedPackages(BeanGenerator.java:337)
at com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:169)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:151)
at com.sun.tools.xjc.model.Model.generateCode(Model.java:230)
at com.sun.tools.xjc.Driver.run(Driver.java:317)
at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:301)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Can anyone help me find whats missing here.

As stated on the JAXB site, use the following Maven plugin:
<plugin>
. <groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
http://java.net/projects/maven-jaxb2-plugin/pages/Home
http://jaxb.java.net/
It seems, you're using a different plugin (org.codehaus.mojo.jaxb2.XjcMojo on your stack trace for which Google leads me to http://mojo.codehaus.org/jaxb2-maven-plugin/ ).

Since it works command line but not in Maven the class with the conflict must appear somewhere on your classpath. Any chance that is happening?
For an example on how to resolve name conflicts see:
How do I create JAXB bindings for docbook

May be you have two sub-elements with the same name, so the generated class name is the same?
If this is the case, you can customized the produced class name using the schema annotations:
First add the following namespaces to your xsd:
<xs:schema xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0">
Second add annotation for the relevant element:
<xs:complexType name="ComplexType">
<xs:annotation><xs:appinfo>
<jaxb:class name="MyClass">
<jaxb:javadoc>This is my class.</jaxb:javadoc>
</jaxb:class>
</xs:appinfo></xs:annotation>
</xs:complexType>

Related

apache cxf wsdl2java Failed to generate types->Access is denied

I'm struggling to fix this issue since 2013...
I'm using Windows 7.
[ERROR] Failed to execute goal
org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java (generate-sources)
on project service-data-model-provider: Execution generate-sources of
goal org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java failed: Failed
to generate types.
a:\Misc\WsMock\service-data-model-provider\src\main\java\schema\eo\common\system\messageheader\v1\MessageContextType.java
(Access is denied) -> [Help 1]
Its completely random and happens for me on all cxf versions and different java versions.
At the moment I'm on jdk 1.8.45 and cxf 3.1.2
The issue can be resolved by setting always
But then the build is always successful even is some errors will happen which are shown as [Warning] in the log.. So I can't use anything like that.
Here's my cfg
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<defaultOptions>
<extraargs>
<extraarg>-validate</extraarg>
<extraarg>-exsh</extraarg>
<extraarg>true</extraarg>
</extraargs>
</defaultOptions>
<wsdlRoot>..\..\..</wsdlRoot>
<includes>
<include>mds/apps/services/**/*.wsdl</include>
</includes>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Another thing that helps but its not resolving the issue completely is to disable the WriteToCache setting in the WindowsHardDrive driver.
That indicates that the system is too slow and CXF\Java is trying to use the file before its completely written to the disk.
Using an SSD the issue is happening only occasionally.
Our data model is huge (lots of XSD's) and the hard drives are encrypted so that's why everything is so slow.
Any ideas how to tune java to handle this? Or maybe its a CXF problem?
Full Stack Trace
[ERROR] Failed to execute goal
org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java (generate-sources)
on project service-data-model-provider: Execution generate-sources of
goal org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java failed: Fai led
to generate types.
a:\Misc\WsMock\service-data-model-provider\src\main\java\co\schema\common\fault\creati
onfault\v1\ObjectFactory.java (Access is denied) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.apache.cxf:cxf-codegen-plugin:3.1.2:w sdl2java
(generate-sources) on project service-data-model-provider: Execution
generate-sources of goal org.apache.cx
f:cxf-codegen-plugin:3.1.2:wsdl2java failed: Failed to generate types.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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:497)
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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution
generate-sources of goal org.apache.cxf:cxf-codeg
en-plugin:3.1.2:wsdl2java failed: Failed to generate types.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more Caused by: org.apache.cxf.tools.common.ToolException: Failed to generate types.
at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate(JAXBDataBinding.java:839)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:730)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:270)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:415)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:415)
at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:260)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:512)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more Caused by: java.io.FileNotFoundException: a:\Misc\WsMock\service-data-model-provider\src\main\java\uk\co\schema\
common\fault\creationfault\v1\ObjectFactory.java (Access is denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:162)
at org.sonatype.plexus.build.incremental.DefaultBuildContext.newFileOutputStream(DefaultBuildContext.java:54)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo$1.createOutputStream(WSDL2JavaMojo.java:411)
at org.apache.cxf.tools.wsdlto.databinding.jaxb.TypesCodeWriter.openBinary(TypesCodeWriter.java:72)
at com.sun.codemodel.CodeWriter.openSource(CodeWriter.java:100)
at com.sun.codemodel.JPackage.createJavaSourceFileWriter(JPackage.java:490)
at com.sun.codemodel.JPackage.build(JPackage.java:441)
at com.sun.codemodel.JCodeModel.build(JCodeModel.java:311)
at com.sun.codemodel.JCodeModel.build(JCodeModel.java:301)
at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate(JAXBDataBinding.java:827)
... 32 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information
about the errors and possible solutions, please read the following
articles: [ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Cheers
Prem
(Moving #Prem's comment to this answer and adding more details)
Adding <fork>always</fork> fixes the issue.
Sample configurations:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-source</id>
<phase>generate-sources</phase>
<configuration>
<fork>always</fork>
</configuration>
...
<!-- Rest of the configuration -->
Docs - maven-cxf-codegen - other config
The same had happened with me..
I too had jdk 1.8 and cxf 3.1.x
I tried the same task on a old PC with jdk 1.7 and cxf 2.7.0 and it worked like charm..
Adding the < plugin > will generate schema and service from wsdl everytime you create a build.. I don't know whether it is a efficient way or not, but I extracted the schema and service once and added them to the root.
Thanks
I faced similar kind of problem when I had problem in my wsdl file. Please check the wsdl file and any missing file path.

wsdl2java Two classes have the same XML type name "{http://***.***.***.***/***/***/***}objectFactory"

This problem occur in newer version of servicemix(tested on 5.4 - cxf 3.0.2 and 5.3 - cxf 2.7.11) in older version 4.5.2 with cxf 2.6.8 everything works, webservices are created.
In our project we have a lot of different webservices generated by maven plugin wsdl2java in diffrent bundles. In servicemix 5.4 almost all webservices are down due to those errors, strange is that in previous servicemix 5.3 one of bundle is able to start without any modification in project.
In maven I tried use additional extraarg:
<extraarg>-autoNameResolution</extraarg>
<extraarg>-xjc-npa</extraarg>
But without any result
Stacktrace:
Unable to start blueprint container for bundle bundle-name1
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .camelBlueprint.factory.camelContext
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[19:org.apache.aries.blueprint.core:1.4.1]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:145)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:753)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:863)[105:org.apache.camel.camel-blueprint:2.13.2]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:528)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:361)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[14:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[14:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[14:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[14:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[14:org.apache.aries.util:1.1.0]
at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.4.1.jar:]
at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: org.apache.camel.NoSuchBeanException: Cannot lookup: routeBuilder from registry: org.apache.camel.blueprint.BlueprintContainerRegistry#597012f0 with expected type: interface org.apache.camel.RoutesBuilder due: Error when instantiating bean ****CxfClient of class ***.***.***.***.***.***.***.***
at org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:62)
at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByNameAndType(PropertyPlaceholderDelegateRegistry.java:63)
at org.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:129)
at org.apache.camel.model.RouteBuilderDefinition.createRoutes(RouteBuilderDefinition.java:70)
at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.installRoutes(AbstractCamelContextFactoryBean.java:750)
at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:311)
at org.apache.camel.blueprint.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:304)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_21]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_21]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_21]
at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_21]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[19:org.apache.aries.blueprint.core:1.4.1]
... 30 more
Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean ****CxfClient of class ***.***.***.***.***.***.***.***
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:300)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[19:org.apache.aries.blueprint.core:1.4.1]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:268)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[19:org.apache.aries.blueprint.core:1.4.1]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:933)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[19:org.apache.aries.blueprint.core:1.4.1]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:145)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:753)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.camel.blueprint.BlueprintContainerRegistry.lookupByNameAndType(BlueprintContainerRegistry.java:54)
at org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:56)
... 43 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:341)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:490)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:704)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:550)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_21]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_21]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_21]
at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_21]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[19:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:298)[19:org.apache.aries.blueprint.core:1.4.1]
... 75 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://***.***.***.***/***/***/***}objectFactory". Use #XmlType.name and #XmlType.namespace to assign different names to them.
this problem is related to the following location:
at ***.***.***.***.***.***.***.ObjectFactory
this problem is related to the following location:
at 1***.1***.1***.1***.1***.1***.1***.ObjectFactory
Two classes have the same XML type name "{http://***.***.***.***/***/***/***}objectFactory". Use #XmlType.name and #XmlType.namespace to assign different names to them.
this problem is related to the following location:
at ***.***.***.***.***.***.***.ObjectFactory
this problem is related to the following location:
at 1***.1***.1***.1***.1***.ObjectFactory
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_21]
at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_21]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:222)[:2.4.0]
at javax.xml.bind.ContextFinder.find(ContextFinder.java:396)[:2.4.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:656)[:2.4.0]
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_21]
at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244)
at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484)
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
... 92 more
EDIT
I tried to downgrade cxf to 2.6.8 but i get the same errors so, I suppose the problem is somewhere else maybe in org.apache.aries.blueprint.core.
EDIT 2
I also tried to create one big bundle with all generated classes but problem is the same
In case you generate your ws-client code via the cxf-codegen-plugin, you could separate the package names of your ws-client bundles/parts with a specific configuration. I achieved something similar in one of my projects like so:
...
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/gen</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/MyWSEndpoint1.wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
<!--
<extraarg>-validate</extraarg>
-->
<extraarg>-p</extraarg>
<extraarg>com.acme.ws.jaxb.ns1</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg></extraarg>
</extraargs>
</wsdlOption>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/MyWSEndpoint2.wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
<!--
<extraarg>-validate</extraarg>
-->
<extraarg>-p</extraarg>
<extraarg>com.acme.ws.jaxb.ns2</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg></extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
...
Thus, "individual" packages for each ws-client specific {http://***.***.***.***/***/***/***}objectFactory should be generated which might help to avoid conflicts during the code generation phase. Thereby, at runtime, no NameSpace-related issues should be blocking you.
Keep in mind that com.acme.ws.jaxb.ns1 and com.acme.ws.jaxb.ns2 are only suggestions and that you could use whatever seems valid for your project there.
See also Apache CXF - WSDL to Java
-p [ wsdl-namespace= ] PackageName
Specifies zero, or more, package names to use for the generated code. Optionally > specifies the WSDL namespace to package name mapping.
Comments welcome.
The problem was with wrong <Import-Package> in pom definition. We changed imports according to fuse documentation and everything start work properly.
<Import-Package>
javax.jws,
javax.wsdl,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.namespace,
javax.xml.ws,
org.apache.cxf,
org.apache.cxf.bus,
org.apache.cxf.bus.spring,
org.apache.cxf.bus.resource,
org.apache.cxf.interceptor,
org.apache.cxf.io,
org.apache.cxf.message,
org.apache.cxf.phase,
org.apache.cxf.service,
org.apache.cxf.service.model,
org.apache.cxf.transport,
org.apache.cxf.ws.addressing,
org.apache.cxf.ws.rm,
org.apache.cxf.ws.rm.v200702,
org.apache.cxf.configuration.spring,
org.apache.cxf.resource,
org.apache.cxf.jaxws,
org.springframework.beans.factory.config
*
</Import-Package>

Maven cxf-codegen-plugin and import in wsdl

I'm trying to generate webservice classes from wsdl file using apache cxf-codegen-plugin from maven.
My wsdl file imports xsd like below using
<xs:import namespace="http://my.ns.com/privateperson" schemaLocation="../xsd/PrivatePerson.xsd"/>
and in pom.xml I have:
<wsdlOption>
<extraargs>
<extraarg>-catalog ${basedir}/src/main/resources/xsd/PrivatePerson.xsd</extraarg>
<extraarg>-server</extraarg>
</extraargs>
...
</wsdlOptions>
However when I run cxf-codegen-plugin I get the following error:
wsdl2java failed: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected option: -catalog valid/path/to/xsd/file/privateperson.xsd
Is there something wrong with my configuration? When I don't include external xsd file everything works fine.
I used catalog as it is described here: http://cxf.apache.org/docs/wsdl-to-java.html
I have also run maven with -e:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.0.0-milestone1:wsdl2java (generate-sources) on project Services: unresolved reference -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.0.0-milestone1:wsdl2java (generate-sources) on project Services: unresolved reference
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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.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)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.apache.maven.plugin.MojoExecutionException: unresolved reference
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:447)
at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:311)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:524)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 25 more
Caused by: java.lang.InternalError: unresolved reference
at com.sun.xml.xsom.impl.parser.DelayedRef._get(DelayedRef.java:103)
at com.sun.xml.xsom.impl.parser.DelayedRef$Type.getType(DelayedRef.java:148)
at com.sun.xml.xsom.impl.ElementDecl.getType(ElementDecl.java:110)
at com.sun.xml.xsom.impl.ElementDecl.updateSubstitutabilityMap(ElementDecl.java:174)
at com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:141)
at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:211)
at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:538)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:269)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:95)
at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:460)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:714)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:270)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:427)
... 29 more
Each of the extra arguments must be on its own; you tried to pass two in one, and that won't work because of the care the plugin takes to quote things correctly for you (or to pass each argument as a separate element of the argument array, depending on whether it execs under the covers or not).
You want this:
<wsdlOption>
<extraargs>
<extraarg>-catalog</extraarg>
<extraarg>${basedir}/src/main/resources/xsd/PrivatePerson.xsd</extraarg>
<extraarg>-server</extraarg>
</extraargs>
...
</wsdlOptions>
(Be aware that getting catalogs right can take experimentation; the logging of failures in XML catalog lookups is… virtually non-existent.)
Try the following tag and check if it works
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/<file-path></wsdl>
</wsdlOption>
</wsdlOptions>
also check which version of cxf plugin you are using. Try to use the latest one.
Let me know if its still giving error
Ok, I've solved my issue - in wsdl I have placed
<xs:import ... />
in wrong place. It was before
<wsdl:types>
element.

Compilation Failure when compiling class generated by jaxb

I have these error when compiling classes generated by JAXB with annotation:
annotations are not supported in -source 1.3 (use -source 5 or higher
to enable annotations) #XmlAccessorType(XmlAccessType.FIELD)
annotations are not supported in -source 1.3 (use -source 5 or higher
to enable annotations) #XmlRegistry
...
For all of the annotation.
I have tried with jdk 1.6 or jdk1.7, both lead to the same error.
Any one have seen this before ?
I am using maven-compiler-plugin
[DEBUG] Trace org.apache.maven.BuildFailureException: Compilation
failure at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused
by: org.apache.maven.plugin.CompilationFailureException: Compilation
failure at
org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at
org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Thank you,
Khue.
By default the Maven compiler plugin tries to compile at the lowest level of Java possible. So even though you are using Java 6 or 7 it is trying to compile a Java 1.3 application. You can change it by adding the following to your pom:
<project>
[...]
<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
[...]
</build>
[...]
</project>

Maven: The scm url does not contain a valid delimiter

I'm trying to get automatic buildNumers working but I keep running into the error
The scm url does not contain a valid delimiter
Here's the relevant part of the pom.
<scm>
<connection>scm:svn:${source.repo}</connection>
<developerConnection>scm:svn:${source.repo}</developerConnection>
<url>${source.repo}</url>
</scm>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<revisionOnScmFailure>1</revisionOnScmFailure>
<format>{0,number}</format>
<items>
<item>buildNumber0</item>
</items>
</configuration>
</plugin>
<properties>
<source.repo>svn://myserver/repository/${project.artifactId}</source.repo>
[..]
</properties>
The subversion location contains two sub projects core and web.
If anyone can help, I feel like I've tried everything.
I've tried the following:
using pipes: invalid url
retrieving a list of items from the server using the repo url from the command line: works fine
adding /trunk to the repo url: delimiter error
adding /trunk/core to the repo url: delimiter error
adding /trunk/web to the repo url: delimiter error
The delimiter error is probably hiding a different error because I dont think the url is wrong.
Here's the stack
java.lang.IllegalArgumentException: The scm url does not contain a valid delimit
er.
at org.apache.maven.scm.provider.ScmUrlUtils.getDelimiter(ScmUrlUtils.ja
va:61)
at org.apache.maven.scm.manager.AbstractScmManager.makeScmRepository(Abs
tractScmManager.java:186)
at org.codehaus.mojo.build.CreateMojo.getScmRepository(CreateMojo.java:7
68)
at org.codehaus.mojo.build.CreateMojo.getScmBranch(CreateMojo.java:619)
at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:464)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Thanks,
Marc
Try running the command:
mvn help:effective-pom
And check the output. That and the other help commands should help you trouble-shoot your Maven settings (e.g. expression evaluation, profiles, etc.)
It is possibly because you are using a placeholder in the URI, and Maven is not expanding it before using it.
I've battled this kind of thing myself with Maven, and sometimes you just have to give up and do the expansion by hand.
Another possibility was that the expanded URL scm:svn:svn://myserver/repository/.... was wrong, but #ach_l's comment convinces me that's not the problem.

Categories

Resources