On 09/05/2010 12:04, Martin Gainty wrote:
> 
> <Context docBase="game" path="/game" debug="0" reloadable="true">
>>
>> The above is wrong. Remove docBase and path, they are illegal in
>> context.xml.
>  
> mg>
> 
> what do you mean by the term illegal..please be more descriptive in your 
> terminology

If I'd said "... they are bearnaise in context.xml" your question might
have made sense, but I didn't.  The meaning is clear, especially when
considered in context*.


p


* you see what I did there?



> docBase
> 
> The Document Base (also known as the Context Root) directory for this web 
> application, or the pathname to the web application archive file (if this web 
> application is being executed directly from the WAR file). You may specify an 
> absolute pathname for this directory or WAR file, or a pathname that is 
> relative to the appBase directory of the owning Host.
> 
> The value of this field must not be set when the Context is configured using 
> a META-INF/context.xml file as it will be inferred by the automatic 
> deployment process.
> 
> if META-INF/context.xml Context element is present then leave it be
> 
> the exception is NOT when META-INF/context.xml is present
> 
> mg>
> 
> mg>
> 
> path 
> 
> The context path of this web application, which is matched against the 
> beginning of each request URI to select the appropriate web application for 
> processing. All of the context paths within a particular Host must be unique. 
> If you specify a context path of an empty string (""), you are defining the 
> default web application for this Host, which will process all requests not 
> assigned to other Contexts.
> 
> The value of this field must not be set except when statically defining a 
> Context in server.xml, as it will be inferred from the filenames used for 
> either the .xml context file or the docBase.
> 
> ok to set as Context attribute in server.xml
> 
> </mg>
>>
>>> <Realm className="org.apache.catalina.realm.JDBCRealm"
>>> connectionName="user" connectionPassword="password"
>>> connectionURL="jdbc:postgresql:game"
>>> driverName="org.postgresql.Driver"
>>> roleNameCol="role" userCredCol="password" userNameCol="loginname"
>>> userRoleTable="player" userTable="player" />
>>
>> Ew. Don't use a JDBCRealm (it's synchronised etc), use a
>> DataSourceRealm with an appropriately configured DataSource.
> 
>  
> 
> <mg>
> use DatasourceRealm for JNDI lookups...its not a hard thing to setup but you 
> will need JNDI provider such as ldap.jar
> 
>  
> 
> DataSourceRealm is an implementation of the Tomcat 6 Realm interface that 
> looks up users in a relational database accessed via a JNDI named JDBC 
> DataSource. There is substantial configuration flexibility that lets you 
> adapt to existing table and column names, as long as your database structure 
> conforms to the following requirements:
> 
> http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#DataSourceRealm
> 
> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> 
> </mg>
> 
> <mg>
> 
> JDBCRealm operates according to the following rules:
> 
> 
> When a user attempts to access a protected resource for the first time, 
> Tomcat 6 will call the authenticate() method of this Realm. Thus, any changes 
> you have made to the database directly (new users, changed passwords or 
> roles, etc.) will be immediately reflected.
> Once a user has been authenticated, the user (and his or her associated 
> roles) are cached within Tomcat for the duration of the user's login. (For 
> FORM-based authentication, that means until the session times out or is 
> invalidated; for BASIC authentication, that means until the user closes their 
> browser). 
> The cached user is not saved and restored across sessions serialisations. Any 
> changes to the database information for an already authenticated user will 
> not be reflected until the next time that user logs on again.
> Administering the information in the users and user roles table is the 
> responsibility of your own applications. Tomcat does not provide any built-in 
> capabilities to maintain users and roles.
> </mg>
>>
>>> </Context>
>>> ---
>>>
>>> Everything works fine in Eclipse on the PC. When I export it as a WAR
>>> and copy it the the server, putting it to the "webapps" folder I do get
>>> the login screen, but trying to log in fails.
>>>
>>> ---
>>> May 7 10:54:02 h1643987 jsvc.exec[5191]: 07.05.2010 10:54:02
>>> org.apache.catalina.realm.JAASRealm authenticate SEVERE: Unexpected
>>> error java.lang.SecurityException: Anmeldekonfiguration kann nicht
>>> gefunden werden.
>>> at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:93)
>>> at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source)
>>> at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>>
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>> at java.lang.Class.newInstance0(Class.java:355)
>>> at java.lang.Class.newInstance(Class.java:308)
>>> at javax.security.auth.login.Configuration$3.run(Configuration.java:246)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.Configuration.getConfiguration(Configuration.java:241)
>>>
>>> at javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at javax.security.auth.login.Log
>>> May 7 10:54:02 h1643987 jsvc.exec[5191]:
>>> .security.auth.login.LoginContext.<init>(LoginContext.java:403)
>>> at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:345)
>>> at
>>> org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
>>>
>>> at
>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
>>>
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>
>>> at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>
>>> at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>
>>> at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>> at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>> at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>
>>> at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>> at java.lang.Thread.run(Thread.java:619) Caused by: java.io.IOExc
>>> May 7 10:54:02 h1643987 jsvc.exec[5191]: en werden.
>>> at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:250)
>>> at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:91)
>>> ... 23 more
>>> 07.05.2010 10:54:02 org.apache.catalina.realm.JAASRealm authenticate
>>> SEVERE: Unexpected error java.lang.SecurityException:
>>> Anmeldekonfiguration kann nicht gefunden werden.
>>> at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:93)
>>> at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source)
>>> at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>>
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>> at java.lang.Class.newInstance0(Class.java:355)
>>> at java.lang.Class.newInstance(Class.java:308)
>>> at javax.security.auth.login.Configuration$3.run(Configuration.java:246)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.Configuration.getConfiguration(Configuration.java:241)
>>>
>>> at
>>> May 7 10:54:02 h1643987 jsvc.exec[5191]: inContext.java:237)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at javax.security.auth.login.LoginContext.init(LoginContext.java:234)
>>> at javax.security.auth.login.LoginContext.<init>(LoginContext.java:403)
>>> at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:345)
>>> at
>>> org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
>>>
>>> at
>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
>>>
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>
>>> at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>
>>> at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>
>>> at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>> at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>> at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Htt
>>> ---
>>>
>>> Why is the JAASRealm throwing an exception, if I never configured it?
>>
>> Try it with the Security Manager disabled. I'll assume you've installed
>> a repackaged version of Tomcat, rather than a download from
>> http://tomcat.apache.org/
>>
>> Edit the /etc/default/tomcat6 file to disable the Security Manager.
>>
>> If it works then we know where the problem is and can work a solution,
>>
>>
>> p
>>
>>> Thanks and regards
>>> - MaxX
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>
>>
> 
>                                         
> _________________________________________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to