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 Sa...@i2.com on 2002/06/27 12:38:17 UTC

Thanks a lot Vincent ...but it did not solve the problem

Hi Vincent,


Thanks a lot for ur attentiona and effort. but ,  even though I have 
included  the below info in web. xml... it gives the same exception : 
ClassacastException  ( To me also, it seems to be from   Webligic) But I 
have a Bean (Implementing Remote Interface  ) deployed which runs 
successfully and then  runns  my next Client which has a Local Interface- 
.Its for the local Interface it throws exception:
 

Testcase: testRunme took 0.172 sec   Caused an ERROR
 mysample2.SSBBean_1rky_LocalHomeImpl

 java.lang.ClassCastException: mysample2.SSBBean_1rky_LocalHomeImpl

     at mysample2.SSBClient.runme(SSBClient.java:66)
     at mysample2.TestSSBClient.testRunme(TestSSBClient.java:50)
     at java.lang.reflect.Method.invoke(Native Method)
     at org.apache.cactus.AbstractTestCase.runServerTest(AbstractTest
24)
     at org.apache.cactus.AbstractTestCase.runBareServerTest(Abstract
va:490)
     at org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTe
va:148)
     at org.apache.cactus.server.AbstractTestController.dispatch79_ha
(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.jav

     at org.apache.cactus.server.AbstractTestController.around79_hand
bstractTestController.java;org/apache/cactus/util/log/LogAspect.java(



Because I am using the Local Object, I  included in my web.xml  as

  <ejb-ref>
        <ejb-ref-name>SSB</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home>mysample.TestSSBLocalHome</local-home>
        <local>mysample.TestSSBLocal</local>
    </ejb-ref>
 
Do u  have any  Sample Bean  (Implementing  EJB Local Interface )  as  jar 
wehihc u have tested..... porbably can u post over the Cactus mailing list 
 PL...?

Thanks,
Sathiya







"Vincent Massol" <vm...@octo.com>
06/27/2002 03:30 AM
Please respond to "Cactus Users List"

 
        To:     "'Cactus Users List'" <ca...@jakarta.apache.org>
        cc: 
        Subject:        Testing Local EJB w/ WL6.1 (was RE: Hello Mr Vincent..Ur Attn. pl.....)


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: Sathiyamurthy_Ramachandran@i2.com
> [mailto:Sathiyamurthy_Ramachandran@i2.com]
> 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




RE: init Logging Error?

Posted by Vincent Massol <vm...@octo.com>.
Hi Shane,

> -----Original Message-----
> From: Shane Duan [mailto:sduan@borland.com]
> Sent: 17 July 2002 00:06
> To: Cactus Users List
> Subject: Re: init Logging Error?
> 
> Vincent,
> 
> I have tried the nightly build and it is fixed.  Thanks a lot for the
> prompt response!
> 
> I wonder if there is any way to initialize the log service before
> anything else happens, though.  When an exception is thrown when test
> runner is trying to construct the test, the test runner will try to
> construct a string from the exception, during which the LogService
will
> throw exception because it is not initialized correctly.  Then there
is
> no way to retrieve the real exception.  A good example will be when
you
> provide a invalid file location in your VM parameter for
cactus.config.
>  None of the test runners I tried (text ui, swing ui and JBuilder test
> runner) were able to report it correctly.  I just happened to guessed
> the reason.

I have also fixed this in the released Cactus 1.4 (when performing the
move to commons-logging). Try it!

Thanks
-Vincent

> 
> Other than than that, everything is working for me.  :)
> Shane
> 
> Vincent Massol wrote:
> 
> >Shane,
> >
> >I have looked at the Cactus code and I believe I have already fixed
this
> >problem in Cactus 1.4. If you have some time, could you try running
your
> >tests with Cactus 1.4 to see if the problem is really fixed ?
> >
> >I have put a nightly build under
>
>http://jakarta.apache.org/builds/jakarta-cactus/nightly/2002-07-16/jaka
r
> >ta-cactus-13-20020716.zip if you don't want to build from CVS ... :-)
> >
> >Thanks
> >-Vincent
> >
> >
> >
> 
> --
> Disclaimer:  I join all the news groups out of my own interest.  All
> opinions expressed here are my own and not necessarily those of my
> employer.
> 
> Borland -- Enabling the digital world where our customers have the
freedom
> of choice to develop, deploy, and integrate applications across the
> enterprise and  the Internet. http://www.borland.com
> 
> This e-mail, and any attachments thereto, is intended only for use by
the
> addressee(s) named herein and may contain legally privileged and/or
> confidential information.  If you are not the intended recipient of
this
> e-mail, you are hereby notified that any dissemination, distribution
or
> copying of this e-mail, and any attachments thereto, is strictly
> prohibited.  If you have received this e-mail in error, please
immediately
> and permanently delete the original and any copy of any e-mail and any
> printout thereof.
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: init Logging Error?

Posted by Shane Duan <sd...@borland.com>.
Vincent,

I have tried the nightly build and it is fixed.  Thanks a lot for the 
prompt response!

I wonder if there is any way to initialize the log service before 
anything else happens, though.  When an exception is thrown when test 
runner is trying to construct the test, the test runner will try to 
construct a string from the exception, during which the LogService will 
throw exception because it is not initialized correctly.  Then there is 
no way to retrieve the real exception.  A good example will be when you 
provide a invalid file location in your VM parameter for cactus.config. 
 None of the test runners I tried (text ui, swing ui and JBuilder test 
runner) were able to report it correctly.  I just happened to guessed 
the reason.

Other than than that, everything is working for me.  :)
Shane

