JAAS + JDeveloper + Tomcat Example

Hello,
Is there a resource somewhere on the web that describes how to use JAAS with JDeveloper (1.10.3 preferably) and Tomcat for complete idiots like myself?
Thanks,
Terris

Terris,
JAAS is nothing specific to Oracle and there is no way to automate its usage. The development of JAAS security in applications and its deployment includes
1. Create a JAAS LoginModule or re-use an existing
2. Configure the target platform - Tomcat - for JAAS (it needs a reference to a policy file with the Permissions defined that you need for your application
3. Make the application instantiate a login context and reference the configuration of the JAAS Login Module
SUN does host good JAAS tutorials on their website. Note that if the requirement isn't JAAS, J2EE declarative security is easier to use and more portable.
Frank

Similar Messages

  • Integration of JAAS in Tomcat

    Hi,
    I want to use JAAS in Tomcat, but i don't hava a idea, how i can realize it !!!
    Can someone help me with a tutorial or tips, to include JAAS in Tomcat.
    Thanks a lot for your help !!
    erdkal

    Hi erdal,
    look on the JAASRealm from tomcat. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html
    There is a JAASImplementation in the nightly builds.
    juraj

  • JAAS with TomCat 5.5  Unable to login.No error shown.PLS HELP ME:(

    Log of tomcat:
    Sep 28, 2006 3:21:49 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin;.;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM;C:\j2sdk1.4.2\bin;c:\mysql\bin;C:\apache-ant-1.6.5\bin;C:\Program Files\QuickTime\QTSystem\;C:\eclipse_ac\bin
    Sep 28, 2006 3:21:49 PM org.apache.coyote.http11.Http11BaseProtocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Sep 28, 2006 3:21:49 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2547 ms
    Sep 28, 2006 3:21:50 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Sep 28, 2006 3:21:50 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
    Sep 28, 2006 3:21:50 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Sep 28, 2006 3:21:54 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive jaasLogin.war
    Sep 28, 2006 3:21:57 PM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    Sep 28, 2006 3:21:57 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    Sep 28, 2006 3:21:57 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    Sep 28, 2006 3:21:58 PM org.apache.coyote.http11.Http11BaseProtocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Sep 28, 2006 3:21:59 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Sep 28, 2006 3:21:59 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/109 config=null
    Sep 28, 2006 3:21:59 PM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    Sep 28, 2006 3:22:00 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 10312 ms
    ===========================================================
    Notice that line i bolded and italic..Does it means that my loginModule is not loaded?how to i configure my login.config so that it will call the module or whatsoever?because it my loginModule is not being called.any solutions to configure JAAS?pls help me..im new to this..=))) i wrote my login.conf and put in the /conf folder of tomcat..what else must i do?=)))

    Sorry, I am not sure about that.
    Also, I don't see a particular line that was bolded in your original post.
    The way I ensured that my LoginModule was being called (aside from the fact that I was able to login) was debugging it in Eclipse and placing a breakpoint in the LoginModule code.
    You could try putting a System.out.println() statement in it to see if it is called.

  • Jdeveloper Facelets example war?

    Is anyone willing to provide a link to a hello world .war file with facelets setup and running in jdeveloper?
    I'm finding it very difficult to get it going even from all the forum posts and facelets mailing list search of 'adf'. :(

    Copy the following JAR files to the WEB-INF/lib directory of the JSF application.
    <facelets-1.0.12>/ jsf-facelets.jar
    <JDeveloper10.1.3>/jsf-ri/jsf-api.jar
    <JDeveloper10.1.3>/jsf-ri/jsf-impl.jar
    <JDeveloper10.1.3>/jakarta-struts/lib/ commons-beanutils.jar
    <JDeveloper10.1.3>/jakarta-struts/lib/ commons-collections.jar
    <JDeveloper10.1.3>/jakarta-struts/lib/ commons-digester.jar
    <JDeveloper10.1.3>/jakarta-struts/lib/ commons-logging.jar
    <facelets-1.0.12>/lib/el-ri.jar
    <facelets-1.0.12>/lib/el-api.jar

  • JAAS Tomcat PB..

    I try to integrate JAAS with Tomcat 5.028 and JSF
    I read a lot of FAQs BUT i have a pb for authorization.
    My web.xml seems OK
    The Login module seems OK
    I always have a HTTP 403 error for bad authorization.
    I launch Tomcat with 2 JVM options:
    -Djava.security.auth.policy=<path to tomcat.policy>
    -Djava.security.auth.login.config=<path to auth.conf>
    My question are:
    Is the .policy file mandatory and how to fill it ??
    How to specify URLs in the file... No URLPermission class available...
    How does my policy file be modified ??
    grant codebase "file://C:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/realms/index.jspx"  Principal * * {
      permission java.io.FilePermission "/admin/admin.jspx", "read";
    };Can you help me ??

    Hi,
    you should look towards jGuard (http://www.jguard.net) which enable easy JAAS integration into J2EE webapps on your application server (including tomcat).
    it provides also taglibs, URLPermission and many others things.
    cheers,
    Charles(jGuard team).

  • Tomcat  can ....?

    hi all,
    Can anybody give a summary of " how to handle Clustering ,load balancing and JAAS using tomcat"?
    I am using tomcat 5.0.28
    Thanks in adv.
    Ganesh

    Hello Robert,
    You cannot get the reason of this without looking at logs. However, You can restart the service from CLI.
    Here’s the list of UCCX utils commands which you can use it from CLI.
    utils service [list start stop restart auto-restart]
    This is the CLI command for service control.
    The CLI command allows starting, stopping, and restarting of all the services as listed:
    System SSH
    Service Manager
    A Cisco DB
    Cisco Tomcat
    Cisco Database Layer Monitor
    Cisco Unified Serviceability
    Cisco CAR DB
    Service Manager
    Cisco Unified CCX Cluster View Daemon
    Cisco Unified CCX Database
    Cisco Unified CCX Application Administration
    Cisco Unified CCX Serviceability Administration
    Cisco Unified CCX Engine
    Cisco Desktop Agent E-Mail Service
    Cisco Desktop Call/Chat Service
    Cisco Desktop Enterprise Service
    Cisco Desktop LDAP Monitor Service
    Cisco Desktop License and Resource Manager Service
    Cisco Desktop Recording and Playback Service
    Cisco Desktop Recording and Statistics Service
    Cisco Desktop Sync Service
    Cisco Desktop VoIP Monitor Service
    Cisco Desktop Browser and IP Phone Agent Service
    Cisco Unified CCX Notification Service
    Example:
    admin: utils service start "Unified CCX Application Administration"
    Command successful.
    Unified CCX Application Administration started successfully.
    =============================Command Syntax: ===================================
    utils service [option] [service-name]
    —The option to start/stop/restart etc.
    —The service which is to be started/stopped or restarted.
    Requirements
    Level privilege: 1
    Command privilege level: 1
    Thanks,
    Surendra Tripathi

  • JAAS and relation of Subject - Principal

    Can someone please explain to me the intended relation of Subject to Principal as they relate to JAAS?
    For example, assume I have the actual credential information stored in LDAP but supplemental data kept in Oracle HR module. During JAAS authentication I perform the LDAP auth and then retrieve the data from Oracle.
    I was assuming that I would then take the created Subject and add two Principals to it (one for the LDAP entry and one for the Oracle data). But if that is the case, then how does the container know which Principal to retrieve from the Subject (for example when EJBContext.getCallerPrincipal() is called)?
    Or should data from both sources be meshed into a single Principal object,and it alone be added to the Subject? If this is the case, there hardly seems a need to be dealing with Subject in JAAS.
    Thanks in advance.

    This is exactly my question. What I am finding out however (through reading tons and looking at how Tomcat does it vs. WebLogic) is that it is pretty much container specific. It boils down to the runtime type of the Principal objects in your Subject. In the case of WebLogic, the HttpServletRequest.getUserPrincipal() method looks for a Principal that implements the WLSUser interface. WebLogic specifies that your Subject can only have one such Principal.
    In Tomcat4, looking at the JAASRealm, they have provided a way for you to specify the runtime type of the Principal object (actually the api allows you to specify many types...which is another point of confussion) that will be used to represent the user principal. Additionally, they have provided the same mechanism to specify the principal classes that will be added to the subject to represent roles...
    I am sorry that your question was specific about EJBContext.getCallerPrincipal() but I answered in terms of HttpServletRequest.getUserPrincipal(). I suspect that the container will automatically propagate the subject to the EJB environment and then use the same mechanism that it uses in the servlet world...however, that point doesn't seem to be well defined.
    I hope we can all get some answers here to enable us to write portable enterprise applications.
    Good luck,
    Troy

  • Has anyone run the connection pooling for mysql & tomcat successfully?

    I'm trying to set up connection pooling. I'm following the how-to page at
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    But when i test the DBTest/test.jsp file, tomcat displays an error =
    could not load jdbc driver class 'null'(msdos)
    i have placed all the required .jar files in the tomcat lib.
    below is the cofiguration i did to the server.xml file
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    <!-- Uncomment these entries to enable JMX MBeans support -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
    debug="0"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
    debug="0"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Tomcat-Standalone">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 4.0 documentation bundle for more detailed
    instructions):
    * Download and install JSSE 1.0.2 or later, and put the JAR files
    into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8081 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8080" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="100" debug="0" connectionTimeout="20000"
    useURIValidationHack="false" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to -1 -->
    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8443" minProcessors="5" maxProcessors="75"
    enableLookups="true"
         acceptCount="100" debug="0" scheme="https" secure="true"
    useURIValidationHack="false" disableUploadTimeout="true">
    <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
    clientAuth="false" protocol="TLS" />
    </Connector>
    -->
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8009" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" connectionTimeout="20000"
    useURIValidationHack="false"
    protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
    port="8009" minProcessors="5" maxProcessors="75"
    acceptCount="10" debug="0"/>
    -->
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8082" minProcessors="5" maxProcessors="75"
    enableLookups="true" disableUploadTimeout="true"
    acceptCount="100" debug="0" connectionTimeout="20000"
    proxyPort="80" useURIValidationHack="false" />
    -->
    <!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
    <!--
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
    port="8083" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" />
    -->
    <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
    <!--
    <Connector className="org.apache.catalina.connector.http10.HttpConnector"
    port="8084" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.3
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    debug="0" resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host -->
    <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true">
    <Context path="/my-jsp" docBase="c:\JSP-Files" debug="0"
    privileged="true" reloadable="true" />
         <Context path="" docBase="c:\Inetpub\wwwroot" debug="0" privileged="true" />
    <Context path="/sharon" docBase="C:\Tomcat 4.1\webapps\sharon" debug="0" privileged="true" />
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
    debug="0"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Logger shared by all Contexts related to this virtual host. By
    default (when using FileLogger), log files are created in the "logs"
    directory relative to $CATALINA_HOME. If you wish, you can specify
    a different directory with the "directory" attribute. Specify either a
    relative (to $CATALINA_HOME) or absolute path to the desired
    directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
         timestamp="true"/>
    <!-- Define properties for each web application. This is only needed
    if you want to set non-default properties, or have web application
    document roots in places other than the virtual host's appBase
    directory. -->
    <!-- Tomcat Root Context -->
    <!--
    <Context path="" docBase="ROOT" debug="0"/>
    -->
    <!-- Tomcat Examples Context -->
    <Context path="/examples" docBase="examples" debug="0"
    reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Ejb name="ejb/EmplRecord" type="Entity"
    home="com.wombat.empl.EmployeeRecordHome"
    remote="com.wombat.empl.EmployeeRecord"/>
    <!-- If you wanted the examples app to be able to edit the
    user database, you would uncomment the following entry.
    Of course, you would want to enable security on the
    application as well, so this is not done by default!
    The database object could be accessed like this:
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    UserDatabase database =
    (UserDatabase) envCtx.lookup("userDatabase");
    -->
    <!--
    <ResourceLink name="userDatabase" global="UserDatabase"
    type="org.apache.catalina.UserDatabase"/>
    -->
    <!-- PersistentManager: Uncomment the section below to test Persistent
              Sessions.
    saveOnRestart: If true, all active sessions will be saved
    to the Store when Catalina is shutdown, regardless of
    other settings. All Sessions found in the Store will be
    loaded on startup. Sessions past their expiration are
    ignored in both cases.
    maxActiveSessions: If 0 or greater, having too many active
    sessions will result in some being swapped out. minIdleSwap
    limits this. -1 means unlimited sessions are allowed.
    0 means sessions will almost always be swapped out after
    use - this will be noticeably slow for your users.
    minIdleSwap: Sessions must be idle for at least this long
    (in seconds) before they will be swapped out due to
    maxActiveSessions. This avoids thrashing when the site is
    highly active. -1 or 0 means there is no minimum - sessions
    can be swapped out at any time.
    maxIdleSwap: Sessions will be swapped out if idle for this
    long (in seconds). If minIdleSwap is higher, then it will
    override this. This isn't exact: it is checked periodically.
    -1 means sessions won't be swapped out for this reason,
    although they may be swapped out for maxActiveSessions.
    If set to >= 0, guarantees that all sessions found in the
    Store will be loaded on startup.
    maxIdleBackup: Sessions will be backed up (saved to the Store,
    but left in active memory) if idle for this long (in seconds),
    and all sessions found in the Store will be loaded on startup.
    If set to -1 sessions will not be backed up, 0 means they
    should be backed up shortly after being used.
    To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
    and minIdleBackup all to -1, saveOnRestart to false, then restart
    Catalina.
    -->
              <!--
    <Manager className="org.apache.catalina.session.PersistentManager"
    debug="0"
    saveOnRestart="true"
    maxActiveSessions="-1"
    minIdleSwap="-1"
    maxIdleSwap="-1"
    maxIdleBackup="-1">
    <Store className="org.apache.catalina.session.FileStore"/>
    </Manager>
              -->
    <Environment name="maxExemptions" type="java.lang.Integer"
    value="15"/>
    <Parameter name="context.param.name" value="context.param.value"
    override="false"/>
    <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
    type="javax.sql.DataSource"/>
    <Resource name="jdbc/TestDB"
         auth="Container"
         type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
         <name>factory</name>
         <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
         <!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.
         -->
         <parameter>
         <name>maxActive</name>
         <value>100</value>
         </parameter>
         <!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit.
         -->
         <parameter>
         <name>maxIdle</name>
         <value>30</value>
         </parameter>
         <!-- Maximum time to wait for a dB connection to become available
         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded. Set to -1 to wait indefinitely.
         -->
         <parameter>
         <name>maxWait</name>
         <value>10000</value>
         </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>user</name>
    <value>javauser</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>javadude</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>org.gjt.mm.mysql.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
         connection. mysqld by default closes idle connections after 8 hours.
         -->
         <parameter>
         <name>url</name>
         <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
    <Resource name="mail/Session" auth="Container"
    type="javax.mail.Session"/>
    <ResourceParams name="mail/Session">
    <parameter>
    <name>mail.smtp.host</name>
    <value>localhost</value>
    </parameter>
    </ResourceParams>
    <ResourceLink name="linkToGlobalResource"
    global="simpleValue"
    type="java.lang.Integer"/>
    </Context>
    </Host>
    </Engine>
    </Service>
    <!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
    as its servlet container. Please read the README.txt file coming with
    the WebApp Module distribution on how to build it.
    (Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
    To configure the Apache side, you must ensure that you have the
    "ServerName" and "Port" directives defined in "httpd.conf". Then,
    lines like these to the bottom of your "httpd.conf" file:
    LoadModule webapp_module libexec/mod_webapp.so
    WebAppConnection warpConnection warp localhost:8008
    WebAppDeploy examples warpConnection /examples/
    The next time you restart Apache (after restarting Tomcat, if needed)
    the connection will be established, and all applications you make
    visible via "WebAppDeploy" directives can be accessed through Apache.
    -->
    <!-- Define an Apache-Connector Service -->
    <!--
    <Service name="Tomcat-Apache">
    <Connector className="org.apache.catalina.connector.warp.WarpConnector"
    port="8008" minProcessors="5" maxProcessors="75"
    enableLookups="true" appBase="webapps"
    acceptCount="10" debug="0"/>
    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
    name="Apache" debug="0">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="apache_log." suffix=".txt"
    timestamp="true"/>
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    </Engine>
    </Service>
    -->
    </Server>
    Pleas4 help!!!

    you have your driver jar in Tomcat\common\lib?
    if so, check your classpath, it could be that.

  • Servlets and Folders in Tomcat 4.1

    I have Tomcat 4.1 running and try to launch my Servlet, it is only 1 .class file. (Win NT 4) Have put it in
    <Tomcat dir>\Webapps\Root\Web-inf\classes
    The web.xml in Web-inf look like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>HelloWorldServlet</servlet-name>
    <servlet-class>HelloWorldServlet</servlet-class>
    </servlet>
    </web-app>
    and it worked. But I don't know why. In Webbrowser i typed
    http://localhost:8080/servlet/HelloWorldServlet
    First question: is there any security problem when ein put my Servlets in this Folder? Can I securely refer from Websites to these Servlets?
    I tried to put the .class file to
    Webapps\HelloWorldServlet\Web-inf\classes
    with the web.xml like above and made a server.xml statement:
    <Context path="/HelloWorldServlet" docBase="HelloWorldServlet" debug="0" reloadable="true" crossContext="true" privileged="true" />
    but nothing worked there.
    I tried:
    http://localhost:8080/HelloWorldServlet/HelloWorldServlet in browser
    but became
    HTTP Status 404 - /HelloWorldServlet/HelloWorldServlet
    "The requested resource (/HelloWorldServlet/HelloWorldServlet) is not available."
    I think the web.xml is not executed. How to solve that? Any additional settings in other files? I have read a lot of setting up tomcat and servlets, even in this forum but found no solution for that problem. Is there an order in server.xml where the entries should be, i placed it under <!-- Tomcat Examples Context -->
    How to link in Html to a servlet?
    Are there any Solutions for these problems? Any ideas?
    Thanks for every hint!
    Sorry for bad english.

    First question: is there any security problem when ein put my Servlets in this Folder? Can I securely refer from Websites to these Servlets?
    Based on my experience, no problem so far.
    Webapps\HelloWorldServlet\Web-inf\classes
    with the web.xml like above and made a server.xml statement:
    <Context path="/HelloWorldServlet" docBase="HelloWorldServlet" debug="0" reloadable="true" crossContext="true" privileged="true" />
    try to refer your servlet via
    htp://localhost:8080/HelloWorldServlet/servlet/HelloWorldServlet
    If tomcat can start successfully, it has already executed the server.xml. If you access the a context, the relevant web.xml will be executed.

  • Where is the system directory of JDeveloper 10.1.2.1?

    In JHeadstart 10g for ADF Installation Guide, it says the followings:
    If you want to be able to use JHeadstart Designer Generator: in <JHeadstartHome>\config\jdevaddins you will also find a file named migration.xml. This file must be copied to the system directory of JDeveloper, for example: <JDeveloperHome>\jdev\system10.1.2.0.0.1811. On Linux this directory is in the home directory of the user that is running JDeveloper: $HOME/jdevhome/system10.1.2.0.0.1811. The exact name of this directory depends on the build number of JDeveloper.
    But, there is no directory like <JDeveloperHome>\jdev\system10.1.2.0.0.1811 in JDeveloper 10g(Version 10.1.2.1, build 1913) New Aug 2005.
    Where is it?

    You have to start JDev 10.1.2.1 once before the
    system directory is created under the /jdev
    directory. The name will be something like
    system10.1.2.1.0.1913.
    Steven Davelaar,
    JHeadstart Team.Thanks, Steven.
    You are right.

  • Tomact examples and form base authentication

    I am looking at the tomcat examples web.xml security constrains and login info settings:
    <security-constraint>
    <display-name>Example Security Constraint</display-name>
    <web-resource-collection>
    <web-resource-name>Protected Area</web-resource-name>
         <!-- Define the context-relative URL(s) to be protected -->
    <url-pattern>/jsp/security/protected/*</url-pattern>
         <!-- If you list http methods, only those methods are protected -->
         <http-method>DELETE</http-method>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
         <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
    <!-- Anyone with one of the listed roles may access this area -->
    <role-name>tomcat</role-name>
         <role-name>role1</role-name>
    </auth-constraint>
    </security-constraint>
    <!-- Default login configuration uses form-based authentication -->
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Example Form-Based Authentication Area</realm-name>
    <form-login-config>
    <form-login-page>/jsp/security/protected/login.jsp</form-login-page>
    <form-error-page>/jsp/security/protected/error.jsp</form-error-page>
    </form-login-config>
    </login-config>
    As we can see form-login page and form-error page uri match url-pattern settings.
    url-pattern: /jsp/security/protected/*
    form-login page: /jsp/security/protected/login.jsp
    form-error page: /jsp/security/protected/error.jsp
    There is no binding of unauthenticated user to ether one of specified roles
    Question: What place in the servlet spec allows serving secured resource for a user without appropriate role association?

    Kinda then beat the the whole idea of authentication then, if you allow a user in that is not assigned to a security role? Anyway, I think you are looking to send the user to another page if they are not in a role but have an id, correct? Well, first it has to be a page outside the secure directory/ies. The error it generates is a 403. So add to your web.xml:
        <error-page>
           <error-code>403</error-code>
           <location>/403.jsp</location>
        </error-page>Anytime a user who is not a member of the allowed roles attempts a login, they will be redirected to this page.
    Ross

  • ADF BC entitiy object security and Tomcat 5.5

    Hello all,
    I have set up ADF BC security in Jdev 10.1.3.3 and it works fine when I test the app module in JDev.
    However, when I deploy the application to Tomcat 5.5, I get
    oracle.security.jazn.JAZNRuntimeException: Configuration file does not exist. Check your JAAS configuration settings
    It seems like oracle.security.jazn is used although I have configured the app module (configurations) parameters:
    jbo.security.config - from default to my config file
    jbo.security.context - to Tomcat implementation of JAAS
    jbo.security.loginmodule - to Frank and Duncan's module (see article "Declarative J2EE authentication and authorization with JAAS).
    Container managed security using JAAS in Tomcat is working fine.
    I am wondering whether it is possible at all to use ADF BC security in any container other than OC4J and if the answer is positive, how it is done (configured).
    Many thanks in advance.
    Best regards,
    Boris

    Hi,
    JAZN as a security platform isn't portable and thus wont work on Tomcat.
    Frank

  • Deploying ADF/JDeveloper portlets in WebSphere Portal

    I'd like to use ADF/JDeveloper to build my application, but my customer is already heavily invested on a WebSphere Portal deployment platform.  The JDeveloper/ADF documentation has extensive information on creating portlets in various ways, but they all seem focused exclusively on deploying in an Oracle platform.  I have tried both the "Standards-Based" as well as the "JSF Portlet Bridge".  I have tried to deploy the portlets in WebSphere Portal using both the generated WAR file, as well as by registering the WSRP producer.  None work.
    With the WAR file, WebSphere Portal seems to import the WAR file just fine, and I can add a portlet to a page, but the portlet always shows as "unavaiable"
    With the WSRP producer, I can get something to show in the page, but the functionality within the portlet doesn't seem to work.
    I've searched extensively, but cannot locate any documentation or use cases for deploying portlets from JDeveloper into WebSphere Portal.  Does anyone have any thoughts?

    Dvohra21, again, I apreciate the effort, but I think you're missing the fundamental question.
    You've given me two types of articles/links.  Some are generic WebSphere Portal documentation about deploying a portlet from a WAR file.  Others are Oracle articles about who to generate portlets in JDeveloper, with examples deploying in Oracle/WebLogic servers.   Unfortunately I don't have a problem with either of those.
    I CAN deploy a portlet WAR file in WebSphere Portal, and sucessfully add it to a Portal page.  I have done that with multiple WAR files generated from Rational Application Developer.
    I CAN produce a WAR file from JDeveloper, following the instructions in the same resources you included, plus a few others.
    The problem is, the WAR file from JDeveloper, does not successfully run on WebSphere Portal.  I create a simple Hello World portlet in JDeveloper, and I can generate a WAR file from it, and seemingly deploy to WebSphere Portal.   However when I add it to a Portal page, it always displays only a blank box with the text "This portlet is unavailable".  This is in the same exact portal page, where the portlet created with Rational Application Developer shows up just fine right along side it.
    Bottomline is, although there is a great deal of information an demos about generating portlets from JDeveloper within an Oracle environment, I could not find a SINGLE ONE, that goes through an end to end scenario where it is deployed in WebSphere Portal.  Nothing in this forum, nothing in Oracle docs, and nothing I can find on a Google search.

  • Servlets and Tomcat/Apache

    Okay,
    Tomcat 4.1 running with Apache.
    Installed mod_jk, piece of cake.
    JSPs run through Apache like a dream.
    Tomcat examples ( jsp and servlets) run through Apache perfectly ( that is no :8080 business).
    My JSP's run through Apache no problem. Works great.
    My SERVLETS WILL NOT RUN THROUGH APACHE FOR ANYTHING.
    My context looks like this in server.xml:
    <Context path="/nuweb" docBase="/home/shared/nuweb" debug="0"
    reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="nuweb" suffix=".log"
    timestamp="true"/>
    </Context>
    Note: that I am not under <TOMCAT_HOME>/webapps.
    The reason is that I will, in production not be the Unix admin on the server. I will only have priviledges within my directory. I will not be able to drop war files in the webapps directory. I will not be able
    to start and stop tomcat or apache ( there are 100 diffrent apache contexts on that machine and someday many of them will be going through tomcat for jsp and servlet support).
    My servlets will only run if I put :8080/nuweb/servlet/HelloServlet in the URL. Take off the 8080 and I get Page not found. Not the tomcat 404 page, the Browswer 404 errror.
    Here is my web.xml which lives in the WEB-INF directory of of /home/shared/nuweb
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>org.nu.servlet.HelloServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/hello</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    </web-app>
    In devlopment I am on a system that is very close to what the production server will look like ( Tomcat 4.1 same version of Apache, same Unix ). In development I can restart all the servers edit server.xml etc. On the production I would have to schedule that stuff. I want to be able to compile classes and drop them in the WEB-INF/classes... directory and have them run. Is that too much to ask?

    Hi,
    I am also facing same error.
    I am not able to view my servlets via apache web server.
    ie when i do "http://localhost/enlighta/logon"
    I get http 404 page not found error
    but when I do http://localhost:8080/enlighta/logon
    all works fine
    I am using apache 2 and tomcat 4.5
    This is I have done:
    1.I have http server running on port 80
    2. appserver on port 8080
    3. I have a war file enlighta.war deployed on webserevr
    4. The static content like images and html page I have moved to webserver
    5. The servlet context of the app on the app server is /enlighta
    6. In the web.xml I have defined all the servlet maping.
    the port 8009 has the connecter is running/listening.
    the configuration
    sever.xml on tomcat
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    httpd.conf on apache
    # Load mod_jk
    LoadModule jk_module modules/mod_jk.so
    # Configure mod_jk
    JkWorkersFile conf/workers.properties
    JkLogFile logs/mod_jk.log
    JkLogLevel info
    # First Virtual Host.
    <VirtualHost 192.168.1.2:8080>
    ServerAdmin [email protected]
    DocumentRoot /enlighta/
    ServerName localhost
    ErrorLog logs/enlighta_error_log
    TransferLog logs/enlighta_access_log
    JkMount /enlighta/* ajp13
    </VirtualHost>
    workers.properties
    worker.list=ajp13
    # Defining a worker named ajp13w and of type ajp13
    # Note that the name and the type do not have to match.
    worker.ajp13.type=ajp13
    worker.ajp13.host=localhost
    worker.ajp13.port=8009
    Now I feel I am doing something wrong on defining virtual host.
    Or may be something else is wrong.
    I have gone thru the previous thread but I dont have mod_jk.conf file.
    Please help!!!
    Thanks
    Sachin

  • How to use jdeveloper with linux?

    how to use jdeveloper with linux?
    Hello, i've download jdeveloper, and i have java1.4 installed. But i can't run jdeveloper i have jdev.exe and jdev but when i put /usr/local/jdev/bin/jdev a have a message like file not found. I don't know what to do.
    Help please!!!
    Ori.

    You need to go to the directory where you unzipped JDeveloper, for example:
    cd opt/jdev/jdevj2eebase1013/jdev/bin
    Once there, do this:
    chmod +x jdev
    chmod +x ojc
    Now you can try this:
    nohup ./jdev &
    or simply
    ./jev
    I usually create a soft link in ~/bin

Maybe you are looking for

  • Item will not transfer to/ from external drive "in use" error.

    I have searched the boards and found a handful of suggestions that I have tried with very limited success. My assumption is that is is a drive issue rather than a mac issue (Enlighten me if I am not posting in the right place!) I'd like to be able to

  • Mapping of values in multiple nodes into one

    Folks, I have a message with the following structure <Document>   <Item>     <ID>1000</ID>    <CustomerPO>128389</CustomerPO>    <Reference>      <Category>A</Category>      <ReferenceID>31909031</ReferenceID>    </Reference>   </Item> <Item>    <ID>

  • ITunes opens, starts playing music

    Okay, running OSX 10.7.1 with iTunes 10.4.1. I'll be watching televlsion and notice music playing and it's iTunes which has gone from not being opened to opening and playing whatever playlist was last played. The one plug-in that I have is SRS iWow b

  • Calling DLL problem

    I have done some tests.  If I fill the array with some fixed value, the return array is always right.  I have the feeling that the problem is with the input data function. >Hi, >I have a LabVIEW applicaiton that calls a DLL library.  I wrote this DLL

  • How to block spam email sender on iMac ?

    How to block spam email sender on iMac ?