You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ja...@external.t-mobile.at on 2008/08/08 13:59:54 UTC

http-conf:conduit problem - [Virus checked]

Hello all,

i found a problem with 
http://cwiki.apache.org/CXF20DOC/client-http-transport.html
<http-conf:conduit name=
"{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
    <http-conf:client Connection="Keep-Alive"
                      MaxRetransmits="1"
                      AllowChunking="false" />
  </http-conf:conduit>


in combination with 
<bean class=
"org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"
/>

problem is that org.apache.cxf.transport.http.HTTPConduit contains several 
@Resource annotations .. but i don't need (want) to set these properties.

Caused by: 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique 
bean of type [org.apache.cxf.configuration.security.AuthorizationPolicy] 
is defined: Unsatisfied dependency of type [class 
org.apache.cxf.configuration.security.AuthorizationPolicy]: expected at 
least 1 matching bean
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:614)
        at 
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:418)
        at 
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:497)
        at 
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:193)
        at 
org.springframework.beans.factory.annotation.InjectionMetadata.injectMethods(InjectionMetadata.java:116)
        at 
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:301)
        ... 90 more


i wanted to use something like this

        <bean name=
"{http://www.deltavista.at/schema/locationsearch}LocationSearchPort.http-conduit" 
class="org.apache.cxf.transport.http.HTTPConduit">
                <constructor-arg>
                        <ref bean="cxf"/>
                </constructor-arg>
                <property name="client">
                        <bean class=
"org.apache.cxf.transports.http.configuration.HTTPClientPolicy">
                                <property name="allowChunking" value=
"false" />
                        </bean>
                </property>
        </bean>
but i don't have endpointInfo in hand ...because client is create (and 
also recreated in some cases) on the fly using code below.
how can i modify this code to disable http chunking if required?

JAXBDataBinding.clearCaches();

                                JaxWsProxyFactoryBean factory = new 
JaxWsProxyFactoryBean();
                                factory.setServiceClass(serviceInterface);
                                factory.setAddress(address);
                                factory.setWsdlLocation(wsdlLocation);
                                factory.setServiceName(QName.valueOf(
serviceName));
                                factory.setProperties(new HashMap<String, 
Object>());
                                factory.getProperties().put(Message.
SCHEMA_VALIDATION_ENABLED, new Boolean(schemaValidationEnabled));
                                factory.setEndpointName(QName.valueOf(
portName));
                                if (username != null) {
                                        factory.setUsername(username);
                                }
                                if (password != null) { 
                                        factory.setPassword(password);
                                }
                                LoggingFeature f = new LoggingFeature();
                                f.setLimit(1024*1024); // 1MB limit of log 
message ... temp file otherwise
                                List<AbstractFeature> ff = 
factory.getFeatures();
                                if (ff == null) {
                                        ff = new 
ArrayList<AbstractFeature>();
                                        factory.setFeatures(ff);
                                }
                                ff.add(f);
                                T port = (T) factory.create();
 
thanks 


best regards
jano

Re: nexclude in WSDLToJava deletes existing classes!

Posted by Daniel Kulp <dk...@apache.org>.
Sounds like you have an old version of Xerces or other DOM implementation (not 
DOM level 3 compliant) on the classpath.

Dan



> When I try that, I get this error:
>
> cxfWSDLToJava:
>      [java] Exception in thread "Main Thread"
> java.lang.AbstractMethodError: getTextContent
>      [java]     at
> org.apache.cxf.bus.extension.ExtensionFragmentParser.deserialiseNamespaces(
>ExtensionFragmentParser.java:89) [java]     at
> org.apache.cxf.bus.extension.ExtensionFragmentParser.deserialiseExtensions(
>ExtensionFragmentParser.java:78) [java]     at
> org.apache.cxf.bus.extension.ExtensionFragmentParser.getExtensions(Extensio
>nFragmentParser.java:60) [java]     at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(ExtensionMan
>agerImpl.java:120) [java]     at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl
>.java:114) [java]     at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManagerIm
>pl.java:83) [java]     at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManagerIm
>pl.java:57) [java]     at
> org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus
>.java:91) [java]     at
> org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:41)
>      [java]     at
> org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:37)
>      [java]     at
> org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:33)
>      [java]     at
> org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
>      [java]     at
> org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:58)
>      [java]     at
> org.apache.cxf.tools.common.toolspec.AbstractToolContainer.getBus(AbstractT
>oolContainer.java:186) [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaConta
>iner.java:157) [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:127) [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:252) [java]     at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
>      [java] Java Result: 1
>
> BUILD SUCCESSFUL
>
>
> Any ideas?

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

