Thank you very much that solved all my problems about the http bc. Now it
also works if I take the <http:provider endpoint. My Http Server was sending
the status 20??! I corrected this.

So I think the http:provider component should display a other message than 
java.lang.IllegalStateException.



gnodet wrote:
> 
> The http endpoint will generate a fault if the HTTP status is
> different from 200 or 202.
> 
> On Thu, Jul 31, 2008 at 12:31 PM, gigeril <[EMAIL PROTECTED]> wrote:
>>
>> No it doesn't send back an http error. It sends back an message ("<KA/>")
>> which is the same content as in the fault message that is send by the
>> http
>> provider .
>>
>>
>> gnodet wrote:
>>>
>>> If an HTTP error status is sent back by the http server, a fault will
>>> be generated.
>>> I guess your server is sending back a 4xx or 5xx http status.
>>>
>>> On Thu, Jul 31, 2008 at 10:56 AM, gigeril <[EMAIL PROTECTED]>
>>> wrote:
>>>>
>>>> Yeah thank you that solved the problem!
>>>> But no I've another Problem:
>>>> In my TCP consumer bc I do a sendsync to the http provider. The http
>>>> provider endpoint get the message and contact the http server, wich
>>>> returns
>>>> a message. Then the http provider doesn't send me the response back. It
>>>> sends only a fault, but in this fault there is the right message from
>>>> the
>>>> server. Why is it doing that??
>>>>
>>>> Here is the debug output of the smx console window
>>>>
>>>> DEBUG - DeliveryChannelImpl            - SendSync
>>>> ID:10.22.20.113-11b784b1162-3:0 in DeliveryChannel{tcp-bc}
>>>> DEBUG - SecuredBroker                  - send exchange with secure
>>>> broker
>>>> DEBUG - SecuredBroker                  - service name
>>>> :{http://knapp.com/tcphttp}http_provider
>>>> DEBUG - SecuredBroker                  - operation name :null
>>>> DEBUG - SedaFlow                       - Called Flow send
>>>> DEBUG - DeliveryChannelImpl            - Waiting for exchange
>>>> ID:10.22.20.113-11b784b1162-3:0 (187b5ff) to be answered i
>>>> n DeliveryChannel{tcp-bc} from sendSync
>>>> DEBUG - SedaQueue                      -
>>>> [EMAIL PROTECTED] dequeued
>>>> exchange: I
>>>> nOut[
>>>>  id: ID:10.22.20.113-11b784b1162-3:0
>>>>  status: Active
>>>>  role: provider
>>>>  service: {http://knapp.com/tcphttp}http_provider
>>>>  endpoint: httpprovider
>>>>  in: <?xml version="1.0" encoding="UTF-8"?><message>hallo</message>
>>>> ]
>>>> DEBUG - HttpComponent                  - Received exchange: status:
>>>> Active,
>>>> role: provider
>>>> DEBUG - HttpComponent                  - Retrieved correlation id:
>>>> ID:10.22.20.113-11b784b1162-3:0
>>>> DEBUG - DeliveryChannelImpl            - Send
>>>> ID:10.22.20.113-11b784b1162-3:0 in DeliveryChannel{servicemix-http}
>>>> DEBUG - SecuredBroker                  - send exchange with secure
>>>> broker
>>>> DEBUG - SedaFlow                       - Called Flow send
>>>> DEBUG - SedaQueue                      -
>>>> [EMAIL PROTECTED] dequeued
>>>> exchange:
>>>> InOut[
>>>>  id: ID:10.22.20.113-11b784b1162-3:0
>>>>  status: Active
>>>>  role: consumer
>>>>  service: {http://knapp.com/tcphttp}http_provider
>>>>  endpoint: httpprovider
>>>>  in: <?xml version="1.0" encoding="UTF-8"?><message>hallo</message>
>>>>  fault: <?xml version="1.0" encoding="UTF-8"?><KA/> --> this is the
>>>> right
>>>> message from my http server!!!
>>>> ]
>>>> DEBUG - DeliveryChannelImpl            - Notifying exchange
>>>> ID:10.22.20.113-11b784b1162-3:0(187b5ff) in DeliveryChannel{
>>>> tcp-bc} from processInboundSynchronousExchange
>>>> DEBUG - DeliveryChannelImpl            - Notified:
>>>> ID:10.22.20.113-11b784b1162-3:0(187b5ff) in DeliveryChannel{tcp-bc}
>>>> from
>>>> sendSync
>>>>
>>>>
>>>>
>>>> Here is my tcp binding component consumer (snippet):
>>>>
>>>>
>>>> public void doCommunication(Socket s )
>>>>        {
>>>>
>>>>                //The Socket s is the connected client where I read from
>>>> (this method gets
>>>> called after the tcpserver.accept() method)
>>>>                 try
>>>>                {
>>>>
>>>>                        InputStream is = s.getInputStream();
>>>>                        InputStreamReader isr = new
>>>> InputStreamReader(is);
>>>>                        BufferedReader br = new BufferedReader(isr);
>>>>                        String anfrage = "", zeile = null;
>>>>                        do
>>>>                        {
>>>>                                zeile = br.readLine();
>>>>                                if (zeile != null)
>>>>                                        anfrage = anfrage + zeile;
>>>>
>>>>                        } while (zeile != null);
>>>>
>>>>                        MessageExchange me =
>>>> this.getChannel().createExchangeFactoryForService(this.getTargetService()).createExchange(this.getDefaultMep());
>>>>                        NormalizedMessage nm =me.createMessage();
>>>>                        nm.setContent(new StringSource(anfrage));
>>>>                        me.setMessage(nm, "in");
>>>>                        if (me instanceof InOut)
>>>>                        {
>>>>                                this.sendSync(me);
>>>>                                NormalizedMessage nmin =
>>>> me.getMessage("out");  // me.getMessage("out)
>>>> --> returns null!"
>>>>                                StringSource ss =
>>>> (StringSource)nmin.getContent();
>>>>                                OutputStream os = s.getOutputStream();
>>>>                                OutputStreamWriter osw = new
>>>> OutputStreamWriter(os);
>>>>                                BufferedWriter bw = new
>>>> BufferedWriter(osw);
>>>>                                bw.write(ss.getText());
>>>>                                bw.flush();
>>>>                                bw.close();
>>>>                                os.close();
>>>>                                s.shutdownOutput();
>>>>
>>>>                        }
>>>>
>>>>
>>>>
>>>>
>>>> gnodet wrote:
>>>>>
>>>>> I think the reason for this stack trace is that you did not put any
>>>>> namespace for your service name.  The service attribute is a QName, so
>>>>> you need to try something like:
>>>>>
>>>>> <beans xmlns:http="http://servicemix.apache.org/http/1.0";
>>>>> xmlns:tns="htp://foo.com/bar">
>>>>>  <http:endpoint service="tns:http_provider"
>>>>>                 endpoint="httpprovider"
>>>>>                                 role="provider"
>>>>>                                 locationURI="http://localhost:8888/";
>>>>>   />
>>>>> </beans>
>>>>>
>>>>>
>>>>> On Wed, Jul 30, 2008 at 8:54 AM, gigeril <[EMAIL PROTECTED]>
>>>>> wrote:
>>>>>>
>>>>>> Hi I am trying to get a TCP - Http Connection to work. I've written
>>>>>> my
>>>>>> own
>>>>>> TCP Binding Component wich works fine if I use both the consumer and
>>>>>> the
>>>>>> producer of it.
>>>>>> But if I try to get a tcp consumer and a http provider to run I get
>>>>>> the
>>>>>> following Exception.
>>>>>> This Exception happens when the HTTP Server returns the response to
>>>>>> the
>>>>>> jetty client (http-bc provider). I see this as the http Server get
>>>>>> the
>>>>>> correct Message that I send with my tcp client.
>>>>>>
>>>>>> Exception in thread "HttpClient-1" java.lang.IllegalStateException
>>>>>>        at
>>>>>> org.mortbay.jetty.client.HttpConnection$Handler.startRequest(HttpConnection.java:375)
>>>>>>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:370)
>>>>>>        at
>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
>>>>>>        at
>>>>>> org.mortbay.jetty.client.HttpConnection.handle(HttpConnection.java:236)
>>>>>>        at
>>>>>> org.mortbay.jetty.client.HttpClient$SocketConnector$1.run(HttpClient.java:320)
>>>>>>        at
>>>>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
>>>>>>
>>>>>> This error is displayed if the xbean.xml of the http_provider-su
>>>>>> looks
>>>>>> like
>>>>>> this:
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>
>>>>>> <beans xmlns:http="http://servicemix.apache.org/http/1.0";>
>>>>>>  <http:provider service="http_provider"
>>>>>>                 endpoint="httpprovider"
>>>>>>                 locationURI="http://localhost:8888/";
>>>>>>   />
>>>>>> </beans>
>>>>>>
>>>>>> This is also the error that I get If I am trying to run a http
>>>>>> consumer
>>>>>> and
>>>>>> a http provider. So I think my tcp bc is implemented correctly.
>>>>>>
>>>>>>
>>>>>> Then I tried to use the http bc with this xbean.xml
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>
>>>>>> <beans xmlns:http="http://servicemix.apache.org/http/1.0";>
>>>>>>  <http:endpoint service="http_provider"
>>>>>>                 endpoint="httpprovider"
>>>>>>                                 role="provider"
>>>>>>                                 locationURI="http://localhost:8888/";
>>>>>>   />
>>>>>> </beans>
>>>>>>
>>>>>> There I get this stacktrace right after deploying it to Servicemix.
>>>>>>
>>>>>> java.lang.RuntimeException: org.xml.sax.SAXParseException: The value
>>>>>> of
>>>>>> the
>>>>>> attribute "prefix="xmlns",localpart="ns1",ra
>>>>>> wname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be
>>>>>> empty.
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.deployment.DescriptorFactory.buildDescriptor(DescriptorFactory.java:141)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.deployment.DescriptorFactory.buildDescriptor(DescriptorFactory.java:80)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.<init>(ServiceUnitLifeCycle.java:67)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.Registry.registerServiceUnit(Registry.java:746)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:518)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:35
>>>>>> 0)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:253)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExternalArchive(AutoDeploymentService.java:20
>>>>>> 1)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchive(JBIContainer.java:476)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchive(JBIContainer.java:486)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.framework.AdminCommandsService.deployServiceAssembly(AdminCommandsService.java:209)
>>>>>>
>>>>>>        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.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseStandardMBean.java:323)
>>>>>>        at
>>>>>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
>>>>>>        at
>>>>>> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
>>>>>>        at
>>>>>> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
>>>>>>        at
>>>>>> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
>>>>>>        at
>>>>>> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
>>>>>>        at java.security.AccessController.doPrivileged(Native Method)
>>>>>>        at
>>>>>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1366)
>>>>>>        at
>>>>>> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
>>>>>>        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
>>>>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
>>>>>>        at sun.rmi.transport.Transport$1.run(Transport.java:159)
>>>>>>        at java.security.AccessController.doPrivileged(Native Method)
>>>>>>        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>>>>>>        at
>>>>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>>>>>>        at
>>>>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>>>>>>        at
>>>>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>>>>>>        at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>        at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>        at java.lang.Thread.run(Thread.java:619)
>>>>>> Caused by: org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"
>>>>>> " is invalid. Prefixed namespace bindings may not be empty.
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
>>>>>> 195)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(XMLNSDocumentScannerImpl.java:
>>>>>> 526)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.ja
>>>>>> va:277)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocument
>>>>>> FragmentScannerImpl.java:2740)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScanne
>>>>>> rImpl.java:508)
>>>>>>        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.jaxp.validation.StreamValidatorHelper.validate(StreamValidatorHelper.java:
>>>>>> 144)
>>>>>>        at
>>>>>> com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:107)
>>>>>>        at javax.xml.validation.Validator.validate(Validator.java:127)
>>>>>>        at
>>>>>> org.apache.servicemix.jbi.deployment.DescriptorFactory.buildDescriptor(DescriptorFactory.java:115)
>>>>>>        ... 38 more
>>>>>>
>>>>>>
>>>>>> Note: I haven't changed any other file after changing the xbean.xml
>>>>>> of
>>>>>> the
>>>>>> http provider.
>>>>>>
>>>>>> So it seems that a namespace with the prefix ns1 isn't correctly
>>>>>> specified
>>>>>> but I didn't specify this namespace and i don't know where it comes
>>>>>> from.
>>>>>>
>>>>>> I've already searched for this error and I found that you wrote that
>>>>>> I
>>>>>> should dissable the jbi generation for the http provider su. I tried
>>>>>> but
>>>>>> it
>>>>>> doesn'T work as I think the jbi.xml is needed for an su to get
>>>>>> deployed
>>>>>> correctly.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/http-endpoint-does-not-work-%28neither-%3Chttp%3Aendpoint....-nor-%3Chttp%3Aprovider%3E-tp18727143p18727143.html
>>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> Guillaume Nodet
>>>>> ------------------------
>>>>> Blog: http://gnodet.blogspot.com/
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/http-endpoint-does-not-work-%28neither-%3Chttp%3Aendpoint....-nor-%3Chttp%3Aprovider%3E-tp18727143p18750361.html
>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/http-endpoint-does-not-work-%28neither-%3Chttp%3Aendpoint....-nor-%3Chttp%3Aprovider%3E-tp18727143p18751726.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/http-endpoint-does-not-work-%28neither-%3Chttp%3Aendpoint....-nor-%3Chttp%3Aprovider%3E-tp18727143p18753141.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to