You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Carlo Camerino <ca...@gmail.com> on 2010/07/03 11:36:02 UTC

Problems With Camel CXF On Glassfish

Hi,

I'm having problems with camel cxf on glassfish.
I'm getting error message

No Services Have Been Found

it only appears though on glassfish because if access it on my
localhost, the proper messages come out.

Available SOAP services:
overrideServer

    * getActiveUsers
    * acceptOverrideRequest

	Endpoint address: http://localhost:8088/override/services/override-server
WSDL : {http://server.override.luminous.ccti.com/}OverrideServerImplService
Target namespace: http://server.override.luminous.ccti.com/

here is my configuration file.

<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
	
	<camel:camelContext>
		<camel:package>com.ccti.luminous.override.routes</camel:package>
		<camel:routeBuilder ref="overrideServerRouteBuilder"/>
	</camel:camelContext>
	
	<cxf:cxfEndpoint id = "overrideServerEndpoint" serviceClass =
"#overrideServer" address = "/override-server">
	</cxf:cxfEndpoint>
	
	<bean id = "overrideServerRouteBuilder" class =
"com.ccti.luminous.override.routes.OverrideServerRouteBuilder">
		<property name = "overrideServer" ref = "overrideServer"/>
	</bean>
	
	<bean id = "overrideServer" class =
"com.ccti.luminous.override.server.OverrideServerImpl">
		<property name = "overrideService" ref = "overrideService"/>
		<property name = "luminousUserService" ref = "luminousUserService"/>
	</bean>

here is my route

/* (non-Javadoc)
	 * @see org.apache.camel.builder.RouteBuilder#configure()
	 */
	@Override
	public void configure() throws Exception {
		from("cxf:bean:overrideServerEndpoint").choice()
		.when(header("operationName").isEqualTo("getActiveUsers")).to("direct:getActiveUsers")
		.when(header("operationName").isEqualTo("acceptOverrideRequest")).to("direct:acceptOverrideRequest");
		
		from("direct:getActiveUsers").process(new Processor() {
			@Override
			public void process(Exchange exchange) throws Exception {
				List messageContentsList = (List) exchange.getIn().getBody();
				OverrideHeader overrideHeader = (OverrideHeader) messageContentsList.get(0);
				List<LuminousUsr> luminousUsrResults =
overrideServer.getActiveUsers(overrideHeader);
				Object[] objectResults = new Object[1];
				objectResults[0] = luminousUsrResults;
				exchange.getOut().setBody(objectResults);
			}
		});
		
		// this one needs to accept two outputs, one coming from the server
		from("direct:acceptOverrideRequest").process(new Processor() {
			
			@Override
			public void process(Exchange exchange) throws Exception {
				LOG.info("papunta dito.");
				List messageContentsList = (List) exchange.getIn().getBody();
				OverrideHeader overrideHeader = (OverrideHeader) messageContentsList.get(0);
				OverrideHeader overrideHeaderResponse =
overrideServer.acceptOverrideRequest(overrideHeader);
				exchange.getOut().setBody(overrideHeaderResponse);
			}
		});
	}

Re: Problems With Camel CXF On Glassfish

Posted by Willem Jiang <wi...@gmail.com>.
How did you set up the Glassfish ?
It's look like the Glassfish can't support to assess out side of the 
localhost, and it has nothing to do with Camel. Can you google for the 
solution ?

Willem
----------------------------------
Apache Camel, Apache CXF committer
Open SOA http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang

Carlo Camerino wrote:
> Hi,
> 
> I'm having problems with camel cxf on glassfish.
> I'm getting error message
> 
> No Services Have Been Found
> 
> it only appears though on glassfish because if access it on my
> localhost, the proper messages come out.
> 
> Available SOAP services:
> overrideServer
> 
>     * getActiveUsers
>     * acceptOverrideRequest
> 
> 	Endpoint address: http://localhost:8088/override/services/override-server
> WSDL : {http://server.override.luminous.ccti.com/}OverrideServerImplService
> Target namespace: http://server.override.luminous.ccti.com/
> 
> here is my configuration file.
> 
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
> 	
> 	<camel:camelContext>
> 		<camel:package>com.ccti.luminous.override.routes</camel:package>
> 		<camel:routeBuilder ref="overrideServerRouteBuilder"/>
> 	</camel:camelContext>
> 	
> 	<cxf:cxfEndpoint id = "overrideServerEndpoint" serviceClass =
> "#overrideServer" address = "/override-server">
> 	</cxf:cxfEndpoint>
> 	
> 	<bean id = "overrideServerRouteBuilder" class =
> "com.ccti.luminous.override.routes.OverrideServerRouteBuilder">
> 		<property name = "overrideServer" ref = "overrideServer"/>
> 	</bean>
> 	
> 	<bean id = "overrideServer" class =
> "com.ccti.luminous.override.server.OverrideServerImpl">
> 		<property name = "overrideService" ref = "overrideService"/>
> 		<property name = "luminousUserService" ref = "luminousUserService"/>
> 	</bean>
> 
> here is my route
> 
> /* (non-Javadoc)
> 	 * @see org.apache.camel.builder.RouteBuilder#configure()
> 	 */
> 	@Override
> 	public void configure() throws Exception {
> 		from("cxf:bean:overrideServerEndpoint").choice()
> 		.when(header("operationName").isEqualTo("getActiveUsers")).to("direct:getActiveUsers")
> 		.when(header("operationName").isEqualTo("acceptOverrideRequest")).to("direct:acceptOverrideRequest");
> 		
> 		from("direct:getActiveUsers").process(new Processor() {
> 			@Override
> 			public void process(Exchange exchange) throws Exception {
> 				List messageContentsList = (List) exchange.getIn().getBody();
> 				OverrideHeader overrideHeader = (OverrideHeader) messageContentsList.get(0);
> 				List<LuminousUsr> luminousUsrResults =
> overrideServer.getActiveUsers(overrideHeader);
> 				Object[] objectResults = new Object[1];
> 				objectResults[0] = luminousUsrResults;
> 				exchange.getOut().setBody(objectResults);
> 			}
> 		});
> 		
> 		// this one needs to accept two outputs, one coming from the server
> 		from("direct:acceptOverrideRequest").process(new Processor() {
> 			
> 			@Override
> 			public void process(Exchange exchange) throws Exception {
> 				LOG.info("papunta dito.");
> 				List messageContentsList = (List) exchange.getIn().getBody();
> 				OverrideHeader overrideHeader = (OverrideHeader) messageContentsList.get(0);
> 				OverrideHeader overrideHeaderResponse =
> overrideServer.acceptOverrideRequest(overrideHeader);
> 				exchange.getOut().setBody(overrideHeaderResponse);
> 			}
> 		});
> 	}
>