ANT and JUnit in weblogic

Hi.
I see that the problem with ant and junit is discussed here, but with no absolutte solution.
The problem:
I create an build.xml containing the <junit>-task and want to run this from within the BEA Workshop. The standard error-message is that it cant find the junit-task. I can run the same build file from command since I got ANT set up correctly with JUnit outside Weblogic.
It sems for me that Workshop dont care about existing installation of ANT, it uses it own version. I have included junit.jar in the same direstory as ant.jar is in BEA-install-dir also, but it wont work.
Does anyone have a solution to this "small" problem??
Thanks in advance.

I haven't figured out why, but my JDeveloper automatically adds the classpath I have in my ant build.xml to the additional classpath of the project. My classpath is set like this in the build.xml:<path id="classpath">
<fileset dir="env/lib">
      <include name="**/*.jar"/>
    </fileset>
</path>And my compile target looks like this:<target name="compile" depends="init">
    <mkdir dir="${compile.outdir}"/>
    <!--Compile Java source files-->
    <javac destdir="${compile.outdir}" debug="on">
       <classpath refid="classpath"/>
       <src refid="srcpath"/>
    </javac>
  </target>And my Jdev project settings -> common -> ant has my build.xml file selected with default make and rebuild targets selected. I have never put a single entry in the additional classpath area but somehow I have all the libs as I set up in my build.xml file. I'm using JDev 9.0.3.2 by the way.

