You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by James Bradt <gm...@xoxy.net> on 2006/08/18 03:06:13 UTC
testing problem
Hello all again,
I am encountering some strange behavior and I am not sure how to correct the
issue.
I am attempting to perform some integration testing and the test is hanging
within an http-soap call. The program, however, has no problem getting the
wsdl right before this (see the GetMethod below)
If I create a complete service-assembly and deploy it to a servicemix
installation, the call works without a problem.
While debugging I can tell that the simpleService gets called and returns
properly. It appears that, later on, the servlet is not returning the
response to the httpClient.
Am I missing some configuration for Jetty?
Any help will be greatly appreciated.
Thanks,
James
================================
the junit test is:
public class WeirdTest extends TestCase {
private String getServiceUnitPath(String name) {
URL url = getClass().getClassLoader().getResource(name);
File path = new File(url.getFile());
path = path.getParentFile();
return path.getAbsolutePath();
}
public void testMe() throws Exception {
JBIContainer container = new JBIContainer();
container.setUseMBeanServer(false);
container.setCreateMBeanServer(false);
container.setNamingContext(new InitialContext());
container.setMonitorInstallationDirectory(false);
container.setEmbedded(true);
container.setFlowName("st");
container.init();
container.start();
Jsr181Component component = new Jsr181Component();
HttpComponent hComponent = new HttpComponent();
container.activateComponent(component, "JSR181Component");
container.activateComponent(hComponent, "HttpComponent");
component.getServiceUnitManager().deploy("engine-su",
getServiceUnitPath("engine-su/xbean.xml"));
component.getServiceUnitManager().init("engine-su",
getServiceUnitPath("engine-su/xbean.xml"));
component.getServiceUnitManager().start("engine-su");
hComponent.getServiceUnitManager().deploy("binding-su",
getServiceUnitPath("binding-su/xbean.xml"));
hComponent.getServiceUnitManager().init("binding-su",
getServiceUnitPath("binding-su/xbean.xml"));
hComponent.getServiceUnitManager().start("binding-su");
GetMethod get = new GetMethod("http://localhost:8193/Service/?wsdl");
// vvvvvvvvvvvvv THIS WORKS vvvvvvvvvvvvv
int state = new HttpClient().executeMethod(get);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
assertEquals(HttpServletResponse.SC_OK, state);
String response = get.getResponseBodyAsString();
System.out.println(response);
InputStream in = getClass().getResourceAsStream("/ping-request.xml");
InputStreamRequestEntity is = new InputStreamRequestEntity(in);
PostMethod method = new PostMethod("http://localhost:8193/Service/");
method.setRequestEntity(is);
HttpClient hc = new HttpClient();
// vvvvvvvvvvvvv HANGS HERE vvvvvvvvvvvvv
int status = hc.executeMethod(method);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
assertEquals(200, status);
response = method.getResponseBodyAsString();
System.out.println(response);
hComponent.getServiceUnitManager().stop("binding-su");
hComponent.getServiceUnitManager().shutDown("binding-su");
hComponent.getServiceUnitManager().undeploy("binding-su",
getServiceUnitPath("binding-su/xbean.xml"));
component.getServiceUnitManager().stop("engine-su");
component.getServiceUnitManager().shutDown("engine-su");
component.getServiceUnitManager().undeploy("engine-su",
getServiceUnitPath("engine-su/xbean.xml"));
}
}
=======================
The xbean.xml for the binding is
<?xml version="1.0"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:demo="urn:servicemix:soap-binding">
<http:endpoint service="demo:simple-http-service"
endpoint="simple-http-service-endpoint" role="consumer"
targetService="demo:simple-JSR-service"
targetEndpoint="simple-JSR-service-endpoint"
locationURI="http://localhost:8193/Service/"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out" soap="true" />
</beans>
and the xbean.xml for the SE is
<?xml version="1.0"?>
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
xmlns:demo="urn:servicemix:soap-binding">
<classpath>
<location>.</location>
</classpath>
<jsr181:endpoint pojoClass="soap.SimpleService" annotations="none"
typeMapping="xmlbeans" service="demo:simple-JSR-service"
endpoint="simple-JSR-service-endpoint" />
</beans>
===========================
the ping-request xml is
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:servicemix:soap-binding">
<soapenv:Body>
<urn:ping>
<urn:request>MESSAGE IN</urn:request>
</urn:ping>
</soapenv:Body>
</soapenv:Envelope>
=======================
and the soap.SimpleService class is
package soap;
public class SimpleService {
public String ping(String request) {
String response = "Ping: " + request;
System.out.println("PINGED: " + request);
return response;
}
}
Re: testing problem
Posted by James Bradt <gm...@xoxy.net>.
Thanks for the quick response,
I kicked up the logging level to debug for every thing.
No exceptions were logged.
However, I did notice that I was using "ST" for my flow name in the test
that was hanging.
I changed to "SEDA" and the test was now able to complete.
This will get me around the problem, but I am not sure why.
James
The biggest difference is that
"Guillaume Nodet" <gn...@gmail.com> wrote in
message news:b23ecedc0609010917gd8381adl704418d6afccda68@mail.gmail.com...
> The main difference could be the classpath.
> Put the log level for servicemix at debug and see if there is any
> exception
> in the log file.
>
Re: testing problem
Posted by Guillaume Nodet <gn...@gmail.com>.
The main difference could be the classpath.
Put the log level for servicemix at debug and see if there is any exception
in the log file.
On 9/1/06, James Bradt <gm...@xoxy.net> wrote:
>
> A follow-up...
>
> Just to add more confusion, if I test the configuration in embedded mode
> (by
> extending the org.apache.servicemix.tck.TestSupport class) with the
> following spring configuration file, the programs do not 'lock up'.
>
> So there appears to be something different between the 'embedded' mode and
> the 'server' mode.
>
> Any suggestions of where to look next?
>
> Thanks,
> James
>
> ---------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://xbean.org/schemas/spring/1.0"
> xmlns:demo="urn:servicemix:soap-binding"
> xmlns:sm="http://servicemix.apache.org/config/1.0"
> xmlns:http="http://servicemix.apache.org/http/1.0"
> xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
> xmlns:iconnect="http://stilesmachinery.com/iconnect/">
>
> <!-- the JBI container -->
> <sm:container id="jbi" monitorInstallationDirectory="false">
> <sm:activationSpecs>
> <sm:activationSpec>
> <sm:component>
> <jsr181:component>
> <jsr181:endpoints>
> <jsr181:endpoint
> pojoClass="soap.SimpleServiceImpl" annotations="jsr181"
> service="demo:simple-JSR-service"
> endpoint="simple-JSR-service-endpoint" />
> </jsr181:endpoints>
> </jsr181:component>
> </sm:component>
> </sm:activationSpec>
>
> <sm:activationSpec>
> <sm:component>
> <http:component>
> <http:endpoints>
> <http:endpoint
> service="demo:simple-http-service"
> endpoint="simple-http-service-endpoint" role="consumer"
> targetService="demo:simple-JSR-service"
> targetEndpoint="simple-JSR-service-endpoint"
> locationURI="http://0.0.0.0:8192/PingService/"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out" soap="true" />
> </http:endpoints>
> </http:component>
> </sm:component>
> </sm:activationSpec>
> </sm:activationSpecs>
> </sm:container>
>
> <!-- generic servicemix client -->
> <bean id="client"
> class="org.apache.servicemix.client.DefaultServiceMixClient">
> <constructor-arg ref="jbi" />
> </bean>
>
> <bean id="xFireProxy"
> class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
> <property name="lookupServiceOnStartup" value="false" />
> <property name="serviceClass"
> value="soap.SimpleService" />
> <property name="wsdlDocumentUrl"
> value="http://localhost:8192/PingService/?wsdl" />
> <property name="properties">
> <map>
> <entry key="timeout" value="100000"></entry>
> </map>
> </property>
> </bean>
>
> </beans>
>
>
>
>
--
Cheers,
Guillaume Nodet
Re: testing problem
Posted by James Bradt <gm...@xoxy.net>.
A follow-up...
Just to add more confusion, if I test the configuration in embedded mode (by
extending the org.apache.servicemix.tck.TestSupport class) with the
following spring configuration file, the programs do not 'lock up'.
So there appears to be something different between the 'embedded' mode and
the 'server' mode.
Any suggestions of where to look next?
Thanks,
James
---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
xmlns:demo="urn:servicemix:soap-binding"
xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
xmlns:iconnect="http://stilesmachinery.com/iconnect/">
<!-- the JBI container -->
<sm:container id="jbi" monitorInstallationDirectory="false">
<sm:activationSpecs>
<sm:activationSpec>
<sm:component>
<jsr181:component>
<jsr181:endpoints>
<jsr181:endpoint
pojoClass="soap.SimpleServiceImpl" annotations="jsr181"
service="demo:simple-JSR-service"
endpoint="simple-JSR-service-endpoint" />
</jsr181:endpoints>
</jsr181:component>
</sm:component>
</sm:activationSpec>
<sm:activationSpec>
<sm:component>
<http:component>
<http:endpoints>
<http:endpoint
service="demo:simple-http-service"
endpoint="simple-http-service-endpoint" role="consumer"
targetService="demo:simple-JSR-service"
targetEndpoint="simple-JSR-service-endpoint"
locationURI="http://0.0.0.0:8192/PingService/"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out" soap="true" />
</http:endpoints>
</http:component>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:container>
<!-- generic servicemix client -->
<bean id="client"
class="org.apache.servicemix.client.DefaultServiceMixClient">
<constructor-arg ref="jbi" />
</bean>
<bean id="xFireProxy"
class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
<property name="lookupServiceOnStartup" value="false" />
<property name="serviceClass"
value="soap.SimpleService" />
<property name="wsdlDocumentUrl"
value="http://localhost:8192/PingService/?wsdl" />
<property name="properties">
<map>
<entry key="timeout" value="100000"></entry>
</map>
</property>
</bean>
</beans>
Re: testing problem
Posted by James Bradt <gm...@xoxy.net>.
"Guillaume Nodet" <gn...@gmail.com> wrote in
message news:b23ecedc0608180043v1e63eb39q5471344a4d257e7b@mail.gmail.com...
> Do you any exception logged when you run this test ?
>
Here is the debug log. I didn't see anything that stood out. The only
exception is the HttpClient timing out.
I appreciate the help.
Thanks,
James
-----------------------------------------
2006-08-18 09:24:28,265 [main ] DEBUG
- enter HttpClient.executeMethod(HttpMethod)
2006-08-18 09:24:28,265 [main ] DEBUG
- enter
HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
2006-08-18 09:24:28,265 [main ] DEBUG
rector - Attempt number 1 to process request
2006-08-18 09:24:28,265 [main ] DEBUG
- enter HttpConnection.open()
2006-08-18 09:24:28,265 [main ] DEBUG
- Open connection to localhost:8192
2006-08-18 09:24:28,280 [main ] DEBUG
- enter HttpMethodBase.execute(HttpState, HttpConnection)
2006-08-18 09:24:28,280 [main ] DEBUG
- enter HttpMethodBase.writeRequest(HttpState,
HttpConnection)
2006-08-18 09:24:28,280 [main ] DEBUG
- enter HttpMethodBase.writeRequestLine(HttpState,
HttpConnection)
2006-08-18 09:24:28,280 [main ] DEBUG
- enter HttpMethodBase.generateRequestLine(HttpConnection,
String, String, String, String)
2006-08-18 09:24:28,296 [main ] DEBUG
- >> "POST /PingService/ HTTP/1.1[\r][\n]"
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.print(String)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[])
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[], int, int)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter
HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
losingMethod - enter
EntityEnclosingMethod.addRequestHeaders(HttpState, HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
inueMethod - enter
ExpectContinueMethod.addRequestHeaders(HttpState, HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpMethodBase.addRequestHeaders(HttpState,
HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpMethodBase.addUserAgentRequestHeaders(HttpState,
HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpMethodBase.addHostRequestHeader(HttpState,
HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
- Adding Host request header
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpMethodBase.addCookieRequestHeader(HttpState,
HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpState.getCookies()
2006-08-18 09:24:28,312 [main ] DEBUG
- enter CookieSpecBase.match(String, int, String, boolean,
Cookie[])
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpMethodBase.addProxyConnectionHeader(HttpState,
HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
losingMethod - enter
EntityEnclosingMethod.addContentLengthRequestHeader(HttpState,
HttpConnection)
2006-08-18 09:24:28,312 [main ] DEBUG
losingMethod - enter
EntityEnclosingMethod.getRequestContentLength()
2006-08-18 09:24:28,312 [main ] DEBUG
- enter PostMethod.hasRequestContent()
2006-08-18 09:24:28,312 [main ] DEBUG
losingMethod - enter EntityEnclosingMethod.hasRequestContent()
2006-08-18 09:24:28,312 [main ] DEBUG
- HttpMethodBase.addRequestHeader(Header)
2006-08-18 09:24:28,312 [main ] DEBUG
losingMethod - enter EntityEnclosingMethod.renerateRequestBody()
2006-08-18 09:24:28,312 [main ] DEBUG
- >> "User-Agent: Jakarta Commons-HttpClient/3.0[\r][\n]"
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.print(String)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[])
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[], int, int)
2006-08-18 09:24:28,312 [main ] DEBUG
- >> "Host: localhost:8192[\r][\n]"
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.print(String)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[])
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[], int, int)
2006-08-18 09:24:28,312 [main ] DEBUG
- >> "Content-Length: 284[\r][\n]"
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.print(String)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[])
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.write(byte[], int, int)
2006-08-18 09:24:28,312 [main ] DEBUG
- enter HttpConnection.writeLine()
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpConnection.write(byte[])
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpConnection.write(byte[], int, int)
2006-08-18 09:24:28,327 [main ] DEBUG
- >> "[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
losingMethod - enter
EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection)
2006-08-18 09:24:28,327 [main ] DEBUG
- enter PostMethod.hasRequestContent()
2006-08-18 09:24:28,327 [main ] DEBUG
losingMethod - enter EntityEnclosingMethod.hasRequestContent()
2006-08-18 09:24:28,327 [main ] DEBUG
losingMethod - enter
EntityEnclosingMethod.getRequestContentLength()
2006-08-18 09:24:28,327 [main ] DEBUG
- enter PostMethod.hasRequestContent()
2006-08-18 09:24:28,327 [main ] DEBUG
losingMethod - enter EntityEnclosingMethod.hasRequestContent()
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpConnection.getRequestOutputStream()
2006-08-18 09:24:28,327 [main ] DEBUG
- >> "<?xml version="1.0"?>[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> "<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:servicemix:soap-binding">[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> " <soapenv:Body>[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> " <urn:ping>[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> " <urn:request>MESSAGE IN</urn:request>[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> " </urn:ping>[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> " </soapenv:Body>[\r][\n]"
2006-08-18 09:24:28,327 [main ] DEBUG
- >> "</soapenv:Envelope>"
2006-08-18 09:24:28,327 [main ] DEBUG
losingMethod - Request body sent
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpConnection.flushRequestOutputStream()
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpMethodBase.readResponse(HttpState,
HttpConnection)
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpMethodBase.readStatusLine(HttpState,
HttpConnection)
2006-08-18 09:24:28,327 [ @ 0.0.0.0:8192] DEBUG
- Dispatching job: HEP@14456085[d=true,io=0,w=true,b=0|0]
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpConnection.readLine()
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpParser.readLine(InputStream, String)
2006-08-18 09:24:28,327 [main ] DEBUG
- enter HttpParser.readRawLine()
2006-08-18 09:24:28,327 [- /PingService/] DEBUG
- REQUEST /PingService/ on org.mortbay.jetty.HttpConnection@6adb31
2006-08-18 09:24:28,327 [- /PingService/] DEBUG
- servlet=jbiServlet
2006-08-18 09:24:28,327 [- /PingService/] DEBUG
- chain=null
2006-08-18 09:24:28,327 [- /PingService/] DEBUG
- servelet holder=jbiServlet
2006-08-18 09:24:28,874 [- /PingService/] DEBUG
nnelImpl - Send ID:iConnectJavaDev-3996-1155907363421-2:0 in
DeliveryChannel{HttpComponent}
2006-08-18 09:24:29,124 [- /PingService/] DEBUG
nnelImpl - Sent: MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: consumer
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
]
2006-08-18 09:24:29,140 [- /PingService/] DEBUG
- Routing exchange MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: provider
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
] to:
ServiceEndpoint[service={urn:servicemix:soap-binding}simple-JSR-service,endpoint=simple-JSR-service-endpoint]
2006-08-18 09:24:29,140 [- /PingService/] DEBUG
- Called Flow send
2006-08-18 09:24:29,140 [- /PingService/] DEBUG
nnelImpl - Processing inbound exchange: MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: provider
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
]
2006-08-18 09:24:29,140 [- /PingService/] DEBUG
nnelImpl - Received: MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: provider
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
]
2006-08-18 09:24:29,155 [- /PingService/] DEBUG
- Received exchange: status: Active, role: Provider
2006-08-18 09:24:29,155 [- /PingService/] DEBUG
- Creating new channel for uri:
urn:xfire:transport:jbi:11559074691550-253729794
2006-08-18 09:24:29,187 [- /PingService/] DEBUG
- Received message to null
2006-08-18 09:24:29,202 [- /PingService/] DEBUG
- Invoking handler
org.codehaus.xfire.handler.LocateBindingHandler in phase dispatch
2006-08-18 09:24:29,202 [- /PingService/] DEBUG
- Invoking handler
org.codehaus.xfire.soap.handler.SoapBodyHandler in phase dispatch
2006-08-18 09:24:29,202 [- /PingService/] DEBUG
- Invoking handler
org.codehaus.xfire.handler.DispatchServiceHandler in phase dispatch
2006-08-18 09:24:29,202 [- /PingService/] DEBUG
- Invoking handler
org.codehaus.xfire.service.binding.ServiceInvocationHandler in phase service
PINGED: MESSAGE IN
2006-08-18 09:24:29,218 [- /PingService/] DEBUG
- Invoking handler
org.codehaus.xfire.handler.OutMessageSender in phase send
2006-08-18 09:24:29,233 [- /PingService/] DEBUG
nnelImpl - Send ID:iConnectJavaDev-3996-1155907363421-2:0 in
DeliveryChannel{JSR181Component}
2006-08-18 09:24:29,265 [- /PingService/] DEBUG
nnelImpl - Sent: MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: provider
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
out: <?xml version="1.0" encoding="UTF-8"?><pingResponse
xmlns="urn:servicemix:soap-binding"><out
xmlns="urn:servicemix:soap-binding">Ping: MESSAGE IN</out></pingResponse>
]
2006-08-18 09:24:29,265 [- /PingService/] DEBUG
- Called Flow send
2006-08-18 09:24:29,280 [- /PingService/] DEBUG
nnelImpl - Processing inbound exchange: MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: consumer
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
out: <?xml version="1.0" encoding="UTF-8"?><pingResponse
xmlns="urn:servicemix:soap-binding"><out
xmlns="urn:servicemix:soap-binding">Ping: MESSAGE IN</out></pingResponse>
]
2006-08-18 09:24:29,280 [- /PingService/] DEBUG
nnelImpl - Received: MessageExchange[
id: ID:iConnectJavaDev-3996-1155907363421-2:0
status: Active
role: consumer
service: {urn:servicemix:soap-binding}simple-JSR-service
endpoint: simple-JSR-service-endpoint
operation: {urn:servicemix:soap-binding}ping
in: <?xml version="1.0" encoding="UTF-8"?><urn:ping
xmlns:urn="urn:servicemix:soap-binding"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><urn:request>MESSAGE
IN</urn:request></urn:ping>
out: <?xml version="1.0" encoding="UTF-8"?><pingResponse
xmlns="urn:servicemix:soap-binding"><out
xmlns="urn:servicemix:soap-binding">Ping: MESSAGE IN</out></pingResponse>
]
2006-08-18 09:24:29,280 [- /PingService/] DEBUG
- Received exchange: status: Active, role: Consumer
2006-08-18 09:24:29,296 [btpool0-2 ] DEBUG
- continuation
org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation@c20893
2006-08-18 09:24:58,327 [main ] DEBUG
rector - Closing the connection.
2006-08-18 09:24:58,327 [main ] DEBUG
- enter HttpConnection.close()
2006-08-18 09:24:58,327 [main ] DEBUG
- enter HttpConnection.closeSockedAndStreams()
2006-08-18 09:24:58,327 [main ] INFO
irector - I/O exception
(org.apache.commons.httpclient.NoHttpResponseException) caught when
processing request: The server localhost failed to respond
2006-08-18 09:24:58,374 [main ] DEBUG
rector - The server localhost failed to respond
org.apache.commons.httpclient.NoHttpResponseException: The server localhost
failed to respond
at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1835)
at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at com.stiles.iconnect.WeirdTest.testMe(WeirdTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
2006-08-18 09:24:58,421 [main ] INFO
irector - Retrying request
2006-08-18 09:24:58,421 [main ] DEBUG
rector - Attempt number 2 to process request
At this point in time the request tries again until, after the 4th failure,
the HttpClient throws a NoHttpResponseException.
------------------
Re: testing problem
Posted by Guillaume Nodet <gn...@gmail.com>.
Do you any exception logged when you run this test ?
On 8/18/06, James Bradt <gm...@xoxy.net> wrote:
> Hello all again,
>
> I am encountering some strange behavior and I am not sure how to correct the
> issue.
>
> I am attempting to perform some integration testing and the test is hanging
> within an http-soap call. The program, however, has no problem getting the
> wsdl right before this (see the GetMethod below)
>
> If I create a complete service-assembly and deploy it to a servicemix
> installation, the call works without a problem.
>
> While debugging I can tell that the simpleService gets called and returns
> properly. It appears that, later on, the servlet is not returning the
> response to the httpClient.
>
> Am I missing some configuration for Jetty?
>
> Any help will be greatly appreciated.
>
> Thanks,
> James
>
>
> ================================
>
> the junit test is:
>
> public class WeirdTest extends TestCase {
>
> private String getServiceUnitPath(String name) {
> URL url = getClass().getClassLoader().getResource(name);
> File path = new File(url.getFile());
> path = path.getParentFile();
> return path.getAbsolutePath();
> }
>
> public void testMe() throws Exception {
> JBIContainer container = new JBIContainer();
> container.setUseMBeanServer(false);
> container.setCreateMBeanServer(false);
> container.setNamingContext(new InitialContext());
> container.setMonitorInstallationDirectory(false);
> container.setEmbedded(true);
> container.setFlowName("st");
>
> container.init();
> container.start();
>
> Jsr181Component component = new Jsr181Component();
> HttpComponent hComponent = new HttpComponent();
>
> container.activateComponent(component, "JSR181Component");
> container.activateComponent(hComponent, "HttpComponent");
>
> component.getServiceUnitManager().deploy("engine-su",
> getServiceUnitPath("engine-su/xbean.xml"));
> component.getServiceUnitManager().init("engine-su",
> getServiceUnitPath("engine-su/xbean.xml"));
> component.getServiceUnitManager().start("engine-su");
>
> hComponent.getServiceUnitManager().deploy("binding-su",
> getServiceUnitPath("binding-su/xbean.xml"));
> hComponent.getServiceUnitManager().init("binding-su",
> getServiceUnitPath("binding-su/xbean.xml"));
> hComponent.getServiceUnitManager().start("binding-su");
>
> GetMethod get = new GetMethod("http://localhost:8193/Service/?wsdl");
>
> // vvvvvvvvvvvvv THIS WORKS vvvvvvvvvvvvv
> int state = new HttpClient().executeMethod(get);
> // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> assertEquals(HttpServletResponse.SC_OK, state);
> String response = get.getResponseBodyAsString();
> System.out.println(response);
>
> InputStream in = getClass().getResourceAsStream("/ping-request.xml");
> InputStreamRequestEntity is = new InputStreamRequestEntity(in);
> PostMethod method = new PostMethod("http://localhost:8193/Service/");
> method.setRequestEntity(is);
> HttpClient hc = new HttpClient();
>
> // vvvvvvvvvvvvv HANGS HERE vvvvvvvvvvvvv
> int status = hc.executeMethod(method);
> // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> assertEquals(200, status);
> response = method.getResponseBodyAsString();
> System.out.println(response);
>
> hComponent.getServiceUnitManager().stop("binding-su");
> hComponent.getServiceUnitManager().shutDown("binding-su");
> hComponent.getServiceUnitManager().undeploy("binding-su",
> getServiceUnitPath("binding-su/xbean.xml"));
>
> component.getServiceUnitManager().stop("engine-su");
> component.getServiceUnitManager().shutDown("engine-su");
> component.getServiceUnitManager().undeploy("engine-su",
> getServiceUnitPath("engine-su/xbean.xml"));
> }
> }
>
> =======================
>
> The xbean.xml for the binding is
>
> <?xml version="1.0"?>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
> xmlns:demo="urn:servicemix:soap-binding">
>
> <http:endpoint service="demo:simple-http-service"
> endpoint="simple-http-service-endpoint" role="consumer"
> targetService="demo:simple-JSR-service"
> targetEndpoint="simple-JSR-service-endpoint"
> locationURI="http://localhost:8193/Service/"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out" soap="true" />
>
> </beans>
>
> and the xbean.xml for the SE is
>
> <?xml version="1.0"?>
> <beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
> xmlns:demo="urn:servicemix:soap-binding">
>
> <classpath>
> <location>.</location>
> </classpath>
>
> <jsr181:endpoint pojoClass="soap.SimpleService" annotations="none"
> typeMapping="xmlbeans" service="demo:simple-JSR-service"
> endpoint="simple-JSR-service-endpoint" />
>
> </beans>
>
> ===========================
>
> the ping-request xml is
>
> <?xml version="1.0"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:servicemix:soap-binding">
> <soapenv:Body>
> <urn:ping>
> <urn:request>MESSAGE IN</urn:request>
> </urn:ping>
> </soapenv:Body>
> </soapenv:Envelope>
>
> =======================
>
> and the soap.SimpleService class is
>
> package soap;
>
> public class SimpleService {
>
> public String ping(String request) {
> String response = "Ping: " + request;
> System.out.println("PINGED: " + request);
> return response;
> }
>
> }
>
>
>
>
>
>
>
>
--
Cheers,
Guillaume Nodet