Vincent Massol wrote:

>Shane,
>
>I have looked at the Cactus code and I believe I have already fixed this
>problem in Cactus 1.4. If you have some time, could you try running your
>tests with Cactus 1.4 to see if the problem is really fixed ?
>
>I have put a nightly build under
>http://jakarta.apache.org/builds/jakarta-cactus/nightly/2002-07-16/jakar
>ta-cactus-13-20020716.zip if you don't want to build from CVS ... :-)
>
>Thanks
>-Vincent
>
>  
>

-- 
Disclaimer:  I join all the news groups out of my own interest.  All opinions expressed here are my own and not necessarily those of my employer.

Borland -- Enabling the digital world where our customers have the freedom of choice to develop, deploy, and integrate applications across the enterprise and  the Internet. http://www.borland.com

This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information.  If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited.  If you have received this e-mail in error, please immediately and permanently delete the original and any copy of any e-mail and any printout thereof.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: init Logging Error?

Posted by Vincent Massol <vm...@octo.com>.
Shane,

I have looked at the Cactus code and I believe I have already fixed this
problem in Cactus 1.4. If you have some time, could you try running your
tests with Cactus 1.4 to see if the problem is really fixed ?

I have put a nightly build under
http://jakarta.apache.org/builds/jakarta-cactus/nightly/2002-07-16/jakar
ta-cactus-13-20020716.zip if you don't want to build from CVS ... :-)

Thanks
-Vincent

> -----Original Message-----
> From: Shane Duan [mailto:sduan@borland.com]
> Sent: 15 July 2002 22:36
> To: Cactus Users List
> Subject: Re: init Logging Error?
> 
> Vicent,
> 
> I copied the stack trace as following in case you need it.  I checked
> and verified that cactus DOES pick up the VM parameter correctly.
> 
> 1) testConvert(org.apache.cactus.sample.ejb.TestConverterEJB)
> 
> org.apache.cactus.util.ChainedRuntimeException: The Cactus
> 'cactus.properties' configuration file need to be present in the java
> CLASSPATH (i.e. the directory that contains it need to be added to the
> client side CLASSPATH - This is the CLASSPATH that you used to start
the
> JUnit test runner).
> 
>     at
>
org.apache.cactus.client.ClientConfigurationChecker.checkCactusPropertie
s(
> ClientConfigurationChecker.java:136)
> 
>     at
> org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:386)
> 
> 
> 
> Vincent Massol wrote:
> 
> >>The true problem behind is, however, is strange as well.  Somehow
the
> >>cactus.properties file is ALWAYS required to be in the class path,
> >>
> >>
> >even
> >
> >
> >>when you specified the cactus.config property through the VM
> >>
> >>
> >parameter.
> >
> >
> >> Is there a reason for this?
> >>
> >>
> >
> >No, I don't think so. I guess it can be called a bug ! :-) I'll check
> >that tomorrow. Thanks.
> >
> >
> 
> --
> Disclaimer:  I join all the news groups out of my own interest.  All
> opinions expressed here are my own and not necessarily those of my
> employer.
> 
> Borland -- Enabling the digital world where our customers have the
freedom
> of choice to develop, deploy, and integrate applications across the
> enterprise and  the Internet. http://www.borland.com
> 
> This e-mail, and any attachments thereto, is intended only for use by
the
> addressee(s) named herein and may contain legally privileged and/or
> confidential information.  If you are not the intended recipient of
this
> e-mail, you are hereby notified that any dissemination, distribution
or
> copying of this e-mail, and any attachments thereto, is strictly
> prohibited.  If you have received this e-mail in error, please
immediately
> and permanently delete the original and any copy of any e-mail and any
> printout thereof.
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: init Logging Error?

