Author |
Message
|
visasimbu |
Posted: Thu Jan 20, 2022 9:19 pm Post subject: mqsicreatebar with build path jar |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
We are implementing devOps for creating bar file using below command. This command will be executed once we checkout all its dependencies. We are getting workspace error when dependency project is Java application and Java application refers to the Jar files which is in its build path. Since build path for toolkit is in some developers directory. This directory not exists in build server.
As a solution , we included the Jar as part of Java applicaton. This results into bar file sized increased because this jar included in the bar file. It suppose not to be included in the bar file because these Jars will be kept in shared path.
How can we build bar file without Jar file including in bar file. Is there any way to point the build path jar location in the command to resolve workspace error.
Code: |
mqsicreatebar -data $WORKSPACE -b some.bar -cleanbuild -a CustomerAPI -deployAsSource -trace -v CustomerAPI_Trace.txt |
|
|
Back to top |
|
 |
abhi_thri |
Posted: Fri Jan 21, 2022 2:15 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
hi...how about using an existing/new worthpath/classpath and refer the same in the build path so that both Windows/Linux projects will refer to the same path. |
|
Back to top |
|
 |
visasimbu |
Posted: Fri Jan 21, 2022 3:12 am Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Always development will happen in Windows machine. Build server is linux machine.
I am fine to keep constant directory for Linux as build path where I can place my Jars. But how to say this Linux directory path as "build path" for the Java applications ?
Since development happens in windows where the path structure will be different from linux.
Is there any way to mention the build path for Java application after cloning from repo. |
|
Back to top |
|
 |
abhi_thri |
Posted: Fri Jan 21, 2022 4:41 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
visasimbu wrote: |
Since development happens in windows where the path structure will be different from linux.
Is there any way to mention the build path for Java application after cloning from repo. |
hi...what I'm suggesting is that define and use an environment path variable (or use existing classpath ones) and set it at the project, eg:- the build path in the java project will then look like <Work_path_env_var>/<jar file>.jar.
This <Work_path_env_var> can then vary on Windows/Linux and as long as the jars are available at the path it should work |
|
Back to top |
|
 |
visasimbu |
Posted: Tue Jan 25, 2022 2:59 am Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Thanks for your reply!
My .classpath file entry was
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="com.ibm.etools.mft.uri.classpath.MBProjectReference"/>
<classpathentry kind="lib" path="D:/someDir/commons-codec-1.10.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
|
Then added variable named "SOURCE_PATH" in eclipse project. SOURCE_PATH variable in eclipse was pointed to absolute path in windows. Variable is configured in eclipse by clicking "Add Variable"->"Configure Variable".
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="var" path="SOURCE_PATH/commons-codec-1.10.jar"/>
<classpathentry kind="con" path="com.ibm.etools.mft.uri.classpath.MBProjectReference"/>
<classpathentry kind="output" path="bin"/>
</classpath>
|
But in Linux build server, I have tried to build it. mqsicreate bar complining that "Jar" is not avaiable for workspace". Not sure how I can set variable to the Linux. I have tried env variable to with the value as like below.
Code: |
export SOURCE_PATH=/home/someuser/sharedjars/ |
But this env variable is not visible to classpath. Hence I am getting error in mqsicreatebar command saying workspace has errors.
Any suggestions please |
|
Back to top |
|
 |
abhi_thri |
Posted: Tue Jan 25, 2022 8:27 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
visasimbu wrote: |
But this env variable is not visible to classpath. Hence I am getting error in mqsicreatebar command saying workspace has errors.
|
hi...guess you are on the right path, was the 'export' done via the user id which runs the mqsicreatebar command, for eg:- in it's user profile file or so? what exactly is the error you are getting now? I'm wondering whether the CLASSPATH var need to be extended to include the new var |
|
Back to top |
|
 |
visasimbu |
Posted: Sat Jan 29, 2022 4:25 am Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Thanks for your reply!
I have tried to include the path in below mentioned 2 places.
1) Yes. I have extended "CLASSPATH" env variable along with my Jar file location as like below.
Code: |
CLASSPATH=/opt/IBM/ace-12.0.3.0/server/messages:/opt/IBM/ace-12.0.3.0/common/classes:/opt/IBM/ace-12.0.3.0/server/classes:/opt/IBM/ace-12.0.3.0/common/classes/IntegrationAPI.jar:/opt/IBM/ace-12.0.3.0/server/classes/brokerutil.jar:/var/mqsi/common/wsrr:/home/someuser/sharedjars/ |
2) Added env variable as like below in same user where I am running my mqsicreatebar command.
Code: |
export SOURCE_PATH=/home/someuser/sharedjars/ |
Error on my mqsicreate says below in the trace file
Code: |
Problem 4: Resource - /SomAppJava; Error message - Unbound classpath variable: 'SOURCE_PATH/commons-codec-1.10.jar' in project 'SomAppJava'. |
|
|
Back to top |
|
 |
