jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicole Luneburg <Nicole.Luneb...@lisasoft.com>
Subject RE: cactus junit authentication required?
Date Tue, 06 Jan 2009 00:10:44 GMT
Hi Petar,

Oops I only answered half your question.
Should get a coffee before I start work in the morning ;)

What I am doing is using the cactify war task to create a cactified war.
This is what my build.xml ant target for that looks like:

        <target name="test.prepare" depends="war, compile.cactus">
          <cactifywar srcfile="${project.build.dir}/${projectname}.war" destfile="${project.build.dir}/test.war">
            <servletredirector/>
            <classes dir="${project.build.dir}/test/"/>
          </cactifywar>
        </target>

The "<servletredirector/>" part I understand puts in the servlet redirector stuff into
my web.xml like:

    <servlet>
        <servlet-name>ServletRedirector</servlet-name>
        <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ServletRedirector</servlet-name>
        <url-pattern>/ServletRedirector</url-pattern>
    </servlet-mapping>

I got all this from:
http://jakarta.apache.org/cactus/writing/howto_security.html
under "Step 2: Securing the Cactus Redirector"

Step 1 talks about having to manually authenticate in the code but then Step 2 says:

"If you're using the Cactus Ant tasks to execute your Cactus tests, please check the Cactifywar
task page as the configuration below is only required for manual configuration and is handled
automatically by the Cactifywar task."

(also ... note my cactify war ant task in my build.xml did not put the "ServletRedirectorSecure"
stuff in my web.xml. Not sure how to do this even though I tried to replace:
<servletredirector/>

With:
<servletredirector name="ServletRedirectorSecure" mapping="/ServletRedirectorSecure" roles="myRole"/>

I also tried putting this manually into the web.xml in the cactified war but this still gave
me the same error)

I keep thinking that I shouldn't need to authenticate, but then I keep getting the error:
"java.lang.IllegalStateException: No valid security context for the caller identity"

?


-----Original Message-----
From: Nicole Luneburg [mailto:Nicole.Luneburg@lisasoft.com]
Sent: Tuesday, 6 January 2009 10:12 AM
To: Cactus Users List
Subject: RE: cactus junit authentication required?

Hi Petar,

Thanks for your reply.
Sorry I thought I did say what exception I was getting ...

"
I'm running the test from my web browser like: http://localhost:8080/myapp/ServletTestRunner?suite=
myapp.tests.MyTestSuite&Cactus_Service=RUN_TEST

Doing this keeps giving me the following error:

java.lang.IllegalStateException: No valid security context for the caller identity
"

Thanks!
Nicole

-----Original Message-----
From: Petar Tahchiev [mailto:paranoiabla@gmail.com]
Sent: Monday, 5 January 2009 7:27 PM
To: Cactus Users List
Subject: Re: cactus junit authentication required?

Hi Nicole,

I would be really interested in you test-case and
also the exact exception you get.

Cheers, Petar.


The contents of this email are confidential and may be subject to legal or professional privilege
and copyright. No representation is made that this email is free of viruses or other defects.
If you have received this communication in error, you may not copy or distribute any part
of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect
receipt of this correspondence.

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


The contents of this email are confidential and may be subject to legal or professional privilege
and copyright. No representation is made that this email is free of viruses or other defects.
If you have received this communication in error, you may not copy or distribute any part
of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect
receipt of this correspondence.

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


Mime
View raw message