MQQueueManager(String queueManagerName) throws MQException - ibm-mq

I have a java program to browse a message from queue.
When i run the application it shows the "java.lang.NoClassDefFoundError:" error
Also i have jar com.ibm.mq which contains class MQQueueManager. but i am getting error message like "This element neither has attached source nor attached Javadoc and hence no Javadoc could be found."
2nd question
It is a program to browse message. after browsing the message how to get only the messageID from the message.
Please give me the solution.

Usually the error you are seeing is caused when people grab the jar files rather than installing the client from the vendor distribution media. If you did not install the IBM MQ client from the media, you can download it for free as SupportPac MQC75. This will provide the complete client, the Initial Verification Program (IVP) that tests the installation, as well as a number of other diagnostics.
As for the message ID...
MQMessage myMessage = new MQMessage();
byte myMessageID = myMessage.messageId;
...as per the docs here and here.

Related

Esper AMQPSource not receiving events

I'm trying to use the AMQPSource and I'm getting the error describe below, also imports are not working in EPL module. In advance, I test adding full package name to DistanceEvent (events.DistanceEvent and does not work).
To sending a message i'm using the publish Rabbitmq webadmin queue option with the next payload:
{"distance":33}
Could anyone help me?
The "IO-error deserializing object" is the reason you are not seeing data.
The "AMQPToObjectCollectorSerializable" expects the AMQP message to carry a valid JVM-serialized object however the "invalid header" means that the message content cannot be read by the JVM. Check the sender making sure it produces a AMQP message with a JVM-serialized object or may use replace "AMQPToObjectCollectorSerializable" with a deserializer that can understand your message. The code for "AMQPToObjectCollectorSerializable" can be found in Github if your are not sure how it deserializes.

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Sending file using Spring Batch sftp

I'm trying to send a file with sftp using Spring Batch.
I find a great example/tutorial on this site https://blog.codecentric.de/en/2011/09/send-data-secure-with-sftp-and-spring-batch/ which I followed, though I am getting the "Could not send file per SFTP: ..." caught exception in the example in the link above in the SftpTasklet class. I believe my problem is that the int-sftp:outbound-channel-adapter in my application context is never getting called. The id associated with it sftpOutboundAdapter not referenced anywhere else on the page and I do not see how it gets called. I have found similar tutorials on other sites where it is also never explicitly called.
Basically, my question comes down to: how does the spring batch int-sftp:outbound-channel-adapter get called?
Thanks in advance
The tasklet sends a message (with a File payload) to outputChannel (sftpChannel.send(message);) which, in turn sends it to the outbound adapter.
Turn on DEBUG logging for org.springframework.integration to see the messasge flow.

GCM: java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender

I have been trying to get Google Cloud Messaging to work in eclipse. I was able to compile the example given on their demo webpage and run that without any errors; however, when I try to create my own example using jersey I get the run time error "java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender" when the following code tries to create a sender.
#POST
#Path("/send")
public Response sendMessage() throws IOException
{
Sender sender = new Sender("api_key");
Message message = new Message.Builder().build();
sender.send(message, DataStore.getDevices(), 5);
return Response.status(200).entity("Success").build();
}
Note: I have replaced my real api key with api_key. I know it works because I was able to get the demo working by running the ant commands explained in the tutorial. Also just to be specific in case of ambiguity, the error I am getting is server side, and has nothing to do with the android device.
Things I have already tried:
I have included the gcm-server.jar in my WEB-INF/lib folder and under project properties I have included it in the build path.
I have also tried, as mentioned on other sites, to include json_simple-1.1.jar the same way I included gcm-server.jar. I don't see how this would effect this error but I saw this listed as an answer in a few different places.
(Solution) Deleted the tomcat server and created a new one. I probably could have just cleaned the project instead and had the same results.
Demo tutorial link: http://developer.android.com/guide/google/gcm/demo.html.
I just found a solution to my problem. In frustration I deleted the old Tomcat server from eclipse and created a new one. When I ran the project again there weren't any problems at all. When I first set up the project I had included the jar files in WEB-INF/lib and later, after reading a lot of posts on the internet, added gcm-server.jar to the build path. It appears that this action would have fixed it but for some reason unknown to me there were some left over files on the server from before the change. I should have tried cleaning my project but I didn't even think about that being the issue. Anyway, I hope that this helps someone because I've sort of condensed all of the information I could find on the internet into this post, as well as included my own dilemma and solution to it.

HermesJMS - Linked Exception : null when attempting to post an XML message

I am using HermesJMS version 1.14. I am attempting to post an XML message to an IBM WebSphere MQ queue via HermesJMS.
I face two issues namely,
If I select a queue, right click, select "New" -> "Message" and then copy , paste the xml message as a text in the 'Payload' tab, it gives me an 'MQ Authentication Error, invalid security credentials'. However, I have very well supplied the security credentials before actually pasting the payload.
If I click on the X button (a visual indication to upload) and select an XML message (xml file in filesystem), it gives me an error stating that "Linked Exception : null".
I have been searching (googling) for about a week's time. I had also posted the same in HermesJMS forum yesterday.
Any idea on this would be highly appreciable.

Resources