Posted by Shane Duan <sd...@borland.com>.
Vicent,

I copied the stack trace as following in case you need it.  I checked 
and verified that cactus DOES pick up the VM parameter correctly.

1) testConvert(org.apache.cactus.sample.ejb.TestConverterEJB)

org.apache.cactus.util.ChainedRuntimeException: The Cactus 
'cactus.properties' configuration file need to be present in the java 
CLASSPATH (i.e. the directory that contains it need to be added to the 
client side CLASSPATH - This is the CLASSPATH that you used to start the 
JUnit test runner).

    at 
org.apache.cactus.client.ClientConfigurationChecker.checkCactusProperties(ClientConfigurationChecker.java:136)

    at org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:386)



Vincent Massol wrote:

>>The true problem behind is, however, is strange as well.  Somehow the
>>cactus.properties file is ALWAYS required to be in the class path,
>>    
>>
>even
>  
>
>>when you specified the cactus.config property through the VM
>>    
>>
>parameter.
>  
>
>> Is there a reason for this?
>>    
>>
>
>No, I don't think so. I guess it can be called a bug ! :-) I'll check
>that tomorrow. Thanks.
>  
>

-- 
Disclaimer:  I join all the news groups out of my own interest.  All opinions expressed here are my own and not necessarily those of my employer.

Borland -- Enabling the digital world where our customers have the freedom of choice to develop, deploy, and integrate applications across the enterprise and  the Internet. http://www.borland.com

This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information.  If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited.  If you have received this e-mail in error, please immediately and permanently delete the original and any copy of any e-mail and any printout thereof.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: init Logging Error?

Posted by Vincent Massol <vm...@octo.com>.

> -----Original Message-----
> From: Shane Duan [mailto:sduan@borland.com]
> Sent: 15 July 2002 22:14
> To: Cactus Users List
> Subject: Re: init Logging Error?
> 
> Hi Vincent,
> 
> I should have sent another mail regarding this but I have been dealing
> with the deployment for the last several hours.
> 
> It turned out that another exception occurred during the construction
of
> the tests and JBuilder TestRunner (in version 7) tried to construct
the
> stack trace string.  Somehow, the LogService gets involved and threw
an
> exception because it was not initialized properly.  I switched to
JUnit
> Text UI test runner and that revealed the problem.
> 

ok cool. Tell me if there is anything to do on Cactus side.

> The true problem behind is, however, is strange as well.  Somehow the
> cactus.properties file is ALWAYS required to be in the class path,
even
> when you specified the cactus.config property through the VM
parameter.
>  Is there a reason for this?

No, I don't think so. I guess it can be called a bug ! :-) I'll check
that tomorrow. Thanks.

> 
> For the record, I am using JBuilder 7, BES server, JUnit 3.7 and
Cactus
> 1.3 for J2EE 1.3
> 

Cheers,
-Vincent

