You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by srinivasks22 <sr...@gmail.com> on 2013/09/17 21:44:56 UTC

Camel Console - Not able to bring it up

I imported camel-example-servlet-tomcat-2.12.1-SNAPSHOT into my workspace and
I am trying to add the webconsole within this web application on a tomcat
server and I am not able to get it through.

pom.xml
--------
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.camel</groupId>
        <artifactId>examples</artifactId>
        <version>2.12.1-SNAPSHOT</version>
    </parent>

    <artifactId>camel-example-servlet-tomcat</artifactId>
    <name>Camel :: Example :: Servlet Tomcat</name>
    <description>An example using Camel Servlet with Apache
Tomcat</description>
    <packaging>war</packaging>

    <dependencies>

        
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-servlet</artifactId>
        </dependency>

        
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>

        
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        
           		                   
        <dependency> 
			<groupId>org.apache.camel</groupId> 
			<artifactId>camel-web</artifactId> 
			<version>2.8.0</version> 
			<type>war</type> 
			<scope>runtime</scope>
		</dependency>  
		
    </dependencies>
    
<build>
		<defaultGoal>install</defaultGoal>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-maven-plugin</artifactId>
				<version>2.1.0</version>
			</plugin>

			<plugin>			
			        <groupId>org.mortbay.jetty</groupId>
			        <artifactId>maven-jetty-plugin</artifactId>
			        <version>${jetty-version}</version>			
			        <configuration>
			          <webAppConfig>
			            <contextPath>/</contextPath>			
			          </webAppConfig>			
			          <systemProperties>
			            
			            <systemProperty>
			              <name>com.sun.management.jmxremote</name>
			              <value/>
			            </systemProperty>
			          </systemProperties>			
			          <scanIntervalSeconds>10</scanIntervalSeconds>
			        </configuration>
			      </plugin>
		</plugins>
	</build>    
    
	<properties>
		<Camel_Version>2.12.0</Camel_Version>
		<jetty-version>7.2.2.v20101205</jetty-version>
	</properties>    

</project>

web.xml
--------
<?xml version="1.0" encoding="ISO-8859-1"?>



