JDBCRealm

Discussion in 'Java' started by Wojtek Kusch, Dec 19, 2006.

  1. Wojtek Kusch

    Wojtek Kusch Guest

    Hallo!

    I am a newbie in JSP. I am defining a JDBCRealm for my web application
    in the server.xml:

    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:eek:dbc:CATALINA"
    userTable="USER" userNameCol="username"
    userCredCol="userpass"
    userRoleTable="USER_ROLE" roleNameCol="role" />



    If I am starting Tomcat I get followwing message:

    INFO: Initializing Coyote HTTP/1.1 on http-8080
    18.12.2006 22:41:27 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 937 ms
    18.12.2006 22:41:27 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    18.12.2006 22:41:27 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    18.12.2006 22:41:27 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    18.12.2006 22:41:28 org.apache.catalina.realm.JAASRealm setContainer
    INFO: Set JAAS app name Catalina
    18.12.2006 22:41:30 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    18.12.2006 22:41:30 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2875 ms




    If I start my JSP-Site (Login.jsp) I get an error:


    org.apache.catalina.realm.JAASRealm authenticate
    SCHWERWIEGEND: Unexpected error
    java.lang.SecurityException: Login configuration can't be found.
    at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:97)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)


    Why JAASRealm is starting?????
    Thanks for an answer!
    Kusch




    My whole Server.xml:
    <Server port="8005" shutdown="SHUTDOWN">

    <!-- Comment these entries out to disable JMX MBeans support used for the
    administration web application -->
    <Listener
    className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener
    className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener
    className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>

    <!-- 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"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />

    </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="Catalina">



    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->



    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443"
    protocol="AJP/1.3" />

    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">


    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:eek:dbc:CATALINA"
    userTable="USER" userNameCol="username"
    userCredCol="userpass"
    userRoleTable="USER_ROLE" roleNameCol="role" />

    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">

    </Host>

    </Engine>

    </Service>

    </Server>
     
    Wojtek Kusch, Dec 19, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PC
    Replies:
    0
    Views:
    613
  2. Replies:
    1
    Views:
    1,969
    Eric Sosman
    Jun 20, 2005
Loading...

Share This Page