> 
> 
> Vincent Massol wrote:
> 
> >Hi Shane,
> >
> >This is very strange and it should not happen. It simply means that
> >somehow the Cactus logging initialization step was skipped ...
somehow
> >...
> >
> >Can you give us more information on :
> >- Cactus version
> >- JUnit version
> >- How do you start it ? From JBuilder ? (I'm just asking as I saw
> >Borland in your email ! :-)). With what Test Runner ?
> >
> >I was going to say : "the easiest would be for you to send the logs",
> >but obviously this won't work ...
> >
> >Have you tried running the Cactus sample which is packaged in the
Cactus
> >distribution ? Is it working ok ?
> >
> >Thanks
> >-Vincent
> >
> >
> >
> 
> --
> Disclaimer:  I join all the news groups out of my own interest.  All
> opinions expressed here are my own and not necessarily those of my
> employer.
> 
> Borland -- Enabling the digital world where our customers have the
freedom
> of choice to develop, deploy, and integrate applications across the
> enterprise and  the Internet. http://www.borland.com
> 
> This e-mail, and any attachments thereto, is intended only for use by
the
> addressee(s) named herein and may contain legally privileged and/or
> confidential information.  If you are not the intended recipient of
this
> e-mail, you are hereby notified that any dissemination, distribution
or
> copying of this e-mail, and any attachments thereto, is strictly
> prohibited.  If you have received this e-mail in error, please
immediately
> and permanently delete the original and any copy of any e-mail and any
> printout thereof.
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: init Logging Error?

Posted by Shane Duan <sd...@borland.com>.
Hi Vincent,

I should have sent another mail regarding this but I have been dealing 
with the deployment for the last several hours.

It turned out that another exception occurred during the construction of 
the tests and JBuilder TestRunner (in version 7) tried to construct the 
stack trace string.  Somehow, the LogService gets involved and threw an 
exception because it was not initialized properly.  I switched to JUnit 
Text UI test runner and that revealed the problem.

The true problem behind is, however, is strange as well.  Somehow the 
cactus.properties file is ALWAYS required to be in the class path, even 
when you specified the cactus.config property through the VM parameter. 
 Is there a reason for this?

For the record, I am using JBuilder 7, BES server, JUnit 3.7 and Cactus 
1.3 for J2EE 1.3



Vincent Massol wrote:

>Hi Shane,
>
>This is very strange and it should not happen. It simply means that
>somehow the Cactus logging initialization step was skipped ... somehow
>...
>
>Can you give us more information on :
>- Cactus version
>- JUnit version
>- How do you start it ? From JBuilder ? (I'm just asking as I saw
>Borland in your email ! :-)). With what Test Runner ?
>
>I was going to say : "the easiest would be for you to send the logs",
>but obviously this won't work ...
>
>Have you tried running the Cactus sample which is packaged in the Cactus
>distribution ? Is it working ok ?
>
>Thanks
>-Vincent
>
>  
>

-- 
Disclaimer:  I join all the news groups out of my own interest.  All opinions expressed here are my own and not necessarily those of my employer.

Borland -- Enabling the digital world where our customers have the freedom of choice to develop, deploy, and integrate applications across the enterprise and  the Internet. http://www.borland.com

This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information.  If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited.  If you have received this e-mail in error, please immediately and permanently delete the original and any copy of any e-mail and any printout thereof.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: init Logging Error?

Posted by Vincent Massol <vm...@octo.com>.
Hi Shane,

This is very strange and it should not happen. It simply means that
somehow the Cactus logging initialization step was skipped ... somehow
...

Can you give us more information on :
- Cactus version
- JUnit version
- How do you start it ? From JBuilder ? (I'm just asking as I saw
Borland in your email ! :-)). With what Test Runner ?

I was going to say : "the easiest would be for you to send the logs",
but obviously this won't work ...

Have you tried running the Cactus sample which is packaged in the Cactus
distribution ? Is it working ok ?

Thanks
-Vincent

> -----Original Message-----
> From: Shane Duan [mailto:sduan@borland.com]
> Sent: 15 July 2002 18:44
> To: Cactus Users List
> Subject: init Logging Error?
> 
> I think this has to be pretty common but I just cannot find any
> information.  And I cannot find any archive of the mails for me to
search.
> 
> I am trying to run the example in
> http://jakarta.apache.org/cactus/howto_ejb_j2eeri.html  and I keep on
> getting the following stack trace, even when I don't have the logging
>  turned on in the cactus.properties file.
> 
> Has anyone seen this before?
> 
> Thanks.
> 
> java.lang.RuntimeException: Must call init() first
>     at
org.apache.cactus.util.log.LogService.getLog(LogService.java:202)
>     at
>
org.apache.cactus.util.ChainedRuntimeException.around97_printStackTrace(
Ch
>
ainedRuntimeException.java;org/apache/cactus/util/log/LogAspect.java(1k)
:1
> 133)
>     at
>
org.apache.cactus.util.ChainedRuntimeException.printStackTrace(ChainedRu
nt
> imeException.java;org/apache/cactus/util/log/LogAspect.java(1k):141)
>     at junit.framework.TestSuite.exceptionToString(TestSuite.java:123)
>     at
junit.framework.TestSuite.addTestMethod(TestSuite.java:106)Error
> Eorr!!!
>     at junit.framework.TestSuite.<init>(TestSuite.java:66)
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


