Hi Sathiya,
You seem to *really* be looking for an answer seen the repetitive emails
... ;-)
I don't know what your problem is and I believe it is not Cactus
related. The best I can do is show you how I've done it using WL 6.1
1/ You call your local EJB from a test class that extends
ServletTestCase
2/ In your web.xml, you need to have a reference to the local bean
you're calling. Ex:
<ejb-ref>
<ejb-ref-name>CustomerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.xxx.host.bedrock.control.CustomerSessionHome</home>
<remote>com.xxx.host.bedrock.control.CustomerSessionLocal</remote>
</ejb-ref>
3/ You then need to map the JNDI name using the app server proprietary
conf file (called weblogic.xml for WL). Ex:
<weblogic-web-app>
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>
CustomerSession
</ejb-ref-name>
<jndi-name>
CustomerSession
</jndi-name>
</ejb-reference-description>
[...]
4/ Then perform the lookup. Ex:
CustomerSessionHome customerHome = (CustomerSessionHome) (
new InitialContext().lookup(
"CustomerSession"));
CustomerSession customer = customerHome.create();
Customer.xxx();
Hope it helps
-Vincent
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: 26 June 2002 15:19
> To: Cactus Users List
> Subject: Hello Mr Vincent..Ur Attn. pl.....
>
> Hi Vincent,
>
> I am trying to run a testclient to test EJBLocalObject interface.
>
> Lookup is fine but when I get a home interface refernce, an
exceptionis
> thrown as " Class cast exception..................." . Once This is
> solved, my EJB LocalObjectTesting get successfully over Using the
Cactus
> ( which is only tools supporintg my reqment....).
>
> Any idea why this happens. : can u pl. send a code samplet how to
code a
> client for EJBLocalObject ( incae mine is wrong)
> My client code is as below:
>
>
>
> ......
> Context ctx = new InitialContext();
> home = (TestSSBLocalHome)ctx.lookup("TestSSB.Test");
> tLocal = home.create();
> output= tLocal.printSomething("IQUOTE");
> expected = "IQUOTEIQUOTE";
> System.out.println("Expceted / outpur from BEAN Client is
> .........V: " + output);
> .......
> My exception is as below :
>
>
>
> 19:44:44,585 [main] DEBUG mysample.TestingSSBClient -
-------------
> Test: testRunme
> 19:44:44,741 [main] DEBUG mysample.TestingSSBClient - Exception
in
> test
> java.lang.ClassCastException:
mysample.TestSSBBean_406vao_LocalHomeImpl
> at mysample.TestSSBClient.runme(TestSSBClient.java:67)
> at
mysample.TestingSSBClient.testRunme(TestingSSBClient.java:50)
> at java.lang.reflect.Method.invoke(Native Method)
> at
>
org.apache.cactus.AbstractTestCase.runServerTest(AbstractTestCase.java:5
24
> )
> at
>
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.ja
va
> :490)
> at
>
org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.ja
va
> :148)
> at
>
org.apache.cactus.server.AbstractTestController.dispatch79_handleRequest
(A
>
bstractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k)
:1
> 23)
> at
>
org.apache.cactus.server.AbstractTestController.around79_handleRequest(A
bs
>
tractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):1
14
> 7)
> at
>
org.apache.cactus.server.AbstractTestController.handleRequest(AbstractTe
st
> Controller.java;org/apache/cactus/util/log/LogAspect.java(1k):101)
> at
>
org.apache.cactus.server.ServletTestRedirector.dispatch88_doPost(Servlet
Te
> stRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):132)
> at
>
org.apache.cactus.server.ServletTestRedirector.around88_doPost(ServletTe
st
> Redirector.java;org/apache/cactus/util/log/LogAspect.java(1k):1147)
> at
>
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirec
to
> r.java;org/apache/cactus/util/log/LogAspect.java(1k):118)
> at
>
org.apache.cactus.server.ServletTestRedirector.dispatch87_doGet(ServletT
es
> tRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):105)
> at
>
org.apache.cactus.server.ServletTestRedirector.around87_doGet(ServletTes
tR
> edirector.java;org/apache/cactus/util/log/LogAspect.java(1k):1147)
> at
>
org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirect
or
> .java;org/apache/cactus/util/log/LogAspect.java(1k):101)
> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
ja
> va:265)
> at
> weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:21)
> at
>
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27
> )
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
et
> Context.java:2501)
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
ja
> va:2204)
> at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
>
>
> Thanks Vincent,
> sathiya
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>