Thank you for replay Dan!

I found my problem, it was on the web-services.,  It seems that both of the
web-services uses same namespace 
and there fore all the class are generated on same folders. So ObectFactory
class that the plugins generate on 
FirstService is ovrided by the SecondService, ending up with valid classes
for SecondServices only. 

I have tried to customizing the package naming on FirstService using jaxws
binding files, after having probloms with customizing i finally 
got generated custom packages. Found this example very help ful on jaxws
bindig:
http://www.zienit.nl/blog/2009/11/enterprise_application_integration/consum
ing-web-services-from-ejb-3-using-jax-ws

Any way

Now i have sat up my pom with two executtions in side cxf-code-gen plugins: 

one for FirstService, and one for SecondService set up to generate to two
different cataloges, and having different jaxb-bindings, 
Now when i run mvn clean install -P get eclipse:eclipse 
i ran into this bug: https://issues.apache.org/jira/browse/CXF-2796

This could be that There is alo an DTTManagerDefault and DTTManager 
classes ships from jvm 1.6_19
jvm 1.6_19: com.sun.org.apache.xml.internal.dtm.DTMManager
xalan 1.7.1:  org.apache.xml.dtm.DTMManager



Caused by: java.lang.ClassCastException:
org.apache.xml.dtm.ref.DTMManagerDefaul
t cannot be cast to org.apache.xml.dtm.DTMManager
        at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:137)
        at org.apache.xpath.XPathContext.<init>(XPathContext.java:102)
        at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
        at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
        at
com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap
(Internalizer.java:224)
        at
com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap
(Internalizer.java:289)
        at
com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internal
izer.java:134)
        at
com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internal
izer.java:96)
        at
com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.j
ava:448)
        at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompiler
Impl.java:221)
        at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompiler
Impl.java:85)
        at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initiali
ze(JAXBDataBinding.java:374)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJ
avaContainer.java:576)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJav
aContainer.java:228)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCon
tainer.java:128)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCon
tainer.java:271)
        ... 28 more


Finally i got around the problem removing the dependency, i dont need any
security on generate pahse:
<dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-ws-security</artifactId>
</dependency>
So this is the reason for bug:
https://issues.apache.org/jira/browse/CXF-2796

But its wired that this dependency and transitive dependency Xalan is
included in 
the cxf-plugins-generate class path... 
is it possible or how can i remove this dependency on running in
generate-resourses pahse? 




----- Opprinnelig melding -----
Fra: Daniel Kulp <[email protected]>
Til: [email protected]
Kopi: [email protected]
Dato: Thu, 27 May 2010 13:06:10 -0400
Emne: Re: strange behaviure using multiple wsdloption on cxf-codegen-plugin

