|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Remotey connecting to Workflow server |
« View previous topic :: View next topic » |
Author |
Message
|
manoj |
Posted: Thu Jan 31, 2002 2:38 pm Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
Hi,
i 've configured JAVA corba Agent on the m/c where Workflow server is running (win 2000 m/c). My Java Corba agent uses Websphere as the jndi sever.I want to connect to the workflow server from an EJB (deployed on Websphere app server 4.0 or WSAD )on a remote m/c on the same Local Area network.
i 've used com.ibm.websphere.naming.WsnInitialContextFactory as the initial context factory while configuring Java corba agent , also changed the locater policy to JNDI_LOCATER in the java corba agent.
Below is my client code :
Agent agent = new Agent();
Properties prop = System.getProperties();
prop.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory" );
prop.put( javax.naming.Context.PROVIDER_URL, "iiop://<Remote m/c where java corba agent running>:900" );
String args1[] = {"MQWFAGENT"};
agent.setContext( args1, prop );
agent.setLocator( Agent.JNDI_LOCATOR );
agent.setName( "MQWFAGENT" );
user = new User(usr, pwd, role);
service = agent.locate("FMCGRP", "FMCSYS");
if (agent == null ) System.out.println("Agent is null");
else System.out.println("Login : Got a valid agent");
if (service == null) System.out.println("Login : Service is null");
else System.out.println("Login Got valid service");
service.logon2(user.getUserId(), user.getPassword(), SessionMode.DEFAULT, AbsenceIndicator.RESET);
---------------------------------------------------------------------------
i am getting the error stack as
java.lang.NullPointerException
at com.ibm.workflow.api.FmcException.getMessage(FmcException.java:177)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:121)
at java.lang.Throwable.toString(Throwable.java:142)
at java.lang.String.valueOf(String.java, Compiled Code)
at java.io.PrintStream.print(PrintStream.java:426)
at java.io.PrintStream.println(PrintStream.java:545)
at java.lang.Throwable.printStackTrace(Throwable.java:195)
at com.ibm.workflow.api.Agent.setName(Agent.java:410)
at RemoteWFLogger.login(RemoteWFLogger.java:89)
at RemoteWFLogger.main(RemoteWFLogger.java:3
--------------------------------------------------------------------
Expecting u r valuable reply
Thax and Best Regards
Manoj
[ This Message was edited by: manoj on 2002-01-31 22:58 ] |
|
Back to top |
|
 |
mswamy |
Posted: Fri Feb 08, 2002 7:53 pm Post subject: |
|
|
Newbie
Joined: 07 Feb 2002 Posts: 1
|
Manoj,
I'm facing the same problem and would be interested in knowing the solution in case u find one.
I however found something interesting happening. I configured my WebClient to use the Agent and that works.
Regards
Meenakshi |
|
Back to top |
|
 |
manoj |
Posted: Sat Feb 09, 2002 8:37 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
I fixed the problem. I use the Websphere as the JNDI naming server on the m/c where my Workflow server is running. I connect from a remote PC where my J2ee application (EJB) running on Websphere server. The EJB looks up the Agent using the Websphere's Initialcontext factory (websphere.jar ,Don't use the deprecated factory ns.jar). (U should configure the same context factory with u r Java Corba Agent)
Hope this helps u
manoj |
|
Back to top |
|
 |
manoj |
Posted: Sat Feb 09, 2002 8:48 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
I missed the following ......
set u r jre home to what u find inside the websphere directory (don't set to Sun JDK . u will face problems with ORB. If u want to use SUN JDK for u r Java corba agent u should run u r J2EE application on SUN JDK (JVM). U 've to edit the java.policy file to give necessory permissions.
regds
manoj |
|
Back to top |
|
 |
JImmy |
Posted: Wed Apr 03, 2002 6:16 pm Post subject: |
|
|
Acolyte
Joined: 23 Feb 2002 Posts: 59 Location: Shanghai, China
|
It does not work yet.
[ This Message was edited by: JImmy on 2002-04-03 23:42 ] |
|
Back to top |
|
 |
manoj |
Posted: Thu Apr 04, 2002 5:52 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
can u provide u r java.policy file
and java corba agent configuration . This u get by running the fmczutil utility and typing "d" option.
--Manoj
|
|
Back to top |
|
 |
JImmy |
Posted: Fri Apr 05, 2002 12:01 am Post subject: |
|
|
Acolyte
Joined: 23 Feb 2002 Posts: 59 Location: Shanghai, China
|
java.policy
---------------------------------------
// Standard extensions get all permissions by default
grant codeBase "file:${java.home}/lib/ext/*" {
permission java.security.AllPermission;
};
grant codeBase "file:/G:/MQSeriesWorkflow/bin/-" {
permission java.util.PropertyPermission "*", "read, write";
permission java.net.SocketPermission "*:900", "accept, connect, listen, resolve";
permission java.net.SocketPermission "*:1024-", "accept, connect, listen, resolve";
};
grant codeBase "file:/G:/WebSphere/AppServer/-" {
permission java.util.PropertyPermission "*", "read, write";
permission java.net.SocketPermission "*:*", "accept, connect, listen, resolve";
};
// default permissions granted to all domains
grant {
// Allows any thread to stop itself using the java.lang.Thread.stop()
// method that takes no argument.
// Note that this permission is granted by default only to remain
// backwards compatible.
// It is strongly recommended that you either remove this permission
// from this policy file or further restrict it to code sources
// that you specify, because Thread.stop() is potentially unsafe.
// See "http://java.sun.com/notes" for more information.
permission java.lang.RuntimePermission "stopThread";
// allows anyone to listen on un-privileged ports
permission java.net.SocketPermission "localhost:1024-", "listen";
// "standard" properies that can be read by anyone
permission java.util.PropertyPermission "java.version", "read";
permission java.util.PropertyPermission "java.vendor", "read";
permission java.util.PropertyPermission "java.vendor.url", "read";
permission java.util.PropertyPermission "java.class.version", "read";
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "os.version", "read";
permission java.util.PropertyPermission "os.arch", "read";
permission java.util.PropertyPermission "file.separator", "read";
permission java.util.PropertyPermission "path.separator", "read";
permission java.util.PropertyPermission "line.separator", "read";
permission java.util.PropertyPermission "java.specification.version", "read";
permission java.util.PropertyPermission "java.specification.vendor", "read";
permission java.util.PropertyPermission "java.specification.name", "read";
permission java.util.PropertyPermission "java.vm.specification.version", "read";
permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
permission java.util.PropertyPermission "java.vm.specification.name", "read";
permission java.util.PropertyPermission "java.vm.version", "read";
permission java.util.PropertyPermission "java.vm.vendor", "read";
permission java.util.PropertyPermission "java.vm.name", "read";
};
--------------------------------------------------------------------
And i use MQWF3.3.1, fmczutil have no option other than "-f", the following is the agent settings:
--------------------------------------------------------------------
- Agent name : MQWFAGENT
- JDK/JRE Installation Directory : G:WebSphereAppServerjava
- Code Version : 3300
- Naming context factory : com.ibm.websphere.naming.WsnIniti
alContextFactory
- JAR file containing naming factory : G:WebSphereAppServerlibwebsph
ere.jar
- Naming provider URL : iiop://localhost:900
- Garbage collection (reaper)
- Agent cycle (in seconds) : 300
- Client threshold (number of objects) : 1000
- Client cycle (in % of agent cycle) : 90
----------------------------------------------------------------------
And the problem is that I can logon via web client, but I get the error message in my own client program.
[ This Message was edited by: JImmy on 2002-04-07 18:48 ] |
|
Back to top |
|
 |
manoj |
Posted: Sun Apr 14, 2002 11:22 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
Hi,
I don't no the code u use to connect to the Java Corba agent.
Here's my code.
Agent agent = new Agent();
String args[] = {"MQWFAGENT"};
Properties prop = new Properties();
prop.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory" );
prop.put( javax.naming.Context.PROVIDER_URL, "iiop://<IP Address of JNDI Name server>:900" );
agent.setContext( args, prop );
agent.setLocator( Agent.JNDI_LOCATOR );
// MQWFAGENT should be there in the JNDI namespace, try dumpnamespace command in websphere/appserver/bin
agent.setName("MQWFAGENT");
System.out.println("Login :Trying to login to w/f server.....");
service = agent.locate("FMCGRP", "FMCSYS");
System.out.println("Login : Config ID is :" + agent.getConfigurationID());
if (agent == null ) System.out.println("Agent is null");
else System.out.println("Login : Got a valid agent");
if (service == null) System.out.println("Login : Service is null");
else System.out.println("Login Got valid service");
service.logon2("ADMIN", "password", SessionMode.DEFAULT, AbsenceIndicator.RESET);
-------------if u can't still connect ,verify u r java.policy file ...u probably 've to specify Websphere/Appserver/lib/-
and in the configuration of java corba agent u 've to specify the numeric IP Address of the JNDI Name server (i could see the localhost)
Hope this help u
---manoj
[ This Message was edited by: manoj on 2002-04-14 12:23 ]
[ This Message was edited by: manoj on 2002-04-14 12:26 ] |
|
Back to top |
|
 |
JImmy |
Posted: Sun Apr 14, 2002 4:46 pm Post subject: |
|
|
Acolyte
Joined: 23 Feb 2002 Posts: 59 Location: Shanghai, China
|
Thanks Manoj
Actually I can connect to Workflow server through Web Client using the JNDI_LOCATOR.
I use the exactely same code as yours, I will review the java.policy file and the codes later. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|