ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Keywords in Java.

Post new topic  Reply to topic
 Keywords in Java. « View previous topic :: View next topic » 
Author Message
Cogito-Ergo-Sum
PostPosted: Tue Nov 22, 2011 11:04 am    Post subject: Keywords in Java. Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

The keywords for Java need to be stored in a separate file named META-INF/keywords.txt. While building the BAR file (from GUI or command line) we just select the Java project and the generated BAR has the JAR embedded in in it. So, how do I insert the META-INF/keywords.txt file ?

So far, the only way that I could think is to manually extract the JAR from BAR, unzip the JAR, add the META-INF/keywords.txt file, JAR it again then add back to BAR. All this can be command using a few commands. But, is this actually the recommended way ?
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Nov 22, 2011 11:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

IMHO, deploying third-party or custom jars to an EG is redundant if you reuse the jar in multiple msg flow projects. Therefore, I put my third-party and custom jars in $MQSI_WORKPATH/shared-classes. Alternately, you can define a location for the EG anywhere on your file system use mqsichangeproperties.

From there, you build your jar just like any other jar. If its easier for you, use the Java perspective of Eclipse rather than the WMB perspective.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Nov 22, 2011 11:45 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

putting jar files willy-nilly into SHARED-CLASSES is not always the right choice.

It's always a better choice than adding them to CLASSPATH, however.

There should nominally be a reasonable way to create a keywords.txt file in the Java project and have it added to the JAR file at build time. I just tried manually creating a META-INF folder and adding a keywords.txt file to that, but it didn't end up appearing to work.

However, I may have done quite a number of little things wrong. I would suggest you try creating a keywords.txt file at the root of the JCN project. And then try creating a META-INF folder at the root of the JCN project, and try that. And then do a few more experiments.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Tue Nov 22, 2011 5:23 pm    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

lancelotlinc wrote:
IMHO, deploying third-party or custom jars to an EG is redundant if you reuse the jar in multiple msg flow projects. Therefore, I put my third-party and custom jars in $MQSI_WORKPATH/shared-classes. Alternately, you can define a location for the EG anywhere on your file system use mqsichangeproperties.

From there, you build your jar just like any other jar. If its easier for you, use the Java perspective of Eclipse rather than the WMB perspective.

This does not answer how one can easily add the META-INF/keywords.txt file.

mqjeff wrote:
There should nominally be a reasonable way to create a keywords.txt file in the Java project and have it added to the JAR file at build time. I just tried manually creating a META-INF folder and adding a keywords.txt file to that, but it didn't end up appearing to work.

However, I may have done quite a number of little things wrong. I would suggest you try creating a keywords.txt file at the root of the JCN project. And then try creating a META-INF folder at the root of the JCN project, and try that. And then do a few more experiments.

I have done my experiments from a different 'end'. That is, once the JAR was created, unzip it, manually add the file and then, zip (jar) it back. This did seem to work.

Actually, from the specification for META-INF, adding the keywords' file sounds non-standard. Then again, if I recall correctly, the JAR built from Java project in WMB does not carry the default manifest either. Instead, setting package version could have been a better choice.
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 23, 2011 3:40 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Cogito-Ergo-Sum wrote:
mqjeff wrote:
There should nominally be a reasonable way to create a keywords.txt file in the Java project and have it added to the JAR file at build time. I just tried manually creating a META-INF folder and adding a keywords.txt file to that, but it didn't end up appearing to work.

However, I may have done quite a number of little things wrong. I would suggest you try creating a keywords.txt file at the root of the JCN project. And then try creating a META-INF folder at the root of the JCN project, and try that. And then do a few more experiments.

I have done my experiments from a different 'end'. That is, once the JAR was created, unzip it, manually add the file and then, zip (jar) it back. This did seem to work.


Yes, that will of course work, but it's not probably the right way. The right way is to figure out how to get the Toolkit to build it automatically as part of compiling the jar.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Nov 23, 2011 5:36 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Cogito-Ergo-Sum wrote:
lancelotlinc wrote:
IMHO, deploying third-party or custom jars to an EG is redundant if you reuse the jar in multiple msg flow projects. Therefore, I put my third-party and custom jars in $MQSI_WORKPATH/shared-classes. Alternately, you can define a location for the EG anywhere on your file system use mqsichangeproperties.

From there, you build your jar just like any other jar. If its easier for you, use the Java perspective of Eclipse rather than the WMB perspective.

This does not answer how one can easily add the META-INF/keywords.txt file.


It did answer, in that you would develop your jar like any other jar. If you were not using WMB, how would you do it?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Keywords in Java.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.