> 
> 
> Umm.....   I wouldn't use jaxb 2.2 unless you REALLY need to. We haven't 
> really tried it much (just started last week) and I know it doesn't work
> well 
> with Java 6 as it requires endorsing some stuff into the JDK endorsed dir.  
> Can you try with 2.1.13?
> 
> Dan
> 
> 
> 
> On Wednesday 26 May 2010 3:56:23 pm [email protected] wrote:
> > Sorry about privous post, correcting the formatting so its more readable..
> > 
> > 
> > 
> >      Hi,
> > 
> > 
> >      Im using java 1.6 and tring to consuming .net web services using cxf-
> >      codegen-plugins.
> > 
> >        First time i had one wsdl option and I got
> >      IllegalAnnotationException Caused by:
> >      com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 43 counts of
> >      IllegalAnnotationExceptions
> > 
> >      This problem solved by adding following dependencies to pom.xml
> > 
> >      <dependency>
> >      <groupId>sun-jaxb</groupId>
> >      <artifactId>jaxb-impl</artifactId>
> >      <version>2.2</version>
> >      </dependency>
> > 
> >      <dependency>
> >      <groupId>sun-jaxb</groupId>
> >      <artifactId>jaxb-xjc</artifactId>
> >      <version>2.2</version>
> >      </dependency>
> > 
> >      As mentioned on the FAQ (http://cxf.apache.org/faq.html#FAQ-
> >      CanCXFrunwithJDK1.6%253F)
> > 
> >      But when i use multiple wsdlOption in the code-gen plugins., like:
> >          <wsdlOptions>
> >                                             
> > <wsdlOption>
> >                                             
> >     <wsdl>$
> >      {test.url}FirstService.svc?wsdl</wsdl>
> >                                             
> >     <extraargs>
> >                                             
> >         <extraarg>-client</
> >      extraarg>
> >                                             
> >     </extraargs>
> >                                             
> > </wsdlOption>
> >                                             
> > <wsdlOption>
> >                                             
> >     <wsdl>$
> >      {test.url}SecondService.svc?wsdl</wsdl>
> >                                             
> >     <extraargs>
> >                                             
> >         <extraarg>-client</
> >      extraarg>
> >                                             
> >     </extraargs>
> >                                             
> > </wsdlOption>
> > 
> >           </wsdlOptions>
> > 
> >      I get the same IllegalAnnotationException when running the generated
> >      client on FirstService.
> >      The client genrated on SecondService runs just fine..
> > 
> >      Is this a bug or do i miss any additional configurations ?
> > 
> >      my complete pom.xml
> > 
> >      <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:
> >      xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:
> >      schemaLocation="http://maven.apache.org/POM/4.0.0 http://
> >      maven.apache.org/maven-v4_0_0.xsd">
> > 
> >          <modelVersion>4.0.0</modelVersion>
> >          <groupId>no.ws.client</groupId>
> >          <artifactId>artifact</artifactId>
> >          <name>Component: .net consumer</name>
> >          <packaging>jar</packaging>
> > 
> >          <properties>
> >              <test.url>http://a.dot.net.service/</mintra.test.url>
> >              <wsdl.url>${test.url}</wsdl.url>
> >              <cxf.version>2.2.6</cxf.version>
> >          </properties>
> >          <dependencies>
> >              <!-- External libraries -->
> >              <dependency>
> >                  <groupId>org.apache.cxf</groupId>
> >                  <artifactId>cxf-rt-frontend-jaxws</artifactId>
> >                  <version>${cxf.version}</version>
> >              </dependency>
> > 
> >              <dependency>
> >                  <groupId>org.apache.cxf</groupId>
> >                  <artifactId>cxf-rt-transports-http</artifactId>
> >                  <version>${cxf.version}</version>
> >              </dependency>
> >              <dependency>
> >                  <groupId>org.apache.cxf</groupId>
> >                  <artifactId>cxf-rt-ws-security</artifactId>
> >                  <version>${cxf.version}</version>
> >              </dependency>
> > 
> > 
> >              <!-- Omit if using standard WSS4J interceptors -->
> >              <dependency>
> >                  <groupId>org.apache.cxf</groupId>
> >                  <artifactId>cxf-rt-ws-policy</artifactId>
> >                  <version>${cxf.version}</version>
> >              </dependency>
> > 
> >              <dependency>
> >                  <groupId>xml-resolver</groupId>
> >                  <artifactId>xml-resolver</artifactId>
> >                  <version>1.2</version>
> >              </dependency>
> >              <dependency>
> >                  <groupId>org.apache.xmlbeans</groupId>
> >                  <artifactId>xmlbeans</artifactId>
> >                  <version>2.4.0</version>
> >              </dependency>
> >              <dependency>
> >                  <groupId>sun-jaxb</groupId>
> >                  <artifactId>jaxb-impl</artifactId>
> >                  <version>2.2</version>
> >              </dependency>
> >              <dependency>
> >                  <groupId>sun-jaxb</groupId>
> >                  <artifactId>jaxb-xjc</artifactId>
> >                  <version>2.2</version>
> >              </dependency>
> > 
> >              <!-- /External libraries -->
> >          </dependencies>
> >          <profiles>
> >              <profile>
> >                  <id>_generate-catalog</id>
> >                  <build>
> >                      <plugins>
> >                          <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>$
> >      {project.build.directory}/generated/cfx/catalog</sourceRoot>
> >                                         
> > <wsdlOptions>
> >                                             
> > <wsdlOption>
> >                                             
> >     <wsdl>$
> >      {mintra.test.url}FirstService.svc?wsdl</wsdl>
> >                                             
> >     <extraargs>
> >                                             
> >         <extraarg>-client</
> >      extraarg>
> >                                             
> >     </extraargs>
> >                                             
> > </wsdlOption>
> >                                             
> > <wsdlOption>
> >                                             
> >     <wsdl>$
> >      {mintra.test.url}FirstService.svc?wsdl</wsdl>
> >                                             
> >     <extraargs>
> >                                             
> >         <extraarg>-client</
> >      extraarg>
> >                                             
> >     </extraargs>
> >                                             
> > </wsdlOption>
> > 
> >                                         
> > </wsdlOptions>
> >                                     
> > </configuration>
> >                                      <goals>
> >                                         
> > <goal>wsdl2java</goal>
> >                                      </goals>
> >                                  </execution>
> >                              </executions>
> >                          </plugin>
> >                      </plugins>
> >                  </build>
> >              </profile>
> >             
> >          </profiles>
> >      </project>
> >       
> 
> -- 
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog

Reply via email to