Urgent :: How to access JMS service from Servlet/JSP

2001-11-19 Thread Lomesh Contractor


Hello All,

Here I am describing whole situation in project.

My site will be hosted on three different servers EACH having orion server
running on it with JMS Server. Now, in my site if any one makes changes,
that changes should be reflected in other two servers at a time. Now, for
that I am using JMS. For each changes I am calling servlet and that servlet
will in turn contact to other two servers for reflection of changes.

Now, I am using property file( as in attachment) that have each servers
required(Contact) information. Now, while initialization of server I am
calling one servlet, that in turn call a class ApplicationReflector.java (
as in attachment ). This class reads property file and create instance of
class ApplicationReflector itself. But it gives error as below ::



javax.naming.NamingException: META-INF/application-client.xml resource not
found (see J2EE spec, application-clientchapter for requirements and
format of the file)
at
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at elitecore.bea.web.control.ApplicationReflector.init(Unknown
Source)
at
elitecore.bea.web.control.ApplicationReflector.createInstances(Unknown
Source)
at elitecore.bea.web.control.ApplicationReflector.clinit(Unknown
Source)
at elitecore.bea.web.util.LoadServlet.init(Unknown Source)
at com.evermind._ah._axe(Unknown Source)
at com.evermind._ah._fpd(Unknown Source)
at com.evermind._ah._bae(Unknown Source)
at com.evermind._ah._bie(Unknown Source)
at com.evermind._ah.init(Unknown Source)
at com.evermind._ck._czc(Unknown Source)
at com.evermind._ae._czc(Unknown Source)
at com.evermind._ab._au(Unknown Source)
at com.evermind._io._twc(Unknown Source)
at com.evermind._io._gc(Unknown Source)
at com.evermind._if.run(Unknown Source)



Well, I have also made entry in the web.xml(as in attachment ) as you said.
Also, I am able to call ejb from servlet with same kind of entry.

ANY CLUE ???

ANY HELP WOULD BE HIGHLY APPRECIATE ... AS I AM NOT GETTING OUT OF THIS
PROBLEM...

THANKS IN ADVANCE...

Regards,

Lomesh Contractor.






-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Kesav Kumar
Sent: Monday, November 12, 2001 3:17 PM
To: Orion-Interest
Subject: Re: Urgent :: How to access JMS service from Servlet/JSP


You don't need application-client.xml if you want to access JMS from
servlets.

You have to write your queueconnection and queues in web.xml.  Add
resoure-ref entries in web.xml
resource-ref
 res-ref-namejms/theQueueConnectionFactory/res-ref-name
 res-typejavax.jms.QueueConnectionFactory/res-type
 res-authContainer/res-auth
/resource-ref
resource-ref
 res-ref-namejms/processQueue/res-ref-name
 res-typejavax.jms.Queue/res-type
 res-authContainer/res-auth
/resource-ref

Once you have the resource-ref entries in web.xml from your servlet write
the following

Context ctx = new InitialContext();
QueueConnection con =
(QueueConnection)ctx.lookup(java:comp/env/jms/theQueueConnectionFactory);
Queue queue = (Queue)ctx.lookup(java:comp/env/jms/processQueue);

I didn't understand your question of different containers?  Do you mean
different containers different orion server?
If you want to get access JMS queue/connection of different orion server
provide proper JNDI properties for obtaining InitialContext.

Example:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
com.evermind.server.ApplicationClientInitialContextFactory);
env.put(Context.PROVIDER_URL, ormi://host/applicationname);
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(env);
Rest of the code is common.

Hope this helps you.

- Original Message -
From: Lomesh Contractor [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Sunday, November 11, 2001 10:21 PM
Subject: Urgent :: How to access JMS service from Servlet/JSP


 Hi Steve,

 Well, I am able to run a standalone client that accesses JMS service, but
 when I access that service using servlet it shows following error::

 javax.naming.NamingException: META-INF/application-client.xml resource not
 found (see J2EE spec, application-c
 lient chapter for requirements and format of the file)
 at

com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
 (Unknown

Re: Re[2]: Urgent :: How to access JMS service from Servlet/JSP

2001-11-13 Thread Vani H.S.

Thank you very much. I sincerely appreciate your help.
Best regards,
Vani


From: Sergey G. Aslanov [EMAIL PROTECTED]
Reply-To: Orion-Interest [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Subject: Re[2]: Urgent :: How to access JMS service from Servlet/JSP
Date: Tue, 13 Nov 2001 09:52:12 +0300

VHS I think, I am also facing a similar problem. I have followed the steps 
you
VHS have mentioned below but when I try to deploy it, it gives the 
following
VHS error message:

VHS Error instantiating application: Error loading web-app 'war-ic' at
VHS D:\orion\applications\PhotonManagementConsoleApp\war-ic: Unknown
VHS resource-ref tag: res-ref-type

Must be res-type, not res-ref-type!
 ^^
VHS Can you please let me know if there are any other steps.
VHS Note: I have created the ear file using ant.
VHS Thanks,
VHS Vani


 From: Kesav Kumar [EMAIL PROTECTED]
 Reply-To: Orion-Interest [EMAIL PROTECTED]
 To: Orion-Interest [EMAIL PROTECTED]
 Subject: Re: Urgent ::  How to access JMS service from Servlet/JSP
 Date: Mon, 12 Nov 2001 01:47:03 -0800
 
 You don't need application-client.xml if you want to access JMS from
 servlets.
 
 You have to write your queueconnection and queues in web.xml.  Add
 resoure-ref entries in web.xml
 resource-ref
   res-ref-namejms/theQueueConnectionFactory/res-ref-name
   res-typejavax.jms.QueueConnectionFactory/res-type
   res-authContainer/res-auth
 /resource-ref
 resource-ref
   res-ref-namejms/processQueue/res-ref-name
   res-typejavax.jms.Queue/res-type
   res-authContainer/res-auth
 /resource-ref
 
 Once you have the resource-ref entries in web.xml from your servlet 
write
 the following
 
 Context ctx = new InitialContext();
 QueueConnection con =
 (QueueConnection)ctx.lookup(java:comp/env/jms/theQueueConnectionFactory);
 Queue queue = (Queue)ctx.lookup(java:comp/env/jms/processQueue);
 
 I didn't understand your question of different containers?  Do you mean
 different containers different orion server?
 If you want to get access JMS queue/connection of different orion server
 provide proper JNDI properties for obtaining InitialContext.
 
 Example:
 Hashtable env = new Hashtable();
 env.put(Context.INITIAL_CONTEXT_FACTORY,
 com.evermind.server.ApplicationClientInitialContextFactory);
 env.put(Context.PROVIDER_URL, ormi://host/applicationname);
 env.put(Context.SECURITY_PRINCIPAL, username);
 env.put(Context.SECURITY_CREDENTIALS, password);
 Context ctx = new InitialContext(env);
 Rest of the code is common.
 
 Hope this helps you.
 




_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





Re: Urgent :: How to access JMS service from Servlet/JSP

2001-11-12 Thread Kesav Kumar

You don't need application-client.xml if you want to access JMS from
servlets.

You have to write your queueconnection and queues in web.xml.  Add
resoure-ref entries in web.xml
resource-ref
 res-ref-namejms/theQueueConnectionFactory/res-ref-name
 res-typejavax.jms.QueueConnectionFactory/res-type
 res-authContainer/res-auth
/resource-ref
resource-ref
 res-ref-namejms/processQueue/res-ref-name
 res-typejavax.jms.Queue/res-type
 res-authContainer/res-auth
/resource-ref

Once you have the resource-ref entries in web.xml from your servlet write
the following

Context ctx = new InitialContext();
QueueConnection con =
(QueueConnection)ctx.lookup(java:comp/env/jms/theQueueConnectionFactory);
Queue queue = (Queue)ctx.lookup(java:comp/env/jms/processQueue);

I didn't understand your question of different containers?  Do you mean
different containers different orion server?
If you want to get access JMS queue/connection of different orion server
provide proper JNDI properties for obtaining InitialContext.

Example:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
com.evermind.server.ApplicationClientInitialContextFactory);
env.put(Context.PROVIDER_URL, ormi://host/applicationname);
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(env);
Rest of the code is common.

Hope this helps you.

- Original Message -
From: Lomesh Contractor [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Sunday, November 11, 2001 10:21 PM
Subject: Urgent :: How to access JMS service from Servlet/JSP


 Hi Steve,

 Well, I am able to run a standalone client that accesses JMS service, but
 when I access that service using servlet it shows following error::

 javax.naming.NamingException: META-INF/application-client.xml resource not
 found (see J2EE spec, application-c
 lient chapter for requirements and format of the file)
 at

com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
 (Unknown Source)
 at javax.naming.spi.NamingManager.getInitialContext(Unknown
Source)
 at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
 at javax.naming.InitialContext.init(Unknown Source)
 at javax.naming.InitialContext.init(Unknown Source)
 at elitecore.bea.web.control.ApplicationReflector.init(Unknown
 Source)
 at
 elitecore.bea.web.control.ApplicationReflector.createInstances(Unknown
 Source)
 at elitecore.bea.web.control.ApplicationReflector.clinit(Unknown
 Source)
 at elitecore.bea.web.util.LoadServlet.init(Unknown Source)
 at com.evermind._ah._axe(Unknown Source)
 at com.evermind._ah._fpd(Unknown Source)
 at com.evermind._ah._bae(Unknown Source)
 at com.evermind._ah._bie(Unknown Source)
 at com.evermind._ah.init(Unknown Source)
 at com.evermind._ck._czc(Unknown Source)
 at com.evermind._ae._czc(Unknown Source)
 at com.evermind._ab._au(Unknown Source)
 at com.evermind._io._twc(Unknown Source)
 at com.evermind._io._gc(Unknown Source)
 at com.evermind._if.run(Unknown Source)

 So, to eliminate this error where I have to make changes ??  Also, I want
 to access JMS service of multiple servers. So, to achieve that where could
I
 have to make changes in the configuration files (xml files).

 If you are familiar with accessing EJB of multiple servers then that also
 would be helpful. And if you can send sample configuration files that also
 would be helpful to me.

 Waiting for reply..

 Regards,

 Lomesh.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Stephen
 Davidson
 Sent: Monday, November 12, 2001 6:59 AM
 To: Orion-Interest
 Subject: Re: How to accesss JMS service from Servlet/JSP


 Lomesh Contractor wrote:

  Hi All,
 
  How can I access JMS service of different **container(s)** from my
  servlet/jsp ??
 
  Which configuration files I have to change to achieve it ?? web.xml or
  ejb-jar.xml ??
 
  If so, Can you send me a sample configuration file ???
 
  Waiting for reply..
 
  Lomesh.

 Hi Lomesh.

 Check the orion docs on the JMS.xml file.  Unfortunately, I do not have
any
 good examples to send at this time.

 -Steve

 --
 Stephen Davidson
 Java Consultant
 Delphi Consultants, LLC
 http://www.delphis.com
 Phone: 214-696-6224 x208






Re: Urgent :: How to access JMS service from Servlet/JSP

2001-11-12 Thread Vani H.S.

I think, I am also facing a similar problem. I have followed the steps you 
have mentioned below but when I try to deploy it, it gives the following 
error message:

Error instantiating application: Error loading web-app 'war-ic' at 
D:\orion\applications\PhotonManagementConsoleApp\war-ic: Unknown 
resource-ref tag: res-ref-type

Can you please let me know if there are any other steps.
Note: I have created the ear file using ant.
Thanks,
Vani


From: Kesav Kumar [EMAIL PROTECTED]
Reply-To: Orion-Interest [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Subject: Re: Urgent ::  How to access JMS service from Servlet/JSP
Date: Mon, 12 Nov 2001 01:47:03 -0800

You don't need application-client.xml if you want to access JMS from
servlets.

You have to write your queueconnection and queues in web.xml.  Add
resoure-ref entries in web.xml
resource-ref
  res-ref-namejms/theQueueConnectionFactory/res-ref-name
  res-typejavax.jms.QueueConnectionFactory/res-type
  res-authContainer/res-auth
/resource-ref
resource-ref
  res-ref-namejms/processQueue/res-ref-name
  res-typejavax.jms.Queue/res-type
  res-authContainer/res-auth
/resource-ref

Once you have the resource-ref entries in web.xml from your servlet write
the following

Context ctx = new InitialContext();
QueueConnection con =
(QueueConnection)ctx.lookup(java:comp/env/jms/theQueueConnectionFactory);
Queue queue = (Queue)ctx.lookup(java:comp/env/jms/processQueue);

I didn't understand your question of different containers?  Do you mean
different containers different orion server?
If you want to get access JMS queue/connection of different orion server
provide proper JNDI properties for obtaining InitialContext.

Example:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
com.evermind.server.ApplicationClientInitialContextFactory);
env.put(Context.PROVIDER_URL, ormi://host/applicationname);
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(env);
Rest of the code is common.

Hope this helps you.



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





Re[2]: Urgent :: How to access JMS service from Servlet/JSP

2001-11-12 Thread Sergey G. Aslanov

VHS I think, I am also facing a similar problem. I have followed the steps you
VHS have mentioned below but when I try to deploy it, it gives the following 
VHS error message:

VHS Error instantiating application: Error loading web-app 'war-ic' at 
VHS D:\orion\applications\PhotonManagementConsoleApp\war-ic: Unknown 
VHS resource-ref tag: res-ref-type

Must be res-type, not res-ref-type!
^^
VHS Can you please let me know if there are any other steps.
VHS Note: I have created the ear file using ant.
VHS Thanks,
VHS Vani


From: Kesav Kumar [EMAIL PROTECTED]
Reply-To: Orion-Interest [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Subject: Re: Urgent ::  How to access JMS service from Servlet/JSP
Date: Mon, 12 Nov 2001 01:47:03 -0800

You don't need application-client.xml if you want to access JMS from
servlets.

You have to write your queueconnection and queues in web.xml.  Add
resoure-ref entries in web.xml
resource-ref
  res-ref-namejms/theQueueConnectionFactory/res-ref-name
  res-typejavax.jms.QueueConnectionFactory/res-type
  res-authContainer/res-auth
/resource-ref
resource-ref
  res-ref-namejms/processQueue/res-ref-name
  res-typejavax.jms.Queue/res-type
  res-authContainer/res-auth
/resource-ref

Once you have the resource-ref entries in web.xml from your servlet write
the following

Context ctx = new InitialContext();
QueueConnection con =
(QueueConnection)ctx.lookup(java:comp/env/jms/theQueueConnectionFactory);
Queue queue = (Queue)ctx.lookup(java:comp/env/jms/processQueue);

I didn't understand your question of different containers?  Do you mean
different containers different orion server?
If you want to get access JMS queue/connection of different orion server
provide proper JNDI properties for obtaining InitialContext.

Example:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
com.evermind.server.ApplicationClientInitialContextFactory);
env.put(Context.PROVIDER_URL, ormi://host/applicationname);
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(env);
Rest of the code is common.

Hope this helps you.



VHS _
VHS Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





-- 
Best regards,
 Sergey G. Aslanov mailto:[EMAIL PROTECTED]





Urgent :: How to access JMS service from Servlet/JSP

2001-11-11 Thread Lomesh Contractor

Hi Steve,

Well, I am able to run a standalone client that accesses JMS service, but
when I access that service using servlet it shows following error::

javax.naming.NamingException: META-INF/application-client.xml resource not
found (see J2EE spec, application-c
lient chapter for requirements and format of the file)
at
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at elitecore.bea.web.control.ApplicationReflector.init(Unknown
Source)
at
elitecore.bea.web.control.ApplicationReflector.createInstances(Unknown
Source)
at elitecore.bea.web.control.ApplicationReflector.clinit(Unknown
Source)
at elitecore.bea.web.util.LoadServlet.init(Unknown Source)
at com.evermind._ah._axe(Unknown Source)
at com.evermind._ah._fpd(Unknown Source)
at com.evermind._ah._bae(Unknown Source)
at com.evermind._ah._bie(Unknown Source)
at com.evermind._ah.init(Unknown Source)
at com.evermind._ck._czc(Unknown Source)
at com.evermind._ae._czc(Unknown Source)
at com.evermind._ab._au(Unknown Source)
at com.evermind._io._twc(Unknown Source)
at com.evermind._io._gc(Unknown Source)
at com.evermind._if.run(Unknown Source)

So, to eliminate this error where I have to make changes ??  Also, I want
to access JMS service of multiple servers. So, to achieve that where could I
have to make changes in the configuration files (xml files).

If you are familiar with accessing EJB of multiple servers then that also
would be helpful. And if you can send sample configuration files that also
would be helpful to me.

Waiting for reply..

Regards,

Lomesh.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Stephen
Davidson
Sent: Monday, November 12, 2001 6:59 AM
To: Orion-Interest
Subject: Re: How to accesss JMS service from Servlet/JSP


Lomesh Contractor wrote:

 Hi All,

   How can I access JMS service of different **container(s)** from my
 servlet/jsp ??

   Which configuration files I have to change to achieve it ?? web.xml or
 ejb-jar.xml ??

   If so, Can you send me a sample configuration file ???

   Waiting for reply..

 Lomesh.

Hi Lomesh.

Check the orion docs on the JMS.xml file.  Unfortunately, I do not have any
good examples to send at this time.

-Steve

--
Stephen Davidson
Java Consultant
Delphi Consultants, LLC
http://www.delphis.com
Phone: 214-696-6224 x208