Author |
Message
|
Esa |
Posted: Thu Mar 27, 2014 11:30 pm Post subject: mqsipackagebar and library dependencies |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
com.ibm.broker.config.appdev.FlowRendererBAR -- and mqsipackagebar command that directly calls it -- don't resolve and include library dependencies of a library.
So if you create a bar file for an application with mqsipackagebar, the resulting bar file may be different from a bar file that you create manually in the Toolkit. It will lack any libraries that are referenced by the libraries that the application is directly dependent of.
I did not find any mention on this in the InfoCenter. Nor did I find any APAR for this in 8.0.0.3 fix list (I tested with 8.0.0.2).
The question is: is it working as designed or is this a bug? |
|
Back to top |
|
 |
Esa |
Posted: Fri Mar 28, 2014 4:24 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
No, this must be a bug.
An indirectly referenced library must be packaged within the .appzip, otherwise it won't be visible for the components of the application. If you add the libzip in the same bar file outside the appzip, it will be deployed in the default application and cannot be accessed from another application.
You can tweak this by removing the directly referenced library from the application's referenced libraries, adding the indirectly depended library and the putting the directly depended library back. That will in fact leave the indirect reference in .project. Or you can manually edit the .project file (an even worse idea). This workaround makes mqsipackagebar produce the correct output. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Mar 28, 2014 5:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I have found that mqsipackagebar is terribly literal minded.
Are you using the mqsipackagebar command that can be generated by the Bar File Builder in Toolkit?
If not, please make sure to list *every last* thing you want included in the bar file on the mqsipackagebar command. |
|
Back to top |
|
 |
Esa |
Posted: Fri Mar 28, 2014 5:52 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
No, the tool that requires a workspace is not called mqsipackagebar, that's mqsicreatebar.
In fact, I'm using FlowRendererBAR.
mqjeff wrote: |
If not, please make sure to list *every last* thing you want included in the bar file on the mqsipackagebar command. |
No. If you include libraries separately with -y switch, they will be deployed outside the application. The only way to make indirectly referenced libraries deploy correctly within the application is to edit the .project of the application. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Mar 28, 2014 7:37 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Ok. I am misremembering stuff between mqsicreatebar and mqsipackagebar. With mqsicreatebar, one has to make sure that all project resources are listed in -p or -o , or they won't get compiled and added.
If you use mqsipackagebar -k, and it doesn't build the appzip with all libzips and those libzips don't include dependent libzips, then that sounds like a bug.
Assuming that all of the projects needed are in the workspace that's being built from.
But I was not making any suggestion to use mqsicreatebar.
I was saying that the Bar File Editor in the v8 and v9 Toolkit has a "command used to build this bar file" section at the bottom of the "manage" tab. This shows you the relevant mqsipackagebar or mqsicreatebar command used to generate the same bar file.
Also, I don't know what FlowRendererBAR is. |
|
Back to top |
|
 |
mtv134 |
Posted: Thu Jun 05, 2014 5:48 am Post subject: |
|
|
Newbie
Joined: 05 Jun 2014 Posts: 1
|
I'm facing the same problem. does anyone know how to solve this issue ? How to add the library file to the appzip file?
When I use the -y option it adds the library outside the app. |
|
Back to top |
|
 |
Esa |
Posted: Thu Jun 05, 2014 5:55 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Esa wrote: |
You can tweak this by removing the directly referenced library from the application's referenced libraries, adding the indirectly depended library and the putting the directly depended library back. That will in fact leave the indirect reference in .project. Or you can manually edit the .project file (an even worse idea). This workaround makes mqsipackagebar produce the correct output. |
And please create a PMR if you have the opportunity to do so. |
|
Back to top |
|
 |
ghoshly |
Posted: Thu Jun 05, 2014 11:33 am Post subject: |
|
|
Partisan
Joined: 10 Jan 2008 Posts: 333
|
I had raised a PMR regarding this.
IBM says, mqsipackagebar command is just little brother of mqsicreatebar and it is not strong enough to get all the dependencies.
Even in 8.0.0.4 also, there is no fix for this.
Work around I use is to add all indirect dependencies as direct reference to the Application project and use mqsipackagebar command. |
|
Back to top |
|
 |
Esa |
Posted: Thu Jun 05, 2014 10:28 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
I do understand if they are a bit unwilling to implement a fix right now, because the solution will have to be in line with V 10 shared libraries.
As a matter of fact, with shared libraries the best practice could be that libraries directly referenced by applications should be packaged with the application and libraries referenced by the referenced libraries should be shared. In that case the current mqsipackagebar/FlowRendererBar would work just fine.
But there is clearly some work left to be done with V 10 library deployment, so we will have to wait some months.
I wouldn't say mqsipackagebar is just a weak kid brother, it's clearly a future tool targeted to be used with CI. It already works nicely with Jenkins. Unless you need to deploy nested libraries and cannot figure out a workaroud for the 'bug'.
ghoshly wrote: |
Work around I use is to add all indirect dependencies as direct reference to the Application project and use mqsipackagebar command. |
I think I tried that, too, without success. For that to work you will need to remove the reference to the indirect library from the directly referenced library. Which would cause an error in the directly referenced library and make it undeployable? Unless you do it before adding the direct reference?
Anyhow, a workaround that depends on that you do tasks in a certain order is not very feasible. I think the best solution would be to make the CI process automatically prepare the playground for mqsipackagebar: after retrieving the projects from version control it will have to add indirectly referenced libraries as projects to the application's .project file. |
|
Back to top |
|
 |
|