Camel wrestling and org.restlet.jee.ext.spring conflicts?
I am trying to create a webapp to deploy to Glassfish 4. Following the example Using Restlet Servlet inside webapp
- maven project created
- added dependencies on
pom.xml
- set the servlet config to
web.xml
- Place bean definition in context.xml
My problem is that it doesn't launch as a webapp under glass panes. With mvn jetty:run
it works fine, but drunk.
I suspect there is a Spring version conflict between wrestler camel and org.restlet.jee.ext.sprint.
-
camel-restlet v1.13.0+
depends onspring v3.2.8.RELEASE
-
org.restlet.jee.ext.sprint v2.2.2
depends onspring v3.2.6.RELEASE
has similar differences such as
-
camel-restlet v1.12.3+
depends onspring v3.2.5.RELEASE
Therefore, I could not find a version camel-restlet
and ext.spring
that would match each other.
How can I give an example from camel.apache.org working under glass.
ps google and co. did it already. examples from github and other resources have already tried.
So. Here's the output from the server.log from a webapp running in a glass shawl. As I said, the same code works well in the dock.
SpringCamelContext DEBUG Route: RS_RestletDemo >>> EventDrivenConsumerRoute[Endpoint[/demo/(id)?restletMethods=GET] -> Channel[Transform(Simple: Request type : ${header.CamelHttpMethod} and ID : ${header.id})]]
SpringCamelContext DEBUG Starting consumer (order: 1001) on route: RS_RestletDemo
DefaultManagementAgent DEBUG Registered MBean with ObjectName: org.apache.camel:context=camel-1-1,type=consumers,name=RestletConsumer(0x40cb4833)
RestletConsumer DEBUG Starting consumer: Consumer[/demo/(id)?restletMethods=GET]
RestletComponent DEBUG Setting parameters: [] to server: org.restlet.Server@8528a1b
RestletComponent DEBUG Added server: null:80
RestletComponent DEBUG Added method based router: org.apache.camel.component.restlet.MethodBasedRouter@62e8f6e1
RestletComponent DEBUG Attached restlet uriPattern: /demo/{id} method: GET
RestletComponent DEBUG Attached methodRouter uriPattern: /demo/{id}
RestletComponent DEBUG Started methodRouter uriPattern: /demo/{id}
SpringCamelContext INFO Route: RS_RestletDemo started and consuming from: Endpoint[/demo/(id)?restletMethods=GET]
GET http://localhost:8080/camel-restlet/rs/demo/123
HTTP Status 500 - Internal Server Error
javax.servlet.ServletException: Servlet.init() for servlet RestletServlet threw exception
root cause
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/restlet/ext/servlet/internal/ServletWarClient.<init>(Lorg/restlet/Context;Ljavax/servlet/ServletContext;)V @35: putfield
Reason:
Type 'org/restlet/ext/servlet/internal/ServletWarClientHelper' (current frame, stack[1]) is not assignable to 'org/restlet/engine/connector/ClientHelper'
Current Frame:
bci: @35
flags: { }
locals: { 'org/restlet/ext/servlet/internal/ServletWarClient', 'org/restlet/Context', 'javax/servlet/ServletContext' }
stack: { 'org/restlet/ext/servlet/internal/ServletWarClient', 'org/restlet/ext/servlet/internal/ServletWarClientHelper' }
Bytecode:
0000000: 2a2b b600 0101 c000 02b7 0003 2ab6 0004
0000010: b200 05b9 0006 0200 572a bb00 0759 2a2c
0000020: b700 08b5 0009 b1
Could you tell me what I am doing wrong?
I tried overriding the Spring version, excluding expring dependencies in pom.xml, etc. bad luck.
UPDATE . FIXED
Note for people facing similar issue I fixed this - using org.restlet.ext.spring v2.1.7
and camel-restlet v2.13.2
- moving org.restlet.ext.spring
up - removing all Spring dependencies from pom.xml
moved
It now works both war
in glassfish 3,4
and offline. jetty
A working version example can be found on github
source to share
No one has answered this question yet
Check out similar questions: