You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Frank Ittermann (JIRA)" <ji...@apache.org> on 2008/07/30 16:51:32 UTC

[jira] Created: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

I guess there is an error in the ProviderFactory of jaxrs component.
--------------------------------------------------------------------

                 Key: CXF-1727
                 URL: https://issues.apache.org/jira/browse/CXF-1727
             Project: CXF
          Issue Type: Bug
          Components: REST
    Affects Versions: 2.1.2
         Environment: Windowx XP, Apache Tomcat and i used spring configuration
            Reporter: Frank Ittermann


I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
The following code block is wrong i guess:

if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
   InjectionUtils.injectContextFields(em.getProvider(), em, m);
   InjectionUtils.injectContextMethods(em.getProvider(), em, m);
   return em.getProvider();
}

The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.

So i wrote a little test to understand this.

System.out.println(IOException.class.isAssignableFrom(Exception.class));
System.out.println(Exception.class.isAssignableFrom(IOException.class));

The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 

Please change the wrong code block the right order of parameter will be

if (((Class<?>)args[i]).isAssignableFrom(exceptionType))

Thank for your attention


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618487#action_12618487 ] 

Frank Ittermann commented on CXF-1727:
--------------------------------------

Okay i got the point and thanks for your fast feedback.


> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618457#action_12618457 ] 

pussinboost edited comment on CXF-1727 at 7/30/08 12:23 PM:
----------------------------------------------------------------

Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time to submit the patch tomorrow.

Can you give my advices how could i submit a patch here or a link.

By the try to build the cxf 2.1.2 source with my patch i end with the error message below

[INFO] FastInfosetting 0 resource
[INFO] [cxf-common-xsd:xsdtojava {execution: generate-sources}]
[ERROR] src-resolve: Cannot resolve the name 'wsdl:tExtensibilityElement' to a(n) 'type definition' component.
  line 32 of file:/C:/jzx/sodtware/apache-cxf-2.1.2-SNAPSHOT-src/rt/bindings/xml/src/main/resources/schemas/wsdl/xml-binding.xsd

Failed to parse a schema.
org.apache.tools.ant.ExitException: ExitException: status -1
        at org.apache.tools.ant.util.optional.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:38)
        at java.lang.Runtime.exit(Runtime.java:88)
        at java.lang.System.exit(System.java:906)
        at com.sun.tools.xjc.Driver._main(Driver.java:116)
        at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
        at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] ExitException: status -1

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 26 seconds
[INFO] Finished at: Wed Jul 30 20:18:27 CEST 2008
[INFO] Final Memory: 60M/916M
[INFO] ------------------------------------------------------------------------

So today i couldn't check if the bug fix works.

Run the maven command
mvn -Pfastinstall doesn't work also the same error occurred.
Any help.

      was (Author: pussinboost):
    Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time submit the patch tomorrow.

Can you give advices how could i submit a patch here or a link.

By the try to build the cxf 2.1.2 source with my patch i end with the error message below

[INFO] FastInfosetting 0 resource
[INFO] [cxf-common-xsd:xsdtojava {execution: generate-sources}]
[ERROR] src-resolve: Cannot resolve the name 'wsdl:tExtensibilityElement' to a(n) 'type definition' component.
  line 32 of file:/C:/jzx/sodtware/apache-cxf-2.1.2-SNAPSHOT-src/rt/bindings/xml/src/main/resources/schemas/wsdl/xml-binding.xsd

Failed to parse a schema.
org.apache.tools.ant.ExitException: ExitException: status -1
        at org.apache.tools.ant.util.optional.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:38)
        at java.lang.Runtime.exit(Runtime.java:88)
        at java.lang.System.exit(System.java:906)
        at com.sun.tools.xjc.Driver._main(Driver.java:116)
        at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
        at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] ExitException: status -1

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 26 seconds
[INFO] Finished at: Wed Jul 30 20:18:27 CEST 2008
[INFO] Final Memory: 60M/916M
[INFO] ------------------------------------------------------------------------

So could now check if the bug fix work.

Run the maven command
mvn -Pfastinstall doesn't work also the same error occurred.
Any help.
  
> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618487#action_12618487 ] 

pussinboost edited comment on CXF-1727 at 7/30/08 1:39 PM:
---------------------------------------------------------------

Okay i got the point and thanks for your fast feedback.

The maven build was successful now. I read the Building CXF section again and try a little bit with maven and now it works. Sorry about the build panic from my side. I'am not so familiar with maven. So great job of yours.

      was (Author: pussinboost):
    Okay i got the point and thanks for your fast feedback.

  
> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618457#action_12618457 ] 

pussinboost edited comment on CXF-1727 at 7/30/08 11:26 AM:
----------------------------------------------------------------

Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time submit the patch tomorrow.

Can you give advices how could i submit a patch here or a link.

By the try to build the cxf 2.1.2 source with my patch i end with the error message below

[INFO] FastInfosetting 0 resource
[INFO] [cxf-common-xsd:xsdtojava {execution: generate-sources}]
[ERROR] src-resolve: Cannot resolve the name 'wsdl:tExtensibilityElement' to a(n) 'type definition' component.
  line 32 of file:/C:/jzx/sodtware/apache-cxf-2.1.2-SNAPSHOT-src/rt/bindings/xml/src/main/resources/schemas/wsdl/xml-binding.xsd

Failed to parse a schema.
org.apache.tools.ant.ExitException: ExitException: status -1
        at org.apache.tools.ant.util.optional.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:38)
        at java.lang.Runtime.exit(Runtime.java:88)
        at java.lang.System.exit(System.java:906)
        at com.sun.tools.xjc.Driver._main(Driver.java:116)
        at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
        at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] ExitException: status -1

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 26 seconds
[INFO] Finished at: Wed Jul 30 20:18:27 CEST 2008
[INFO] Final Memory: 60M/916M
[INFO] ------------------------------------------------------------------------

So could now check if the bug fix work.

Run the maven command
mvn -Pfastinstall doesn't work also the same error occurred.
Any help.

      was (Author: pussinboost):
    Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time submit the patch tomorrow.

Can you give advices how could i submit a patch here or a link.

By the try to build the cxf 2.1.2 source with my patch i end with the error message below

[INFO] FastInfosetting 0 resource
[INFO] [cxf-common-xsd:xsdtojava {execution: generate-sources}]
[ERROR] src-resolve: Cannot resolve the name 'wsdl:tExtensibilityElement' to a(n) 'type definition' component.
  line 32 of file:/C:/jzx/sodtware/apache-cxf-2.1.2-SNAPSHOT-src/rt/bindings/xml/src/main/resources/schemas/wsdl/xml-binding.xsd

Failed to parse a schema.
org.apache.tools.ant.ExitException: ExitException: status -1
        at org.apache.tools.ant.util.optional.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:38)
        at java.lang.Runtime.exit(Runtime.java:88)
        at java.lang.System.exit(System.java:906)
        at com.sun.tools.xjc.Driver._main(Driver.java:116)
        at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
        at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] ExitException: status -1

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 26 seconds
[INFO] Finished at: Wed Jul 30 20:18:27 CEST 2008
[INFO] Final Memory: 60M/916M
[INFO] ------------------------------------------------------------------------

So could now check if the bug fix work.
  
> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618457#action_12618457 ] 

Frank Ittermann commented on CXF-1727:
--------------------------------------

Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time submit the patch tomorrow.

Can you give advices how could i submit a patch here or a link.

> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618482#action_12618482 ] 

Sergey Beryozkin commented on CXF-1727:
---------------------------------------

Sorry, I meant I'd myself change the code as you suggested - I'll do it this evening and try the tests. Because you explained what  the problem was and the change was minimal I thought it was sufficient to treat your initial entry  in this JIRA as an actual patch...

