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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Problem with native Java API

Post new topic  Reply to topic
 Problem with native Java API « View previous topic :: View next topic » 
Author Message
kw2373
PostPosted: Sat Jun 18, 2005 12:15 am    Post subject: Problem with native Java API Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

I'm trying to switch my Java code to use the native Java API, fmcjapi.jar. Mostly it works OK on the target Unix server, but when I try to debug code using WSAD on Windows I get an error "FMC38000E Could not locate Agent for Domain LOCAL" on calling the com.ibm.mqworkflow.api.Agent.setName method. I'm using the LOC Locator policy.

On revising the old API, I see that the difference between fmcojapi.jar and fmcojagt.jar is that the latter includes the LOC Locator policy. Does this mean that fmcjapi.jar is a replacement for fmcojapi.ar and not for fmcojagt.jar and doesn't include the LOC policy, and if so how do I get access to this policy from WSAD?

Keith
Back to top
View user's profile Send private message
jmac
PostPosted: Sat Jun 18, 2005 5:54 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

Keith:

I use WASADIE for development, and have had no issues with the Native Java API. I simply remove the fmcojagt.jar file from the Classpath and add the fmcjapi.jar and the fmcrc file to the classpath and everything works fine.

You do not want to have the fmcojagt or fmcojapi jars in the classpath and you must have fmcrc in the classpath.
_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kw2373
PostPosted: Mon Jun 20, 2005 3:57 am    Post subject: Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

Thanks very much, John. I've already done all this, but no good.

I think this probably comes down to the configuration I'm using. I develop code on a fully-fledged Windows MQ Workflow server, so I'm trying to log on to a local workflow instance using a local MQ queue manager. The setup utility for the native Java API on Windows (which produces the fmcrc file) only accepts two configurations, using either an MQ client or a clustered queue manager with the workflow server hosting the primary queue manager. In each case the workflow instance would be on a remote server. Does this mean that the native Java API won't work on a stand-alone Windows MQ Workflow server?

Keith
Back to top
View user's profile Send private message
jmac
PostPosted: Mon Jun 20, 2005 5:45 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

I am running it as we speak on a standalone windows machine. My fmcrc file looks like this:
Code:
# Replace the place holders with valid values of your
# current configuration
#
Configuration/DefaultConfigurationID=FMC
Configuration/FMC/FMLConnectName=FMC.FMCGRP.FMCSYS,FMCQM
Configuration/FMC/SystemGroup=FMCGRP
Configuration/FMC/MQConnectionType=MQServer
# Following profile values must be set for MQClient connections
#
#Configuration/FMC/MQQueueManager=FMCQM
#Configuration/FMC/MQCommunicationAddress=JMAC
#Configuration/FMC/MQPort=5010

As you can see I am currently running with MQServer, in the past I have run MQCLient and not had any issues. BTW, the recommendation now is to run MQClient.

I am not sure what your issue is.... good luck, and keep us posted with the results[/code]
_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kw2373
PostPosted: Tue Jun 21, 2005 1:26 am    Post subject: Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

Thanks again, John, but still no good, I'm afraid. I'd already tried modifying the fmcrc file in a similar way, although I can't see this documented anywhere. I've now modified my fmcrc to be exactly the same as yours, but I still get the same error.

The code is absolutely standard, i.e.

If I'm using the default configuration ID:

Agent agent = new Agent( );

agent.setLocator( Agent.LOC_LOCATOR );
agent.setName( "LOCAL" );


This fails with a java.beans.PropertyVetoException at the agent.setName statement. The error message is "FMC38000E Could not locate Agent for domain LOCAL".

Using a defined configuration ID, the code is:

Agent agent = new Agent( );

agent.setLocator( Agent.LOC_LOCATOR );
agent.setConfigurationID( "CONFIGID" );
agent.setName( "LOCAL" );


and the exception (again a java.beans.PropertyVetoException) occurs in setConfigurationID. The error message is "FMC38001E Configuration CONFIGID cannot be set". This applies even if the defined configuration ID is the default FMC.

Both these errors are listed in the MQ Workflow programming manual, but no reason for them is given.

All of this works OK using either fmcojagt.jar or fmcojapi.jar. It;s only when I use fmcjapi.jar that it fails.

