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

Michael Bolz commented on OLINGO-298:
-------------------------------------

Hi Eugenio,

I also have seen the import of the {{NotAllowedException}} in 
{{ODataExceptionMapperImpl}}.
To remove this and the use of {{Application}} via {{@Context}} I have to do 
further checks.

But I think in your use case you could probably switch from the 
{{CXFNonSpringJaxrsServlet}} to the {{ODataServlet}} in the {{web.xml}}.
In the second one the {{ODataExceptionMapperImpl}} is not used to handle the 
exception.
Is this possible for you?

Kind regards, Michael

{{web.xml}} - Snippet:
{code}
    <servlet>
        <servlet-name>NonJaxrsServlet</servlet-name>
        
<servlet-class>org.apache.olingo.odata2.core.servlet.ODataServlet</servlet-class>
        <init-param>
            <param-name>org.apache.olingo.odata2.service.factory</param-name>
            
<param-value>org.example.your.service.factory.MyServiceFactory</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>NonJaxrsServlet</servlet-name>
        <url-pattern>/OData.svc/*</url-pattern>
    </servlet-mapping>
{code}


> Incompatibility with jsr311
> ---------------------------
>
>                 Key: OLINGO-298
>                 URL: https://issues.apache.org/jira/browse/OLINGO-298
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 1.2.0
>            Reporter: Eugenio Lentini
>            Assignee: Michael Bolz
>            Priority: Blocker
>
> Hi,
> I have tried to deploy a web application with an OData web service based on 
> Olingo on IBM Websphere version 8.5.5 and I have got an exception due to an 
> incompatible use of @Contex annotation with jsr311 specification
> org.apache.wink.server.internal.application.ApplicationProcessor 
> processClasses Une exception s'est produite lors du traitement de la classe 
> org.apache.olingo.odata2.core.rest.ODataExceptionMapperImpl. Classe ignorée.
> java.lang.IllegalArgumentException: javax.ws.rs.core.Application is not an 
> interface
> Basically you are using in the class ODataExceptionMapperImpl.java the 
> annotation in this way 
> @Context
> Application app;
> but the javax.ws.rs.core.Application is not allowed as context type according 
> to the specification jsr311 but it is allow in jsr339.
> Could you please have a look?
> Eugenio



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to