You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org> on 2011/06/15 05:02:50 UTC
[jira] [Created] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
-------------------------------------------------------------------------------------------
Key: QPID-3307
URL: https://issues.apache.org/jira/browse/QPID-3307
Project: Qpid
Issue Type: Bug
Components: Java Client
Reporter: Charith Dhanushka Wickramarachchi
Priority: Critical
Hi ,
When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
Scenario.
In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
thanks,
Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Updated] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charith Dhanushka Wickramarachchi updated QPID-3307:
----------------------------------------------------
Attachment: QPID-3307_patch_unit_test.txt
Hi ,
I'm attaching an unit test case which will send receive an Object Message which have a custom Serializable Type inside.In that case the ObjectInputStream i have provided will be used. To re-create the exact class loading scenario I'll have to find a way to simulate that kind of class loading environment within the Unit test. I'll have to think through it on how to implement that.
thanks,
Charith
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Resolved] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Robbie Gemmell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robbie Gemmell resolved QPID-3307.
----------------------------------
Resolution: Fixed
Fix Version/s: 0.13
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Assignee: Robbie Gemmell
> Priority: Critical
> Fix For: 0.13
>
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Updated] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charith Dhanushka Wickramarachchi updated QPID-3307:
----------------------------------------------------
Attachment: QPID-3307_patch.txt
Hi Keith ,
Thanks for the feedback. I have updated the patch by changing the bracing style according to the doc you have pointed.
I'll attach another patch for unit tests after i look at the current system test and object message test.
thanks,
Charith
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Commented] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Keith Wall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13052878#comment-13052878 ]
Keith Wall commented on QPID-3307:
----------------------------------
Hi Charith
Did you take a look at the unit tests in directory client/src/test/java in package org.apache.qpid.test.unit.client.message?
I think the addition of a 'pure' unit test, rather than an extension to the system test would be more appropriate. I'd imagine we'd want a unit test much like client's BytesMessageTest, which would exercise the happy paths (serialised class, serialised primitive) and the maybe the unhappy path (serialised class not found through I can see this might be tricky).
I took a look at your extension to the system test ObjectInputStream. Does the test using CustomSerializableObject give us anything more than the existing tests with ObjectMessageTest.Payload?
Hope this helps.
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Commented] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064361#comment-13064361 ]
Charith Dhanushka Wickramarachchi commented on QPID-3307:
---------------------------------------------------------
Hi Robbie,
Sorry for the delay in updating. Actually i found a way to simulate the Environment but i caught up with some work and couldn't find a time to work on a unit test case. I think happy path is already covered in the current serialization test cases we have. Only thing is i need to add a test case that simulates the above mentioned class loading environment. Will be able to provide a patch for that soon, possibly in next weekend.
thanks,
Charith
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Assignee: Robbie Gemmell
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Commented] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Keith Wall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051741#comment-13051741 ]
Keith Wall commented on QPID-3307:
----------------------------------
Hi Charith
I think the patch on the whole looks fine. My comments would be only a) the absence of a unit test case and b) bracing style does not match https://cwiki.apache.org/qpid/java-coding-standards.html. I think a unit test that exercised the happy/unhappy path with a normal classloader arrangement would suffice. We do already have a system test, ObjectMessageTest, but I think we should be striving for more unit tests wherever we can.
cheers Keith.
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Assigned] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Robbie Gemmell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robbie Gemmell reassigned QPID-3307:
------------------------------------
Assignee: Robbie Gemmell
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Assignee: Robbie Gemmell
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Updated] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charith Dhanushka Wickramarachchi updated QPID-3307:
----------------------------------------------------
Attachment: QPID-3307_patch.txt
Re-attaching the patch Granting license to ASF for inclusion in ASF works :)
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Commented] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Robbie Gemmell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13088397#comment-13088397 ]
Robbie Gemmell commented on QPID-3307:
--------------------------------------
In the interests of getting this applied I have applied the 'QPID-3307_patch.txt' from June 20th, and then corrected a couple of style issues and added some basic unit tests myself for ObjectMessage and ClassLoadingAwareObjectInputStream to provide some unit rather than system test coverage of the classes.
Resolving JIRA.
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Assignee: Robbie Gemmell
> Priority: Critical
> Fix For: 0.13
>
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Updated] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charith Dhanushka Wickramarachchi updated QPID-3307:
----------------------------------------------------
Attachment: QPID-3307_patch.txt
Attaching the patch to resolve this issue.
I looked at the Apache ActiveMQ code and used the method they used to resolve this exact issue.
thanks,
Charith
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Commented] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Charith Dhanushka Wickramarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053031#comment-13053031 ]
Charith Dhanushka Wickramarachchi commented on QPID-3307:
---------------------------------------------------------
Hi Keith ,
Thanks for the feedback. Yes you are correct i was looking at Test cases in systests/src/main/java. As you mentioned the scenario covered by the test case i have provided is already covered in org.apache.qpid.test.unit.client.message.ObjectMessageTest.
I see there is no unit test for Object messages in package org.apache.qpid.test.unit.client.message to I'll add an unit test for it and provide a patch.
thanks,
Charith
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
[jira] [Commented] (QPID-3307) ClassNotfound Exception when using
Qpid java client in Complex classloading Environments.
Posted by "Robbie Gemmell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/QPID-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13063894#comment-13063894 ]
Robbie Gemmell commented on QPID-3307:
--------------------------------------
Hi Charith,
Have you made any progress on adding at least happy-path unit testing for this? It would be good to get your patch applied.
Regards,
Robbie
> ClassNotfound Exception when using Qpid java client in Complex classloading Environments.
> -------------------------------------------------------------------------------------------
>
> Key: QPID-3307
> URL: https://issues.apache.org/jira/browse/QPID-3307
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Charith Dhanushka Wickramarachchi
> Assignee: Robbie Gemmell
> Priority: Critical
> Attachments: QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch.txt, QPID-3307_patch_unit_test.txt
>
>
> Hi ,
> When we are using qpid client to receive JMSObject in complex class loading environments like web application containers/Osgi environments .There is a scenario where this issues comes.
> Scenario.
> In a web application container normally they use a class loader per web app. and if we have qpid client libs at the root classloader level this error can come. The reason for this is Serializable Object types that are used inside the web app are not visible to the class loader that loads the JMSObject message and unmarshall it.
> thanks,
> Charith
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org