Keith
Back to top
View user's profile Send private message
hos
PostPosted: Tue Jun 21, 2005 6:02 am    Post subject: Reply with quote

Chevalier

Joined: 03 Feb 2002
Posts: 470

Where is your fmcrc file located?
Best place is, to move it to InstalledApps/.../WEB-INF/classes
fmcrc file needs to be loaded by the same classloader as fmcjapi.jar.
Back to top
View user's profile Send private message
kw2373
PostPosted: Tue Jun 21, 2005 8:31 am    Post subject: Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

This isn't a web application - I'm trying to debug my standard MQ Workflow class library using a noddy test application.

The fmcrc file is with the fmcjapi.jar file in D:\IBM\MQWorkflow\BIN\JAVA3500, which is where fmcojagt.jar and fmcojapi.jar are also located. I've added fmcrc and fmcjapi.jar (and com.ibm.mq.jar etc) to both the system classpath and the WSAD classpath.

Keith
Back to top
View user's profile Send private message
hos
PostPosted: Wed Jun 22, 2005 3:49 am    Post subject: Reply with quote

Chevalier

Joined: 03 Feb 2002
Posts: 470

Most certainly your application is not using the fmcrc file that you think it is using. You can edit the file and insert a syntax error to verify that it is indeed used. The directory where fmcrc is located has to be in the CLASSPATH. I think fmcjapi.jar also comes with a dummy fmcr file inside and you don't want to use this one.

Other possibility:
call
Code:
java -DFMC_INSTANT_TRACE=TRUE <MQWFDIR>\SMP\java\HelloApplication\HelloApplication MQWFAgent LOC ADMIN password


and look for a file named FmcInstantTrace.log in your temp directory. This file will give you most probably more insights
Back to top
View user's profile Send private message
kw2373
PostPosted: Fri Jun 24, 2005 11:51 am    Post subject: Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

Thanks, hos.

That's solved one error - FmcInstantTrace.log showed that the application was expecting an MQClient connection (it complained that no queue manager name was supplied). On checking my fmcrc file again I found that I'd used MQConnectionType=MQserver instead of MQServer.

With this corrected, HelloApplication works OK. Unfortunately this doesn't fix my original problem, which is how I get WSAD to recognise the existence of the fmcrc file (assuming that's what's needed to make fmcjapi work). The directory it's in is in the system classpath, but how do I add it to WSAD's classpath, which will accept only filenames and not directories?

Keith
Back to top
View user's profile Send private message
jmac
PostPosted: Fri Jun 24, 2005 1:52 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

Keith:

Add a variable that points to the directory, then put that variable into that projects "Java Build path".... there may be other ways to do this, but that works for me.
_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kw2373
PostPosted: Fri Jun 24, 2005 11:07 pm    Post subject: Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

Well, I've finally done it, so many thanks again to both of you for helping out.

It didn't work straight off - I couldn't find any way to add a directory name to the Java build path - it will only take .jar or .zip files.

You can add an explicit file name, but as hos said it's the directory including the fmcrc file that needs to be on the classpath, not the file itself. Using a variable name for the directory didn't help, since it can only be added to the build path after you've extended it with a .jar or .zip filename. I even tried renaming the directory with a .jar extension, but WSAD wasn't fooled.

I finally fixed it by creating a jar file containing fmcrc and adding that to the Java build path.

Keith
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jun 25, 2005 5:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

That's for lack of knowing better.
Check out the screen where you add jars to the classpath...
You should have 3 to 4 buttons on the right.
2 are for adding jars, one is for adding directories containing libraries (.dll, .so, .o ...etc) use that one...

And don't forget to switch tab select and activate...

Enjoy
Back to top
View user's profile Send private message Send e-mail
kw2373
PostPosted: Tue Jun 28, 2005 9:14 pm    Post subject: Reply with quote

Newbie

Joined: 18 Jun 2005
Posts: 7

Thanks, fjb_saper, but I've tried that (I've spent hours trying all sorts of options!) and I can't find any way of actually using it.

The two options are to add a new directory or use an existing one. Trying to add a new directory always gives an error message about not being able to nest the new directory. Try to use an existing directory, and it won't allow any directory outside the WSAD workspace to be used. Using an existing directory within the project gives the same nesting error as for a new one.