Perhaps Dan or someone else can help you with the Maven issue - building CXF locally would help in case you spot some other problems and decide to submit a patch :-)

Cheers, Sergey 

> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618398#action_12618398 ] 

Sergey Beryozkin commented on CXF-1727:
---------------------------------------

Thanks for it, I consider your suggestion be a patch. I'm planning to do a merge with few minor fixes very soon this week and I'll include this fix.

> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-1727.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.2

This is fixed now, thanks

> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>             Fix For: 2.1.2
>
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-1727) I guess there is an error in the ProviderFactory of jaxrs component.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618457#action_12618457 ] 

pussinboost edited comment on CXF-1727 at 7/30/08 11:21 AM:
----------------------------------------------------------------

Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time submit the patch tomorrow.

Can you give advices how could i submit a patch here or a link.

By the try to build the cxf 2.1.2 source with my patch i end with the error message below

[INFO] FastInfosetting 0 resource
[INFO] [cxf-common-xsd:xsdtojava {execution: generate-sources}]
[ERROR] src-resolve: Cannot resolve the name 'wsdl:tExtensibilityElement' to a(n) 'type definition' component.
  line 32 of file:/C:/jzx/sodtware/apache-cxf-2.1.2-SNAPSHOT-src/rt/bindings/xml/src/main/resources/schemas/wsdl/xml-binding.xsd

Failed to parse a schema.
org.apache.tools.ant.ExitException: ExitException: status -1
        at org.apache.tools.ant.util.optional.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:38)
        at java.lang.Runtime.exit(Runtime.java:88)
        at java.lang.System.exit(System.java:906)
        at com.sun.tools.xjc.Driver._main(Driver.java:116)
        at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
        at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] ExitException: status -1

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 26 seconds
[INFO] Finished at: Wed Jul 30 20:18:27 CEST 2008
[INFO] Final Memory: 60M/916M
[INFO] ------------------------------------------------------------------------

So could now check if the bug fix work.

      was (Author: pussinboost):
    Before i can submit a patch i will try if me suggestion is right. I fixed this and build a new cxf 2.1.2 version local. After that i will see if i have the time submit the patch tomorrow.

Can you give advices how could i submit a patch here or a link.
  
> I guess there is an error in the ProviderFactory of jaxrs component.
> --------------------------------------------------------------------
>
>                 Key: CXF-1727
>                 URL: https://issues.apache.org/jira/browse/CXF-1727
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1.2
>         Environment: Windowx XP, Apache Tomcat and i used spring configuration
>            Reporter: Frank Ittermann
>
> I thin in the method createExceptionMapper of the org.apache.cxf.jaxrs.provider.ProviderFactory class is an error.
> The following code block is wrong i guess:
> if (exceptionType.isAssignableFrom((Class<?>)args[i])) {
>    InjectionUtils.injectContextFields(em.getProvider(), em, m);
>    InjectionUtils.injectContextMethods(em.getProvider(), em, m);
>    return em.getProvider();
> }
> The if doesn't work correctly. I wrote a ExceptionMapper<Exception> for the general Exception class. And i tested this ExceptionMapper with a throw of a IOException and it was not called. So I decided to debug the ExceptionMapper staff and i found that the if in the code block a above is false.
> So i wrote a little test to understand this.
> System.out.println(IOException.class.isAssignableFrom(Exception.class));
> System.out.println(Exception.class.isAssignableFrom(IOException.class));
> The first line of code is what your if does and if you check this you will see it returns false. But Exception is the super class
> of IOException how could it possible. The answer is easy because the isAssignableFrom method check if the 
> passed class parameter is the same or a child of the class on which isAssignableForm was called. So The bug fix will be the second line they return true. 
> Please change the wrong code block the right order of parameter will be
> if (((Class<?>)args[i]).isAssignableFrom(exceptionType))
> Thank for your attention

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.