Author |
Message
|
smdavies99 |
Posted: Fri Jul 08, 2011 6:01 am Post subject: Friday afternoon discssion |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I have some Java (sorry Vitor) code that talks to an external site on the other side of the world. I can't easily use the HTTPrequest node but this post is not about that.
As I said, I have some java code that calls the external site and gets the results back. All fine and good.
I wrote the code in such a way so that I could then call the java methods from ESQL directly or from a JCN.
All pretty straight forward.
When I run the java code as a JAVA application, it returns the data correctly.
Then that same bit of java is run using broker it fails.
The error srting from the try/catch is shown below.
Code: |
Network is down: connect Error
|
Here is the bit of code I add on at the beginning to make it work. I've remove the real URL...
The code does an HTTP get on the destination with a string command and a non HTML string is returned.
Code: |
public static void main(String[] args) throws Exception {
String destinationURL;
String requestData;
requestDate = "";
System.out.println(requestData);
destinationURL = "http://redacted/";
requestResult = requestOperation(destinationURL,requestData);
System.out.println(requestResult);
}
|
So my question it, what gives?
Why does the same method work on its own and fails when used inside broker?
Environments = XP & Solaris(Sparc) Broker = 6.1.0.9.
comments and thoughts most welcome.
I'm not the worlds best java coder so I'll put my hand up to that right from the start. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Jul 08, 2011 6:05 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Try comparing the JVM settings between WMB's JVM and the JVM you are using to run it standalone.
Also, try using the same JVM settings from WMB on your standalone JVM.
Can you post the results of mqsi report all properties? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 08, 2011 6:07 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
lancelotlinc wrote: |
Can you post the results of mqsi report all properties? |
The JVM where it 'works' is the eclipse toolkit jvm.
All the other jvm setting in broker are OOTB. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Jul 08, 2011 6:16 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
If you are behind a corporate proxy, you may have authenticated already your user id using a web browser from your user account, therefore, the connection can go through. However, if you deploy code to WMB runtime, and WMB runtime uses a different ID which is not authenticated at the corporate firewall http proxy, then it will block your attempt to get traffic through. Therefore, if this is the cause, the solution would be to have your network engineer configure your corporate proxy to auto-authenticate the WMB runtime user ID. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 08, 2011 6:25 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Nope Good thought though.
The string used in the post is getting through. The firewall is open to the endpoint address. The port is Port 80. We are using the Solaris broker already for external TCP/IP, HTTP & Soap connections. Unless I am totaly thick (or in need of beer...) the outgoing should be ok.
I'll try it from outside the corporate network in a few hours. If that exhibits the same behaviour then I'll have to think of another way to talk to the external host.
Oh, from the debug sessions of both methogs, I see the same data in the Java URL connector especially for the proxy. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 08, 2011 6:26 am Post subject: Re: Friday afternoon discssion |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
I have some Java (sorry Vitor) code |
Don't apologise. I'm told it's a very nice language, and the Singletons are delicious.
I just don't get it. But then I don't get American football either. Both of these are failings on my part which do not diminish the intrinsic value of either. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 08, 2011 6:31 am Post subject: Re: Friday afternoon discssion |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
Don't apologise. I'm told it's a very nice language, and the Singletons are delicious.
|
Te-He.
The comment was my gently slap around the face with a bit of wet fish hoping you were awake. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 08, 2011 6:43 am Post subject: Re: Friday afternoon discssion |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
The comment was my gently slap around the face with a bit of wet fish hoping you were awake. |
I remain in the same state of consciousness I typically use in the office. I wouldn't describe it as "awake" exactly, but I don't snore at my desk, am able to comsume coffee while still keeping the pain distant.
Have pity for those of us for whom Friday afternoon remains an asperation. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 08, 2011 6:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
smdavies99 wrote: |
Nope Good thought though.
The string used in the post is getting through. The firewall is open to the endpoint address. The port is Port 80. We are using the Solaris broker already for external TCP/IP, HTTP & Soap connections. Unless I am totaly thick (or in need of beer...) the outgoing should be ok.
I'll try it from outside the corporate network in a few hours. If that exhibits the same behaviour then I'll have to think of another way to talk to the external host.
Oh, from the debug sessions of both methogs, I see the same data in the Java URL connector especially for the proxy. |
Think: The difference between the stand alone and the broker version is the class loader... So you may need to define a service to force your class loader...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 08, 2011 9:30 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
fjb_saper wrote: |
Think: The difference between the stand alone and the broker version is the class loader... So you may need to define a service to force your class loader...
Have fun  |
Yep, you are right on the nail. That sorted it.
Why is Java so darn complicated. All those CLASSPATHs, Class Loaders and other gumpf. What happened to simplicity? Pah!
When I see the Java dev's workspaces and just how complicated everything is and all the dependencies (jarfile x must be loaded before jarfile y etc) I am so glad to get back to my Broker workspaces.
now where's that beer?
PS, don't even get me started on that walking disaster area that are Java Stack Traces.... _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Jul 08, 2011 9:57 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
When using common jars, like log4j, axis, or other utility jars, I avoid the classloading problem by placing the common jars in $MQSI_WORKPATH/shared-classes rather than packaging the utility jars in the Bar file. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 08, 2011 10:47 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
lancelotlinc wrote: |
When using common jars, like log4j, axis, or other utility jars, I avoid the classloading problem by placing the common jars in $MQSI_WORKPATH/shared-classes rather than packaging the utility jars in the Bar file. |
Good point BUT {yeah there is one...}
If you do that then totally automated deploys are a thing of the past.
With the PHB's talking buzzwords like 'agile', 'tdd', 'continuios integration' then if you even talk about manually deploying a jar file that is application related and not infrastructure you will be branded as 'old skool'. We wouldn't want that now would we???? (It's ok for me as I am less than 10 years awayfrom retiring) _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Jul 08, 2011 11:36 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
My deploys, even to $MQSI_WORKPATH/shared-classes, are automated. Albeit, WMB developers cannot run them in environments other than DEV. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|