RE: :Re: nexclude in WSDLToJava deletes existing classes!

Posted by Anthony Smith <an...@fedex.com>.
Using this old post helped solve the issue:
http://www.nabble.com/ClientFactoryBean-AbstractMethodError-tt13580636.h
tml#a13580636 

I tried another xerces.jar 

-----Original Message-----
From: 411161 [mailto:411161@fedex.com] 
Sent: Tuesday, May 05, 2009 10:53 AM
To: users@cxf.apache.org
Subject: <Suspected SPAM>:Re: nexclude in WSDLToJava deletes existing
classes!




logemann wrote:
> 
> In my trial to ignore certain namespaces when generating classes with

> the following ANT file:
> 
>      <target name="generateLogentisWsClient">
>          <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava"  
> fork="true">
>              <arg value="-client"/>
>              <arg value="-d"/>
>              <arg value="src"/>
>              <arg value="-nexclude"/>
>              <arg value="http://enum.model.bwh.logentis.de"/>
>              <arg value="-nexclude"/>
>              <arg value="http://model.bwh.logentis.de"/>
>              <arg value="res/OrderManager.wsdl"/>
>              <classpath>
>                  <path refid="cxf.classpath"/>
>              </classpath>
>          </java>
>      </target>
> 
> 
> i found out that classes that already exist (thus shouldnt be  
> generated) will be REMOVED from the src tree when using the mentioned

> ant task above.... is this what the authors wanted? This is really  
> ugly....
> 
> --
> Marc Logemann
> blog http://logemannreloaded.blogspot.com
> privat http://www.logemann.org
> 
> 
> 
> 

When I try that, I get this error:

cxfWSDLToJava:
     [java] Exception in thread "Main Thread"
java.lang.AbstractMethodError:
getTextContent
     [java]     at
org.apache.cxf.bus.extension.ExtensionFragmentParser.deserialiseNamespac
es(ExtensionFragmentParser.java:89)
     [java]     at
org.apache.cxf.bus.extension.ExtensionFragmentParser.deserialiseExtensio
ns(ExtensionFragmentParser.java:78)
     [java]     at
org.apache.cxf.bus.extension.ExtensionFragmentParser.getExtensions(Exten
sionFragmentParser.java:60)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(Extension
ManagerImpl.java:120)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerI
mpl.java:114)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManage
rImpl.java:83)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManage
rImpl.java:57)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManager
Bus.java:91)
     [java]     at
org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:41)
     [java]     at
org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:37)
     [java]     at
org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:33)
     [java]     at
org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
     [java]     at
org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:58)
     [java]     at
org.apache.cxf.tools.common.toolspec.AbstractToolContainer.getBus(Abstra
ctToolContainer.java:186)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaCo
ntainer.java:157)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner.java:127)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner.java:252)
     [java]     at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
83)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
     [java] Java Result: 1

BUILD SUCCESSFUL


Any ideas?

-- 
View this message in context:
http://www.nabble.com/http-conf%3Aconduit-problem-----Virus-checked--tp1
8890644p23390336.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: nexclude in WSDLToJava deletes existing classes!

Posted by 411161 <41...@fedex.com>.


logemann wrote:
> 
> In my trial to ignore certain namespaces when generating classes with  
> the following ANT file:
> 
>      <target name="generateLogentisWsClient">
>          <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava"  
> fork="true">
>              <arg value="-client"/>
>              <arg value="-d"/>
>              <arg value="src"/>
>              <arg value="-nexclude"/>
>              <arg value="http://enum.model.bwh.logentis.de"/>
>              <arg value="-nexclude"/>
>              <arg value="http://model.bwh.logentis.de"/>
>              <arg value="res/OrderManager.wsdl"/>
>              <classpath>
>                  <path refid="cxf.classpath"/>
>              </classpath>
>          </java>
>      </target>
> 
> 
> i found out that classes that already exist (thus shouldnt be  
> generated) will be REMOVED from the src tree when using the mentioned  
> ant task above.... is this what the authors wanted? This is really  
> ugly....
> 
> --
> Marc Logemann
> blog http://logemannreloaded.blogspot.com
> privat http://www.logemann.org
> 
> 
> 
> 

