[ 
https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012003#comment-13012003
 ] 

Ivan Vitoria commented on CXF-3418:
-----------------------------------

Sorry, the three context elements were not been injected instead of just 
MessageContext. My fault!

The problem was that the inherited class needed an explicit interface due to 
the new methods, and this interface must be added to the new model.

{code:xml} 
 public class GenericRestServiceImpl2 extends GenericRestServiceImpl implements 
IExtraBehaviour {
 
        public void extraMethod() {...}
 
}

@Transactional
public interface IExtraBehaviour {
        
        void extraMethod();

}

<model xmlns="http://cxf.apache.org/jaxrs";>
    <resource name="IExtraBehaviour" path="/" consumesType="application/xml" 
producesType="application/xml">
        <!-- IRestService methods -->
                 <operation name="get" verb="GET" path="/{id}">
            <param name="id" type="PATH"/>
        </operation>
        <!-- IExtraBehaviour methods -->
        <operation name="extraMethod" verb="GET" path="/extra" />        
    </resource>
</model>

{code} 

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, 
> JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using 
> Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no 
> problem when I add the @Transactional annotation to the DAO layer, but i 
> would like to have the REST methods in the same transaction, so i've annoated 
> the services. But I can't do it, neither annotating the interface nor the 
> classes.  A ServiceConstructionException is throwed as soon as I add the 
> @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to