You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fachhoch <fa...@gmail.com> on 2011/06/21 23:42:39 UTC
example app to embed camel-web-console
I want to embed camel web console into my app ,are there any examples ?,I
tried adding
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-web</artifactId>
<version>2.7.1</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
to my pom , it did not work ,do I need to add anything in my web.xml ?
--
View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4512075.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: example app to embed camel-web-console
Posted by fachhoch <fa...@gmail.com>.
if I seperate this into two wars , ie one for my aplication and other camel
war , how can camel war update routes from my application war ?
--
View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4531839.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: example app to embed camel-web-console
Posted by Jon Anstey <ja...@gmail.com>.
Now it depends on what jar you are talking about but in general since a WAR
classloader is flat, you can't have two versions of the same class... so you
will either have to find some way of using the same version of this jar in
your application as Camel uses or separate this into 2 WARs.
On Fri, Jun 24, 2011 at 12:05 PM, fachhoch <fa...@gmail.com> wrote:
> It worked well in the test application, I tried in my actual application
> It
> failed with no such method error, because camel and my application both
> had the same jar with different version , so what is the solution for this
> ? I mean both wars might have same jars with differnt version and
> obviously it lead to probelms os how to what do you suggest ?
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4521186.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Cheers,
Jon
---------------
FuseSource
Email: jon@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen
Re: example app to embed camel-web-console
Posted by fachhoch <fa...@gmail.com>.
It worked well in the test application, I tried in my actual application It
failed with no such method error, because camel and my application both
had the same jar with different version , so what is the solution for this
? I mean both wars might have same jars with differnt version and
obviously it lead to probelms os how to what do you suggest ?
--
View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4521186.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: example app to embed camel-web-console
Posted by Jon Anstey <ja...@gmail.com>.
Instead of maven-jetty-plugin use the newer jetty-maven-plugin which does
overlay properly
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.2.2.v20101205</version>
</plugin>
since this is an overlay (2 WARs merged into 1), the web.xml file from the
Camel web console is overwritten by your web.xml file. I modified your
web.xml file to include Camel web console:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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"
version="2.4">
<display-name>myproject</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:com/mycompany/applicationContext-camel.xml
</param-value>
</context-param>
<!--
There are three means to configure Wickets configuration mode and they
are
tested in the order given.
1) A system property: -Dwicket.configuration
2) servlet specific <init-param>
3) context specific <context-param>
The value might be either "development" (reloading when templates
change)
or "deployment". If no configuration is found, "development" is the
default.
-->
<filter>
<filter-name>wicket.myproject</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.mycompany.WicketApplication</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>wicket.myproject</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<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>
<!--
TODO scrap this when we move to latest jersey: 1.4-ea05
-->
<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>
Your wicket app is at: http://localhost:8080/myproject/
Browse routes at: http://localhost:8080/routes
Cheers,
Jon
On Thu, Jun 23, 2011 at 3:48 PM, fachhoch <fa...@gmail.com> wrote:
> I dont want both the apps to be independent , I want to have camel web
> console in my app as a web resource, I tried
> http://localhost:8080/artms/routes url it did not work ,
> so to test it in simple way I created a a wicket quickstart project added
> camel-web-console as dependency.
>
> this project is maven eclipse project it has jetty pluign .I attached this
> project. Please help me run web-console in this.
> http://camel.465427.n5.nabble.com/file/n4517697/myproject.zipmyproject.zip
>
> this can run using
> mvn jetty:run
>
> to access this in browser http://localhost:8080/myproject/
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4517697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Cheers,
Jon
---------------
FuseSource
Email: jon@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen
Re: example app to embed camel-web-console
Posted by fachhoch <fa...@gmail.com>.
I dont want both the apps to be independent , I want to have camel web
console in my app as a web resource, I tried
http://localhost:8080/artms/routes url it did not work ,
so to test it in simple way I created a a wicket quickstart project added
camel-web-console as dependency.
this project is maven eclipse project it has jetty pluign .I attached this
project. Please help me run web-console in this.
http://camel.465427.n5.nabble.com/file/n4517697/myproject.zip myproject.zip
this can run using
mvn jetty:run
to access this in browser http://localhost:8080/myproject/
--
View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4517697.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: example app to embed camel-web-console
Posted by Jon Anstey <ja...@gmail.com>.
Yeah, what Taariq suggested should work. Keep in mind that when you specify
camel-web as a dependency, the maven-jetty-plugin will overlay the camel
webconsole web app in your own web app and run it as one web app. You would
probably have to have multiple executions of the maven-jetty-plugin in your
pom to get both web apps to be independent.
On Thu, Jun 23, 2011 at 2:59 PM, Taariq Levack <ta...@gmail.com> wrote:
> I would expect the following to work.
> http://localhost:8080/artms/routes <http://localhost:8080/routes>
> http://localhost:8080/artms/endpoints <http://localhost:8080/endpoints>
>
> On Thu, Jun 23, 2011 at 3:17 PM, fachhoch <fa...@gmail.com> wrote:
>
> > Thanks for the reply ,I emebdded camel war to my war project which I
> deploy
> > using jetty-maven-plugin
> >
> > ,context root for my war is artms ,please tell me how to access camel
> > console , I mean what is the url
> > my jetty runs on 8080 so I acces my application as localhost:8080/artms
> > what should be for camel ?
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4517407.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
--
Cheers,
Jon
---------------
FuseSource
Email: jon@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen
Re: example app to embed camel-web-console
Posted by Taariq Levack <ta...@gmail.com>.
I would expect the following to work.
http://localhost:8080/artms/routes <http://localhost:8080/routes>
http://localhost:8080/artms/endpoints <http://localhost:8080/endpoints>
On Thu, Jun 23, 2011 at 3:17 PM, fachhoch <fa...@gmail.com> wrote:
> Thanks for the reply ,I emebdded camel war to my war project which I deploy
> using jetty-maven-plugin
>
> ,context root for my war is artms ,please tell me how to access camel
> console , I mean what is the url
> my jetty runs on 8080 so I acces my application as localhost:8080/artms
> what should be for camel ?
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4517407.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: example app to embed camel-web-console
Posted by fachhoch <fa...@gmail.com>.
Thanks for the reply ,I emebdded camel war to my war project which I deploy
using jetty-maven-plugin
,context root for my war is artms ,please tell me how to access camel
console , I mean what is the url
my jetty runs on 8080 so I acces my application as localhost:8080/artms
what should be for camel ?
--
View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4517407.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: example app to embed camel-web-console
Posted by Taariq Levack <ta...@gmail.com>.
Hi
So you hit tomcat, and there were no errors deploying?
Did you perhaps configure your IDE to deploy to a context root? If so you need to add that to the URL.
Also, did you manage to get the example app running from the maven archetype?
Follow this page carefully http://camel.apache.org/web-console.html
Taariq
On 22 Jun 2011, at 4:29 AM, fachhoch <fa...@gmail.com> wrote:
> Atleast please guide how to embed apache-web-console in my app.
> I tried adding the camel war dependency in my pom, maven added everything
> from the camelwar to my war when I tried accessing local host:8080 I got
> tomcat home page please guide how to integrate camel web console in my app
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4512688.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: example app to embed camel-web-console
Posted by fachhoch <fa...@gmail.com>.
Atleast please guide how to embed apache-web-console in my app.
I tried adding the camel war dependency in my pom, maven added everything
from the camelwar to my war when I tried accessing local host:8080 I got
tomcat home page please guide how to integrate camel web console in my app
--
View this message in context: http://camel.465427.n5.nabble.com/example-app-to-embed-camel-web-console-tp4512075p4512688.html
Sent from the Camel - Users mailing list archive at Nabble.com.