When I try that, I get this error:

cxfWSDLToJava:
     [java] Exception in thread "Main Thread" java.lang.AbstractMethodError:
getTextContent
     [java]     at
org.apache.cxf.bus.extension.ExtensionFragmentParser.deserialiseNamespaces(ExtensionFragmentParser.java:89)
     [java]     at
org.apache.cxf.bus.extension.ExtensionFragmentParser.deserialiseExtensions(ExtensionFragmentParser.java:78)
     [java]     at
org.apache.cxf.bus.extension.ExtensionFragmentParser.getExtensions(ExtensionFragmentParser.java:60)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(ExtensionManagerImpl.java:120)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl.java:114)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManagerImpl.java:83)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManagerImpl.java:57)
     [java]     at
org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:91)
     [java]     at
org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:41)
     [java]     at
org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:37)
     [java]     at
org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:33)
     [java]     at
org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
     [java]     at
org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:58)
     [java]     at
org.apache.cxf.tools.common.toolspec.AbstractToolContainer.getBus(AbstractToolContainer.java:186)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:157)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:252)
     [java]     at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
     [java] Java Result: 1

BUILD SUCCESSFUL


Any ideas?

-- 
View this message in context: http://www.nabble.com/http-conf%3Aconduit-problem-----Virus-checked--tp18890644p23390336.html
Sent from the cxf-user mailing list archive at Nabble.com.


nexclude in WSDLToJava deletes existing classes!

Posted by Marc Logemann <ml...@logemann.org>.
In my trial to ignore certain namespaces when generating classes with  
the following ANT file:

     <target name="generateLogentisWsClient">
         <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava"  
fork="true">
             <arg value="-client"/>
             <arg value="-d"/>
             <arg value="src"/>
             <arg value="-nexclude"/>
             <arg value="http://enum.model.bwh.logentis.de"/>
             <arg value="-nexclude"/>
             <arg value="http://model.bwh.logentis.de"/>
             <arg value="res/OrderManager.wsdl"/>
             <classpath>
                 <path refid="cxf.classpath"/>
             </classpath>
         </java>
     </target>


i found out that classes that already exist (thus shouldnt be  
generated) will be REMOVED from the src tree when using the mentioned  
ant task above.... is this what the authors wanted? This is really  
ugly....

--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Re: no types generation with WSDLToJava

Posted by Daniel Kulp <dk...@apache.org>.
You can do this with a JAXB binding file.     I think on the schemaBinding 
element, you add a map="false" attribute or something like that to tell it to  
not map that schema to files.

Dan


On Tuesday 12 August 2008 6:45:25 am Marc Logemann wrote:
> Hi,
>
> is it possible not to generate java types from WSDL with WSDLToJava?
> The point is, i am manually annotating my domain classes with JAXB
> stuff and i have also JPA annotations in there. When i call
> WSDLToJava, i want that it generates all the needed stub code and
> client code and stuff but not the types because overwriting my domain
> classes would result in losing my JPA annotations.
>
> Any ideas? Thanks.
>
> --
> Marc Logemann
> blog http://logemannreloaded.blogspot.com
> privat http://www.logemann.org



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

no types generation with WSDLToJava

Posted by Marc Logemann <ml...@logemann.org>.
Hi,

is it possible not to generate java types from WSDL with WSDLToJava?  
The point is, i am manually annotating my domain classes with JAXB  
stuff and i have also JPA annotations in there. When i call  
WSDLToJava, i want that it generates all the needed stub code and  
client code and stuff but not the types because overwriting my domain  
classes would result in losing my JPA annotations.

Any ideas? Thanks.

--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org




Re: http-conf:conduit problem [Virus checked]

Posted by Daniel Kulp <dk...@apache.org>.
This should all be fixed with 2.1.2 (hoping to do release builds today).   
We've removed most of the @Resource annotations that really aren't needed.

Dan


