Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8485071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:32:33+00:00 2026-06-10T20:32:33+00:00

I’m very beginner of Websphere MQ classes for Java programming. I’ve decided to follow

  • 0

I’m very beginner of Websphere MQ classes for Java programming.
I’ve decided to follow this way to write a small application able to connect and read messages from a queue through TCP/IP.

following this guide: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fja10410_.htm

At point 4 it is suggested to test Websphere Client installation (Version: 7.0.1.8) on windows command prompt using:
java -Djava.library.path=library_path MQIVP
where ‘library_path’ for me is “C:\Program Files\IBM\WebSphere MQ\java\lib”

The application runs and I have proceeded writing a simple program with Eclipse IDE here the code:

import com.ibm.mq.MQEnvironment;

public class MQtestMain {

    public static void main(String[] args) {

        System.out.println("main");

        new MQtestMain();
    }

    public MQtestMain(){

        System.out.println("MQtestMain");

        MQEnvironment.hostname = "my.host.name";
        MQEnvironment.channel = "my.channel";
        MQEnvironment.port = 1414;

    }

}

It has nothing to do but it is just a test to be sure that everything is correctly set.

I have set a custom library with both ‘com.ibm.mq.jar’ and ‘com.ibm.mq.jmqi.jar’ from “C:\Program Files\IBM\WebSphere MQ\java\lib” and no error are reported at compile time.

Running the application from Eclipse it correctly prints out “main” and “MQtestMain” on console.

Therefore I have proceeded to export it: File > Export > Runnable Jar
setting ‘Library handling’ to ‘Package required libraries into generated JAR’

Unfortunately if I run the program from windows command prompt: java -jar MQtest.jar
here the result:

main
MQtestMain
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.NoClassDefFoundError: javax/resource/ResourceException
        at com.ibm.mq.MQEnvironment.<clinit>(MQEnvironment.java:576)
        at MQtestMain.<init>(MQtestMain.java:21)
        at MQtestMain.main(MQtestMain.java:14)
        ... 5 more
Caused by: java.lang.ClassNotFoundException: javax.resource.ResourceException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 8 more

First and second line are correct but I really don’t understand the following errors


update:

I try to give you more information:
As I’ve said running the application from its main class file there are no problems, while execute it from the jar file it seems not able to find the IBM libraries.
I have created a personal library in eclipse named “MQ classes for Java” containig the two jar packages used by this application.
here the content of the project .classpath file:

<?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.7"/>
    <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/MQ classes for Java"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

Is there a way to link the correct libraries to the runnable jar in order to launch it form every machine with WMQ Client installed?


Solution:

The errors, due to some dependencies not found, have been solved including all the IBM classes for Java jar files into the WMQ Client folder instalation (“C:\Program Files\IBM\WebSphere MQ\java\lib”)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:32:34+00:00Added an answer on June 10, 2026 at 8:32 pm

    Solution:

    These errors are due to some dependencies not found;
    they could be solved including all the IBM classes for Java jar files into the WMQ Client folder instalation (“C:\Program Files\IBM\WebSphere MQ\java\lib”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.