JMS Connection Problem

2002-04-19 Thread Lomesh Contractor

Hi All,

My problem arises when I trying to communicate with JMS Server. I am
running my JMS server on Server A and am trying to connect to it from Server
B.

But, on doing this I am getting following exception . I have checked out
almost everything, but could not found the any clue.

Regards,
Lomesh

//

java.lang.SecurityException: Invalid username/password for bea (admin)
at com.evermind._cd._mu(Unknown Source)
at com.evermind._cd._mu(Unknown Source)
at com.evermind._cd._np(Unknown Source)
at com.evermind._ce._np(Unknown Source)
at com.evermind.server.rmi.RMIContext.lookup(Unknown Source)
at com.evermind._cf._np(Unknown Source)
at com.evermind._cf.lookup(Unknown Source)
at
com.evermind.server.administration.ApplicationResourceFinder.getLocation(Unk
nown Source)
at com.evermind._ck._ho(Unknown Source)
at com.evermind._ah.getEnvironmentContext(Unknown Source)
at com.evermind._cf._np(Unknown Source)
at com.evermind._cf.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at elitecore.bea.web.HomePageController.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.(Unknown Source)
at com.evermind._ck._czc(Unknown Source)
at com.evermind._ae._czc(Unknown Source)
at com.evermind._ab._crc(Unknown Source)
at com.evermind._ab._at(Unknown Source)
at com.evermind._ae._an(Unknown Source)
at com.evermind._ae._at(Unknown Source)
at com.evermind.server.ApplicationServer._wh(Unknown Source)
at com.evermind.server.ApplicationServer._at(Unknown Source)
at com.evermind._in.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)
at com.evermind._if.run(Unknown Source)


//







Re: JNDI question: client talking to EJBs on multiple app servers

2002-04-19 Thread Lachezar Dobrev

  Well... "dedicated.connection=true" is not documented :)))
  Second. There ARE drawbacks.
  The method you show in the message will lead you to resource leakage.
  Try reusing contexts for one and the same target.
  Anyway. The Answer is: YES, it WILL work.

  However. The classes, for the Home and remote interfaces for the beans you
are looking-up for have to be in the Bootstrap class-path (in most cases in
the boot jar, or specified on the commandline). Otherwise you will get a
ClassCastException ( "MyClass" implements "MyInterface" and not
"MyInterface" and the VM thinks these are different classes :((( ).

  Anyway. for a simple stand-alone client this works fine, as long as you
stay out of dynamic-class-loading and keep in mind, that each ne Context
gets another thread, socket and leads to resource shortage.

  Otherwise the code in your case would work just fine. :)))

  Lachezar

> Brilliant -- thanks. What I couldn't find was any documentation
> on what goes in the environment Hashtable. :)
>
> What does the dedicated.connection=true property do? If I were
> to do this:
>
>   public FooRemote getRemote(String jndiURL)
>   {
>  Hashtable env = new Hashtable();
>  env.put(Context.PROVIDER_URL, jndiURL);
>  InitialContext context = new InitialContext(env);
>  Object ref = context.lookup(EJB_NAME);
>  FooHome home =
>   (FooHome)PortableRemoteObject.narrow(ref, FooHome.class);
>  FooRemote remote = home.create();
>  return fooRemote;
>   }
>
>   public void doStuff()
>   {
> FooRemote beanOne = getRemote("ormi://fred/app");
> FooRemote beanTwo = getRemote("ormi://wilma/app");
> // do stuff...
>   }
>
> Will it work? Or is the remote going to get confused as to
> which server it points to?
>
> On Thu, 2002-04-18 at 00:53, Lachezar Dobrev wrote:
> >   Hi.
> >   A working model is to create two Initial Context-s for each server.
> >   Use a "dedicated.connection=true" property to create the context.
> >   The "dedicated.connection" however leads to resource leakage, and if
you
> > keep creating more and more of them you will eventualy get
> > "java.lang.OutOfMemoryError: Can not create native thread" at some
200-300
> > contexts.
> >   If you create an context for both servers, and then use them later you
> > might not have this problem.
> >
> >   public static Context[] connections;
> >
> >   public void ejbCreate(){
> > if ( connections != null ) return;
> > Hashtable env = new Hashtable();
> >
> > // Use any of these.
> > env.put("dedicated.connection", Boolean.TRUE );
> > //env.put("dedicated.connection", "true");
> >
> > // Set up user, pass,
> > // factory (RMIInitialContextFactory).
> > env.put("...", ""); // Set up things
> >
> > connections = new Context[2];
> >
> > // For The first server
> > env.put(Context.PROVIDER_URL, "ormi://Comp1/App1");
> > connections[0] = new InitialContext(env);
> >
> > // Now for the other server
> > env.put(Context.PROVIDER_URL, "ormi://Comp2/App2");
> > connections[1] = new InitialContext(env);
> >   }
> >
> >   public void connectServer1(){
> > connections[0].lookup("MyBean1");
> >   }
> >   public void connectServer2(){
> > connections[1].lookup("MyBean2");
> >   }
> >
> >You DO understand this is Orion-specific, right?
> >
> >   Good luck. Lachezar.
> >
> > > I've got the same beans deployed on two different app servers (each
> > > backed by a different database). I want my client to talk to both.
> > > Say the two app servers are running on machines named Fred and Wilma;
> > >
> > > I know I can choose which one I talk to by setting
> > >
> > >   java.naming.provider.url=ormi://fred/app
> > >
> > > or
> > >
> > >   java.naming.provider.url=ormi://wilma/app
> > >
> > > But how do I switch at run time? I don't want to keep changing the
> > > system property every time I get an InitialContext(), because the
> > > system property is a global setting and one piece of code might not
> > > know what another piece of code is doing. Is there a way to specify
> > > the JNDI url when you create an InitialContext?
> > >
> > >
> > >
> >
> >
> >
>
>





sendRedirect()

2002-04-19 Thread Sergey G. Aslanov

Hi all

   I have two web apps, one with root, other with with virtual
   directory:




   I wants to redirect to some page /lalala.html of app CBOSSishop and
   do sendRedirect("/lalala.html") in CBOSSishop, but
   orion redirects it to the root app CBOSSwww /lalala.html;jsessionid=...
   When i remove this line from default-web-site.xml:

   and do redirect again, it successfully redirects it to
   /ishop/lalala.html;jsessionid=...!
   Is it a orion bug?
   Please help!


-- 
Sergey G. Aslanov
CBOSS Group,
Web-technologies department
mailto:[EMAIL PROTECTED]
http://www.cboss.ru
tel: +7 095 7555655