Issue Details (XML | Word | Printable)

Key: SMXCOMP-335
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Guillaume Nodet
Reporter: Ryan Bohn
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ServiceMix Components

Sending an exchange in a thread created by the bean result in a NullpointerException on DeliveryChannel.send()

Created: 12/Nov/07 12:47 PM   Updated: 15/Feb/09 12:19 AM
Return to search
Component/s: servicemix-bean
Affects Version/s: None
Fix Version/s: 3.2.4, servicemix-bean-2008.01

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works BeanEndpoint_sm1134.patch 2008-09-01 10:50 PM Jeroen Ninck Blok 2 kB
Zip Archive servicemix-bean-example.zip 2007-11-12 12:47 PM Ryan Bohn 9 kB
Environment: Mac OSX Tiger


 Description  « Hide
I'm trying to send a message asynchronously from a sender to a receiver using an InOnly exchange. When I call DeliveryChannel.send(), I get the following NullPointerException:

Sending message: Hello?
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:846)
at org.apache.servicemix.bean.BeanEndpoint$PojoChannel.send(BeanEndpoint.java:566)
at example.Sender$1.run(Sender.java:40)
at java.lang.Thread.run(Thread.java:613)

When I go to the line of code in the BeanEndpoint, I see the following:

requests.put(messageExchange.getExchangeId(), currentRequest.get());

Using my debugger, I noticed the value of currentRequest.get() returns null, which is not allowed in a ConcurrentHashMap (neither null keys nor null values are allowed). the message exchange id is non-null.

I also noticed that currentRequest is only set when the component receives an exchange, which is not the case here.

Both the sender and receiver are using bean endpoints. I have attached the project to this ticket. You can deploy the project using maven, with the following command:

mvn install jbi:projectDeploy



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order