Thursday, October 4, 2018

Message Queue in Liberty Profile ​

I didn't know that Liberty Profile has come with an internal embedded messaging server? This sound interesting to me, I should to give it a try now. For this to work, it required the full profile version of Liberty Profile. When I first start, I didn’t realize the one I'm using now is a web profile version, end up I'm not able to configure the messaging features in the server. I got the Liberty full profile from here. According to the tutorial found on the web, the configuration on the server.xml is pretty straightforward. Here is the work done in PTP configuration:

The <jmsactivationspec> tag is the very crucial part of connecting the embedded messaging engine to the MDB deployed in the server. The documentation mentions here has detail explanation on how the things should work. Without this tag or miss configure the id will give a friendly error reminding you that there are some problem with the tag. Below is the sample error in my case, notice the name of the id has mentioned in the error:
[WARNING ] CNTR4015W: The message endpoint for the MessageBean message-driven bean cannot be activated because the jms2-0.0.1-SNAPSHOT/MessageBean activation specification is not available. The message endpoint will not receive messages until the activation specification becomes available.
Code snippet below is a simple MDB app for the sake of this testing purpose:


Connect to MDB without using JNDI 

Now the server is ready to accept the incoming messages. The sample below is a standalone Java program that will establish a connection to Liberty Profile, it doesn’t use the JNDI to send the message to MDB. This is the hardest part as not much information available on the web. Eventually, I have identified 3 libraries which are needed in order to build this program, there are available in the WAS installation path located at AppServer/runtimes​. Here are the 3 libraries:
  1. com.ibm.ws.ejb.thinclient_8.5.0.jar
  2. com.ibm.ws.sib.client.thin.jms_8.5.0.jar
  3. com.ibm.ws.orb_8.5.0.jar
Looking at the code above, I have no idea what the setBusName() on line 16 trying to do? It will just throw an error as seen below if I remove that line:
Caused by: com.ibm.websphere.sib.exception.SIIncorrectCallException: CWSIT0003E: No busName property was found in the connection properties.
  at com.ibm.ws.sib.trm.client.ClientAttachProperties.< init>(ClientAttachProperties.java:109)
  at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl.createConnection(TrmSICoreConnectionFactoryImpl.java:295)
  at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl.createConnection(TrmSICoreConnectionFactoryImpl.java:222)
  at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:711)
  at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:647)
  at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createConnection(JmsJcaConnectionFactoryImpl.java:376)
  at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:162)
  ... 3 more

Connect to MDB with JNDI

This is much easier to implement as compare to the previous client app just because it uses JNDI. It doesn’t require any additional library from WAS server. Long story short, here is the code:

Tuesday, October 2, 2018

Resolving conflict between nVidia and mesa when upgrading Fedora 25

What a busy week! I was doing a major upgrade to the Fedora system and I was almost getting myself killed in the action. During the upgrade process, I was stopped by this nasty error:
$ sudo dnf system-upgrade download --releasever=25
...
...
...
Error: Transaction check error:
file /usr/lib64/libGLX_indirect.so.0 from install of mesa-libGL-17.0.5-3.fc25.x86_64 conflicts with file from package nvidia-driver-libs-2:378.13-3.fc24.x86_64
file /usr/lib/libGLX_indirect.so.0 from install of mesa-libGL-17.0.5-3.fc25.i686 conflicts with file from package nvidia-driver-libs-2:378.13-3.fc24.i686

Error Summary 
-------------
I spend almost one week to tackle this error, from day till night researching on the root cause. To keep the story short, 2 things need to do. First step is to uninstall the driver, I follow the instructions from this link which is dedicated for Fedora. After this step, there are some configuration files was left over in the xorg.config.d directory and some other rpm packages were still not yet remove. This is the sample output for my case:
$ rpm –qa | grep nvidia
nvidia-driver-libs-378.13-3.fc24.x86_64
nvidia-driver-libs-378.13-3.fc24.i686
nvidia-settings-378.13-1.fc24.x86_64
nvidia-libXNVCtrl-378.13-1.fc24.x86_64
dkms-nvidia-378.13-2.fc24.x86_64
nvidia-driver-378.13-3.fc24.x86_64
Then the next step would be this:

$ sudo dnf remove nvidia-kmod

Never try to uninstall individual rpm package manually, as the command above is the professional way to do it. Clean the whole chunk in one shot. Only after this command, then only the system upgrade can continue. During the last weekend, I have successfully upgraded from Fedora 24 all the way up to Fedora 27 in one shot.