abhi_thri |
Posted: Sat Jan 29, 2022 8:41 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
hi...strictly speaking shouldn't SOURCE_PATH be set to '/home/someuser/sharedjars' instead of '/home/someuser/sharedjars/', not sure it matters or not.
also can you do an echo on it to see it is set as expected - 'echo $SOURCE_PATH',
Another point, the user id used to run the mqsicreatebar command, is '/home/someuser/sharedjars/commons-codec-1.10.jar' visible for this user with regards to the file permissions. |
|
Back to top |
|
 |
visasimbu |
Posted: Mon Jan 31, 2022 12:04 am Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Thanks for your reply!
As suggested, I have tried removing '/' at the end of the path. Same result. I got error as shown below.
Also I have moved the Jar files out of user home folder to below location with ownership as "someuser:mqbrkrs" and chmod as 755.
Code: |
[someuser@ip-20-**-1**-1** ~]$ export SOURCE_PATH=/opt/IBM/app/sharedclasses
[someuser@ip-20-**-1**-1** ~]$ echo $SOURCE_PATH
/opt/IBM/app/sharedclasses
[someuser@ip-20-**-1**-1** ~]$ echo $CLASSPATH
/opt/IBM/ace-12.0.3.0/server/messages:/opt/IBM/ace-12.0.3.0/common/classes:/opt/IBM/ace-12.0.3.0/server/classes:/opt/IBM/ace-12.0.3.0/common/classes/IntegrationAPI.jar:/opt/IBM/ace-12.0.3.0/server/classes/brokerutil.jar:/var/mqsi/common/wsrr:/opt/IBM/app/sharedclasses
[someuser@ip-20-**-1**-1** ~]$ ls -ltr /opt/IBM/app/sharedclasses
total 280
-rwxr-xr-x 1 someuser mqbrkrs 284184 Jan 31 11:27 commons-codec-1.10.jar |
Error from mqsicreatebar is
Code: |
Problem markers list from the workspace:
Problem 4: Resource - /someAppJava; Error message - The project cannot be built until build path errors are resolved.
Problem 5: Resource - /someAppJava; Error message - Unbound classpath variable: 'SOURCE_PATH/commons-codec-1.10.jar' in project 'someAppJava'. |
|
|
Back to top |
|
 |
abhi_thri |
Posted: Mon Jan 31, 2022 2:57 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
hi...what if you use an absolute path for the jar file temporarily, is that defintely working? |
|
Back to top |
|
 |
visasimbu |
Posted: Tue Feb 01, 2022 1:46 am Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
abhi_thri wrote: |
hi...what if you use an absolute path for the jar file temporarily, is that defintely working? |
Yes. I am able to compile successfully if i convert to absolute path like below. Please note that I have converted to lib in LHS instead of var.
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="/opt/IBM/app/sharedclasses/commons-codec-1.10.jar"/>
<classpathentry kind="con" path="com.ibm.etools.mft.uri.classpath.MBProjectReference"/>
<classpathentry kind="output" path="bin"/>
</classpath> |
Issue occurs only with var & SOURCE_PATH as like below.
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="var" path="SOURCE_PATH/commons-codec-1.10.jar"/>
<classpathentry kind="con" path="com.ibm.etools.mft.uri.classpath.MBProjectReference"/>
<classpathentry kind="output" path="bin"/>
</classpath> |
Even tried below combinations as well.
Combination 1
Code: |
<classpathentry kind="var" path="$SOURCE_PATH/commons-codec-1.10.jar"/> |
Combination 2
Code: |
<classpathentry kind="var" path="${SOURCE_PATH}/commons-codec-1.10.jar"/> |
Combination 3
Code: |
export SOURCE_PATH=/opt/IBM/app/sharedclasses/commons-codec-1.10.jar
<classpathentry kind="var" path="$SOURCE_PATH"/> |
Combination 4
Code: |
export SOURCE_PATH=/opt/IBM/app/sharedclasses/commons-codec-1.10.jar
<classpathentry kind="var" path="SOURCE_PATH"/> |
|
|
Back to top |
|
 |
giri93giri |
Posted: Wed Feb 08, 2023 9:35 am Post subject: |
|
|
Newbie
Joined: 08 Feb 2023 Posts: 1
|
Hi,
Were you able to resolve this issue? We are facing very similar issue, and we are looking for a solution.
Thanks. |
|
Back to top |
|
 |
visasimbu |
Posted: Wed Feb 08, 2023 10:29 am Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
No still this issue is open. |
|
Back to top |
|
 |
|