Similar Messages

  • Packages, Classpath, Ant, and JUnit (setting up a nice environment)

    Hi,
    I am seeking a little help getting up and running, creating a nice environment where I can build a Java project, including building with Ant and using JUnit - hopefully this is the right forum. I am having some trouble in getting JUnit to run my tests properly (it is installed and findable by my Java install) and I think this is due to a package/classpath issue that is currently outside my experience. Here's my setup to explain:
    I have installed the JUnit jar in my extensions folder, and it works properly (I can call it, don't get errors about JUnit), however, when I run my test I get the error:
    "Could not find class: org.xxx.powersim.ModelTest
    Time: 0
    OK (0 tests)
    Java Result: 1"
    ModelTest has been compiled properly without error, and looks like this:
    package org.xxx.powersim;
    import org.junit.*;
    import static org.junit.Assert.*;
    import java.util.*;
    public final class ModelTest {
         public static void main(String args[]) {
               org.junit.runner.JUnitCore.main("org.xxx.powersim.ModelTest");
         @Test
         public void testJunit() {
              assertTrue(true);
    }Pretty simple stuff.
    As you can see I'm trying to use the 'main' method of the test to execute the test itself... but I've tried running it via the runner from the command line also: "java org.junit.runner.JUnitCore org.xxx.powersim.ModelTest". I get the same result.
    It might be a package issue, so here's how I have things set up in the file system:
    PowerSim
         /build
              /org
                   /xxx
                        /powersim
                             - ModelTest.class
         /src
              /org
                   /xxx
                        /powersim
                             -ModelTest.javaI've tried running it within Ant, by hand using the runner, by hand calling the main method, and from within TextMate's built-in bundle - I get the same result. JUnit is installed and running fine, but it can't seem to see the test class - the more I think about it this is a package problem that I'm just not sure how to fix. I've tried running it by hand in the root /PowerSim directory, in the /build folder, and in the /powersim folder where ModelTest is. I still get the error that "Could not find class: org.xxx.powersim.ModelTest".
    My files compile just fine with my simple Ant script which is as follows:
    <?xml version="1.0"?>
    <project name="PowerSim" default="run" basedir=".">
    <property name="src" value="./src"/>
    <property name="build" value="./build"/>
    <property name="compile.debug"       value="true"/>
    <path id="compile.classpath">
       <pathelement location="${mysql.jdbc}"/>
       <pathelement location="${junit.jar}"/>
    </path>
       <target name="build" depends="init">
           <javac srcdir="${src}"
                  destdir="${build}"
                  debug="${compile.debug}"
                  source="1.5">
              <classpath refid="compile.classpath"/>
           </javac>
       </target>
    <target name="init">
       <mkdir dir="${build}"/>
    </target>
    <target name="run" depends="build">
       <java classname="org.xxx.powersim.Model"
           fork="true"
           dir="${build}"
           classpath="${build}"
           maxmemory="500m">
       </java>
       </target>
         <target name="test" depends="build">
             <java classname="org.xxx.powersim.ModelTest"
                 fork="yes"
                 dir="${build}"
                 classpath="${build}"
                 maxmemory="500m">
             </java>
             </target>
    <target name="clean" description="Removes previous build">
       <delete verbose="true">
         <fileset dir="${build}"/>
       </delete>
    </target>
    </project>As you can see, I'm not sure what to try next - any help would be much appreciated.
    I've tried adding things to my $CLASSPATH. For example I've added the root folder of the project, 'PowerSim' to my classpath, but this appears to have no effect. I am running OS X 10.5.
    Thanks again for any help you may be able to offer, it will be very much appreciated,
    - Peter

    Ok - final bump and then I'll go away.
    (Really - if anyone has any advice that would be great)

  • Ant 1.6.5 and JUnit 4.1

    According to ant bugs Bug-40682 and Bug-40697, Ant 1.6.5 and JUnit 4.1 have integration problems. Is there a plan for Jdeveloper 11g to upgrade to Ant 1.7?

    We are currently testing up take of Ant 1.7 for JDeveloper 11.
    --RiC                                                                                                                                                                                           

  • Using Ant  or JUnit with Sun's Verifier

    Hi,
    I am trying to integrate Sun's J2EE "Verifier" into the build process. I am trying two different approaches, but am encountering similar issues.
    Using Ant
    One approach I am trying is with an Ant target. I keep getting this error "No local string for com.sun.enterprise.tools. ....etc...". I suspect the problem is with the setting of J2EE_HOME or the setting of a system property "com.sun.enterprise.home". I see this is set in verifier.bat...and I have decompiled Verifier.class and I see that this environmental variable is read at line 377 of Verifier.class. I am trying to set it...but ....there is the error that seems to indicate that the property file LocalStrings.properties is not being found. Of course the Verifier works when I run verifier.bat.
    <?xml version="1.0"?>
    <project name="verify" default="verify" basedir = "C:\j2sdkee1.3.1\">
    <target name="verify">
    <java fork="yes" classname="com.sun.enterprise.tools.verifier.Verifier">
    <classpath>
    <pathelement path="C:/j2sdkee1.3.1/lib/j2eetools.jar" />
              <pathelement path="c:/j2sdkee1.3.1/lib/j2ee.jar" />
    </classpath>
    <sysproperty key="com.sun.enterprise.home" value="C:\j2sdkee1.3.1\" />
         <sysproperty key="J2EE_HOME" value="C:\j2sdkee1.3.1\" />     
         <sysproperty key="LOCALEDIR" value="C:\j2sdkee1.3.1/lib/locale/" />          
    <arg value="C:/Ascential/RTIServer/apps/jboss/server/default/deploy/RTI.ear"/>
         <arg value="-oc:/verifierant/result"/>
    <arg value="-f"/>     
    </java>
    </target>
    </project>
    From JUnit
    I am trying to call the main() method of the Verifier...but getting similar "No local string..." errors.
    String[] args = { "I:\Release_30Sep2003\development\deploy\build\jboss\RTI.ear",
    "-oI:\Release_30Sep2003\development\deploy\build\jboss\results",
    "-f"};
    Verifier.main(args);
    Has anyone integrated this tool into Ant or Junit that could offer me some advice?
    Thanks,
    Mike Foley
    [email protected]

    How about running verifier.bat using ants exec task?

  • How to speed up frequent undeploy and deploy on weblogic server ?

    We have one web application deployed on a Weblogic Server (10.3).
    We use ANT and the wldeploy task ( http://download.oracle.com/docs/cd/E13222_01/wls/docs90/programming/wldeploy.html ) to UNDEPLOY and DEPLOY (frequently) the webapp.
    It seems to us that the entire process (RECOMPILE -> make WAR -> UNDEPLOY -> DEPLOY) , which is completely automatic (made by ANT), is too slow (about 1 minute) , especially the step of DEPLOY.
    Do exist some tricks to speed up the entire process ?
    We have 4/5 notebook (the developers PCs) and 1 remote Weblogic Server .
    (SORRY, some admin can move this thread on weblogic server forum ? Thanks)
    Edited by: user3873926 on 29-ott-2009 9.21

    Just a suggestion: Try using iWS6.0SP2, it has some performance improvements.

  • Log4j.properties location for ant and kodo tools

    Greetings all
    Is it possible to configure the kodo ant tasks,
    such as jdoc (kodo.ant.JDOEnhancerTask) to use
    a log4j.properties file that is not in the
    classpath?
    We generally have our log4j.properties
    file in a separate location away from the classpath
    and for standard junit and java ant targets we can
    set it's location via a jvmarg...
    Version: 3.0.0
    Thanks
    droo.

    Ok thanks for the help.
    Perhaps I could suggest for a future version that the
    Kodo Ant Tasks include the ability to specify a "jvmarg"
    like you can for java and junit targets now, for example:
    <taskdef
    name="jdoc"
    classname="kodo.ant.JDOEnhancerTask"
    classpathref="compile.path" />
    <jdoc>
    <fileset refid="all.jdo.files" />
    <classpath refid="other.path" />
    <config propertiesFile="${kodo.properties}"/>
    <jvmarg value="-Dlog4j.properties=file:///my/log4j/config" /
    >
    <jvmarg value="-Djava.compiler=NONE" />
    <jvmarg value="-Dfred=mary" />
    </jdoc>
    But if not then it's ok too :) Thanks again.
    droo.
    Droo-
    I'm not aware of an ant task to set system properties. You could
    specify it on the command line. E.g.,:
    ant -Dlog4j.configuration=/my/log4j/config mytarget
    You could also install beanshell and use the beanshell target to set
    it. E.g.:
    <target name="setlog4jproperty">
    <script language="beanshell"><![CDATA[
                   System.setProperty ("log4j.configuration", "/my/log4j/config");
    ]]> ]]></script>
    </target>
    See the ant documentation for more on the required dependencies for
    beanshell.
    In article <[email protected]>, droo wrote:
    Yes of course, but the real question is...
    How do I specify a system property for a
    kodo ant task?
    Sorry if this question is too stupid!
    Here is what I have...
    <taskdef
    name="jdoc"
    classname="kodo.ant.JDOEnhancerTask"
    classpathref="compile-path" />
    <jdoc>
    <fileset refid="all-jdo-files" />
    <classpath refid="post-compile-path" />
    <config propertiesFile="${nf.kodo.properties}"/>
    </jdoc>
    In <[email protected]> Marc Prud'hommeaux wrote:
    Droo-
    I think you can specify the "log4j.configuration" system property.
    Take a look at:
    http://jakarta.apache.org/log4j/docs/manual.html
    In article <[email protected]>, droo wrote:
    Greetings all
    Is it possible to configure the kodo ant tasks,
    such as jdoc (kodo.ant.JDOEnhancerTask) to use
    a log4j.properties file that is not in the
    classpath?
    We generally have our log4j.properties
    file in a separate location away from the classpath
    and for standard junit and java ant targets we can
    set it's location via a jvmarg...
    Version: 3.0.0
    Thanks
    droo.

  • User Name and Password in weblogic realm while invoking a web service

    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment. When I
    invoke the web service through my browser (IE 6.0) using the web services url,
    it brings my service method correctly. From there, if I click the invoke button
    it asks me for a network user name and password under "weblogic" realm??? If I
    provide the admin user credentials (which I supplied while creating my domain)
    it is not accepting that it keeps popping up this network user password window
    over and over. Not sure which username/password I have to provide here to see
    the result of my service.
    If I try to invoke the web service through my client (static) I am getting a connection
    refused exception. I guess either way, I am not able to access my web service.
    In the attached file, I have cut and pasted the client stack trace as well as
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh
    [errorstacktrace.txt]

    I think the client is not able to do a HTTP POST
    to the WLS server but it can do a HTTP GET.
    I dont know why.
    http://manojc.com
    "Ganesh" <[email protected]> wrote in message
    news:3eba91bc$[email protected]..
    >
    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment.When I
    invoke the web service through my browser (IE 6.0) using the web servicesurl,
    it brings my service method correctly. From there, if I click the invokebutton
    it asks me for a network user name and password under "weblogic" realm???If I
    provide the admin user credentials (which I supplied while creating mydomain)
    it is not accepting that it keeps popping up this network user passwordwindow
    over and over. Not sure which username/password I have to provide here tosee
    the result of my service.
    If I try to invoke the web service through my client (static) I am gettinga connection
    refused exception. I guess either way, I am not able to access my webservice.
    In the attached file, I have cut and pasted the client stack trace as wellas
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh

  • Roles and .wars in WebLogic

              I have a .war file whose web.xml file defines a security role of LoggingRole. No
              matter what I do, I cannot successfully login and access the web-app. I am running
              on WebLogic 7.0 on Windows 2000.
              I tried going into the admin console and defining a role named LoggingRole then
              adding the Administrators group to it. Then I make sure there are some users in
              the Administrators group. Everytime I try to use those users to login, it fails.
              If I delete the secuirty constraints from the web-app it works fine. if I install
              the web-app on other servlet engines wit hthe security, it works. Any ideas?
              Here is the relevant snippet of the web.xml:
                   <security-constraint>
                        <web-resource-collection>
                             <web-resource-name>System Viewer</web-resource-name>
                             <url-pattern>/menu2</url-pattern>
                        </web-resource-collection>
                        <auth-constraint>
                             <role-name>LoggingRole</role-name>
                        </auth-constraint>
                   </security-constraint>
                   <security-role>
                        <role-name>LoggingRole</role-name>
                   </security-role>
              Thanks,
              brian
              

              In WL6, normally you should have something like <security-role-assignment>
              <role-name>developer</role-name>
              <principal-name>developer</principal-name>
              <principal-name>customer</principal-name>
              </security-role-assignment>
              in your weblogic.xml. I never try this in WL7 and hope it will work.
              The alternative is, open your weblogic admin console, following the following
              steps: (Left pane) Deployment->Web Applications->YourWebApplication, then (right
              pane)Edit web application descriptors. On the next screen, (Left pane)Web AppExt->Security
              role assignment->.... If you don't have Web AppExt, you should be able to create
              one when you see this screen. After you assign tghe roles, click persistent and
              a new web.xml and a new weblogic.xml will be generated and you can use them for
              future use.
              "Brian Pipa" <[email protected]> wrote:
              >
              >I have a .war file whose web.xml file defines a security role of LoggingRole.
              >No
              >matter what I do, I cannot successfully login and access the web-app.
              >I am running
              >on WebLogic 7.0 on Windows 2000.
              >
              >I tried going into the admin console and defining a role named LoggingRole
              >then
              >adding the Administrators group to it. Then I make sure there are some
              >users in
              >the Administrators group. Everytime I try to use those users to login,
              >it fails.
              >If I delete the secuirty constraints from the web-app it works fine.
              >if I install
              >the web-app on other servlet engines wit hthe security, it works. Any
              >ideas?
              >
              >Here is the relevant snippet of the web.xml:
              >     <security-constraint>
              >          <web-resource-collection>
              >               <web-resource-name>System Viewer</web-resource-name>
              >               <url-pattern>/menu2</url-pattern>
              >          </web-resource-collection>
              >          <auth-constraint>
              >               <role-name>LoggingRole</role-name>
              >          </auth-constraint>
              >     </security-constraint>
              >
              >     <security-role>
              >          <role-name>LoggingRole</role-name>
              >     </security-role>
              >
              >Thanks,
              >brian
              

  • Blogs and discussion in weblogic portal 10.3

    Hi,
    I want to enable blogs and dicussion in weblogic portal 10.3, can anyone guide me how to proceed??
    Regards,
    Anshul
    Edited by: Anshul on Oct 16, 2012 1:52 AM

    Please see these two documentation links:
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/db/index.html
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/prodOps/teamDevelopment.html#wp1046771

  • Building jars using ant and eclipse

    Note: If this post could be in a more appropriate forum category could someone please tell me which one is better.
    Vexing issue:
    I am using ANT so that it will take care of which classes have been modified and therefore which jars need to be updated.
    I noticed one way ANT can work is to look at the timestamp of the class files and then build the necessary jars. This works fine EXCEPT that eclipse has a nasty habit of sometimes recompiling everything, even when I dont ask it to. It would seem to make more sense basing the recompilation on the source files, and whether they have been modified. So I set this up with my build.xml, ie
    <target name="compile" depends="init"
    description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" fork="true"/>
         </target>
    Now suppose I go and change one of my source files, ANT recompiles that file and that all works great. However, suppose that file had in it, which many do,
    public static String EXAMPLE_VARIABLE = "example";
    This static variable is referenced in many classes, and yet ANT only recompiles the one file, and thus there begins an inconsistency!
    Is there any way to get around this? I would have expected ANT to recompile all the files that depend on the class with the static variable but it doesnt.
    Any help much appreciated.
    Cel

    You know, that's a good question. I would think JVMs at runtime could resolve static variables, like when it compiles classes using that static variable it puts a placeholder "Hey, here I am using XXX, at runtime, figure it out and give me the value right at the start..". But I think it works like you suggest in that a static value is compiled into every location that uses it. The only thing I can think of is provide a target for a build-all in your ant and have it rebuild all.
    I agree though that the javac compiler should be smarter in how it compiles classes. Anytime a class has certain attributes that may be compiled in to other classes, it should check and recompile any class that depends on the static value that has changed.

  • About the bat file to start and stop the weblogic server10.3

    I am using windows 2003 os.
    i installed the WLS 10.3 .
    can anyone help me how to write the bat file for starting and stoping the weblogic server instance.so that it willl run as background service.
    I am new to this .Please suggest me
    Any help is appreciated.
    Thanks
    Sailaja.

    Hi David,
    yes.i am talking about Admin server.
    when i am creating the new domain,i didn't encounter any prompt asking me to run the Admin server as windows services.why i am not getting this prompt?where exactly i will get this prompt while creating domain.
    i am using the weblogic 10.3
    how can i make the admin server as windows services.
    Thanks
    Sailaja.
    Edited by: sj0609 on Dec 2, 2008 4:02 PM

  • Enter username and password for "weblogic" at ..

    We have a web service running on a single domain on a weblogic 7.0 SP1 cluster.
    We load balance via a F5 in front of the cluster. Our F5 accepts SSL requests
    on port XXX3, terminates SSL and forwards the non-SSL request to a managed server
    in the cluster for processing. Likewise, the F5 receives HTTP requests on port
    XXX0 and forwards the non-SSL request to a managed server in the cluster.
    We have no Weblogic security features configured for the web service. Only the
    standard "myrealm" is configured with the defaults values.
    Whenever we call this web service, via the F5, on the XXXX ports, we are prompted
    to authenticate. The message "Enter username and password for "weblogic" at <domain-name>"
    appears. We don't even have a "weblogic" realm configured. (1) We are not sure
    why we need to authenticate when no security has been configured for this application
    (2) We've tried every username password combination we can think of and none work.
    One clue is.... if we use the standard HTTP ports 80 and 443 for traffic coming
    into the firewall, we are not prompted to authenticate. The web service works
    just fine. The problem seems to rise when we use the non-standard ports on the
    F5 of XXX0 and XXX3 and forward traffic from these ports to the managed servers.
    Has anyone seen this behavior?
    -Cassandra

    In Firefox go to the tools menu - Add-ons - extensions then remove browse for change.

  • Netbeans and junit

    Hi,
    I am sorry if this is the wrong place to post this but I need a quick answer.
    I have developed a school project in netbeans and junit.
    How can I execute the junit tests externaly to the IDE?
    Where is the junit installed?
    thanks,
    Sebastian

    JUnit is just a java library. Take a look at
    http://www.junit.org/index.htm

  • CMT and using non-Weblogic JMS in a session bean

              I am writing a session bean which sends a JMS message using a non-weblogic JMS
              provider. This bean is marked for CMT and I want the JMS send to participate in
              this CMT as well. My understanding is that I should be able to do this by defining
              a <resource-ref> element in the ejb-jar.xml and a corresponding <resource-descriptor>
              element in the weblogic-ejb-jar.xml file. The bean would then use the <res-ref-name>
              defined under the <resource-ref> element to lookup the connection factory. What
              do I have to put in weblogic-ejb-jar.xml file to make sure that the connection
              factory specified in <res-ref-name> maps to a connection factory that is in a
              foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI) and not in
              Weblogic's JNDI?
              Thanks in advance for your help.
              

    It sounds like you're using Tibco JMS to receive messages from the MDB, and
              then to send out a message. WLS 7.0 will handle the transaction enlistment
              properly when it receives messages for the MDB, but you'll have to enlist
              the JMS provider yourself when you send the message, using the white paper
              that Tom pointed you to as a guide.
              In WLS 8.1, coming soon, we'll automatically enlist the provider in the
              transaction if you look it up using a "resource-ref" element in the EJB like
              you described. Today, you can use that element but no transaction
              enlistement is being done.
              greg
              "Venkat" <[email protected]> wrote in message
              news:[email protected]...
              >
              > We also need this feature.
              > We are using Weblogic 7.0 and Tibco JMS 3.0,
              > which supports XA.
              >
              > We are mainly interested in subscribing using MDB
              > and publishing using a session bean in one transaction.
              > Do you think by using resource-refs in conjunction
              > with registering with Weblogic JNDI during startup
              > can do the job?
              >
              > Or how about using XAConnectionFactory and XASession
              > classes for JMS publishing ?
              >
              > Thanks.
              >
              > Tom Barnes <[email protected]> wrote:
              > >Hi Mihir,
              > >
              > >Support for automatic enlistment of foreign JMS vendors
              > >via the resource-ref approach is not available in WLS.
              > >This support will be available in the next release:
              > >limited access beta is available now, public beta is available
              > >in 2-3 months. You are the first customer I've heard of that
              > >asked for this feature. Very cool. Good timing.
              > >
              > >As you are not using WebLogic JMS, you will need to do the
              > >transaction enlistment yourself. This isn't that hard
              > >to do. I suggest that you refer to the integrating foreign
              > >JMS vendor white-paper available on dev2dev.bea.com.
              > >Also, refer to the integrating transactions with
              > >MQSeries integration paper, which will likely serve your
              > >purposes better. Note that some JMS vendors
              > >have problems with concurrent transactions in a single
              > >JMS connection, or with transactions that attempt
              > >to switch threads (eg. suspend() in one thread
              > >and resume() in another).
              > >
              >
              >http://dev2dev.bea.com/resourcelibrary/whitepapersdetail.jsp?highlight=whit
              epapers&filePath=components%2Fdev2dev%2Fresourcelibrary%2Fwhitepapers%2Fwp_j
              msproviders.htm
              >
              >http://dev2dev.bea.com/resourcelibrary/whitepapersdetail.jsp?highlight=whit
              epapers&filePath=components%2Fdev2dev%2Fresourcelibrary%2Fwhitepapers%2Fwp_j
              tatransactions.htm
              > >
              > >Tom
              > >
              > >mihir sharma wrote:
              > >> I am writing a session bean which sends a JMS message using a
              non-weblogic
              > >JMS
              > >> provider. This bean is marked for CMT and I want the JMS send to
              participate
              > >in
              > >> this CMT as well. My understanding is that I should be able to do this
              > >by defining
              > >> a <resource-ref> element in the ejb-jar.xml and a corresponding
              <resource-descriptor>
              > >> element in the weblogic-ejb-jar.xml file. The bean would then use the
              > ><res-ref-name>
              > >> defined under the <resource-ref> element to lookup the connection
              factory.
              > >What
              > >> do I have to put in weblogic-ejb-jar.xml file to make sure that the
              > >connection
              > >> factory specified in <res-ref-name> maps to a connection factory that
              > >is in a
              > >> foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI)
              > >and not in
              > >> Weblogic's JNDI?
              > >>
              > >> Thanks in advance for your help.
              > >>
              > >
              >
              

  • Weblogic 10 jaas and login.jsp and web.xml/weblogic.xml security constaints

    Hello,
    I struggled through and got the examples.security.jaas.SampleCallbackHandler.java and examples.common.utils.ExampleUtils.java/ExampleConstants.java into eclipse where they compile. A bean I made can call SambleCallbackHandler like such:
    mybean.logmein(username,password,url). I can then do a mybean.getStatus() or even a mybean.returnCode(). It does seem to correctly identlify that it is authenticating me (I see in stdout logs that it shows success or failures. The problem I have is I do not know how to apply this weblogic and web.xml/weblogic.xml so that if authentication works it redirects me to the page requiring the authentication. In web.xml I have the following set up:
    <security-role>
         <role-name>Admins</role-name>
    </security-role>
    <login-config>
         <auth-method>FORM</auth-method>
         <realm-name>default</realm-name>
         <form-login-config>
              <form-login-page>/login.jsp</form-login-page>
              <form-error-page>/badlogin.html</form-error-page>
         </form-login-config>
    </login-config>
    <security-constraint>
         <web-resource-collection>
              <web-resource-name>empower</web-resource-name>
              <description>These pages are only accessible by authorized users.</description>
              <url-pattern>/admin/*</url-pattern>
              <http-method>GET</http-method>
              <http-method>POST</http-method>
         </web-resource-collection>
    <auth-constraint>
    <description>These are the roles who have access</description>
    <role-name>Administrators</role-name>
    </auth-constraint>
         <user-data-constraint>
         <description>This is how the user data must be transmitted</description>
         <transport-guarantee>NONE</transport-guarantee>
         </user-data-constraint>
    </security-constraint>
    My weblogic.xml has:
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <wls:security-role-assignment>
    <wls:role-name>Admins</wls:role-name>
    <wls:principal-name>Administrators</wls:principal-name>
    <wls:principal-name>dashap</wls:principal-name>
    </wls:security-role-assignment>
    </wls:weblogic-web-app>
    With this set up, if I try to go to a page in /admin folder in my application, it correctly pops up the login page. The jaas in the bean is doing a loginContext.login(), which I thought does authentication too, but it never goes back to the /admin page I was going to that needed the authentication. With jaas, can I not use the web.xml FORM security option? Do I Need to use j_security in the login.jsp's form's action= option and j_username and j_password for the input type names? How do I use j_username/j_password things if I am using jaas? I could just ignore using the web.xml security stuff and put something in the pages that need authentication, but it would be easier if I could use jaas with the security featurs without doing all that. Note that my code above is using a realm called default just because that was what was in the example I got from the web. Does that need to be something else?

    Hi John,
    I would like magic of course. However, in this case I want something special: my authentication provider uses special means and contents of headers, cookies and service from external identity management systems to determine the user's identity.
    I do not want the application to present the login dialog! I want to derive the identity and the fact that the user is logged in from whatever the authentication provider returns in terms of Subject.
    Ideally, the flow is something like:
    - user accesses an unprotected resource - resource is shown, no interaction with authentication provider
    - user presses a link or button that takes him/her to a protected resource
    - the authentication provider is contacted to work with the identity asserter to establish the identity of the current user and create a subject object for this user
    - the application can access the subject and principals
    - ADF Security recognizes the identity and the roles (based on the principals) and coordinates access based on this.
    the authentication method is client certificate. presumably this prompts WebLogic/OPS to use an identity asserter to work with custom headers and cookies ("... when you configure a web application to use CLIENT-CERT authentication. In this case, WebLogic can perform identity assertion based on values from request headers and cookies. If the header name or cookie name matches the active token type for the provider, the value is passed to the provider."). No login form should be presented to the user, as all information required to perform the authentication is already available.
    I am trying to understand what I must do to have the ADF application adopt the subject set by the authentication provider - if anything?!
    If you more ideas to share - I would love to hear them.
    best regards,
    Lucas

Maybe you are looking for

  • DVD drive issue

    When i put a DVD in the drive it does not show on the computer and after few moments self ejects? This does not happen with audio CD, it functions properly. I am running OS X 10.6.8.

  • J2SE Adapter

    Hi all, We are planning to install J2SE adapters. We are looking for some answers for these question: 1. Our server environment are based on Microsoft server 2000/2003, so I think its not a problem to install J2SE adapters. 2. What's the system requi

  • How can get & use java true type fonts in my applets

    Hi I could get the System fonts in my Applet by making use of Toolkit.getFontList() I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException. How can I get & make use True Type Fonts in my Java Ap

  • Regarding ESS configuration

    Hi All,      I deployed business package now how to create system alias in portal?     What are the steps to create system alias?     Where i have to findout that deployed business package? regards, kumar

  • Configuration of Extended Notifications.

    Here is my problem, I need to put a link to the workitem for notifications in SAP inbox as well as in notifications to the outside mail. I am aware of report RUSWUWFML2 this does not solve my issue as it sends to all pending users. And also for some