init Logging Error?

Posted by Shane Duan <sd...@borland.com>.
I think this has to be pretty common but I just cannot find any 
information.  And I cannot find any archive of the mails for me to search.

I am trying to run the example in 
http://jakarta.apache.org/cactus/howto_ejb_j2eeri.html  and I keep on 
getting the following stack trace, even when I don't have the logging 
 turned on in the cactus.properties file.

Has anyone seen this before?

Thanks.

java.lang.RuntimeException: Must call init() first
    at org.apache.cactus.util.log.LogService.getLog(LogService.java:202)
    at 
org.apache.cactus.util.ChainedRuntimeException.around97_printStackTrace(ChainedRuntimeException.java;org/apache/cactus/util/log/LogAspect.java(1k):1133)
    at 
org.apache.cactus.util.ChainedRuntimeException.printStackTrace(ChainedRuntimeException.java;org/apache/cactus/util/log/LogAspect.java(1k):141)
    at junit.framework.TestSuite.exceptionToString(TestSuite.java:123)
    at junit.framework.TestSuite.addTestMethod(TestSuite.java:106)Error 
Eorr!!!
    at junit.framework.TestSuite.<init>(TestSuite.java:66)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Thanks a lot Vincent ...but it did not solve the problem

Posted by Nicholas Lesiecki <ni...@eblox.com>.
Have you considered it being a classloader issue?

Cheers,

nick

-----Original Message-----
From: Sathiyamurthy_Ramachandran@i2.com
[mailto:Sathiyamurthy_Ramachandran@i2.com]
Sent: Thursday, June 27, 2002 3:38 AM
To: Cactus Users List
Subject: Thanks a lot Vincent ...but it did not solve the problem


Hi Vincent,


Thanks a lot for ur attentiona and effort. but ,  even though I have
included  the below info in web. xml... it gives the same exception :
ClassacastException  ( To me also, it seems to be from   Webligic) But I
have a Bean (Implementing Remote Interface  ) deployed which runs
successfully and then  runns  my next Client which has a Local Interface-
.Its for the local Interface it throws exception:


Testcase: testRunme took 0.172 sec   Caused an ERROR
 mysample2.SSBBean_1rky_LocalHomeImpl

 java.lang.ClassCastException: mysample2.SSBBean_1rky_LocalHomeImpl

     at mysample2.SSBClient.runme(SSBClient.java:66)
     at mysample2.TestSSBClient.testRunme(TestSSBClient.java:50)
     at java.lang.reflect.Method.invoke(Native Method)
     at org.apache.cactus.AbstractTestCase.runServerTest(AbstractTest
24)
     at org.apache.cactus.AbstractTestCase.runBareServerTest(Abstract
va:490)
     at org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTe
va:148)
     at org.apache.cactus.server.AbstractTestController.dispatch79_ha
(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.jav

     at org.apache.cactus.server.AbstractTestController.around79_hand
bstractTestController.java;org/apache/cactus/util/log/LogAspect.java(



Because I am using the Local Object, I  included in my web.xml  as

  <ejb-ref>
        <ejb-ref-name>SSB</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home>mysample.TestSSBLocalHome</local-home>
        <local>mysample.TestSSBLocal</local>
    </ejb-ref>

Do u  have any  Sample Bean  (Implementing  EJB Local Interface )  as  jar
wehihc u have tested..... porbably can u post over the Cactus mailing list
 PL...?

Thanks,
Sathiya







"Vincent Massol" <vm...@octo.com>
06/27/2002 03:30 AM
Please respond to "Cactus Users List"


        To:     "'Cactus Users List'" <ca...@jakarta.apache.org>
        cc:
        Subject:        Testing Local EJB w/ WL6.1 (was RE: Hello Mr
Vincent..Ur Attn. pl.....)


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: Sathiyamurthy_Ramachandran@i2.com
> [mailto:Sathiyamurthy_Ramachandran@i2.com]
> 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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>