<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  <display-name>My Web Application</display-name>

  
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:camel-config.xml</param-value>
  </context-param>

  
  <listener>
   
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

  
  <servlet>
    <servlet-name>CamelServlet</servlet-name>
   
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  
  <servlet-mapping>
    <servlet-name>CamelServlet</servlet-name>
    <url-pattern>/camel/*</url-pattern>
  </servlet-mapping>
  
  
<filter> 
    <filter-name>Jersey Filter</filter-name> 

<filter-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</filter-class> 
    <init-param> 
               
<param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> 
               
<param-value>org.apache.camel.web.util.CamelResourceConfig</param-value> 
    </init-param> 
    <init-param> 
               
<param-name>com.sun.jersey.config.feature.FilterForwardOn404</param-name> 
      <param-value>true</param-value> 
    </init-param> 
   <init-param> 
               
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name> 
      <param-value>/(images|css|js)/.*</param-value> 
    </init-param> 
    <init-param> 
               
<param-name>com.sun.jersey.config.feature.ImplicitViewables</param-name> 
      <param-value>true</param-value> 
    </init-param> 
    <init-param> 
      <param-name>com.sun.jersey.config.feature.Trace</param-name> 
      <param-value>true</param-value> 
    </init-param> 
    <init-param> 
      <param-name>com.sun.jersey.config.feature.Redirect</param-name> 
      <param-value>true</param-value> 
    </init-param> 
    <init-param> 
      <param-name>com.sun.jersey.config.property.packages</param-name> 
      <param-value>org.apache.camel.web:</param-value> 
    </init-param> 
    <init-param> 
               
<param-name>com.sun.jersey.config.property.WadlResourceUri</param-name> 
                <param-value>/api</param-value> 
    </init-param> 
  </filter> 

  <filter-mapping> 
    <filter-name>Jersey Filter</filter-name> 
    <url-pattern>/*</url-pattern> 
  </filter-mapping> 

  <servlet> 
    <servlet-name>TemplateEngineServlet</servlet-name> 


<servlet-class>org.fusesource.scalate.servlet.TemplateEngineServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
  </servlet> 

  <servlet-mapping> 
    <servlet-name>TemplateEngineServlet</servlet-name> 
    <url-pattern>*.mustache</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
    <servlet-name>TemplateEngineServlet</servlet-name> 
    <url-pattern>*.scaml</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
    <servlet-name>TemplateEngineServlet</servlet-name> 
    <url-pattern>*.ssp</url-pattern> 
  </servlet-mapping> 

  <error-page> 
    <error-code>500</error-code> 
    <location>/WEB-INF/scalate/errors/500.scaml</location> 
  </error-page>       
          
  
</web-app>
  

I am trying to access
http://localhost:8090/camel-example-servlet-tomcat-2.12.1-SNAPSHOT/ for
which I get a 500 error

java.lang.IllegalArgumentException: No ServletTemplateEngine instance
registered on ServletContext for key
org.fusesource.scalate.servlet.ServletTemplateEngine. Are you sure your web
application has registered the Scalate TemplateEngineServlet?

org.fusesource.scalate.servlet.ServletTemplateEngine$.apply(ServletTemplateEngine.scala:40)

org.fusesource.scalate.jersey.ScalateTemplateProcessor.resolve(ScalateTemplateProcessor.scala:69)

org.fusesource.scalate.jersey.ScalateTemplateProcessor.resolve(ScalateTemplateProcessor.scala:44)

com.sun.jersey.server.impl.template.TemplateFactory.resolveRelativeViewable(TemplateFactory.java:147)

com.sun.jersey.server.impl.template.TemplateFactory.resolveViewable(TemplateFactory.java:94)

com.sun.jersey.server.impl.template.ViewableRule.accept(ViewableRule.java:101)

com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)

com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)

com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)

com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)

com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)

com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)

com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)

com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)

com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:886)

com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:834)

com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:795)

I also need a web console url for this and tried
http://localhost:8090/camel-example-servlet-tomcat-2.12.1-SNAPSHOT/services/routes
which is not picking up either.

I have tried to search through various blogs as to how to set webconsole as
part of web application and I couldn't find any thing helpful




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Console-Not-able-to-bring-it-up-tp5739689.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Console - Not able to bring it up

Posted by James Strachan <ja...@gmail.com>.
The exception message describes the problem; the servlet endpoint doesn't
support producing (i.e. sending messages to it) only consuming. Though
hawtio should be smart enough to detect that and then hide the Send tab.
I've raised an issue to track this:
https://github.com/hawtio/hawtio/issues/560

you could use a different kind of endpoint which does support both
producing and consuming


On 18 September 2013 18:37, srinivasks22 <sr...@gmail.com> wrote:

> Thank you Claus. I installed hawito on to my local tomcat server on which I
> have also deployed the camel-example-servlet-tomcat war file. I used
> http://localhost:8090/sample-1.2-M10/ and was able to see the the routes
> and
> endpoints. However when I click on the endpoint servlet:///hello and
> navigate to send message screen, I see  a header name (which I entered
> name)
> and value of the message header (for which I gave foo) and the body (I left
> empty) and once I click the send message I keep getting the below error
> message :
>
> Operation failed due to: org.apache.camel.FailedToCreateProducerException:
> Failed to create Producer for endpoint: Endpoint[servlet:///hello]. Reason:
> java.lang.UnsupportedOperationException: You cannot create producer with
> servlet endpoint, please consider to use http or http4 endpoint.
>  at
> org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:409)
>  at
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:220)
>
> No matter what ever I give these header name and values, I keep getting
> this
> again and again. Am I missing any thing here?
>
> Regards
> Srinivas
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Console-Not-able-to-bring-it-up-tp5739689p5739772.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
James
-------
Red Hat

Email: jstracha@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration

Re: Camel Console - Not able to bring it up

Posted by srinivasks22 <sr...@gmail.com>.
Thank you Claus. I installed hawito on to my local tomcat server on which I
have also deployed the camel-example-servlet-tomcat war file. I used
http://localhost:8090/sample-1.2-M10/ and was able to see the the routes and
endpoints. However when I click on the endpoint servlet:///hello and
navigate to send message screen, I see  a header name (which I entered name)
and value of the message header (for which I gave foo) and the body (I left
empty) and once I click the send message I keep getting the below error
message : 

Operation failed due to: org.apache.camel.FailedToCreateProducerException:
Failed to create Producer for endpoint: Endpoint[servlet:///hello]. Reason:
java.lang.UnsupportedOperationException: You cannot create producer with
servlet endpoint, please consider to use http or http4 endpoint.
 at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:409)
 at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:220)

No matter what ever I give these header name and values, I keep getting this
again and again. Am I missing any thing here?

Regards
Srinivas





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Console-Not-able-to-bring-it-up-tp5739689p5739772.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Console - Not able to bring it up

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See the warning on top of the page
http://camel.apache.org/web-console

For example the hawtio web console can be installed separately or
co-located with your application. Though if you install it seperately
it can work as console for all your Camel applications deployed in
Tomcat.

I encourage you to take a look at hawtio or one of the alternatives
from that link. Though so far hawtio seems really great.

If you still want to embed the old deprecated camel web-console in a
WAR to deploy on Tocmat, then see the links from that link at the
section: Embedding web console in your own web application. They may
help you.






On Tue, Sep 17, 2013 at 9:44 PM, srinivasks22 <sr...@gmail.com> wrote:
> I imported camel-example-servlet-tomcat-2.12.1-SNAPSHOT into my workspace and
> I am trying to add the webconsole within this web application on a tomcat
> server and I am not able to get it through.
>
> pom.xml
> --------
> <?xml version="1.0" encoding="UTF-8"?>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
>     <modelVersion>4.0.0</modelVersion>
>
>     <parent>
>         <groupId>org.apache.camel</groupId>
>         <artifactId>examples</artifactId>
>         <version>2.12.1-SNAPSHOT</version>
>     </parent>
>
>     <artifactId>camel-example-servlet-tomcat</artifactId>
>     <name>Camel :: Example :: Servlet Tomcat</name>
>     <description>An example using Camel Servlet with Apache
> Tomcat</description>
>     <packaging>war</packaging>
>
>     <dependencies>
>
>
>         <dependency>
>             <groupId>org.apache.camel</groupId>
>             <artifactId>camel-core</artifactId>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.camel</groupId>
>             <artifactId>camel-spring</artifactId>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.camel</groupId>
>             <artifactId>camel-servlet</artifactId>
>         </dependency>
>
>
>         <dependency>
>             <groupId>org.springframework</groupId>
>             <artifactId>spring-web</artifactId>
>         </dependency>
>
>
>         <dependency>
>             <groupId>log4j</groupId>
>             <artifactId>log4j</artifactId>
>         </dependency>
>         <dependency>
>             <groupId>org.slf4j</groupId>
>             <artifactId>slf4j-log4j12</artifactId>
>         </dependency>
>
>
>         <dependency>
>                         <groupId>org.apache.camel</groupId>
>                         <artifactId>camel-web</artifactId>
>                         <version>2.8.0</version>
>                         <type>war</type>
>                         <scope>runtime</scope>
>                 </dependency>
>
>     </dependencies>
>
> <build>
>                 <defaultGoal>install</defaultGoal>
>
>                 <plugins>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-compiler-plugin</artifactId>
>                                 <configuration>
>                                         <source>1.6</source>
>                                         <target>1.6</target>
>                                 </configuration>
>                         </plugin>
>
>                         <plugin>
>                                 <groupId>org.apache.camel</groupId>
>                                 <artifactId>camel-maven-plugin</artifactId>
>                                 <version>2.1.0</version>
>                         </plugin>
>
>                         <plugin>
>                                 <groupId>org.mortbay.jetty</groupId>
>                                 <artifactId>maven-jetty-plugin</artifactId>
>                                 <version>${jetty-version}</version>
>                                 <configuration>
>                                   <webAppConfig>
>                                     <contextPath>/</contextPath>
>                                   </webAppConfig>
>                                   <systemProperties>
>
>                                     <systemProperty>
>                                       <name>com.sun.management.jmxremote</name>
>                                       <value/>
>                                     </systemProperty>
>                                   </systemProperties>
>                                   <scanIntervalSeconds>10</scanIntervalSeconds>
>                                 </configuration>
>                               </plugin>
>                 </plugins>
>         </build>
>
>         <properties>
>                 <Camel_Version>2.12.0</Camel_Version>
>                 <jetty-version>7.2.2.v20101205</jetty-version>
>         </properties>
>
> </project>
>
> web.xml
> --------
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
>
>
> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
>   <display-name>My Web Application</display-name>
>
>
>   <context-param>
>     <param-name>contextConfigLocation</param-name>
>     <param-value>classpath:camel-config.xml</param-value>
>   </context-param>
>
>
>   <listener>
>
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>   </listener>
>
>
>   <servlet>
>     <servlet-name>CamelServlet</servlet-name>
>
> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>
>
>   <servlet-mapping>
>     <servlet-name>CamelServlet</servlet-name>
>     <url-pattern>/camel/*</url-pattern>
>   </servlet-mapping>
>
>
> <filter>
>     <filter-name>Jersey Filter</filter-name>
>
> <filter-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</filter-class>
>     <init-param>
>
> <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name>
>
> <param-value>org.apache.camel.web.util.CamelResourceConfig</param-value>
>     </init-param>
>     <init-param>
>
> <param-name>com.sun.jersey.config.feature.FilterForwardOn404</param-name>
>       <param-value>true</param-value>
>     </init-param>
>    <init-param>
>
> <param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
>       <param-value>/(images|css|js)/.*</param-value>
>     </init-param>
>     <init-param>
>
> <param-name>com.sun.jersey.config.feature.ImplicitViewables</param-name>
>       <param-value>true</param-value>
>     </init-param>
>     <init-param>
>       <param-name>com.sun.jersey.config.feature.Trace</param-name>
>       <param-value>true</param-value>
>     </init-param>
>     <init-param>
>       <param-name>com.sun.jersey.config.feature.Redirect</param-name>
>       <param-value>true</param-value>
>     </init-param>
>     <init-param>
>       <param-name>com.sun.jersey.config.property.packages</param-name>
>       <param-value>org.apache.camel.web:</param-value>
>     </init-param>
>     <init-param>
>
> <param-name>com.sun.jersey.config.property.WadlResourceUri</param-name>
>                 <param-value>/api</param-value>
>     </init-param>
>   </filter>
>
>   <filter-mapping>
>     <filter-name>Jersey Filter</filter-name>
>     <url-pattern>/*</url-pattern>
>   </filter-mapping>
>
>   <servlet>
>     <servlet-name>TemplateEngineServlet</servlet-name>
>
>
> <servlet-class>org.fusesource.scalate.servlet.TemplateEngineServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>
>   <servlet-mapping>
>     <servlet-name>TemplateEngineServlet</servlet-name>
>     <url-pattern>*.mustache</url-pattern>
>   </servlet-mapping>
>   <servlet-mapping>
>     <servlet-name>TemplateEngineServlet</servlet-name>
>     <url-pattern>*.scaml</url-pattern>
>   </servlet-mapping>
>   <servlet-mapping>
>     <servlet-name>TemplateEngineServlet</servlet-name>
>     <url-pattern>*.ssp</url-pattern>
>   </servlet-mapping>
>
>   <error-page>
>     <error-code>500</error-code>
>     <location>/WEB-INF/scalate/errors/500.scaml</location>
>   </error-page>
>
>
> </web-app>
>
>
> I am trying to access
> http://localhost:8090/camel-example-servlet-tomcat-2.12.1-SNAPSHOT/ for
> which I get a 500 error
>
> java.lang.IllegalArgumentException: No ServletTemplateEngine instance
> registered on ServletContext for key
> org.fusesource.scalate.servlet.ServletTemplateEngine. Are you sure your web
> application has registered the Scalate TemplateEngineServlet?
>
> org.fusesource.scalate.servlet.ServletTemplateEngine$.apply(ServletTemplateEngine.scala:40)
>
> org.fusesource.scalate.jersey.ScalateTemplateProcessor.resolve(ScalateTemplateProcessor.scala:69)
>
> org.fusesource.scalate.jersey.ScalateTemplateProcessor.resolve(ScalateTemplateProcessor.scala:44)
>
> com.sun.jersey.server.impl.template.TemplateFactory.resolveRelativeViewable(TemplateFactory.java:147)
>
> com.sun.jersey.server.impl.template.TemplateFactory.resolveViewable(TemplateFactory.java:94)
>
> com.sun.jersey.server.impl.template.ViewableRule.accept(ViewableRule.java:101)
>
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
>
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
>
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
>
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
>
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
>
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
>
> com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:886)
>
> com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:834)
>
> com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:795)
>
> I also need a web console url for this and tried
> http://localhost:8090/camel-example-servlet-tomcat-2.12.1-SNAPSHOT/services/routes
> which is not picking up either.
>
> I have tried to search through various blogs as to how to set webconsole as
> part of web application and I couldn't find any thing helpful
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Console-Not-able-to-bring-it-up-tp5739689.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen