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-client        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)
****************************************************************************
********

        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-name>jms/theQueueConnectionFactory</res-ref-name>
 <res-type>javax.jms.QueueConnectionFactory</res-type>
 <res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
 <res-ref-name>jms/processQueue</res-ref-name>
 <res-type>javax.jms.Queue</res-type>
 <res-auth>Container</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
>
>
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>

   <display-name>Orion Primer Web Application</display-name>

   <servlet>
      <servlet-name>elitecore.bea.web.util.LoadServlet</servlet-name>
      <servlet-class>elitecore.bea.web.util.LoadServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <resource-ref>
	<description>Testing</description>
	<res-ref-name>jms/mytopic</res-ref-name>
	<res-type>javax.jms.Topic</res-type>
	<res-auth>Container</res-auth>
   </resource-ref>

   <resource-ref> 
	<res-ref-name>jms/QueueConnectionFactory</res-ref-name> 
	<res-type>javax.jms.QueueConnectionFactory</res-type> 
	<res-auth>Container</res-auth> 
   </resource-ref> 

   <resource-ref> 
	<res-ref-name>jms/TopicConnectionFactory</res-ref-name> 
	<res-type>javax.jms.TopicConnectionFactory</res-type> 
	<res-auth>Container</res-auth> 
   </resource-ref> 

   <resource-ref> 
	<res-ref-name>jms/myqueue</res-ref-name> 
	<res-type>javax.jms.Queue</res-type> 
	<res-auth>Container</res-auth> 
   </resource-ref> 

   <ejb-ref>
      <ejb-ref-name>ejb/HelloHome</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <home>elitecore.bea.ejb.HelloHome</home>
      <remote>elitecore.bea.ejb.Hello</remote>
   </ejb-ref>
  
   <ejb-ref>
      <ejb-ref-name>ejb/HelloAnswerHome</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <home>elitecore.bea.ejb.HelloAnswerHome</home>
      <remote>elitecore.bea.ejb.HelloAnswer</remote>
   </ejb-ref>

   <ejb-ref>
      <ejb-ref-name>ejb/HelloAnswerTestHome</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <home>elitecore.bea.ejb.test.HelloAnswerTestHome</home>
      <remote>elitecore.bea.ejb.test.HelloAnswerTest</remote>
   </ejb-ref>

</web-app>

Attachment: ApplicationReflector.java
Description: java/

Attachment: synchronizeservers.properties
Description: Binary data

Reply via email to