You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ucrkarthik <uc...@hotmail.com> on 2012/12/03 18:46:45 UTC

Re: Making Camel based middle layer available even when services are not

Hi Williem,

I have the following code cxf-endpoint defined and I get the same error. 
    <cxf:cxfEndpoint xmlns:s="http://test.com/fileExchange/query/v1"
                     address="http://localhost:1234/fileExchange/query"
                     endpointName="s:FileExchangeBinding"
                     id="SomeIdCxf"
                     serviceName="s:FileExchange"
                    
wsdlURL="classpath:export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl"
                    
serviceClass="com.test.services.repository.fileExchange.FileExchangeService">
    </cxf:cxfEndpoint>

I would like to avoid storing the WSDL in my local directory. I would rather
have it reference the wsdl from the bundle jar that's deployed. 

Here is the error that I get when I deploy the jar(bundle), which is very
similar to the same error:
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
Problem parsing
'classpath:export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl'.:
java.net.MalformedURLException: Unknown protocol: classpath
        at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:244)
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
        ... 33 more

Thanks,
Karthik




--
View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723555.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Making Camel based middle layer available even when services are not

Posted by ucrkarthik <uc...@hotmail.com>.
> How did you store the xsd file? Did you put it into the application
> bundle?
Yes, the xsd is stored in the bundle. For example:
BundleA.jar: 
/export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl 
/export/wsdl-data-exchanges/wsdl/FileExchange.xsd 
/META-INF/MANIFEST.MF 

I will start researching the jax-ws-catalog.xml file for mapping the xsd
into the classpath. 

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723872.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Making Camel based middle layer available even when services are not

Posted by Willem jiang <wi...@gmail.com>.
Hi,
How did you store the xsd file?
Did you put it into the application bundle?
You may consider to setup the jax-ws-catalog.xml file to mapping the xsd into the class path you have.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, December 11, 2012 at 4:54 AM, ucrkarthik wrote:

> I would like to first thank everyone for your help. This has been very
> helpful.  
>  
> Once I installed org.ops4j.pax.url.classpath bundle in ServiceMix I was able
> to get past the last error but now I get another error.
>  
> I reference a XSD in the WSDL as follows:
> <wsdl:types>
> <xsd:schema
> targetNamespace="http://someHose/fileExchange/query/types/v1">
> <xsd:include schemaLocation="FileExchangeTypes.xsd"/>
> </xsd:schema>
> </wsdl:types>
>  
> It seems that it does not like the value that I put in for the
> schemaLocation(above).  
>  
> Here is the error that I get:
> Caused by: javax.wsdl.WSDLException: WSDLException (at
> /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem
> parsing 'FileExchangeTypes.xsd'.: java.io.FileNotFoundException:
> C:\apache-servicemix-4.4.0\FileExchangeTypes.xsd (The system cannot find the
> file spec
> ified)
> at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:244)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
> at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
> ... 33 more
> Caused by: java.io.FileNotFoundException:
> C:\apache-servicemix-4.4.0\FileExchangeTypes.xsd (The system cannot find the
> file specified)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:120)
> at java.io.FileInputStream.<init>(FileInputStream.java:79)
> at
> sun.net.www.protocol.file.FileURLConnection.connect (http://www.protocol.file.FileURLConnection.connect)(FileURLConnection.java:70)
> at
> sun.net.www.protocol.file.FileURLConnection.getInputStream (http://www.protocol.file.FileURLConnection.getInputStream)(FileURLConnection.java:161)
> at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
> at
> org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(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.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
> ... 46 more
>  
> Thanks
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723858.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Making Camel based middle layer available even when services are not

Posted by ucrkarthik <uc...@hotmail.com>.
I would like to first thank everyone for your help. This has been very
helpful. 

Once I installed org.ops4j.pax.url.classpath bundle in ServiceMix I was able
to get past the last error but now I get another error.

I reference a XSD in the WSDL as follows:
    <wsdl:types>
        <xsd:schema
targetNamespace="http://someHose/fileExchange/query/types/v1">
            <xsd:include schemaLocation="FileExchangeTypes.xsd"/>
        </xsd:schema>
    </wsdl:types>

It seems that it does not like the value that I put in for the
schemaLocation(above). 

Here is the error that I get:
Caused by: javax.wsdl.WSDLException: WSDLException (at
/wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem
parsing 'FileExchangeTypes.xsd'.: java.io.FileNotFoundException:
C:\apache-servicemix-4.4.0\FileExchangeTypes.xsd (The system cannot find the
file spec
ified)
        at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:244)
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
        ... 33 more
Caused by: java.io.FileNotFoundException:
C:\apache-servicemix-4.4.0\FileExchangeTypes.xsd (The system cannot find the
file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:120)
        at java.io.FileInputStream.<init>(FileInputStream.java:79)
        at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
        at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
        at
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(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.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        ... 46 more

Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723858.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Making Camel based middle layer available even when services are not

Posted by Christian Müller <ch...@gmail.com>.
In this case, option 2. And make sure Bundle A export this package.

Best,
Christian

Sent from a mobile device
Am 07.12.2012 07:49 schrieb "ucrkarthik" <uc...@hotmail.com>:

> Yes that is correct.
>
> I am looking at the contents of the "Bundle A" jar file and it has the
> following structure:
>
> BundleA.jar:
> /export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl
> /export/wsdl-data-exchanges/wsdl/FileExchange.xsd
> /META-INF/MANIFEST.MF
>
> Do I still use:
> Option1: wsdlURL="META-INF/wsdl/interfaceName/FileExchangeService.wsdl".
>
> or
>
> Option 2:
> wsdlURL="export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl".
>
> Thanks,
> Karthik
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723721.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Making Camel based middle layer available even when services are not

Posted by ucrkarthik <uc...@hotmail.com>.
Yes that is correct.

I am looking at the contents of the "Bundle A" jar file and it has the
following structure:

BundleA.jar:
/export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl
/export/wsdl-data-exchanges/wsdl/FileExchange.xsd
/META-INF/MANIFEST.MF

Do I still use:
Option1: wsdlURL="META-INF/wsdl/interfaceName/FileExchangeService.wsdl". 

or

Option 2:
wsdlURL="export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl".

Thanks,
Karthik 

 



--
View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723721.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Making Camel based middle layer available even when services are not

Posted by Christian Müller <ch...@gmail.com>.
If I understand right, than bundle A will contain the WSDL file and the
generated classes. Bundle B contains your Camel route where you refer to
the WSDL file, right?
If this is the case (it works for me), make sure you also export the
package where your WSDL file is located (e.g. META-INF.wsdl.interfaceName).
And refer to the WSDL like
wsdlURL="META-INF/wsdl/interfaceName/FileExchangeService.wsdl".

Best,
Christian

On Mon, Dec 3, 2012 at 6:46 PM, ucrkarthik <uc...@hotmail.com> wrote:

> reference

Re: Making Camel based middle layer available even when services are not

Posted by Aki Yoshida <el...@gmail.com>.
yes in that case, you need to deploy the url-classpath  handler one.
Since you have already the url-mvn handler already deployed, you can just invoke

 install mvn:org.ops4j.pax.url/pax-url-classpath/1.3.5

(I used version 1.3.5 as an example, but you can use the same version
as your other pax's version).
regards, aki

2012/12/6 ucrkarthik <uc...@hotmail.com>:
> I have the following bundles installed:
>
> OPS4J Pax Url - mvn:org.ops4j.pax.url.mvn; singleton:=true
> OPS4J Pax Url - warorg.ops4j.pax.url.war; singleton:=true
> OPS4J Pax Url - wrap:org.ops4j.pax.url.wrap; singleton:=true
>
> Is that enfough? or do I have to install the pax-url-classpath bundle?
>
> Thansk
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723710.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Making Camel based middle layer available even when services are not

Posted by ucrkarthik <uc...@hotmail.com>.
I have the following bundles installed:
 
OPS4J Pax Url - mvn:org.ops4j.pax.url.mvn; singleton:=true
OPS4J Pax Url - warorg.ops4j.pax.url.war; singleton:=true
OPS4J Pax Url - wrap:org.ops4j.pax.url.wrap; singleton:=true

Is that enfough? or do I have to install the pax-url-classpath bundle?

Thansk



--
View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723710.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Making Camel based middle layer available even when services are not

Posted by Aki Yoshida <el...@gmail.com>.
are you using blueprint?
in that case, you need the pax-url-classpath bundle.
org.ops4j.pax.url/pax-url-classpath

regards, aki


2012/12/3 ucrkarthik <uc...@hotmail.com>:
> Hi Williem,
>
> I have the following code cxf-endpoint defined and I get the same error.
>     <cxf:cxfEndpoint xmlns:s="http://test.com/fileExchange/query/v1"
>                      address="http://localhost:1234/fileExchange/query"
>                      endpointName="s:FileExchangeBinding"
>                      id="SomeIdCxf"
>                      serviceName="s:FileExchange"
>
> wsdlURL="classpath:export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl"
>
> serviceClass="com.test.services.repository.fileExchange.FileExchangeService">
>     </cxf:cxfEndpoint>
>
> I would like to avoid storing the WSDL in my local directory. I would rather
> have it reference the wsdl from the bundle jar that's deployed.
>
> Here is the error that I get when I deploy the jar(bundle), which is very
> similar to the same error:
> Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> Problem parsing
> 'classpath:export/wsdl-data-exchanges/wsdl/FileExchangeService.wsdl'.:
> java.net.MalformedURLException: Unknown protocol: classpath
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:244)
>         at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
>         at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
>         ... 33 more
>
> Thanks,
> Karthik
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905p5723555.html
> Sent from the Camel - Users mailing list archive at Nabble.com.