2 Replies Latest reply on Feb 23, 2009 4:02 AM by Alessio Soldano

    Anybody have a good classpath for running clients against jb

    Bryan Kearney Newbie

      Anyone have a functioning classpath for jboss5 cxf clients? I am attempting to use this:

      #!/bin/bash
      JBOSS_HOME="/home/bkearney/jboss5"
      JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed"
      
      CLASSPATH="./target/testclient-0.0.1-SNAPSHOT.jar"
      #CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/saaj-api.jar"
      #CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/saaj-impl.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-core.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-api.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-transports-http.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-transports-http-jetty.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-frontend-jaxws.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-ws-policy.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-ws-rm.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jbossws-cxf-client.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-common-utilities.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/spring-beans.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/spring-core.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/spring-context.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/FastInfoset.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/commons-logging.jar"
      #CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jbossws-spi-jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/log4j.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jboss-log4j.jar"
      CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/concurrent.jar"
      
      echo $CLASSPATH
      java -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" -classpath $CLASSPATH com.redhat.bk.client.CXFClient
      


      If the ENDORSED directory is not set, I get a wierd error which I think is related to saaj.

      Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
       at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:105)
       at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:74)
       at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2127)
       at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(ElementImpl.java:656)
       at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(SAX2DOM.java:194)
       at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.java:204)
       at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.characters(ToXMLSAXHandler.java:524)
       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.characters(AbstractSAXParser.java:538)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:463)
       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
       at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
       at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:637)
       at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
       ... 18 more
      [bkearney@localhost testclient]$
      
      


      If I set it, I get:

      Exception in thread "main" javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
       at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
       at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
       at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
       at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
       at org.apache.cxf.staxutils.StaxUtils.<clinit>(StaxUtils.java:66)
       at org.apache.cxf.bus.spring.TunedDocumentLoader.loadFastinfosetDocument(TunedDocumentLoader.java:141)
       at org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinit
      


        • 1. Re: Anybody have a good classpath for running clients agains
          Bryan Kearney Newbie

          To test a simple client with Reliable messaging I ended up with the following script. As part of the next release is there any equivilant of wsrunclient.sh from native planned?

          #!/bin/bash
          JBOSS_HOME="/home/bkearney/jboss5"
          JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed"
          
          CLASSPATH="./target/testclient-0.0.1-SNAPSHOT.jar"
          # CXF Jars
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-api.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-common-utilities.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-bindings-soap.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-core.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-databinding-jaxb.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-frontend-jaxws.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-frontend-simple.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-management.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-transports-http.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-transports-http-jetty.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-ws-addr.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-ws-policy.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-rt-ws-rm.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/cxf-tools-common.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/neethi.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jbossws-cxf-client.jar"
          
          #Spring Jars
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/spring-context.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/spring-core.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/spring-beans.jar"
          
          # JBOSS Jars
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/concurrent.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/commons-logging.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/FastInfoset.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/log4j.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jboss-log4j.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/jboss-xml-binding.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/wsdl4j.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/wstx.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/xml-resolver.jar"
          CLASSPATH="$CLASSPATH:$JBOSS_HOME/client/XmlSchema.jar"
          
          echo $CLASSPATH
          java -classpath $CLASSPATH com.redhat.bk.client.CXFClient
          #java -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" -classpath $CLASSPATH com.redhat.bk.client.CXFClient
          


          • 2. Re: Anybody have a good classpath for running clients agains
            Alessio Soldano Master

            Hi Bryan,
            this is currently scheduled for JBossWS-CXF 3.1.1, see https://jira.jboss.org/jira/browse/JBWS-2151.
            In the mean time, the script you proposed last is not bad, perhaps we just need to test it with many clients.
            In case you need it, a good starting point for the CXF / JBossWS-CXF jars to be added to the classpath with the current trunk (soon version 3.1.0), is the following:

            jbossws.cxf.classpath=${jboss.client.dir}/commons-collections.jar:${jboss.client.dir}/commons-lang.jar:${jboss.client.dir}/cxf-anttasks.jar:${jboss.client.dir}/cxf-api.jar:${jboss.client.dir}/cxf-common-schemas.jar:${jboss.client.dir}/cxf-common-utilities.jar:${jboss.client.dir}/cxf-rt-bindings-coloc.jar:${jboss.client.dir}/cxf-rt-javascript.jar:${jboss.client.dir}/cxf-rt-bindings-corba.jar:${jboss.client.dir}/cxf-rt-bindings-http.jar:${jboss.client.dir}/cxf-rt-bindings-object.jar:${jboss.client.dir}/cxf-rt-bindings-soap.jar:${jboss.client.dir}/cxf-rt-bindings-xml.jar:${jboss.client.dir}/cxf-rt-core.jar:${jboss.client.dir}/cxf-rt-databinding-jaxb.jar:${jboss.client.dir}/cxf-rt-frontend-jaxws.jar:${jboss.client.dir}/cxf-rt-frontend-jaxrs.jar:${jboss.client.dir}/cxf-rt-frontend-simple.jar:${jboss.client.dir}/cxf-rt-management.jar:${jboss.client.dir}/cxf-rt-transports-http.jar:${jboss.client.dir}/cxf-rt-transports-http-jetty.jar:${jboss.client.dir}/cxf-rt-transports-jms.jar:${jboss.client.dir}/cxf-rt-transports-local.jar:${jboss.client.dir}/cxf-rt-ws-addr.jar:${jboss.client.dir}/cxf-rt-ws-policy.jar:${jboss.client.dir}/cxf-rt-ws-rm.jar:${jboss.client.dir}/cxf-rt-ws-security.jar:${jboss.client.dir}/cxf-tools-common.jar:${jboss.client.dir}/cxf-tools-java2ws.jar:${jboss.client.dir}/cxf-tools-validator.jar:${jboss.client.dir}/cxf-tools-wsdlto-core.jar:${jboss.client.dir}/cxf-tools-wsdlto-databinding-jaxb.jar:${jboss.client.dir}/cxf-tools-wsdlto-frontend-jaxws.jar:${jboss.client.dir}/FastInfoset.jar:${jboss.client.dir}/geronimo-javamail_1.4_spec.jar:${jboss.client.dir}/geronimo-ws-metadata_2.0_spec.jar:${jboss.client.dir}/jaxws-api.jar:${jboss.client.dir}/jbossws-cxf-client.jar:${jboss.client.dir}/jbossws-jboss500.jar:${jboss.client.dir}/neethi.jar:${jboss.client.dir}/saaj-api.jar:${jboss.client.dir}/saaj-impl.jar:${jboss.client.dir}/spring-beans.jar:${jboss.client.dir}/spring-context.jar:${jboss.client.dir}/spring-core.jar:${jboss.client.dir}/wsdl4j.jar:${jboss.client.dir}/wss4j.jar:${jboss.client.dir}/xml-resolver.jar:${jboss.client.dir}/XmlSchema.jar:${jboss.client.dir}/velocity.jar: