Andreas,

> -----Original Message-----
> From: Andreas Loew [mailto:[EMAIL PROTECTED]]
> Sent: 07 March 2002 21:02
> To: [EMAIL PROTECTED]
> Subject: Cactus setup problem with Weblogic 6.1: ClassCastException
> 
> Hello world,
> 
> we are having problems with the configuration of Cactus
> (jakarta-cactus-23-1.2.zip) on Weblogic 6.1 SP2.
> 
> Our test classes extend the ServletTestCase and run tests against EJB
2.0
> CMP entity beans having (only) local interfaces deployed in the
Weblogic
> EJB container.
> 
> (1) We have built a war file with the ejb local "client" classes &
test
> classes in the WEB-INF/classes subdirectory, the cactus, log4j, ...
libs
> in
> the WEB-INF/libs directory and an EJB jar file, which are both
correctly
> deployed.

This is not needed as the webapp classloader inherits from the ejb
classloader and thus any class in a war has full visibility to any class
in your ejb jars. I would suggest you remove these EJB classes from
web-inf/classes. However you can keep cactus.jar, junit.jar,
aspectjrt.jar in WEB-INF/lib and your test classes in WEB-INF/classes.
You should package the whole thing in an EAR.

> 
> (2) We want to start the test class from the command line, and have
the
> test classes as well as cactus, log4j, ... libs set up correctly in
the
> classpath.
> 
> What we get is the following class cast exception:
> 
> java.lang.ClassCastException:
>
de.mobilcom.mpayment.datamanaging.ejb.contract.ContractBean_84q3mx_Local
Ho
> meImpl
>         at
>
de.mobilcom.mpayment.test.ejb.TEST_EJBOrderTransaction.getContractManage
r(
> TEST_EJBOrderTransaction.java:87)
>         at
>
de.mobilcom.mpayment.test.AbstractTestCase_OrderTransaction.setUp(Abstra
ct
> TestCase_OrderTransaction.java:42)
>         at
>
de.mobilcom.mpayment.test.ejb.TEST_EJBOrderTransaction.setUp(TEST_EJBOrd
er
> Transaction.java:48)
>         at
>
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.ja
va
> :454)
>         at
>
org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.ja
va
> :137)
>         at
>
org.apache.cactus.server.AbstractTestController.handleRequest(AbstractTe
st
> Controller.java:122)
>         at
>
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirec
to
> r.java:134)
>         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
ja
> va:265)
>         at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
ja
> va:200)
>         at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
et
> Context.java:2495)
>         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)
> 
> (3) When we add all the classes and jar files from step (1) to the
> Weblogic
> server startup classpath, all testcases are running fine, but Weblogic
> generates a warning that our ejb classes are in the local classpath
and
> cannot be redeployed while the server is running.
> 
> What are we doing wrong? Any clues on how we can leave out (3) and
still
> be
> able to run our tests?
> 

I believe this may be because you have added the EJB classes in
WEB-INF/classes.

Also, in order to be able to call EJB from a servlet you need to define
the EJB to call in web.xml and in 

For example :

In web.xml:

  <ejb-ref>
    <ejb-ref-name>CustomerSession</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.xxx.control.CustomerSessionHome</home>
    <remote>com.xxx.control.CustomerSession</remote>
  </ejb-ref>

In weblogic.xml :

<weblogic-web-app>
  <reference-descriptor>
    <ejb-reference-description>
      <ejb-ref-name>
        CustomerSession
      </ejb-ref-name>
      <jndi-name>
        CustomerSession
      </jndi-name>
    </ejb-reference-description>
  </reference-descriptor>
</weblogic-web-app>

> Thanks in advance,
> regards from Germany
> 
> Andreas

Regards from London !
Thanks
-Vincent

_______________________
Vincent Massol
OCTO Technology UK Ltd
http://www.octo.com
[EMAIL PROTECTED]
Tel: (020) 8996 9540 




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to