What I haven't mentioned before is that I'm using WSAD 5.0. Perhaps some of these options are more useable in later versions?

Keith
Back to top
View user's profile Send private message
tyrone1979
PostPosted: Sat May 19, 2007 6:42 pm    Post subject: How to create FMCRC files in Windows Reply with quote

Newbie

Joined: 19 May 2007
Posts: 1

Actually, we need 3 fmcrc files in MQ Workflow windows version using native Java api.

In AIX version, the fmcjapi.jar reference fmcrc files to locate the workflow configurations. They are:
installation fmcrc file
default configuration fmcrc file
configuration fmcrc file
and when you want to use fmcjapi.jar in windows, you must create these 3 fmcrc files because the fmcjapi.jar was developed for AIX mainly.
In fact MQ workflow in windows stores the same installation, default configuration and configuration in Registry instead of fmcrc files. So you can reference registry to create above 3 fmcrc files.
1. Installation fmcrc file:

1.1 In registry:
for MQ Workflow 3.5
HKEY_LOCAL_MACHINE/SOFTWARE/IBM/MQSeries Workflow/3.2/Installation
1.2 installation fmcrc file like:

Installation/ConfigurationRootDirectory=C:/Program Files/IBM WebSphere MQ Workflow/
Installation/FolderName=IBM WebSphere MQ Workflow
Installation/InstallatoinDirectory=C:/Program Files/IBM WebSphere MQ Workflow
Installation/InstalledComponents=JWHGCLUMDRBPASI
Installation/Language=JPN
Installation/ServiceLevel=3
Installation/VRM=030500

1.3 Location
If you are not good at classpath config, you can save it in c:\windows\system32\fmc\

2 Default configuration fmcrc file

2.1 registry
HKEY_LOCAL_MACHINE/SOFTWARE/IBM/MQSeries Workflow/3.2/configuration

2.2 fmcrc file

Configuration/DefaultConfigurationID=FMC

2.3 Location

C:/Program Files/IBM WebSphere MQ Workflow/

3. configuration fmcrc file

3.1 registry

HKEY_LOCAL_MACHINE/SOFTWARE/IBM/MQSeries Workflow/3.2/configuration/fmc

3.2 fmcrc file

There is a simple way to create it. In your cfgs path, you should have a fmczkcfg.dat file. copy this file into fmcrc
and install configuration/FMC/ into the head of each line. like

Configuration/FMC/Agent.Reaper.Cycle=300000
Configuration/FMC/Agent.Reaper.Ratio=90
Configuration/FMC/Agent.Reaper.Threshold=1000
Configuration/FMC/ConfigurationId=FMC
Configuration/FMC/ConfiguredComponents=ARCUQ
Configuration/FMC/FMLClientChannelTable=c:/program files/ibm websphere mq workflow/chltabs/mqwfchl.tab
Configuration/FMC/FMLConnectName=FMC.FMCGRP.FMCSYS01,WAS0003
Configuration/FMC/FMLSegmentation=0
Configuration/FMC/FMLServerChannelTable=c:\program files\ibm websphere mq workflow\chltabs\mqwfchl.tab
Configuration/FMC/MQBackupQueues=c
Configuration/FMC/MQClusterCommunicationAddress=[MQ Workflow server ip]
Configuration/FMC/MQClusterFirstQueueManager=FMCQM01
Configuration/FMC/MQClusterMode=a
Configuration/FMC/MQClusterName=FMCGRP
Configuration/FMC/MQClusterPort=20101
Configuration/FMC/MQClusterPrincipal=fmc
Configuration/FMC/MQClusterProtocol=t
Configuration/FMC/MQCommunicationAddress=[client ip]
Configuration/FMC/MQCommunicationProtocol=t
Configuration/FMC/MQPort=5010
Configuration/FMC/MQPrefix=FMC
Configuration/FMC/MQPrincipal=fmc
Configuration/FMC/MQQueueManager=[client mq manager]
Configuration/FMC/RTIconDirectory=c:\program files\ibm websphere mq workflow\bin\iconinst
Configuration/FMC/System=FMCSYS01
Configuration/FMC/SystemGroup=FMCGRP

3.3 Location

The same path as fmczkcfg.dat


Then try your HelloApplication again. You can get different result.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Problem with native Java API
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.