Help! web.xml security without using WAR files

I'm currently using the RDBMSRealm and URL ACL security for my app. I would like to use the web.xml descriptor for security so that I can specify login pages and such. We currently are not using WAR files. I've been having alot of trouble setting this up. Is there a way to use the RDBMS realm along with the web.xml security? It looks like it should work, but I can't seem to get it to function. How do I specify the regular document root as a webapp? I'm currently running WLS 5.1 with SP4. Thanks.

The RDBMSRealm is just the authentication mechanism underneath WLS versus the
web.xml of the WebApplication which describes all the access control for that WebApp.
the later being scoped only to that WebApp.
you don't need to deploy in a war file, you can expand the archive into an identical
directory structure and then just point us towards the top level of that structure.
see: http://www.weblogic.com/docs51/classdocs/webappguide.html
.paul
chris wrote:
I'm currently using the RDBMSRealm and URL ACL security for my app. I would like to use the web.xml descriptor for security so that I can specify login pages and such. We currently are not using WAR files. I've been having alot of trouble setting this up. Is there a way to use the RDBMS realm along with the web.xml security? It looks like it should work, but I can't seem to get it to function. How do I specify the regular document root as a webapp? I'm currently running WLS 5.1 with SP4. Thanks.

Similar Messages

  • Unable to deploy a simple servlet using WAR file on Oracle9iAS v9.0.3

    Hi All,
    I am facing problem while deploying a simple servlet using WAR file on Oracle 9i App Server.
    I have installed Oracle9iAS J2EE and Web Cache v9.0.3 on Windows 2000 server.
    It includes:
         - Oracle HTTP Server
         - Oracle9iAS Containers for J2EE
         - Oracle9iAS Web Cache
         - Oracle Enterprise Manager
    The release of installed Oracle9iAS is Release 2 (9.0.3)      
    I referred following link to Deploy Applications Using WAR file:
         http://otn.oracle.com/products/ias/daily/sept12.html
    As mentioned in this documentation I have followed following steps to deploy WAR file:
    1] I have created a war file by name SimpleServlet.war. In SimpleServlet.war, there is a servlet by name Simple which prints time at which servlet was accessed.
    2] I have modified <ora9ias_home>\j2ee\home\config\application.xml and added following web module entry:
         <web-module id="SimpleServlet" path="../../home/applications/SimpleServlet.war" />
    3] To make this module accessible from over the web, I have modified file
         <ora9ias_home>\j2ee\home\config\default-web-site.xml and added following entry:
         <web-app application="SimpleServlet" name="SimpleServlet" root="/SimpleServlet"/>
    4] I saved both the files and started Oracle HTTP Server and accessed page as below:
              http://<server>:7777/SimpleServlet/Simple
    where Simple is servlet in SimpleServlet.war file.          
    In the browser, The page cannot be found is shown to user. I have verified that SimpleServlet.war is extracted to SimpleServlet folder under <ora9ias_home>\j2ee\home\applications folder. I found that Simple.class is stored under WEB-INF/classes folder and web.xml contains correct entry for url pattern for servlet Simple.
    What else could be the problem? Am I placing the war file in wrong place or modifying application.xml or default-web-site.xml in a wrong directory?
    This is very urgent. Please help me with your valuable comments on this.
    Thanks in advance.
    Regards,
    Sandesh

    Hi All,
    I am facing problem while deploying a simple servlet
    using WAR file on Oracle 9i App Server.
    I have installed Oracle9iAS J2EE and Web Cache v9.0.3
    on Windows 2000 server.
    It includes:
         - Oracle HTTP Server
         - Oracle9iAS Containers for J2EE
         - Oracle9iAS Web Cache
         - Oracle Enterprise Manager
    The release of installed Oracle9iAS is Release 2
    (9.0.3)      
    I referred following link to Deploy Applications
    Using WAR file:
         http://otn.oracle.com/products/ias/daily/sept12.html
    As mentioned in this documentation I have followed
    following steps to deploy WAR file:
    1] I have created a war file by name
    SimpleServlet.war. In SimpleServlet.war, there is a
    servlet by name Simple which prints time at which
    servlet was accessed.
    2] I have modified
    <ora9ias_home>\j2ee\home\config\application.xml and
    added following web module entry:
    <web-module id="SimpleServlet"
    path="../../home/applications/SimpleServlet.war" />
    3] To make this module accessible from over the web,
    I have modified file
    <ora9ias_home>\j2ee\home\config\default-web-site.xml
    and added following entry:
    <web-app application="SimpleServlet"
    name="SimpleServlet" root="/SimpleServlet"/>
    4] I saved both the files and started Oracle HTTP
    Server and accessed page as below:
              http://<server>:7777/SimpleServlet/Simple
    where Simple is servlet in SimpleServlet.war file.          
    In the browser, The page cannot be found is shown to
    user. I have verified that SimpleServlet.war is
    extracted to SimpleServlet folder under
    <ora9ias_home>\j2ee\home\applications folder. I found
    that Simple.class is stored under WEB-INF/classes
    folder and web.xml contains correct entry for url
    pattern for servlet Simple.
    What else could be the problem? Am I placing the war
    file in wrong place or modifying application.xml or
    default-web-site.xml in a wrong directory?
    This is very urgent. Please help me with your
    valuable comments on this.
    Thanks in advance.
    Regards,
    SandeshHave you restarted you http server and then tried to load it again? Are you using the right port; maybe you have to use port 7778? Check you server settings in the http server instance. Also check your url binding of you application at Farm > Application Server: infrastructurehost > OC4J_instance > Application: appname > Web Module: modulename
    Good luck!
    rgds Thomas

  • Unable to deploy a simple servlet using WAR file

    Hi All,
    I am facing problem while deploying a simple servlet using WAR file on Oracle 9i App Server.
    I have installed Oracle 9i App Server. I referred following link to Deploy Applications Using WAR file:
         http://otn.oracle.com/products/ias/daily/sept12.html
    As mentioned in this documentation I have followed following steps to deploy WAR file:
    1] I have created a war file by name SimpleServlet.war. In SimpleServlet.war, there is a servlet by name Simple which prints time at which servlet was accessed.
    2] I have modified <ora9ias_home>\j2ee\home\config\application.xml and added following web module entry:
         <web-module id="SimpleServlet" path="../../home/applications/SimpleServlet.war" />
    3] To make this module accessible from over the web, I have modified file
         <ora9ias_home>\j2ee\home\config\default-web-site.xml and added following entry:
         <web-app application="SimpleServlet" name="SimpleServlet" root="/SimpleServlet"/>
    4] I saved both the files and started Oracle HTTP Server and accessed page as below:
              http://<server>:7777/SimpleServlet/Simple
    where Simple is servlet in SimpleServlet.war file.          
    In the browser, The page cannot be found is shown to user. I have verified that SimpleServlet.war is extracted to SimpleServlet folder under <ora9ias_home>\j2ee\home\applications folder. I found that Simple.class is stored under WEB-INF/classes folder and web.xml contains correct entry for url pattern for servlet Simple.
    What else could be the problem? Am I placing the war file in wrong place or modfiying application.xml or default-web-site.xml in a wrong directory?
    This is very urgent. Please help me with your valuable comments on this.
    Thanks in advance.
    Regards,
    Sandesh

    Hi Juliana,
    Thanks a lot for your suggestion.
    I am sorry if I have posted this message to a wrong forum. This is first time I am posting a message to OTN. I will resend message to J2EE forum as per you suggestion.
    Meanwhile, please note information you asked for is as below:
    I installed Oracle9iAS J2EE and Web Cache v9.0.3 on Windows 2000 server.
    It includes:
         - Oracle HTTP Server
         - Oracle9iAS Containers for J2EE
         - Oracle9iAS Web Cache
         - Oracle Enterprise Manager
    The release of installed Oracle9iAS is Release 2 (9.0.3)      
    Please do reply at the earliest.
    Once again thanks and look forward to hear from you.
    Regards,
    Sandesh

  • Unable to load descriptor .../web.xml - DescriptorException - Java EE6 war

    Deploying a simple Java EE 6 war into WebLogic 10.3.3 fails with <Unable to load descriptor /root/Oracle/Middleware/user_projects/domains/palis1/servers/AdminServer/upload/SimpleEE6App.war/WEB-INF/web.xml of module SimpleEE6App.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:<null>
    The web app consists of one JSF 2 web dialog, one managed bean, one stateless session bean and one entity bean. In GlassFish v3 the app works fine. Then I installed the actual version of WebLogic server in order to check whether I can run EE6 apps there to. But deploying the war using WebLogic admin console fails with
    ... <AdminServer> <main> <<WLS Kernel>> <> <> <1273649525966> <BEA-000360> <Server started in RUNNING mode>
    ... <AdminServer> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <admin> <> <> <1273649790693> <BEA-160197> <Unable to load descriptor /root/Oracle/Middleware/user_projects/domains/palis1/servers/AdminServer/upload/SimpleEE6App.war/WEB-INF/web.xml of module SimpleEE6App.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:<null>
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
    at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(WebAppDescriptor.java:141)
    at weblogic.servlet.utils.WarUtils.getWebAppBean(WarUtils.java:124)
    at weblogic.application.compiler.WARModule.processLibraries(WARModule.java:413)
    at weblogic.application.compiler.WARModule.merge(WARModule.java:455)
    at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:16)
    at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver$CompilerFlowDriver.compile(FlowDriver.java:96)
    at weblogic.application.compiler.ReadOnlyWarMerger.merge(ReadOnlyWarMerger.java:27)
    at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:88)
    at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:41)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver$CompilerFlowDriver.compile(FlowDriver.java:96)
    at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:157)
    at weblogic.utils.compiler.Tool.run(Tool.java:158)
    at weblogic.utils.compiler.Tool.run(Tool.java:115)
    at weblogic.application.compiler.AppMerge.merge(AppMerge.java:169)
    at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:88)
    at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:63)
    at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:181)
    at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:156)
    at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:661)
    at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:469)
    at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5000)
    at com.bea.console.actions.app.install.Flow.appSelected(Flow.java:467)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
    at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
    at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
    at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
    at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
    The web.xml is
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
    </web-app>
    After changing the version number I got the same error message with the differing number. I also tryed to deploy the web-app_3_0.xsd into the server. This also did not solve the problem.
    Any ideas?
    Thanks in advance
    Axel Burghof

    The web app consists of one JSF 2 web dialog, one managed bean, one stateless session bean and one entity bean. In GlassFish v3 the app works fine. Then I installed the actual version of WebLogic server in order to check whether I can run EE6 apps there to. But deploying the war using WebLogic admin console fails with ...
    Hey Axel -
    WLS 10.3.x does not implement Java EE 6 -- it's a Java EE 5 based server.
    While we have added support for a few independent Java EE 6 specifications where we can -- such as JSF 2.0 in WLS 10.3.3 and JPA 2.0/JAX-RS 1.1 with WLS 10.3.4 that is coming in the next patchset -- we don't support all of the Java EE 6 model and thus you can't use any of the EJB 3.1, Servlet 3.0 changes and you can't deploy EJBs (and JPA entities) inside of a WAR file. Our next major release will be a Java EE 6 implementation, where this will be possible.
    -steve-

  • Cannot deploy using .war file

    im using ant to build my war file.
    the application works when i copy the build/web to %catalina%\webapps folder but when i use war file there is error.
    i check the directory and the files of the working and not working source files but nothing seems to be different.
    can anyone help?
    java.lang.NullPointerException
         at com.saw.Media.UserAccessBean.closeConnection(UserAccessBean.java:262)
         at com.saw.Media.UserAccessBean.addUser(UserAccessBean.java:177)
         at org.apache.jsp.addUser1_jsp._jspService(addUser1_jsp.java:176)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at com.saw.Media.SVLDispatcherServlet.doPost(SVLDispatcherServlet.java:143)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
         at java.lang.Thread.run(Thread.java:534)

    Thanks for replying.
    i used the example at this web site http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    everything worked.
    jakarta-tomcat-4.1.29
    jakarta-ant-1.5-bin
    mysql-4.0.16-win
    mysql-connector-java-3.0.9-stable
    I suspect its my .java code. I tried to change the .java code but more errors which i dont understand comes up.
    public void addUser() throws Exception
    Connection dbConnection = null;
    try {
    dbConnection = getConnection();
    add(dbConnection);
    } catch (SQLException e) {
    System.out.println(e.getMessage());
    // Print any other nested exceptions
    while ((e = e.getNextException()) != null) {
    System.out.println(" next " + e.getMessage());
    throw e; // Re-throw the SQLException
    } finally {
    closeConnection(dbConnection);
    } // addUser()
    // PRIVATE METHODS
    // ===============
    // Add an user to the database
    private void add(Connection conn) throws Exception
    PreparedStatement ps = null;
    // Build the SQL statement
    StringBuffer sql = new StringBuffer();
    sql.append("INSERT INTO USERS ");
    sql.append("(user_name, user_pass, user_full_name) " ); // Leave a space at the end
    sql.append("VALUES (?, ?, ?) ");
    // Execute SQL statement
    try {
    ps = conn.prepareStatement(sql.toString());
    ps.setString(1, userName); // Set the missing values in the prepared statement
    ps.setString(2, userPass);
    ps.setString(3, userFullName);
    count = ps.executeUpdate();
    } catch (SQLException e) {
    count = 0; // So we know the operation was not successful
    // Here we are catching exceptions to reset a counter and optionally
    // for debugging purposes
    // May be we could log them to a file
    // Once caught, we are re-throwing them once again to a higher level
    // So, we need the catch block even if we are not debugging
    System.out.println(e.getMessage());
    // Print any other nested exceptions
    while ((e = e.getNextException()) != null) {
    System.out.println(" next " + e.getMessage());
    throw e; // Re-throw the SQLException
    // will be caught at a higher level
    } finally {
    ps.close();
    } // add()
    * Gets a datasource connection
    * Different from getting a databse connection using DriverManager
    * @param jndiName Name of datasource
    Connection getConnection()
    throws NamingException, SQLException {
    Context initCtx = null;
    try {
    // Obtain the initial JNDI context
    initCtx = new InitialContext();
    // Perform JNDI lookup to obtain resource manager connection factory
    DataSource ds =
    (javax.sql.DataSource)
    initCtx.lookup("java:comp/env/jdbc/" + jndiName);
    // Invoke factory to obtain a connection
    return ds.getConnection();
    } finally {
    // Don't forget to close the naming context
    if (initCtx != null) {
    initCtx.close();
    } // getConnection()
    // Close a datasource connection
    // Similar to closing a database connection
    private void closeConnection (Connection conn) throws Exception {
    conn.close();
    } // closeConnection()

  • Web.xml - security constraint question

    I want to make a kind of inverted security constraint. I want to ALLOW access to one specific page over HTTP. All other pages should be HTTPS.
    Is that possible???

    Use the <security-role-ref> for the Faces Servlet to map the LDAP roles to the logical role names used by the managed bean to determine if links may be rendered.
    Bean code:
    this.isAdmin = context.getExternalContext().isUserInRole("admin");web.xml:
            <security-role>
              <role-name>Local Admin Group</role-name>
         </security-role>
         <security-role>
              <role-name>DBA Group</role-name>
         </security-role>
        <!-- Faces Servlet -->
        <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <security-role-ref>
                  <role-name>admin</role-name>
                  <role-link>DBA Group</role-link>
           </security-role-ref>
            <security-role-ref>
                  <role-name>admin</role-name>
                  <role-link>Local Admin Group</role-link>
           </security-role-ref>
        </servlet>

  • Web.xml: security-constraint [un]usable in JSF?

    <security-constraint> in web.xml is a simple, effective and portable method of declaring a web application�s security policies.
    It's been noted, however, in an earlier topic (http://forum.java.sun.com/thread.jspa?threadID=747919&messageID=4279347) that it has it�s limitations in the context of jsf.
    A reasonable solution would be to consult <security-constraint> elements in one�s own web.xml when rendering <h:commandLink>'s on a page according to the security policy.
    Unfortunately, there is no standard method of reading web.xml, other than what�s available from the ServletContext.
    I found some container specific-implementations in the Cargo project from the http://cargo.codehaus.org,
    but I�m looking for a portable solution. Any thoughts?
    Thanks, y�all!

    Use the <security-role-ref> for the Faces Servlet to map the LDAP roles to the logical role names used by the managed bean to determine if links may be rendered.
    Bean code:
    this.isAdmin = context.getExternalContext().isUserInRole("admin");web.xml:
            <security-role>
              <role-name>Local Admin Group</role-name>
         </security-role>
         <security-role>
              <role-name>DBA Group</role-name>
         </security-role>
        <!-- Faces Servlet -->
        <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <security-role-ref>
                  <role-name>admin</role-name>
                  <role-link>DBA Group</role-link>
           </security-role-ref>
            <security-role-ref>
                  <role-name>admin</role-name>
                  <role-link>Local Admin Group</role-link>
           </security-role-ref>
        </servlet>

  • Sending non-SOAP XML message without using JMS

    Hi, I would like to build application to exchange non-SOAP XML message without using JSM. Could you please tell me which Java Technology that can help doing this? Thanks in advance

    to be more specific, could you please tell me any open source jaxm-like that support non-SOAP XML?

  • How to create new Custom XML Report without using Form Builder

    Hi,
    What are the steps to create new Custom XML Report without using Report Builder ?
    Thanks and Regards,
    Abhi

    Hi,
    Steps we now follow
    1)Create Data Model in Reports Builder
    2)Create xml
    3)Insert xml in Publisher to build Fomat
    4)FTp rdf
    5)Create Data Definition and Template
    6)Create executable and Concurrent Program
    Is there any way we can build reports without use of Report Builder ? By writing PL SQL Package for Before Report and After Report etc ...
    Thanks and Regards,
    Abhijit Rode

  • DIM: how to load metadata to Essbase without using rule files

    Hi,
    The Essbase adapter has been installed in the informatica PowerCenter (v8.1.1). We want to create a Essbase target definition to load metadata. In the Table Creation Wizard, we select Table Type: Dynamic dimension building (Type 3), but it needs to specify Rules file in the Column Creation Wizard.
    Any method to load metadata into Essbase without using Rules file?
    Thank you in advance.

    You could load the data into Essbase without Rule file by means of free form loading which the Datasource would be a file.

  • Using web resources in a JAR/WAR file in another project

    Hi,
    I would like to make a core set of .jspx files available to other developers without them having to physically include each of the .jspx files into their JDeveloper projects manually.
    I've tried creating various WAR and JAR files, and then including those into my JDeveloper projects (Project Properties > Libraries > Add Jar/Directory) but the result is always the same:
    javax.faces.FacesException: Problem in renderResponse: /test.jspx Not Found in ExternalContext as a Resource
    In the simplest case, I've created a war file with only a single file in it:
    /test.jspx
    I've also tried a war with:
    /public_html/test.jspx
    Can anybody provide some pointers as to what it is I need to do here? Some things I've read suggest that I need to extend the classpath to include my test.war, but I can't find the appropriate setting for this in JDeveloper.
    I'm using the latest version of JDeveloper 10g, and for the purposes of testing I'm using the embedded OC4J.
    Thanks for any tips!
    Alistair.

    I haven't done this so far, but it should be possible.
    One thing you should have in mind is this:
    Every WAR is a separate Web Application and has its own context as well as context root.
    If you'd like to reuse pages from another WAR file you need to know its context root at the bare minimum to reference to it.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • LinkageError while trying to use war-file bundled jars

    Good day.
    I have a servlet for which I want to use the latest JAX-WS 2.1.4 jars. I compile my servlet, and include in the WEB-INF/lib/ directory those same JAX-WS 2.1.4 jars. According to the classloading scheme under the SJWS v7.0, I can enable my servlet to actually use those jars, rather than the functional equivalent, but older, versions the container would provide, by setting delegate="false" in the servlet's sun-web.xml file.
    http://docs.sun.com/app/docs/doc/819-2634/6n4tl5ko9?l=en&a=view
    When I deploy this servlet, and a client makes a request of it, however, I'm getting an odd exception:
    java.lang.LinkageError: JAXB 2.0 API jar is being loaded (from jar:file:/sun/webserver7/lib/webserv-jwsdp.jar!/javax/xml/bind/annotation/XmlSchema.class), but this RI (from jar:file:/sun/webserver7/https-msoa5/web-app/msoa5/tManager/WEB-INF/lib/jaxb-impl.jar!/com/su
    n/xml/bind/v2/model/impl/ModelBuilder.class) requires JAXB 2.1 API jar.
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
    at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)
    at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)
    at javax.xml.ws.spi.Provider.provider(Provider.java:76)
    at javax.xml.ws.Service.<init>(Service.java:57)
    at com.sun.fast.eventmgr.wsdl.WsdltventManagerV4Service.<init>(WsdltventManagerV4Service.java:46)
    My WEB-INF/lib/ directory contains the jaxb jars, which leaves me puzzled as to why the linkage error. Here is the set of jars in the WEB-INF/lib directory:
    sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/FastInfoset.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/activation.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/http.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxb-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxb-impl.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxb-xjc.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxws-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxws-rt.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxws-tools.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jsr173_api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jsr181-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jsr250-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/mimepull.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/resolver.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/saaj-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/saaj-impl.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/sjsxp.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/stax-ex.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/streambuffer.jar
    Any suggestions on what the problem might be?
    Thanks.

    Thanks for the reply.
    The jar containing the sought class would be WEB-INF/lib/jaxb-api.jar per this brute force inspection:
    $ for i in $(find WEB-INF/lib/ -name \*.jar); do echo "---$i"; jar tf $i |grep javax/xml/bind/annotation/XmlSchema.class; done
    ---WEB-INF/lib/jaxb-xjc.jar
    ---WEB-INF/lib/streambuffer.jar
    ---WEB-INF/lib/jaxws-tools.jar
    ---WEB-INF/lib/FastInfoset.jar
    ---WEB-INF/lib/jaxb-api.jar
    javax/xml/bind/annotation/XmlSchema.class
    ---WEB-INF/lib/http.jar
    ---WEB-INF/lib/jsr173_api.jar
    ---WEB-INF/lib/jaxb-impl.jar
    ---WEB-INF/lib/activation.jar
    ---WEB-INF/lib/stax-ex.jar
    ---WEB-INF/lib/jsr181-api.jar
    ---WEB-INF/lib/jaxws-api.jar
    ---WEB-INF/lib/saaj-api.jar
    ---WEB-INF/lib/mimepull.jar
    ---WEB-INF/lib/jaxws-rt.jar
    ---WEB-INF/lib/saaj-impl.jar
    ---WEB-INF/lib/sjsxp.jar
    ---WEB-INF/lib/resolver.jar
    ---WEB-INF/lib/jsr250-api.jar

  • How to Redeploy application in OC4J using war file

    Hi
    Am new in area of 9ias and OC4J.
    I have deployed and application in OC4J of 9ias 902. using enterprise manager web interface.
    now i have change the contents of current jsp and added more jsp files.
    do i have to recreate war file and redeploy it in oc4j? or just copy the new version of current jsp and copy new jsp in application forlder.
    in case of redeploying , exterprise manager web interface asks for .ear file.
    can anyone give some hint to me... it will great help
    thanks
    samir
    [email protected]

    Yes you have to rebuild the WAR file. You can deploy WAR from EMWebsite by using the deploy WAR link. If you are in development and your WAR/EAR file is constantly changing you can use standalone OC4J.
    regards
    Debu

  • Web.xml problem and using of FrontController Pattern

    I use FrontController pattern and created servlet ControllerServlet.
    I want that when users open my site (for example mysite.com) all requests goes to controller? and even when users enter diretc path to jsp or servlet all requests were sent to ControllerServlet.
    in my As I read in "Java Servlet and JSP CookBook" for this I have to write in web.xml file such code:
    <servlet-mapping>
      <sevlet-name>ControllerServlet</servlet-name>
      <url-pattern>/*</url-pattern>
    </sevlet-mapping>so any requests will be sended to my controller servlet.
    But now I have other problem. How I have to call my jsp pages? When I use RequestDispatcher and forward reques to jsp pahe login.jsp, I have error because this request again redirects to controller.
    PS For calling servlet I have solve of this problem I just have to add to web.xml file security-constraint element for needed servlets.

    You really shouldn't have to map all urls to your ControllerServlet. Set the welcome file in the web.xml to open index.html and in index.html use JavaScript to direct the page to the ControllerServlet. Now as long as you only do RequestDispatcher forwards (no sendRedirects), all hyper links point to the ControllerServlet and all form actions point to the ControllerServlet you are okay. The reason is that the user will nevr see anything else in the browser address other than the ControllerServlet url and should never know the url of any other JSP or Servlet to request them directly.

  • Web.xml security-constraint order matters?

    After a long and frustrating debuggin session I've just discovered that the order in which <security-constraint>
    entries are added to the web.xml file matters to OC4J.
    That is if a more laxed rule is matched first the rest
    (even though they might be more precise or even an
    exact match won't be applied.
    Is this normal behaviour?
    EXAMPLE BELOW WORKS - INVERT ENTRIES AND IT WILL FAIL
    <security-constraint>
        <web-resource-collection>
          <web-resource-name>Protected</web-resource-name>
          <url-pattern>/admin*.uix</url-pattern>
        </web-resource-collection>
        <auth-constraint>
          <role-name>DSMSuperUser</role-name>
        </auth-constraint>
      </security-constraint>
      <security-constraint>
        <web-resource-collection>
          <web-resource-name>Secure</web-resource-name>
          <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
          <role-name>DSMUser</role-name>
        </auth-constraint>
      </security-constraint>

    Here is an excerpt from the servlet spec stating the proper behavior:
    The container matches URL patterns defined in security constraints
    using the same algorithm described in this specification for matching client
    requests to servlets and static resources as described in SRV.11.1
    SRV.11.1 Use of URL Paths
    Upon receipt of a client request, the web container determines the web application
    to which to forward it. The web application selected must have the the longest
    context path that matches the start of the request URL. The matched part of the URL
    is the context path when mapping to servlets.
    The web container next must locate the servlet to process the request using the
    path mapping procedure described below:
    The path used for mapping to a servlet is the request URL from the request
    object minus the context path. The URL path mapping rules below are used in
    order. The first successful match is used with no further matches attempted:
    1. The container will try to find an exact match of the path of the request to the
    path of the servlet. A successful match selects the servlet.
    2. The container will recursively try to match the longest path-prefix: This is done
    by stepping down the path tree a directory at a time, using the ’/’ character as
    a path separator. The longest match determines the servlet selected.
    3. If the last segment in the URL path contains an extension (e.g. .jsp), the servlet
    container will try to match a servlet that handles requests for the extension.
    An extension is defined as the part of the last segment after the last ’.’ character.
    4. If neither of the previous three rules result in a servlet match, the container will
    attempt to serve content appropriate for the resource requested. If a "default"
    servlet is defined for the application, it will be used.
    The container must use case-sensitive string comparisons for matching.
    So this is STILL an issue w/ 10.1.2.0.2...
    EXAMPLE BELOW WORKS - INVERT ENTRIES AND IT WILL FAIL
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>oemAdmin</web-resource-name>
    <url-pattern>/admin/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>OEM_ADMIN</role-name>
    </auth-constraint>
    <user-data-constraint>
    <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>allOem</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>OEM_USER</role-name>
    </auth-constraint>
    <user-data-constraint>
    <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    If I don't find a SR for this issue I'll open one b/c this is not acceptable.

Maybe you are looking for

  • ITunes unknown error (-200) (and others)

    Just switched from a iPod mini to an older 20 gig. Tried to sync it. iTunes crashed. Made me reformat the iPod. Lost all music on it. Also, no audio was playing. Told me to update iTunes. (thinking it would solve the sync issue) I did. iTunes wont op

  • How do I represent the apostrophe char in java? ''' doesn't work and ...

    case '\u0027':doesn't either. what is the representation like: 'h' is h

  • Is WLAN connection possible with Satellite A40-702?

    I phoned Broadband provider the other day to upgrade to wireless - now concerned that my laptop (model above) wont be compatible with wireless. Could anyone advise?

  • Outlet adapter not working

    I was recently given an old Ipod mini which had been formated for a Mac. I have a pc, so I reformatted the ipod. It told me to plug it in before it could finish, which I have seen in other posts that there is no way around. So I went out and bought A

  • How to view my memory?

    i have macbook pro and new imac How can i see my memory or how much memo have i used and have left??