[mule-user] Bad endpoint configuration using REST receiver servlet in mule 3.1

4 views
Skip to first unread message

pathi7

unread,
Jul 1, 2011, 2:01:30 PM7/1/11
to us...@mule.codehaus.org
Hello,
I am trying to deploy a REST service using jersey in Mule 3.1 as web app. Below is my mule configuration and web.xml file. This service when run as Mule server it runs but when deploy as web app and try to invoke the service it gives bad endpoint configuration message. Please help what I am doing wrong here.


Mule _config.xml
----------------------------

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/3.1/mule-jersey.xsd
http://jersey.apache.org/core http://jersey.apache.org/schemas/core.xsd">

<flow name="HelloWorld">
<inbound-endpoint address="servlet://restPUTTest"/>
<jersey:resources>
<component class="org.mule.transport.jersey.HelloWorldResource"/>
</jersey:resources>
</flow>

</mule>

web.xml
**********************
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Mule</display-name>
<description>Mule Web App Samples</description>

<context-param>
<param-name>org.mule.config</param-name>
<param-value>
mule-config.xml
</param-value>
</context-param>

<!--
To use a MuleXml configuration file use this context listener
-->
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>

<servlet>
<servlet-name>muleRESTServlet</servlet-name>
<servlet-class>org.mule.transport.servlet.MuleRESTReceiverServlet</servlet-class>

<init-param>
<param-name>org.mule.servlet.timeout</param-name>
<param-value>4000</param-value>
<description>request timeout</description>
</init-param>
<!-- If a servlet is read-only it will not receive doPut or doDelete events -->
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>muleRESTServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
</web-app>

----------------------------------------------

Error stack
***********************************


2011-07-01 13:55:09,755 [http-8080-1] ERROR - message: Bad endpoint configuratio
n
java.lang.IllegalStateException: Bad endpoint configuration
at org.mule.endpoint.URIBuilder.getEndpoint(URIBuilder.java:216)
at org.mule.endpoint.AbstractEndpointBuilder.getProperties(AbstractEndpo
intBuilder.java:429)
at org.mule.endpoint.AbstractEndpointBuilder.prepareToBuildEndpoint(Abst
ractEndpointBuilder.java:277)
at org.mule.endpoint.AbstractEndpointBuilder.doBuildInboundEndpoint(Abst
ractEndpointBuilder.java:177)
at org.mule.endpoint.AbstractEndpointBuilder.buildInboundEndpoint(Abstra
ctEndpointBuilder.java:108)
at org.mule.endpoint.DefaultEndpointFactory.getInboundEndpoint(DefaultEn
dpointFactory.java:83)
at org.mule.endpoint.DefaultEndpointFactory.getInboundEndpoint(DefaultEn
dpointFactory.java:51)
at org.mule.transport.servlet.MuleRESTReceiverServlet.getEndpointForURI(
MuleRESTReceiverServlet.java:197)
at org.mule.transport.servlet.MuleRESTReceiverServlet.doGet(MuleRESTRece
iverServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.mule.api.endpoint.MalformedEndpointException: The endpoint "dan"
is malformed and cannot be parsed. If this is the name of a global endpoint, ch
eck the name is correct, that the endpoint exists, and that you are using the co
rrect configuration (eg the "ref" attribute). Note that names on inbound and ou
tbound endpoints cannot be used to send or receive messages; use a named global
endpoint instead.
at org.mule.endpoint.MuleEndpointURI.preprocessUri(MuleEndpointURI.java:
201)
at org.mule.endpoint.MuleEndpointURI.<init>(MuleEndpointURI.java:139)
at org.mule.endpoint.URIBuilder.getEndpoint(URIBuilder.java:211)
... 22 more


Thanks for any help.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


pathi7

unread,
Jul 6, 2011, 2:34:22 PM7/6/11
to us...@mule.codehaus.org
Can any one help in troubleshooting the error please?

Thanks.

Magnus Larsson

unread,
Jul 6, 2011, 3:47:58 PM7/6/11
to us...@mule.codehaus.org
Hello!

Can't really help you but I have experienced similar problems earlier, i.e. trying to route a call to a Jersey-REST service through the servlet transport with no success.

Two ways around it:
1. Skip using servlet-transport and expose the Jersey-rest service over a separate port (not very good since it expose the problem to the caller)
2. Skip using Jersey for the rest-service. I recently used the restlet-support in 3.1.2 to impl. a rest service and it worked fine over the servlet-transport.

Hope it helps,
Magnus.
--
Magnus Larsson

Callista Enterprise AB
Mobile: +46 (0)733-51 91 72
mailto:magnus....@callistaenterprise.se
http://www.callistaenterprise.se
Reply all
Reply to author
Forward
0 new messages