Bug 1042826 - No active contexts for scope type javax.enterprise.context.RequestScoped
Summary: No active contexts for scope type javax.enterprise.context.RequestScoped
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
low
urgent
Target Milestone: ---
: ---
Assignee: Magesh Kumar Bojan
QA Contact: Jiri Sedlacek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-13 13:25 UTC by Andrej Podhradsky
Modified: 2015-10-18 22:38 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If you use JAX-RS annotations on the interface implemented by your bean service, you may encounter an error. It is a good idea not to use binding annotations directly on service interfaces as it clutters the abstract service contract with binding-specific details. Separate JAX-RS annotations into a distinct interface to avoid confusing CDI/Weld.
Clone Of:
Environment:
Last Closed: 2014-11-11 21:12:13 UTC
Type: Bug


Attachments (Terms of Use)
error log (19.58 KB, text/plain)
2013-12-13 13:25 UTC, Andrej Podhradsky
no flags Details
rest-example (5.32 KB, application/zip)
2013-12-13 13:26 UTC, Andrej Podhradsky
no flags Details
updated example (7.03 KB, application/zip)
2013-12-13 13:42 UTC, Keith Babo
no flags Details

Description Andrej Podhradsky 2013-12-13 13:25:36 UTC
Created attachment 836322 [details]
error log

Description of problem:
After deploying a simple rest app I'm getting the following error:

WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped

Version-Release number of selected component (if applicable):
ER7

How reproducible:
always

Steps to Reproduce:
1. Deploy rest-example into SOA 6.0.0.ER7 (rest-exaple.zip is eclipse project)
2. Go to http://localhost:8080/rest/hello/World

Actual results:
See the attached file error.log

Expected results:
It should return 'Hello World'

Comment 1 Andrej Podhradsky 2013-12-13 13:26:11 UTC
Created attachment 836323 [details]
rest-example

Comment 2 Keith Babo 2013-12-13 13:41:27 UTC
This is due to the fact that you are using JAX-RS annotations on the interface implemented by your bean service.  We don't recommend using binding annotations directly on service interfaces as it pollutes the abstract service contract with binding-specific details.  In this particular case, it looks like CDI/Weld is getting confused because the actual CDI bean has JAX-RS annotations on the interface it's using.  All you need to do is separate out the JAX-RS annotations into a distinct interface (e.g. HelloResource) and the app will work just fine.  I have attached a revised version for reference.

Comment 3 Keith Babo 2013-12-13 13:42:24 UTC
Created attachment 836329 [details]
updated example

Comment 4 Andrej Podhradsky 2013-12-13 15:05:20 UTC
The updated example works fine and if it is correct behaviour then this isses can be closed. 
I'm just wondering why it is working in switchyard-1.1.0.Final-EAP6.1.GA and not in FSW.

Comment 5 Rob Cernich 2014-10-14 17:24:50 UTC
mbojan could you please verify whether or not behavioral differences exist between FSW 6.0 and 6.1?  If there are differences, please document what it would take to make FSW 6.1 behave like 6.0.  Thanks in advance.

Comment 6 Rob Cernich 2014-10-21 17:12:47 UTC
Hey Magesh, please ignore my last comment.  I misread Andrej's statement.  It looks like the difference is between community and product.  Could you please investigate why that might be happening (if it still occurs in FSW 6.1).

Comment 7 tcunning 2014-11-11 21:12:13 UTC
This did work on 1.1, but with more recent changes it doesn't appear to work on community + EAP.    Tested it on 2.0.0-SNAPSHOT + EAP-6.3 and got the same error described here.   I don't think there are behavioral differences in this area between product and community - I'm getting similar results using the example here.


Note You need to log in before you can comment on or make changes to this bug.