Grokbase Groups Camel users May 2015
FAQ
In Camel 2.15.x we has two JettyComponents to support Jetty9 and Jetty8 at the same time.
If you want to instantiate one of the Jetty component, you cannot use the JettyHttpComponent any more, as it is abstract class now.

If you want to use Jetty9, you need to use the class”JettyHttpComponent9", otherwise you need to chose “JettyHttpComponent8”.


--
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem


On May 28, 2015 at 4:48:31 AM, btt423 (btatum@diversecomputing.com) wrote:
I was originally testing out the Rest DSL and using Jetty as the server.
This works great and I'm a big fan. My next step was to try and get SSL
working with my test application. Based on the reading that I did, it looks
like I needed to add a jetty bean definition in blueprint.xml, and specify
the keystore, keystore password and key password. When I add the bean
definition for jetty, I'm getting the exception listed below. I have tried
a number of different troubleshooting attempts, but always get this
exception whenever I attempt to define the bean in blueprint xml (even
taking SSL completely out the equation). The exception, details of my
environment and the applicable snippets of code/config are below - I would
appreciate any help that could be provided!!

******* Environment Info: *******

Camel 2.15.2
camel-blueprint 2.15.2
camel-jetty 2.15.2

******* Exception: *******

org.osgi.service.blueprint.container.ComponentDefinitionException: Error
when instantiating bean jetty of class class
org.apache.camel.component.jetty.JettyHttpComponent
at
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:333)
at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)
at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
at
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
at
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
at
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:668)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:370)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.InstantiationException
at
sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at
org.apache.aries.blueprint.utils.ReflectionUtils.newInstance(ReflectionUtils.java:329)
at
org.apache.aries.blueprint.container.BeanRecipe.newInstance(BeanRecipe.java:962)
at
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:331)
... 21 more

******* blueprint.xml: *******

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
" rel="nofollow">http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
class="org.apache.camel.component.jetty.JettyHttpComponent">












******* RouteBuilder: *******

public class RestRouter extends RouteBuilder {

@Override
public void configure() throws Exception {

restConfiguration()
.component("jetty")
.host("localhost")
.port("8082")
//.scheme("https")
.contextPath("rest")
.bindingMode(RestBindingMode.auto)
.dataFormatProperty("prettyPrint", "true");

rest("/say")
.get("/hello").to("direct:hello")
.get("/bye").consumes("application/json").to("direct:bye")
.post("/bye").to("mock:update");

from("direct:hello")
.transform().constant("Hello World");
from("direct:bye")
.transform().constant("Bye World");
}
}



--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-with-jetty-and-SSL-tp5767572.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
groupusers @
categoriescamel
postedMay 27, '15 at 8:48p
activeMay 31, '15 at 1:51a
posts4
users4
websitecamel.apache.org

People

Translate

site design / logo © 2021 Grokbase