You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by ma...@yahoo.com on 2005/07/23 04:55:51 UTC

Cactus tests failing - unable to lookup Data sources

Hi, I just got cactus up and running. I have everything setup ok and it seems to be running some tests well. Some tests are failing because of database connectivity. Here is what I do.
 
            InitialContext ctx = new InitialContext();
            DataSource ds = (DataSource) ctx.lookup(_connectionPoolname);

This same code runs fine when deployed to the app server (in production), but when cactus runs tests (using cactified version of ear file), it throws NamingException while looking data source. Here is the error message:
 
   [cactus] Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
 
Any ideas?
 
I appreciate your insight.
 
Madhan.


Madhan.

Re: Cactus tests failing - unable to lookup Data sources

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi Madhan,

In article <20...@web54407.mail.yahoo.com>,
Mon, 25 Jul 2005 11:52:07 -0700 (PDT),
Madhan Thirukonda <ma...@yahoo.com> wrote: 
madhanmt2-list> Thanks for your time. I traced the problem. I actually
madhanmt2-list> had some junit tests and did not change the calls to
madhanmt2-list> the cactus way so it was running it on the client
madhanmt2-list> side. When I added ServletTestSuite().addTestSuite(),
madhanmt2-list> it ran okay (like below)

Ah. I couldn't imagine that.

Thanks for the information.
----
Kazuhito SUGURI

Re: Cactus tests failing - unable to lookup Data sources

Posted by Madhan Thirukonda <ma...@yahoo.com>.
Kazuhito,
Thanks for your time. I traced the problem. I actually
had some junit tests and did not change the calls to
the cactus way so it was running it on the client
side. When I added ServletTestSuite().addTestSuite(),
it ran okay (like below)

Thanks,
Madhan.

  public static Test suite() {
    ServletTestSuite suite = new ServletTestSuite();
    suite.addTestSuite(VirusScanEJBTest.class);
    return suite;
  }
  
  /*
  public static void main(String[] args) {
    // JUnitDoclet begin method testcase.main
   
junit.textui.TestRunner.run(VirusScanEJBTest.class);
    // JUnitDoclet end method testcase.main
  }
  */

--- Kazuhito SUGURI <su...@lab.ntt.co.jp>
wrote:

> Hi Madhan,
> 
> In article
>
<20...@web54410.mail.yahoo.com>,
> Sun, 24 Jul 2005 17:04:22 -0700 (PDT),
> Madhan Thirukonda <ma...@yahoo.com> wrote: 
> madhanmt2-list> I am running the appserver (OC4J) in
> a seperate JVM
> madhanmt2-list> (I couldn't get it to working using
> <containerset>
> madhanmt2-list> so I run it outside my ant script).
> Is that a problem?
> 
> I don't think that is the problem.
> I think the problem is in configuration of the
> server
> and/or ear archiving.
> 
> You might extract the cactified ear (and war(s)
> included in it)
> to know how the cactified application is configured.
> Could you find what may be wrong?
> 
> Regards,
> ----
> Kazuhito SUGURI
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> 
> 


Madhan.

Re: Cactus tests failing - unable to lookup Data sources

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi Madhan,

In article <20...@web54410.mail.yahoo.com>,
Sun, 24 Jul 2005 17:04:22 -0700 (PDT),
Madhan Thirukonda <ma...@yahoo.com> wrote: 
madhanmt2-list> I am running the appserver (OC4J) in a seperate JVM
madhanmt2-list> (I couldn't get it to working using <containerset>
madhanmt2-list> so I run it outside my ant script). Is that a problem?

I don't think that is the problem.
I think the problem is in configuration of the server
and/or ear archiving.

You might extract the cactified ear (and war(s) included in it)
to know how the cactified application is configured.
Could you find what may be wrong?

Regards,
----
Kazuhito SUGURI

Re: Cactus tests failing - unable to lookup Data sources

Posted by Madhan Thirukonda <ma...@yahoo.com>.
Kazuhito,
 
testXXX is invoking that piece of code. I have the same /target name. The only thing that I changed from the original one is the name of the .ear file. Everything else is the same.
 
I am running the appserver (OC4J) in a seperate JVM (I couldn't get it to working using <containerset> so I run it outside my ant script). Is that a problem?
 
Thanks,
Madhan.

Kazuhito SUGURI <su...@lab.ntt.co.jp> wrote:
Hi Madhan,

In article <20...@web54401.mail.yahoo.com>,
Fri, 22 Jul 2005 19:55:51 -0700 (PDT),
wrote: 
madhanmt2-list> Hi, I just got cactus up and running. I have everything setup ok and it seems to be running some tests well. Some tests are failing because of database connectivity. Here is what I do.
madhanmt2-list> 
madhanmt2-list> InitialContext ctx = new InitialContext();
madhanmt2-list> DataSource ds = (DataSource) ctx.lookup(_connectionPoolname);

Where the code is located?

If the code is in beginXXX method, it should fail because
it's executed in client-side.

If the code is in testXXX or setUp method, the problem may be depending on
how the DataSource is configured.
For example, if the DataSource is available only for /target context,
the resource cannot be used from /target-cactified context.

We may need more information to help you.

Thanks,
----
Kazuhito SUGURI

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org



Madhan.

Re: Cactus tests failing - unable to lookup Data sources

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi Madhan,

In article <20...@web54401.mail.yahoo.com>,
Fri, 22 Jul 2005 19:55:51 -0700 (PDT),
<ma...@yahoo.com> wrote: 
madhanmt2-list> Hi, I just got cactus up and running. I have everything setup ok and it seems to be running some tests well. Some tests are failing because of database connectivity. Here is what I do.
madhanmt2-list>  
madhanmt2-list>             InitialContext ctx = new InitialContext();
madhanmt2-list>             DataSource ds = (DataSource) ctx.lookup(_connectionPoolname);

Where the code is located?

If the code is in beginXXX method, it should fail because
it's executed in client-side.

If the code is in testXXX or setUp method, the problem may be depending on
how the DataSource is configured.
For example, if the DataSource is available only for /target context,
the resource cannot be used from /target-cactified context.

We may need more information to help you.

Thanks,
----
Kazuhito SUGURI