On Monday 11 August 2008 5:47:52 am jan.minaroviech@external.t-mobile.at 
wrote:
> Thanks Ian, going to try. My workaround was to call after startup, before
> creating first client:
>
>  org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
> c =
> ((org.springframework.context.annotation.CommonAnnotationBeanPostProcessor)
> applicationContext.getBean(
> "org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"
> ));
>         c.ignoreResourceType("org.apache.cxf.transport.http.HTTPConduit");
>         c.ignoreResourceType(
> "org.apache.cxf.configuration.security.AuthorizationPolicy");
>         c.ignoreResourceType(
> "org.apache.cxf.transports.http.configuration.HTTPClientPolicy");
>         c.ignoreResourceType(
> "org.apache.cxf.configuration.security.ProxyAuthorizationPolicy");
>         c.ignoreResourceType(
> "org.apache.cxf.configuration.jsse.TLSClientParameters");
>         c.ignoreResourceType(
> "org.apache.cxf.transport.http.MessageTrustDecider");
>         c.ignoreResourceType(
> "org.apache.cxf.transport.http.HttpBasicAuthSupplier");
>
> best regards
> jano
>
>
>
>
> Ian Roberts <i....@dcs.shef.ac.uk>
> 08/08/2008 14:24
> Bitte antworten an
> users@cxf.apache.org
>
>
> An
> users@cxf.apache.org
> Kopie
>
> Thema
> Re: http-conf:conduit problem -  [Virus checked]
>
> jan.minaroviech@external.t-mobile.at wrote:
> > how can i modify this code to disable http chunking if required?
>
> After the "T port = (T) factory.create();", you can do
>
>        Client client = ClientProxy.getClient(port);
>        Conduit conduit = client.getConduit();
>        if(conduit instanceof HTTPConduit) {
>          HTTPClientPolicy policy = ((HTTPConduit)conduit).getClient();
>          if(policy == null) {
>            policy = new HTTPClientPolicy();
>            ((HTTPConduit)conduit).setClient(policy);
>          }
>
>          // disable chunking
>          policy.setAllowChunking(false);
>        }
>
> Ian



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: http-conf:conduit problem [Virus checked]

Posted by ja...@external.t-mobile.at.
Thanks Ian, going to try. My workaround was to call after startup, before 
creating first client:

 org.springframework.context.annotation.CommonAnnotationBeanPostProcessor 
c = 
((org.springframework.context.annotation.CommonAnnotationBeanPostProcessor)
applicationContext.getBean(
"org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"
));
        c.ignoreResourceType("org.apache.cxf.transport.http.HTTPConduit");
        c.ignoreResourceType(
"org.apache.cxf.configuration.security.AuthorizationPolicy");
        c.ignoreResourceType(
"org.apache.cxf.transports.http.configuration.HTTPClientPolicy");
        c.ignoreResourceType(
"org.apache.cxf.configuration.security.ProxyAuthorizationPolicy");
        c.ignoreResourceType(
"org.apache.cxf.configuration.jsse.TLSClientParameters");
        c.ignoreResourceType(
"org.apache.cxf.transport.http.MessageTrustDecider");
        c.ignoreResourceType(
"org.apache.cxf.transport.http.HttpBasicAuthSupplier");
 
best regards
jano




Ian Roberts <i....@dcs.shef.ac.uk> 
08/08/2008 14:24
Bitte antworten an
users@cxf.apache.org


An
users@cxf.apache.org
Kopie

Thema
Re: http-conf:conduit problem -  [Virus checked]






jan.minaroviech@external.t-mobile.at wrote:

> how can i modify this code to disable http chunking if required?

After the "T port = (T) factory.create();", you can do

       Client client = ClientProxy.getClient(port);
       Conduit conduit = client.getConduit();
       if(conduit instanceof HTTPConduit) {
         HTTPClientPolicy policy = ((HTTPConduit)conduit).getClient();
         if(policy == null) {
           policy = new HTTPClientPolicy();
           ((HTTPConduit)conduit).setClient(policy);
         }

         // disable chunking
         policy.setAllowChunking(false);
       }

Ian

-- 
Ian Roberts               | Department of Computer Science
i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK




Re: http-conf:conduit problem - [Virus checked]

Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
jan.minaroviech@external.t-mobile.at wrote:

> how can i modify this code to disable http chunking if required?

After the "T port = (T) factory.create();", you can do

       Client client = ClientProxy.getClient(port);
       Conduit conduit = client.getConduit();
       if(conduit instanceof HTTPConduit) {
         HTTPClientPolicy policy = ((HTTPConduit)conduit).getClient();
         if(policy == null) {
           policy = new HTTPClientPolicy();
           ((HTTPConduit)conduit).setClient(policy);
         }

         // disable chunking
         policy.setAllowChunking(false);
       }

Ian

-- 
Ian Roberts               | Department of Computer Science
i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK