You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by MEL <ME...@yahoo.co.uk> on 2015/11/30 15:14:23 UTC

camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

I am using the camel-servlet component, in an app hosted in tomcat, to
trigger a route via a URL such as this

http://localhost:9090/appcontext/triggerimport/

When upgrading to 2.16.1 the URL fails to trigger the route;  the URL works
if I downgrade to 2.15.3 or 2.16.0 (looks like CAMEL-9263 may have
introduced the issue)




web.xml


	<servlet>
		<servlet-name>MyTriggerImportServlet</servlet-name>
		<display-name>Trigger import of JArchive content</display-name>
	
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
		<load-on-startup>2</load-on-startup>
		<init-param>
			<param-name>ignoreDuplicateServletName</param-name>
			<param-value>true</param-value>
		</init-param>
	</servlet>
	
	
	<servlet-mapping>
		<servlet-name>MyTriggerImportServlet</servlet-name>
		<url-pattern>/triggerimport/*</url-pattern>
	</servlet-mapping>
	
	
	
camel-config.xml

		<route id="jarchive-import-rest-service">
			<from
uri="servlet://jarchive?servletName=MyTriggerImportServlet&amp;matchOnUriPrefix=true"
/>
			<to uri="direct:handlenotifications" pattern="OutIn" />
		</route>
	
	





--
View this message in context: http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

Posted by henrik <he...@synth.no>.
yihtserns wrote:
> Why are you trying to access
> *http://localhost:9090/appcontext/triggerimport/* when your Servlet URI is
> *servlet://jarchive*?
> 
> Shouldn't you be accessing
> *http://localhost:9090/appcontext/triggerimport/jarchive* instead?

Found the problem.  My config was slightly different from Mel's.  

My servlet-mapping url-patter was <url-pattern>/pp/import/*</url-pattern>
and I initialized the servlet as servlet://import/... 

I could access this with http://localhost:9090/appcontext/pp/import/start
earlier, but with 2.16.1 I had to use
http://localhost:9090/appcontext/pp/import/import/start

The fix was to use <url-pattern>/pp/*</url-pattern> instead.

Henrik




--
View this message in context: http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558p5775952.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

Posted by yihtserns <si...@yahoo.com>.
Why are you trying to access
*http://localhost:9090/appcontext/triggerimport/* when your Servlet URI is
*servlet://jarchive*?

Shouldn't you be accessing
*http://localhost:9090/appcontext/triggerimport/jarchive* instead?



--
View this message in context: http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558p5775943.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

Posted by henrik <he...@synth.no>.
At 2015-11-30 15:14 GMT+01:00 MEL wrote:
> I am using the camel-servlet component, in an app hosted in tomcat, to 
> trigger a route via a URL such as this 
> 
> http://localhost:9090/appcontext/triggerimport/
> 
> When upgrading to 2.16.1 the URL fails to trigger the route;  the URL
> works 
> if I downgrade to 2.15.3 or 2.16.0 (looks like CAMEL-9263 may have 
> introduced the issue) 

Hi.

I'm having the same problem with camel-servlet.  Did you figure it out?

Cheers,
Henrik




--
View this message in context: http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558p5775896.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

Posted by henrik <he...@synth.no>.
Aki Yoshida-3 wrote:
> There was some change introduced by CAMEL-9263 and there was a bug
> that calculated the wrong path in some cases.
> But this bug shouldn't affect normal servlet scenarios. So, I don't
> know why your scenario that runs with 2.16.0 is not running with 
> 2.16.1.
> You may try 2.16.2-SNAPSHOT to see if your scenario runs with that
> version, as this version corrects the mentioned bug.
> 
> In other cases, we need to see if there are any error logs indicating
> why the endpoint is not starting.

The endpoint is actually starting up:

[INFO ] [2016-01-06T15:30:37,050] [RMI TCP Connection(3)-127.0.0.1]
Initialized CamelHttpTransportServlet[name= MyTriggerImportServlet,
contextPath=/my-integration]  [CamelHttpTransportServlet]

2.16.2-SNAPSHOT does not fix the problem.

I have created CAMEL-9485 to track this issue.

Henrik




--
View this message in context: http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558p5775940.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

Posted by Aki Yoshida <el...@gmail.com>.
There was some change introduced by CAMEL-9263 and there was a bug
that calculated the wrong path in some cases.
But this bug shouldn't affect normal servlet scenarios. So, I don't
know why your scenario that runs with 2.16.0 is not running with
2.16.1.
You may try 2.16.2-SNAPSHOT to see if your scenario runs with that
version, as this version corrects the mentioned bug.

In other cases, we need to see if there are any error logs indicating
why the endpoint is not starting.

2015-11-30 15:14 GMT+01:00 MEL <ME...@yahoo.co.uk>:
> I am using the camel-servlet component, in an app hosted in tomcat, to
> trigger a route via a URL such as this
>
> http://localhost:9090/appcontext/triggerimport/
>
> When upgrading to 2.16.1 the URL fails to trigger the route;  the URL works
> if I downgrade to 2.15.3 or 2.16.0 (looks like CAMEL-9263 may have
> introduced the issue)
>
>
>
>
> web.xml
>
>
>         <servlet>
>                 <servlet-name>MyTriggerImportServlet</servlet-name>
>                 <display-name>Trigger import of JArchive content</display-name>
>
> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
>                 <load-on-startup>2</load-on-startup>
>                 <init-param>
>                         <param-name>ignoreDuplicateServletName</param-name>
>                         <param-value>true</param-value>
>                 </init-param>
>         </servlet>
>
>
>         <servlet-mapping>
>                 <servlet-name>MyTriggerImportServlet</servlet-name>
>                 <url-pattern>/triggerimport/*</url-pattern>
>         </servlet-mapping>
>
>
>
> camel-config.xml
>
>                 <route id="jarchive-import-rest-service">
>                         <from
> uri="servlet://jarchive?servletName=MyTriggerImportServlet&matchOnUriPrefix=true"
> />
>                         <to uri="direct:handlenotifications" pattern="OutIn" />
>                 </route>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558.html
> Sent from the Camel - Users mailing list archive at Nabble.com.