You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by vramanaj <vr...@gmail.com> on 2009/11/30 14:46:39 UTC

Re: How to access JNDI resources on Tomcat level

Hi,

I am facing problem with configuring JNDI DataSources for Josso project in
Tomcat 6. Getting the following errors in tomcat log when i am trying to
access the application. Defined resource in
conf/Catalina/localhost/webapp.xml. And res-reference in the application's
web.xml.

Nov 30, 2009 7:48:52 AM
org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
getDataSource
SEVERE: Error during DB connection lookup
javax.naming.NameNotFoundException: Name DefaultDS is not bound in this
Context
       at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
       at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

Steps Followed:
1. Defined DataSource within GlobalNamingResources
           <Resource name="/DefaultDS"
           auth="Container"
           type="javax.sql.DataSource"
           description="SSO DataSource"
           username="josso"
           password="josso"
           driverClassName="oracle.jdbc.OracleDriver"
           url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
           factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
           maxActive="8"
           maxIdle="4"/>

2. Added res-reference in web.xml
3. Defined resource in conf/Catalina/localhost/webapp.xml
           <Resource name="/DefaultDS"
           auth="Container"
           type="javax.sql.DataSource"
           description="SSO DataSource"
           username="josso"
           password="josso"
           driverClassName="oracle.jdbc.OracleDriver"
           url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
           factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
           maxActive="8"
           maxIdle="4"/>

4. In josso-gateway-db-stores.xml
   <db-istore:datasource-store id="josso-identity-store"
                     dsJndiName="java:comp/env/DefaultDS"
                     userQueryString="SELECT NAME FROM JOSSO_USER WHERE
LOGIN = ?"
                     rolesQueryString="SELECT ROLE FROM JOSSO_USER_ROLE
WHERE LOGIN = ?;"
                     credentialsQueryString="SELECT LOGIN AS USERNAME,
PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
                     userPropertiesQueryString="SELECT NAME, VALUE FROM
JOSSO_USER_PROPERTY WHERE LOGIN = ?"
                     resetCredentialDml="UPDATE JOSSO_USER SET PASSWORD = ?
WHERE LOGIN = ?"
                     relayCredentialQueryString="SELECT LOGIN FROM
JOSSO_USER WHERE #?# = ?" />

5. When i try to access the example partner application (/partner), getting
the following error:
           Error : Error During Lookup Name DefaultDS is not bound in this
Context

I am using Josso 1.8.0 with tomcat 6.0.18.

Please help me out to proceed further. Quick response is highly appreciable.

Thanks in Advance.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Mikolaj Rydzewski-2 wrote:
>
> Mikolaj Rydzewski wrote:
>> Now, I want to setup Josso single sign on system (www.josso.org) and
>> force it to use JNDI DataSources as well. With no luck.
> Here's the solution for anyone interested (addition to typical josso
> setup):
>
>     * define DataSource within GlobalNamingResources (e.g. jdbc/users)
>     * add JNDI support to josso webapp (e.g. and ResourceLink to
>       META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>     * reference DataSource from josso-gateway-config.xml using
>       java:comp/env/jdbc/users as its JNDI name
>
> Enjoy ;-)
>
> --
> Mikolaj Rydzewski <mi...@ceti.pl>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
Quoted from:
http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html

Mikolaj Rydzewski-2 wrote:
> 
> Christopher Schultz wrote:
>>>    * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>      META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>     
>>
>> Note that this is not required for Realms. See
>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>   
> I'm exposing DataSource to josso webapp, not the Realm. So I need this. 
> Lack of such configuration was causing my initial problems.
> 
> -- 
> Mikolaj Rydzewski <mi...@ceti.pl>
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26574958.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by André Warnier <aw...@ice-sa.com>.
vramanaj wrote:
> Can we have the below 2 security constraints in web.xml ? auth-methods are
> different for the both. 

There was an earlier thread on this same list about that, about a week ago.
Basically the answer is no, because the Servlet Spec does not allow for 
that. (In other words, it is not specific to Tomcat, it is the case for 
any servlet engine).


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Can we have the below 2 security constraints in web.xml ? auth-methods are
different for the both. In our existing application we have 2nd
security-constraint/login-config is existing. As part of Josso
configuration, we need have the configuration like 1st one. Can we club both
of them with out disturbing the existing one ?

1. 
   <security-constraint>
      <web-resource-collection>
         <web-resource-name>Technical Website</web-resource-name>
         <url-pattern>/technical/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
         <role-name>manager</role-name>
      </auth-constraint>
   </security-constraint>
   <login-config>
      <auth-method>DIGEST</auth-method>
      <realm-name>@APPNAME@ WebUI</realm-name>
   </login-config>

2.
   <security-constraint>
      <web-resource-collection>
         <web-resource-name>Single SignOn</web-resource-name>
         <url-pattern>/sso</url-pattern>
      </web-resource-collection>
      <auth-constraint>
         <role-name>sso_role</role-name>
      </auth-constraint>
   </security-constraint>
   <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Make-To-Order WebUI</realm-name>
        <form-login-config>
            <form-login-page>/login-redirect.jsp</form-login-page>
            <form-error-page>/login-redirect.jsp</form-error-page>
        </form-login-config>
   </login-config>
******************************************************************************

Pid Ster wrote:
> 
> On 15/12/2009 12:44, vramanaj wrote:
>>
>> Yes, I did. I have followed those configuration steps for other
>> applications
>> earlier.
>> Are there any other configurations required to store the cookies in IE
>> browser, if the application is ssl enabled ?
> 
> No, Tomcat doesn't need to do anything special for IE.
> 
> 
> p
> 
>> Pid Ster wrote:
>>>
>>> On 15/12/2009 11:25, vramanaj wrote:
>>>>
>>>> The problem is https. For rememberMe in Josso, the site should be in
>>>> ssl.
>>>> I
>>>> configured ssl in tomcat. Now i am getting the following error. I have
>>>> installed the cert. in IE. Please help me if there are tomcat settings
>>>> required for ssl.
>>>
>>> If the problem is setting up HTTPS, have you completed the steps
>>> included on the page below?
>>>
>>>    http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
>>>
>>>
>>> p
>>>
>>>
>>>> 15 Dec 2009 06:14:38,992 DEBUG Error getting client certs
>>>> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
>>>> 	at
>>>> com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
>>>> 	at
>>>> org.apache.tomcat.util.net.jsse.JSSESupport.getX509Certificates(JSSESupport.java:87)
>>>> 	at
>>>> org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:141)
>>>> 	at
>>>> org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1012)
>>>> 	at org.apache.coyote.Request.action(Request.java:352)
>>>> 	at
>>>> org.apache.catalina.connector.Request.getAttribute(Request.java:896)
>>>> 	at
>>>> org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263)
>>>> 	at
>>>> org.josso.gateway.signon.LoginSelectorAction.execute(LoginSelectorAction.java:67)
>>>> 	at
>>>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>>>> 	at
>>>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>>>> 	at
>>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>>>> 	at
>>>> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>>> 	at
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>> 	at
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>> 	at
>>>> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>>>> 	at
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>> 	at
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>> 	at
>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>> 	at
>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>>> 	at
>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>> 	at
>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>> 	at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>>>> 	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)
>>>> 15 Dec 2009 06:14:38,992 DEBUG Looking for cookie:
>>>> JOSSO_REMEMBERME_josso
>>>> 15 Dec 2009 06:14:38,992 DEBUG RemembermeCookie NOT found!
>>>>
>>>>
>>>>
>>>>
>>>> Pid Ster wrote:
>>>>>
>>>>> On 14/12/2009 12:55, vramanaj wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am through with the Josso configuration. Could be able to see the
>>>>>> sso
>>>>>> logon page, redirecting the authenticated username to the partner
>>>>>> application. Facing problem with rememberMe option. Second time when
>>>>>> i
>>>>>> try
>>>>>> to logon to the application, logon page is showing up again. I set
>>>>>> 'rememberMeEnabled' to true in josso. For rememberMe in sso, i read
>>>>>> that
>>>>>> we
>>>>>> need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
>>>>>> getting created. Still are there any configurations we need to do in
>>>>>> tomcat
>>>>>> ?
>>>>>
>>>>> No idea, but it sounds like a JOSSO problem.
>>>>> Maybe that community can assist.
>>>>>
>>>>>
>>>>> p
>>>>>
>>>>>
>>>>>> Regards
>>>>>>
>>>>>>
>>>>>>
>>>>>> vramanaj wrote:
>>>>>>>
>>>>>>> Resolved AuthenticationFailureException issue. This is coming
>>>>>>> because
>>>>>>> i
>>>>>>> have used basic-authentication scheme. If basic-authentication
>>>>>>> scheme
>>>>>>> used, we need remove hasAlgorithm and hasEnconding properties in
>>>>>>> josso-gateway-auth.xml file.
>>>>>>>
>>>>>>> Now Josso session id is getting created. But getting the below error
>>>>>>> while
>>>>>>> trying to access the application:
>>>>>>>
>>>>>>> java.lang.RuntimeException: Outbound relaying failed. No Principal
>>>>>>> found.
>>>>>>> Verify your SSO Agent Configuration!
>>>>>>> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
>>>>>>>
>>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>>>>>
>>>>>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>>>>>>
>>>>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>>>>>
>>>>>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>>>>>> 	java.lang.Thread.run(Thread.java:619)
>>>>>>>
>>>>>>> Tomcat log shows:
>>>>>>>
>>>>>>> Dec 1, 2009 8:51:55 AM
>>>>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler
>>>>>>> handle
>>>>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
>>>>>>> createSession=success -
>>>>>>> ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
>>>>>>> Dec 1, 2009 8:51:55 AM
>>>>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler
>>>>>>> handle
>>>>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
>>>>>>> authenticationSuccess=success -
>>>>>>> authScheme=basic-authentication,ssoSessionId=E
>>>>>>> F9E9AFEDD935C7366BCA259DCC85577
>>>>>>> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm
>>>>>>> authenticate
>>>>>>> WARNING: Login exception authenticating username "null"
>>>>>>> javax.security.auth.login.LoginException: Login Failure: all modules
>>>>>>> ignored
>>>>>>>            at
>>>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>>>>>>>            at
>>>>>>> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>>>>>>>            at
>>>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>>>>>>>            at java.security.AccessController.doPrivileged(Native
>>>>>>> Method)
>>>>>>>            at
>>>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>>>>>>>            at
>>>>>>> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>>>>>>>            at
>>>>>>> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>>>>>>>            at
>>>>>>> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>>>>>>>            at
>>>>>>> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>>>>>>>            at
>>>>>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>>>>>>>            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)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> vramanaj wrote:
>>>>>>>>
>>>>>>>> User name and password are correct only.
>>>>>>>>
>>>>>>>>
>>>>>>>> Pid Ster wrote:
>>>>>>>>>
>>>>>>>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>>>>>>>
>>>>>>>>>> I have passed through this DataSource look up problem. I altered
>>>>>>>>>> context.xml/web.xml of josso webapp. And also used short JNDI
>>>>>>>>>> names
>>>>>>>>>> at
>>>>>>>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full
>>>>>>>>>> JNDI
>>>>>>>>>> name
>>>>>>>>>> at Josso configuration level (e.g.
>>>>>>>>>> java:comp/env/jdbc/DefaultDS).
>>>>>>>>>>
>>>>>>>>>> Now when i try to access the application, getting the error
>>>>>>>>>> Invalid
>>>>>>>>>> Authentication Information.
>>>>>>>>>>
>>>>>>>>>> Tomcat log shows as:
>>>>>>>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>>>>>>>> authenticationFailed=failure -
>>>>>>>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>>>>>>>> ication -
>>>>>>>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>>>>>>>>
>>>>>>>>> I guess the user or password information is wrong then.
>>>>>>>>> This would be a JOSSO problem, presumably...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> p
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> -----------------------------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> vramanaj wrote:
>>>>>>>>>>>
>>>>>>>>>>> Added context.xml in META-INF directory. And also added
>>>>>>>>>>> resurce-ref
>>>>>>>>>>> in
>>>>>>>>>>> josso webapp. Still getting the same error.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> vramanaj wrote:
>>>>>>>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>>>>>>>
>>>>>>>>>>>>> <Context path="/partnerapp"
>>>>>>>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>>>>>>>              debug="99" reloadable="true"
>>>>>>>>>>>>> antiJARLocking="true"
>>>>>>>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>>>>>>>> type="javax.sql.DataSource"/>
>>>>>>>>>>>>> </Context>
>>>>>>>>>>>>>
>>>>>>>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>>>>>>>
>>>>>>>>>>>> Stacktraces you have posted originate from josso webapp, not
>>>>>>>>>>>> from
>>>>>>>>>>>> test
>>>>>>>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26842846.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 15/12/2009 12:44, vramanaj wrote:
>
> Yes, I did. I have followed those configuration steps for other applications
> earlier.
> Are there any other configurations required to store the cookies in IE
> browser, if the application is ssl enabled ?

No, Tomcat doesn't need to do anything special for IE.


p

> Pid Ster wrote:
>>
>> On 15/12/2009 11:25, vramanaj wrote:
>>>
>>> The problem is https. For rememberMe in Josso, the site should be in ssl.
>>> I
>>> configured ssl in tomcat. Now i am getting the following error. I have
>>> installed the cert. in IE. Please help me if there are tomcat settings
>>> required for ssl.
>>
>> If the problem is setting up HTTPS, have you completed the steps
>> included on the page below?
>>
>>    http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
>>
>>
>> p
>>
>>
>>> 15 Dec 2009 06:14:38,992 DEBUG Error getting client certs
>>> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
>>> 	at
>>> com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
>>> 	at
>>> org.apache.tomcat.util.net.jsse.JSSESupport.getX509Certificates(JSSESupport.java:87)
>>> 	at
>>> org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:141)
>>> 	at
>>> org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1012)
>>> 	at org.apache.coyote.Request.action(Request.java:352)
>>> 	at org.apache.catalina.connector.Request.getAttribute(Request.java:896)
>>> 	at
>>> org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263)
>>> 	at
>>> org.josso.gateway.signon.LoginSelectorAction.execute(LoginSelectorAction.java:67)
>>> 	at
>>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>>> 	at
>>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>>> 	at
>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>>> 	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>> 	at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>> 	at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>> 	at
>>> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>>> 	at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>> 	at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>> 	at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>> 	at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>> 	at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>> 	at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>> 	at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>>> 	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)
>>> 15 Dec 2009 06:14:38,992 DEBUG Looking for cookie: JOSSO_REMEMBERME_josso
>>> 15 Dec 2009 06:14:38,992 DEBUG RemembermeCookie NOT found!
>>>
>>>
>>>
>>>
>>> Pid Ster wrote:
>>>>
>>>> On 14/12/2009 12:55, vramanaj wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I am through with the Josso configuration. Could be able to see the sso
>>>>> logon page, redirecting the authenticated username to the partner
>>>>> application. Facing problem with rememberMe option. Second time when i
>>>>> try
>>>>> to logon to the application, logon page is showing up again. I set
>>>>> 'rememberMeEnabled' to true in josso. For rememberMe in sso, i read
>>>>> that
>>>>> we
>>>>> need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
>>>>> getting created. Still are there any configurations we need to do in
>>>>> tomcat
>>>>> ?
>>>>
>>>> No idea, but it sounds like a JOSSO problem.
>>>> Maybe that community can assist.
>>>>
>>>>
>>>> p
>>>>
>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>>
>>>>> vramanaj wrote:
>>>>>>
>>>>>> Resolved AuthenticationFailureException issue. This is coming because
>>>>>> i
>>>>>> have used basic-authentication scheme. If basic-authentication scheme
>>>>>> used, we need remove hasAlgorithm and hasEnconding properties in
>>>>>> josso-gateway-auth.xml file.
>>>>>>
>>>>>> Now Josso session id is getting created. But getting the below error
>>>>>> while
>>>>>> trying to access the application:
>>>>>>
>>>>>> java.lang.RuntimeException: Outbound relaying failed. No Principal
>>>>>> found.
>>>>>> Verify your SSO Agent Configuration!
>>>>>> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
>>>>>>
>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>>>>
>>>>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>>>>>
>>>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>>>>
>>>>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>>>>> 	java.lang.Thread.run(Thread.java:619)
>>>>>>
>>>>>> Tomcat log shows:
>>>>>>
>>>>>> Dec 1, 2009 8:51:55 AM
>>>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
>>>>>> createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
>>>>>> Dec 1, 2009 8:51:55 AM
>>>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
>>>>>> authenticationSuccess=success -
>>>>>> authScheme=basic-authentication,ssoSessionId=E
>>>>>> F9E9AFEDD935C7366BCA259DCC85577
>>>>>> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm
>>>>>> authenticate
>>>>>> WARNING: Login exception authenticating username "null"
>>>>>> javax.security.auth.login.LoginException: Login Failure: all modules
>>>>>> ignored
>>>>>>            at
>>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>>>>>>            at
>>>>>> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>>>>>>            at
>>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>>>>>>            at java.security.AccessController.doPrivileged(Native
>>>>>> Method)
>>>>>>            at
>>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>>>>>>            at
>>>>>> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>>>>>>            at
>>>>>> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>>>>>>            at
>>>>>> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>>>>>>            at
>>>>>> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>>>>>>            at
>>>>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>>>>>>            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)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> vramanaj wrote:
>>>>>>>
>>>>>>> User name and password are correct only.
>>>>>>>
>>>>>>>
>>>>>>> Pid Ster wrote:
>>>>>>>>
>>>>>>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>>>>>>
>>>>>>>>> I have passed through this DataSource look up problem. I altered
>>>>>>>>> context.xml/web.xml of josso webapp. And also used short JNDI names
>>>>>>>>> at
>>>>>>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full
>>>>>>>>> JNDI
>>>>>>>>> name
>>>>>>>>> at Josso configuration level (e.g.
>>>>>>>>> java:comp/env/jdbc/DefaultDS).
>>>>>>>>>
>>>>>>>>> Now when i try to access the application, getting the error Invalid
>>>>>>>>> Authentication Information.
>>>>>>>>>
>>>>>>>>> Tomcat log shows as:
>>>>>>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>>>>>>> authenticationFailed=failure -
>>>>>>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>>>>>>> ication -
>>>>>>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>>>>>>>
>>>>>>>> I guess the user or password information is wrong then.
>>>>>>>> This would be a JOSSO problem, presumably...
>>>>>>>>
>>>>>>>>
>>>>>>>> p
>>>>>>>>
>>>>>>>>
>>>>>>>>> -----------------------------------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> vramanaj wrote:
>>>>>>>>>>
>>>>>>>>>> Added context.xml in META-INF directory. And also added
>>>>>>>>>> resurce-ref
>>>>>>>>>> in
>>>>>>>>>> josso webapp. Still getting the same error.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>>>>
>>>>>>>>>>> vramanaj wrote:
>>>>>>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>>>>>>
>>>>>>>>>>>> <Context path="/partnerapp"
>>>>>>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>>>>>>              debug="99" reloadable="true" antiJARLocking="true"
>>>>>>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>>>>>>> type="javax.sql.DataSource"/>
>>>>>>>>>>>> </Context>
>>>>>>>>>>>>
>>>>>>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>>>>>>
>>>>>>>>>>> Stacktraces you have posted originate from josso webapp, not from
>>>>>>>>>>> test
>>>>>>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it may concern,

On 12/15/2009 7:44 AM, vramanaj wrote:
> Yes, I did [read the SSL HOWTO]. I have followed those configuration
> steps for other applications earlier.

You may still need to import the /remote server's/ certificate into your
keystore in order to trust that server's certificate. Does your LDAP
server use a self-signed certificate?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksn3GYACgkQ9CaO5/Lv0PCfxgCgrLZL7rf7vKYQjY9Hu47OQVhp
hxkAn03btgtswea2P+lDwbihYbDl1ig8
=V1dR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Yes, I did. I have followed those configuration steps for other applications
earlier. 
Are there any other configurations required to store the cookies in IE
browser, if the application is ssl enabled ?


Pid Ster wrote:
> 
> On 15/12/2009 11:25, vramanaj wrote:
>>
>> The problem is https. For rememberMe in Josso, the site should be in ssl. 
>> I
>> configured ssl in tomcat. Now i am getting the following error. I have
>> installed the cert. in IE. Please help me if there are tomcat settings
>> required for ssl.
> 
> If the problem is setting up HTTPS, have you completed the steps 
> included on the page below?
> 
>   http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
> 
> 
> p
> 
> 
>> 15 Dec 2009 06:14:38,992 DEBUG Error getting client certs
>> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
>> 	at
>> com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
>> 	at
>> org.apache.tomcat.util.net.jsse.JSSESupport.getX509Certificates(JSSESupport.java:87)
>> 	at
>> org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:141)
>> 	at
>> org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1012)
>> 	at org.apache.coyote.Request.action(Request.java:352)
>> 	at org.apache.catalina.connector.Request.getAttribute(Request.java:896)
>> 	at
>> org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263)
>> 	at
>> org.josso.gateway.signon.LoginSelectorAction.execute(LoginSelectorAction.java:67)
>> 	at
>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>> 	at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>> 	at
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>> 	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> 	at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> 	at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> 	at
>> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>> 	at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> 	at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> 	at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>> 	at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>> 	at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>> 	at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> 	at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>> 	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)
>> 15 Dec 2009 06:14:38,992 DEBUG Looking for cookie: JOSSO_REMEMBERME_josso
>> 15 Dec 2009 06:14:38,992 DEBUG RemembermeCookie NOT found!
>>
>>
>>
>>
>> Pid Ster wrote:
>>>
>>> On 14/12/2009 12:55, vramanaj wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am through with the Josso configuration. Could be able to see the sso
>>>> logon page, redirecting the authenticated username to the partner
>>>> application. Facing problem with rememberMe option. Second time when i
>>>> try
>>>> to logon to the application, logon page is showing up again. I set
>>>> 'rememberMeEnabled' to true in josso. For rememberMe in sso, i read
>>>> that
>>>> we
>>>> need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
>>>> getting created. Still are there any configurations we need to do in
>>>> tomcat
>>>> ?
>>>
>>> No idea, but it sounds like a JOSSO problem.
>>> Maybe that community can assist.
>>>
>>>
>>> p
>>>
>>>
>>>> Regards
>>>>
>>>>
>>>>
>>>> vramanaj wrote:
>>>>>
>>>>> Resolved AuthenticationFailureException issue. This is coming because
>>>>> i
>>>>> have used basic-authentication scheme. If basic-authentication scheme
>>>>> used, we need remove hasAlgorithm and hasEnconding properties in
>>>>> josso-gateway-auth.xml file.
>>>>>
>>>>> Now Josso session id is getting created. But getting the below error
>>>>> while
>>>>> trying to access the application:
>>>>>
>>>>> java.lang.RuntimeException: Outbound relaying failed. No Principal
>>>>> found.
>>>>> Verify your SSO Agent Configuration!
>>>>> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
>>>>>
>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>>>
>>>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>>>>
>>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>>> 
>>>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>>>> 	java.lang.Thread.run(Thread.java:619)
>>>>>
>>>>> Tomcat log shows:
>>>>>
>>>>> Dec 1, 2009 8:51:55 AM
>>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
>>>>> createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
>>>>> Dec 1, 2009 8:51:55 AM
>>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
>>>>> authenticationSuccess=success -
>>>>> authScheme=basic-authentication,ssoSessionId=E
>>>>> F9E9AFEDD935C7366BCA259DCC85577
>>>>> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm
>>>>> authenticate
>>>>> WARNING: Login exception authenticating username "null"
>>>>> javax.security.auth.login.LoginException: Login Failure: all modules
>>>>> ignored
>>>>>           at
>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>>>>>           at
>>>>> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>>>>>           at
>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>>>>>           at java.security.AccessController.doPrivileged(Native
>>>>> Method)
>>>>>           at
>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>>>>>           at
>>>>> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>>>>>           at
>>>>> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>>>>>           at
>>>>> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>>>>>           at
>>>>> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>>>>>           at
>>>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>>>>>           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)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> vramanaj wrote:
>>>>>>
>>>>>> User name and password are correct only.
>>>>>>
>>>>>>
>>>>>> Pid Ster wrote:
>>>>>>>
>>>>>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>>>>>
>>>>>>>> I have passed through this DataSource look up problem. I altered
>>>>>>>> context.xml/web.xml of josso webapp. And also used short JNDI names
>>>>>>>> at
>>>>>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full
>>>>>>>> JNDI
>>>>>>>> name
>>>>>>>> at Josso configuration level (e.g.
>>>>>>>> java:comp/env/jdbc/DefaultDS).
>>>>>>>>
>>>>>>>> Now when i try to access the application, getting the error Invalid
>>>>>>>> Authentication Information.
>>>>>>>>
>>>>>>>> Tomcat log shows as:
>>>>>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>>>>>> authenticationFailed=failure -
>>>>>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>>>>>> ication -
>>>>>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>>>>>>
>>>>>>> I guess the user or password information is wrong then.
>>>>>>> This would be a JOSSO problem, presumably...
>>>>>>>
>>>>>>>
>>>>>>> p
>>>>>>>
>>>>>>>
>>>>>>>> -----------------------------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> vramanaj wrote:
>>>>>>>>>
>>>>>>>>> Added context.xml in META-INF directory. And also added
>>>>>>>>> resurce-ref
>>>>>>>>> in
>>>>>>>>> josso webapp. Still getting the same error.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>>>
>>>>>>>>>> vramanaj wrote:
>>>>>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>>>>>
>>>>>>>>>>> <Context path="/partnerapp"
>>>>>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>>>>>             debug="99" reloadable="true" antiJARLocking="true"
>>>>>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>>>>>> type="javax.sql.DataSource"/>
>>>>>>>>>>> </Context>
>>>>>>>>>>>
>>>>>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>>>>>
>>>>>>>>>> Stacktraces you have posted originate from josso webapp, not from
>>>>>>>>>> test
>>>>>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26794176.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 15/12/2009 11:25, vramanaj wrote:
>
> The problem is https. For rememberMe in Josso, the site should be in ssl.  I
> configured ssl in tomcat. Now i am getting the following error. I have
> installed the cert. in IE. Please help me if there are tomcat settings
> required for ssl.

If the problem is setting up HTTPS, have you completed the steps 
included on the page below?

  http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html


p


> 15 Dec 2009 06:14:38,992 DEBUG Error getting client certs
> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
> 	at
> com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
> 	at
> org.apache.tomcat.util.net.jsse.JSSESupport.getX509Certificates(JSSESupport.java:87)
> 	at
> org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:141)
> 	at
> org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1012)
> 	at org.apache.coyote.Request.action(Request.java:352)
> 	at org.apache.catalina.connector.Request.getAttribute(Request.java:896)
> 	at
> org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263)
> 	at
> org.josso.gateway.signon.LoginSelectorAction.execute(LoginSelectorAction.java:67)
> 	at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
> 	at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> 	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
> 	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at
> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
> 	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)
> 15 Dec 2009 06:14:38,992 DEBUG Looking for cookie: JOSSO_REMEMBERME_josso
> 15 Dec 2009 06:14:38,992 DEBUG RemembermeCookie NOT found!
>
>
>
>
> Pid Ster wrote:
>>
>> On 14/12/2009 12:55, vramanaj wrote:
>>>
>>> Hi,
>>>
>>> I am through with the Josso configuration. Could be able to see the sso
>>> logon page, redirecting the authenticated username to the partner
>>> application. Facing problem with rememberMe option. Second time when i
>>> try
>>> to logon to the application, logon page is showing up again. I set
>>> 'rememberMeEnabled' to true in josso. For rememberMe in sso, i read that
>>> we
>>> need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
>>> getting created. Still are there any configurations we need to do in
>>> tomcat
>>> ?
>>
>> No idea, but it sounds like a JOSSO problem.
>> Maybe that community can assist.
>>
>>
>> p
>>
>>
>>> Regards
>>>
>>>
>>>
>>> vramanaj wrote:
>>>>
>>>> Resolved AuthenticationFailureException issue. This is coming because i
>>>> have used basic-authentication scheme. If basic-authentication scheme
>>>> used, we need remove hasAlgorithm and hasEnconding properties in
>>>> josso-gateway-auth.xml file.
>>>>
>>>> Now Josso session id is getting created. But getting the below error
>>>> while
>>>> trying to access the application:
>>>>
>>>> java.lang.RuntimeException: Outbound relaying failed. No Principal
>>>> found.
>>>> Verify your SSO Agent Configuration!
>>>> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
>>>>
>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>>
>>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>>>
>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>> 	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>>> 	java.lang.Thread.run(Thread.java:619)
>>>>
>>>> Tomcat log shows:
>>>>
>>>> Dec 1, 2009 8:51:55 AM
>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
>>>> createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
>>>> Dec 1, 2009 8:51:55 AM
>>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
>>>> authenticationSuccess=success -
>>>> authScheme=basic-authentication,ssoSessionId=E
>>>> F9E9AFEDD935C7366BCA259DCC85577
>>>> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm authenticate
>>>> WARNING: Login exception authenticating username "null"
>>>> javax.security.auth.login.LoginException: Login Failure: all modules
>>>> ignored
>>>>           at
>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>>>>           at
>>>> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>>>>           at
>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>>>>           at java.security.AccessController.doPrivileged(Native Method)
>>>>           at
>>>> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>>>>           at
>>>> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>>>>           at
>>>> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>>>>           at
>>>> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>>>>           at
>>>> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>>>>           at
>>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>>>>           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)
>>>>
>>>>
>>>>
>>>>
>>>> vramanaj wrote:
>>>>>
>>>>> User name and password are correct only.
>>>>>
>>>>>
>>>>> Pid Ster wrote:
>>>>>>
>>>>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>>>>
>>>>>>> I have passed through this DataSource look up problem. I altered
>>>>>>> context.xml/web.xml of josso webapp. And also used short JNDI names
>>>>>>> at
>>>>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI
>>>>>>> name
>>>>>>> at Josso configuration level (e.g.
>>>>>>> java:comp/env/jdbc/DefaultDS).
>>>>>>>
>>>>>>> Now when i try to access the application, getting the error Invalid
>>>>>>> Authentication Information.
>>>>>>>
>>>>>>> Tomcat log shows as:
>>>>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>>>>> authenticationFailed=failure -
>>>>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>>>>> ication -
>>>>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>>>>>
>>>>>> I guess the user or password information is wrong then.
>>>>>> This would be a JOSSO problem, presumably...
>>>>>>
>>>>>>
>>>>>> p
>>>>>>
>>>>>>
>>>>>>> -----------------------------------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> vramanaj wrote:
>>>>>>>>
>>>>>>>> Added context.xml in META-INF directory. And also added resurce-ref
>>>>>>>> in
>>>>>>>> josso webapp. Still getting the same error.
>>>>>>>>
>>>>>>>>
>>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>>
>>>>>>>>> vramanaj wrote:
>>>>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>>>>
>>>>>>>>>> <Context path="/partnerapp"
>>>>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>>>>             debug="99" reloadable="true" antiJARLocking="true"
>>>>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>>>>> type="javax.sql.DataSource"/>
>>>>>>>>>> </Context>
>>>>>>>>>>
>>>>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>>>>
>>>>>>>>> Stacktraces you have posted originate from josso webapp, not from
>>>>>>>>> test
>>>>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
The problem is https. For rememberMe in Josso, the site should be in ssl.  I
configured ssl in tomcat. Now i am getting the following error. I have
installed the cert. in IE. Please help me if there are tomcat settings
required for ssl. 

15 Dec 2009 06:14:38,992 DEBUG Error getting client certs
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
	at
com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
	at
org.apache.tomcat.util.net.jsse.JSSESupport.getX509Certificates(JSSESupport.java:87)
	at
org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:141)
	at
org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1012)
	at org.apache.coyote.Request.action(Request.java:352)
	at org.apache.catalina.connector.Request.getAttribute(Request.java:896)
	at
org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263)
	at
org.josso.gateway.signon.LoginSelectorAction.execute(LoginSelectorAction.java:67)
	at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
	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)
15 Dec 2009 06:14:38,992 DEBUG Looking for cookie: JOSSO_REMEMBERME_josso
15 Dec 2009 06:14:38,992 DEBUG RemembermeCookie NOT found!




Pid Ster wrote:
> 
> On 14/12/2009 12:55, vramanaj wrote:
>>
>> Hi,
>>
>> I am through with the Josso configuration. Could be able to see the sso
>> logon page, redirecting the authenticated username to the partner
>> application. Facing problem with rememberMe option. Second time when i
>> try
>> to logon to the application, logon page is showing up again. I set
>> 'rememberMeEnabled' to true in josso. For rememberMe in sso, i read that
>> we
>> need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
>> getting created. Still are there any configurations we need to do in
>> tomcat
>> ?
> 
> No idea, but it sounds like a JOSSO problem.
> Maybe that community can assist.
> 
> 
> p
> 
> 
>> Regards
>>
>>
>>
>> vramanaj wrote:
>>>
>>> Resolved AuthenticationFailureException issue. This is coming because i
>>> have used basic-authentication scheme. If basic-authentication scheme
>>> used, we need remove hasAlgorithm and hasEnconding properties in
>>> josso-gateway-auth.xml file.
>>>
>>> Now Josso session id is getting created. But getting the below error
>>> while
>>> trying to access the application:
>>>
>>> java.lang.RuntimeException: Outbound relaying failed. No Principal
>>> found.
>>> Verify your SSO Agent Configuration!
>>> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
>>>
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>>
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>> 	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>> 	java.lang.Thread.run(Thread.java:619)
>>>
>>> Tomcat log shows:
>>>
>>> Dec 1, 2009 8:51:55 AM
>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
>>> createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
>>> Dec 1, 2009 8:51:55 AM
>>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
>>> authenticationSuccess=success -
>>> authScheme=basic-authentication,ssoSessionId=E
>>> F9E9AFEDD935C7366BCA259DCC85577
>>> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm authenticate
>>> WARNING: Login exception authenticating username "null"
>>> javax.security.auth.login.LoginException: Login Failure: all modules
>>> ignored
>>>          at
>>> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>>>          at
>>> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>>>          at
>>> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>>>          at java.security.AccessController.doPrivileged(Native Method)
>>>          at
>>> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>>>          at
>>> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>>>          at
>>> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>>>          at
>>> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>>>          at
>>> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>>>          at
>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>>>          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)
>>>
>>>
>>>
>>>
>>> vramanaj wrote:
>>>>
>>>> User name and password are correct only.
>>>>
>>>>
>>>> Pid Ster wrote:
>>>>>
>>>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>>>
>>>>>> I have passed through this DataSource look up problem. I altered
>>>>>> context.xml/web.xml of josso webapp. And also used short JNDI names
>>>>>> at
>>>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI
>>>>>> name
>>>>>> at Josso configuration level (e.g.
>>>>>> java:comp/env/jdbc/DefaultDS).
>>>>>>
>>>>>> Now when i try to access the application, getting the error Invalid
>>>>>> Authentication Information.
>>>>>>
>>>>>> Tomcat log shows as:
>>>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>>>> authenticationFailed=failure -
>>>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>>>> ication -
>>>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>>>>
>>>>> I guess the user or password information is wrong then.
>>>>> This would be a JOSSO problem, presumably...
>>>>>
>>>>>
>>>>> p
>>>>>
>>>>>
>>>>>> -----------------------------------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>> vramanaj wrote:
>>>>>>>
>>>>>>> Added context.xml in META-INF directory. And also added resurce-ref
>>>>>>> in
>>>>>>> josso webapp. Still getting the same error.
>>>>>>>
>>>>>>>
>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>
>>>>>>>> vramanaj wrote:
>>>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>>>
>>>>>>>>> <Context path="/partnerapp"
>>>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>>>            debug="99" reloadable="true" antiJARLocking="true"
>>>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>>>> type="javax.sql.DataSource"/>
>>>>>>>>> </Context>
>>>>>>>>>
>>>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>>>
>>>>>>>> Stacktraces you have posted originate from josso webapp, not from
>>>>>>>> test
>>>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26793293.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 14/12/2009 12:55, vramanaj wrote:
>
> Hi,
>
> I am through with the Josso configuration. Could be able to see the sso
> logon page, redirecting the authenticated username to the partner
> application. Facing problem with rememberMe option. Second time when i try
> to logon to the application, logon page is showing up again. I set
> 'rememberMeEnabled' to true in josso. For rememberMe in sso, i read that we
> need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
> getting created. Still are there any configurations we need to do in tomcat
> ?

No idea, but it sounds like a JOSSO problem.
Maybe that community can assist.


p


> Regards
>
>
>
> vramanaj wrote:
>>
>> Resolved AuthenticationFailureException issue. This is coming because i
>> have used basic-authentication scheme. If basic-authentication scheme
>> used, we need remove hasAlgorithm and hasEnconding properties in
>> josso-gateway-auth.xml file.
>>
>> Now Josso session id is getting created. But getting the below error while
>> trying to access the application:
>>
>> java.lang.RuntimeException: Outbound relaying failed. No Principal found.
>> Verify your SSO Agent Configuration!
>> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
>>
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>> 	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>> 	java.lang.Thread.run(Thread.java:619)
>>
>> Tomcat log shows:
>>
>> Dec 1, 2009 8:51:55 AM
>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
>> createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
>> Dec 1, 2009 8:51:55 AM
>> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
>> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
>> authenticationSuccess=success -
>> authScheme=basic-authentication,ssoSessionId=E
>> F9E9AFEDD935C7366BCA259DCC85577
>> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm authenticate
>> WARNING: Login exception authenticating username "null"
>> javax.security.auth.login.LoginException: Login Failure: all modules
>> ignored
>>          at
>> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>>          at
>> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>>          at
>> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>>          at java.security.AccessController.doPrivileged(Native Method)
>>          at
>> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>>          at
>> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>>          at
>> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>>          at
>> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>>          at
>> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>>          at
>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>>          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)
>>
>>
>>
>>
>> vramanaj wrote:
>>>
>>> User name and password are correct only.
>>>
>>>
>>> Pid Ster wrote:
>>>>
>>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>>
>>>>> I have passed through this DataSource look up problem. I altered
>>>>> context.xml/web.xml of josso webapp. And also used short JNDI names at
>>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI
>>>>> name
>>>>> at Josso configuration level (e.g.
>>>>> java:comp/env/jdbc/DefaultDS).
>>>>>
>>>>> Now when i try to access the application, getting the error Invalid
>>>>> Authentication Information.
>>>>>
>>>>> Tomcat log shows as:
>>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>>> authenticationFailed=failure -
>>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>>> ication -
>>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>>>
>>>> I guess the user or password information is wrong then.
>>>> This would be a JOSSO problem, presumably...
>>>>
>>>>
>>>> p
>>>>
>>>>
>>>>> -----------------------------------------------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>> vramanaj wrote:
>>>>>>
>>>>>> Added context.xml in META-INF directory. And also added resurce-ref in
>>>>>> josso webapp. Still getting the same error.
>>>>>>
>>>>>>
>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>
>>>>>>> vramanaj wrote:
>>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>>
>>>>>>>> <Context path="/partnerapp"
>>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>>            debug="99" reloadable="true" antiJARLocking="true"
>>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>>> type="javax.sql.DataSource"/>
>>>>>>>> </Context>
>>>>>>>>
>>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>>
>>>>>>> Stacktraces you have posted originate from josso webapp, not from
>>>>>>> test
>>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>>
>>>>>>> --
>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Hi,

I am through with the Josso configuration. Could be able to see the sso
logon page, redirecting the authenticated username to the partner
application. Facing problem with rememberMe option. Second time when i try
to logon to the application, logon page is showing up again. I set
'rememberMeEnabled' to true in josso. For rememberMe in sso, i read that we
need to set tomcat ssl enabled. I did that. JOSSO_REMEMBERME_josso is
getting created. Still are there any configurations we need to do in tomcat
?

Regards



vramanaj wrote:
> 
> Resolved AuthenticationFailureException issue. This is coming because i
> have used basic-authentication scheme. If basic-authentication scheme
> used, we need remove hasAlgorithm and hasEnconding properties in
> josso-gateway-auth.xml file.
> 
> Now Josso session id is getting created. But getting the below error while
> trying to access the application:
> 
> java.lang.RuntimeException: Outbound relaying failed. No Principal found.
> Verify your SSO Agent Configuration!
> 	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
> 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
> 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> 	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> 	java.lang.Thread.run(Thread.java:619)
> 
> Tomcat log shows:
> 
> Dec 1, 2009 8:51:55 AM
> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
> createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
> Dec 1, 2009 8:51:55 AM
> org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
> INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
> authenticationSuccess=success -
> authScheme=basic-authentication,ssoSessionId=E
> F9E9AFEDD935C7366BCA259DCC85577
> Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm authenticate
> WARNING: Login exception authenticating username "null"
> javax.security.auth.login.LoginException: Login Failure: all modules
> ignored
>         at
> javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
>         at
> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>         at
> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>         at
> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>         at
> org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
>         at
> org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
>         at
> org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
>         at
> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
>         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)
> 
> 
> 
> 
> vramanaj wrote:
>> 
>> User name and password are correct only.
>> 
>> 
>> Pid Ster wrote:
>>> 
>>> On 01/12/2009 12:37, vramanaj wrote:
>>>>
>>>> I have passed through this DataSource look up problem. I altered
>>>> context.xml/web.xml of josso webapp. And also used short JNDI names at
>>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI
>>>> name
>>>> at Josso configuration level (e.g.
>>>> java:comp/env/jdbc/DefaultDS).
>>>>
>>>> Now when i try to access the application, getting the error Invalid
>>>> Authentication Information.
>>>>
>>>> Tomcat log shows as:
>>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>>> authenticationFailed=failure -
>>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>>> ication -
>>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>>> 
>>> I guess the user or password information is wrong then.
>>> This would be a JOSSO problem, presumably...
>>> 
>>> 
>>> p
>>> 
>>> 
>>>> -----------------------------------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> vramanaj wrote:
>>>>>
>>>>> Added context.xml in META-INF directory. And also added resurce-ref in
>>>>> josso webapp. Still getting the same error.
>>>>>
>>>>>
>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>
>>>>>> vramanaj wrote:
>>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>>> Catalina/localhost/webapp.xml.
>>>>>>>
>>>>>>> <Context path="/partnerapp"
>>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>>           debug="99" reloadable="true" antiJARLocking="true"
>>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>>> type="javax.sql.DataSource"/>
>>>>>>> </Context>
>>>>>>>
>>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>>
>>>>>> Stacktraces you have posted originate from josso webapp, not from
>>>>>> test
>>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>>
>>>>>> --
>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26777280.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Resolved AuthenticationFailureException issue. This is coming because i have
used basic-authentication scheme. If basic-authentication scheme used, we
need remove hasAlgorithm and hasEnconding properties in
josso-gateway-auth.xml file.

Now Josso session id is getting created. But getting the below error while
trying to access the application:

java.lang.RuntimeException: Outbound relaying failed. No Principal found.
Verify your SSO Agent Configuration!
	org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:502)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	java.lang.Thread.run(Thread.java:619)

Tomcat log shows:

Dec 1, 2009 8:51:55 AM
org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
INFO: Tue Dec 01 08:51:55 EST 2009 - sso-session - info - vjosyula -
createSession=success - ssoSessionId=EF9E9AFEDD935C7366BCA259DCC85577
Dec 1, 2009 8:51:55 AM
org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler handle
INFO: Tue Dec 01 08:51:55 EST 2009 - sso-user - info - vjosyula -
authenticationSuccess=success -
authScheme=basic-authentication,ssoSessionId=E
F9E9AFEDD935C7366BCA259DCC85577
Dec 1, 2009 8:51:56 AM org.apache.catalina.realm.JAASRealm authenticate
WARNING: Login exception authenticating username "null"
javax.security.auth.login.LoginException: Login Failure: all modules ignored
        at
javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
        at
javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
        at
javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
        at java.security.AccessController.doPrivileged(Native Method)
        at
javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
        at
javax.security.auth.login.LoginContext.login(LoginContext.java:579)
        at
org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:363)
        at
org.josso.tc60.agent.CatalinaSSOAgent.authenticate(CatalinaSSOAgent.java:95)
        at
org.josso.agent.AbstractSSOAgent.processRequest(AbstractSSOAgent.java:335)
        at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:496)
        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)




vramanaj wrote:
> 
> User name and password are correct only.
> 
> 
> Pid Ster wrote:
>> 
>> On 01/12/2009 12:37, vramanaj wrote:
>>>
>>> I have passed through this DataSource look up problem. I altered
>>> context.xml/web.xml of josso webapp. And also used short JNDI names at
>>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI
>>> name
>>> at Josso configuration level (e.g.
>>> java:comp/env/jdbc/DefaultDS).
>>>
>>> Now when i try to access the application, getting the error Invalid
>>> Authentication Information.
>>>
>>> Tomcat log shows as:
>>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>>> authenticationFailed=failure -
>>> remoteHost=10.104.9.33,authScheme=basic-authent
>>> ication -
>>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
>> 
>> I guess the user or password information is wrong then.
>> This would be a JOSSO problem, presumably...
>> 
>> 
>> p
>> 
>> 
>>> -----------------------------------------------------------------------------------------------------
>>>
>>>
>>>
>>> vramanaj wrote:
>>>>
>>>> Added context.xml in META-INF directory. And also added resurce-ref in
>>>> josso webapp. Still getting the same error.
>>>>
>>>>
>>>> Mikolaj Rydzewski-2 wrote:
>>>>>
>>>>> vramanaj wrote:
>>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>>> Catalina/localhost/webapp.xml.
>>>>>>
>>>>>> <Context path="/partnerapp"
>>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>>           debug="99" reloadable="true" antiJARLocking="true"
>>>>>> antiResourceLocking="false" crossContext="true">
>>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>>> type="javax.sql.DataSource"/>
>>>>>> </Context>
>>>>>>
>>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>>
>>>>> Stacktraces you have posted originate from josso webapp, not from test
>>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>>
>>>>> --
>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26592407.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
User name and password are correct only.


Pid Ster wrote:
> 
> On 01/12/2009 12:37, vramanaj wrote:
>>
>> I have passed through this DataSource look up problem. I altered
>> context.xml/web.xml of josso webapp. And also used short JNDI names at
>> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI
>> name
>> at Josso configuration level (e.g.
>> java:comp/env/jdbc/DefaultDS).
>>
>> Now when i try to access the application, getting the error Invalid
>> Authentication Information.
>>
>> Tomcat log shows as:
>> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
>> authenticationFailed=failure -
>> remoteHost=10.104.9.33,authScheme=basic-authent
>> ication -
>> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException
> 
> I guess the user or password information is wrong then.
> This would be a JOSSO problem, presumably...
> 
> 
> p
> 
> 
>> -----------------------------------------------------------------------------------------------------
>>
>>
>>
>> vramanaj wrote:
>>>
>>> Added context.xml in META-INF directory. And also added resurce-ref in
>>> josso webapp. Still getting the same error.
>>>
>>>
>>> Mikolaj Rydzewski-2 wrote:
>>>>
>>>> vramanaj wrote:
>>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>>> Catalina/localhost/webapp.xml.
>>>>>
>>>>> <Context path="/partnerapp"
>>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>>           debug="99" reloadable="true" antiJARLocking="true"
>>>>> antiResourceLocking="false" crossContext="true">
>>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>>> type="javax.sql.DataSource"/>
>>>>> </Context>
>>>>>
>>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>>
>>>> Stacktraces you have posted originate from josso webapp, not from test
>>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>>
>>>> --
>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26591302.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 01/12/2009 12:37, vramanaj wrote:
>
> I have passed through this DataSource look up problem. I altered
> context.xml/web.xml of josso webapp. And also used short JNDI names at
> tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI name
> at Josso configuration level (e.g.
> java:comp/env/jdbc/DefaultDS).
>
> Now when i try to access the application, getting the error Invalid
> Authentication Information.
>
> Tomcat log shows as:
> INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
> authenticationFailed=failure -
> remoteHost=10.104.9.33,authScheme=basic-authent
> ication -
> ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException

I guess the user or password information is wrong then.
This would be a JOSSO problem, presumably...


p


> -----------------------------------------------------------------------------------------------------
>
>
>
> vramanaj wrote:
>>
>> Added context.xml in META-INF directory. And also added resurce-ref in
>> josso webapp. Still getting the same error.
>>
>>
>> Mikolaj Rydzewski-2 wrote:
>>>
>>> vramanaj wrote:
>>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>>> Catalina/localhost/webapp.xml.
>>>>
>>>> <Context path="/partnerapp"
>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>           debug="99" reloadable="true" antiJARLocking="true"
>>>> antiResourceLocking="false" crossContext="true">
>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>> type="javax.sql.DataSource"/>
>>>> </Context>
>>>>
>>>> And also added resource-ref to WEB-INF/web.xml.
>>>>
>>> Stacktraces you have posted originate from josso webapp, not from test
>>> app. You need to alter context.xml / web.xml of josso webapp.
>>>
>>> --
>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
I have passed through this DataSource look up problem. I altered
context.xml/web.xml of josso webapp. And also used short JNDI names at
tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), and full JNDI name
at Josso configuration level (e.g. 
java:comp/env/jdbc/DefaultDS). 

Now when i try to access the application, getting the error Invalid
Authentication Information.

Tomcat log shows as:
INFO: Tue Dec 01 07:31:45 EST 2009 - sso-user - info - vjosyula -
authenticationFailed=failure -
remoteHost=10.104.9.33,authScheme=basic-authent
ication -
ERROR:vjosyula:org.josso.auth.exceptions.AuthenticationFailureException

-----------------------------------------------------------------------------------------------------



vramanaj wrote:
> 
> Added context.xml in META-INF directory. And also added resurce-ref in
> josso webapp. Still getting the same error.
> 
> 
> Mikolaj Rydzewski-2 wrote:
>> 
>> vramanaj wrote:
>>> I have used jdbc/DefaultDS. Added ResourceLink to
>>> Catalina/localhost/webapp.xml.
>>>
>>> <Context path="/partnerapp"
>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>          debug="99" reloadable="true" antiJARLocking="true"
>>> antiResourceLocking="false" crossContext="true">
>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>> type="javax.sql.DataSource"/>
>>> </Context>
>>>
>>> And also added resource-ref to WEB-INF/web.xml.
>>>   
>> Stacktraces you have posted originate from josso webapp, not from test 
>> app. You need to alter context.xml / web.xml of josso webapp.
>> 
>> -- 
>> Mikolaj Rydzewski <mi...@ceti.pl>
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26591040.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Added context.xml in META-INF directory. And also added resurce-ref in josso
webapp. Still getting the same error.


Mikolaj Rydzewski-2 wrote:
> 
> vramanaj wrote:
>> I have used jdbc/DefaultDS. Added ResourceLink to
>> Catalina/localhost/webapp.xml.
>>
>> <Context path="/partnerapp"
>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>          debug="99" reloadable="true" antiJARLocking="true"
>> antiResourceLocking="false" crossContext="true">
>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>> type="javax.sql.DataSource"/>
>> </Context>
>>
>> And also added resource-ref to WEB-INF/web.xml.
>>   
> Stacktraces you have posted originate from josso webapp, not from test 
> app. You need to alter context.xml / web.xml of josso webapp.
> 
> -- 
> Mikolaj Rydzewski <mi...@ceti.pl>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26590651.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
vramanaj wrote:
> I have used jdbc/DefaultDS. Added ResourceLink to
> Catalina/localhost/webapp.xml.
>
> <Context path="/partnerapp"
> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>          debug="99" reloadable="true" antiJARLocking="true"
> antiResourceLocking="false" crossContext="true">
> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
> type="javax.sql.DataSource"/>
> </Context>
>
> And also added resource-ref to WEB-INF/web.xml.
>   
Stacktraces you have posted originate from josso webapp, not from test 
app. You need to alter context.xml / web.xml of josso webapp.

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
I have used jdbc/DefaultDS. Added ResourceLink to
Catalina/localhost/webapp.xml.

<Context path="/partnerapp"
docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
         debug="99" reloadable="true" antiJARLocking="true"
antiResourceLocking="false" crossContext="true">
<ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
type="javax.sql.DataSource"/>
</Context>

And also added resource-ref to WEB-INF/web.xml.
---------------------------------------------------------------------


Mikolaj Rydzewski-2 wrote:
> 
> vramanaj wrote:
>> 1. Defined DataSource within GlobalNamingResources
>>            <Resource name="/DefaultDS"
>>   
> As already mentioned here, you should rather use jdbc/DefaultDS.
>>>     * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>       META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>     
> Did you miss this step? Since /josso webapp performs all magick with 
> usernames/passwords you need to allow it to access JNDI related
> information.
> 
> -- 
> Mikolaj Rydzewski <mi...@ceti.pl>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26590277.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
vramanaj wrote:
> 1. Defined DataSource within GlobalNamingResources
>            <Resource name="/DefaultDS"
>   
As already mentioned here, you should rather use jdbc/DefaultDS.
>>     * add JNDI support to josso webapp (e.g. and ResourceLink to
>>       META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>     
Did you miss this step? Since /josso webapp performs all magick with 
usernames/passwords you need to allow it to access JNDI related information.

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
No, DataSource is working fine now. Thank yoy very much for all of your
support in resolving that problem. 
New issue has come in configuring the authentication scheme. 



Pid Ster wrote:
> 
> On 01/12/2009 11:41, vramanaj wrote:
>>
>> I have removed path and docbase from webapp.xml file. I have tried the db
>> connection from a servlet as below. I have gone through the josso source
>> codes. It is failing at below getDataSource function.
>>
>>      protected DataSource getDataSource() throws SSOIdentityException {
>>
>>          if (_datasource == null) {
>>
>>              try {
>>
>>                  if (logger.isDebugEnabled())
>> logger.debug("[getDatasource()
>> : ]" + _dsJndiName);
>>
>>                  InitialContext ic = new InitialContext();
>>                  _datasource = (DataSource) ic.lookup(_dsJndiName);
>>
>>              } catch (NamingException ne) {
>>                  logger.error("Error during DB connection lookup", ne);
>>                  throw new SSOIdentityException(
>>                          "Error During Lookup\n" + ne.getMessage());
>>              }
>>
>>          }
>>
>>          return _datasource;
>>      }
> 
> So, you are confirming that the DataSource isn't working?
> 
> p
> 
> 
>> Pid Ster wrote:
>>>
>>> On 01/12/2009 10:36, vramanaj wrote:
>>>>
>>>> Full Stack Trace:
>>>> Dec 1, 2009 1:46:58 AM
>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>>> getDataSource
>>>> SEVERE: Error during DB connection lookup
>>>> javax.naming.NameNotFoundException: Name jdbc is not bound in this
>>>> Context
>>>>           at
>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>>           at
>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>>           at
>>>> org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
>>>>           at
>>>> javax.naming.InitialContext.lookup(InitialContext.java:392)
>>>>           at
>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDataSource(DataSourceIdentityStore.java:85)
>>>>           at
>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDBConnection(DataSourceIdentityStore.java:105)
>>>>           at
>>>> org.josso.gateway.identity.service.store.db.AbstractDBIdentityStore.loadCredentials(AbstractDBIdentityStore.java:125)
>>>>           at
>>>> org.josso.auth.scheme.AbstractAuthenticationScheme.getKnownCredentials(AbstractAuthenticationScheme.java:166)
>>>>           at
>>>> org.josso.auth.scheme.UsernamePasswordAuthScheme.authenticate(UsernamePasswordAuthScheme.java:160)
>>>>           at
>>>> org.josso.auth.AuthenticatorImpl.check(AuthenticatorImpl.java:69)
>>>>           at
>>>> org.josso.gateway.identity.service.SSOIdentityProviderImpl.login(SSOIdentityProviderImpl.java:201)
>>>>           at
>>>> org.josso.gateway.identity.service.SSOIdentityProviderImpl.assertIdentity(SSOIdentityProviderImpl.java:274)
>>>>           at
>>>> org.josso.gateway.SSOGatewayImpl.assertIdentity(SSOGatewayImpl.java:332)
>>>>           at
>>>> org.josso.gateway.signon.LoginAction.login(LoginAction.java:144)
>>>>           at
>>>> org.josso.gateway.signon.LoginAction.execute(LoginAction.java:86)
>>>>           at
>>>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>>>>           at
>>>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>>>>           at
>>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>>>>           at
>>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>>>>           at
>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>>>>           at
>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>>>           at
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>>           at
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>>           at
>>>> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>>>>           at
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>>           at
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>>           at
>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>>           at
>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>>>           at
>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>>           at
>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>>           at
>>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>>>>           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)
>>>> ------------------------------------------------------------------------------------------------------
>>>> /apache-tomcat-6.0.18-sso/conf/Catalina/localhost/partnerapp.xml:
>>>>
>>>> <Context path="/partnerapp"
>>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>>            debug="99" reloadable="true" antiJARLocking="true"
>>>
>>> path is not legal here, and docBase is not necessary if the path to
>>> tomcat is the same for conf and webapps.
>>>
>>>
>>> Can you make a normal connection to the Db within a servlet, or does it
>>> throw an exception?
>>>
>>>    Context context = new InitialContext();
>>>    context  = (Context) context.lookup("java:/comp/env");
>>>    DataSource ds = (DataSource) context.lookup("jdbc/DefaultDS");
>>>    Connection conn = ds.getConnection();
>>>
>>>
>>> p
>>>
>>>
>>>> antiResourceLocking="false" crossContext="true">
>>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>>> type="javax.sql.DataSource"/>
>>>> </Context>
>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>
>>>>
>>>> Pid Ster wrote:
>>>>>
>>>>> On 01/12/2009 05:13, vramanaj wrote:
>>>>>>
>>>>>> Still getting the same error after changing Data Source name to
>>>>>> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>>>>>>
>>>>>>             Error : Error During Lookup Name jdbc is not bound in
>>>>>> this
>>>>>> Context
>>>>>
>>>>> What is the full stack trace?
>>>>>
>>>>> Are you adding it to tomcat/conf/webapp.xml or to the
>>>>> META-INF/context.xml?  Check that Tomcat isn't overwriting the former,
>>>>> with the latter during startup or app reload cycles.
>>>>>
>>>>>> Are there any extra customizations required for Josso+Tomcat6?
>>>>>
>>>>> Tomcat doesn't know what JOSSO is.
>>>>>
>>>>> Can you write a sample servlet that gets a connection from the
>>>>> DataSource you've defined?  Maybe we can see if there's a problem with
>>>>> the definition, or if it's JOSSO that can't see the DS.
>>>>>
>>>>>
>>>>> p
>>>>>
>>>>>
>>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>
>>>>>> Pid Ster wrote:
>>>>>>>
>>>>>>> On 30/11/2009 13:46, vramanaj wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am facing problem with configuring JNDI DataSources for Josso
>>>>>>>> project
>>>>>>>> in
>>>>>>>> Tomcat 6. Getting the following errors in tomcat log when i am
>>>>>>>> trying
>>>>>>>> to
>>>>>>>> access the application. Defined resource in
>>>>>>>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>>>>>>>> application's
>>>>>>>> web.xml.
>>>>>>>>
>>>>>>>> Nov 30, 2009 7:48:52 AM
>>>>>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>>>>>>> getDataSource
>>>>>>>> SEVERE: Error during DB connection lookup
>>>>>>>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in
>>>>>>>> this
>>>>>>>> Context
>>>>>>>>            at
>>>>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>>>>>>            at
>>>>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>>>>>>
>>>>>>>> Steps Followed:
>>>>>>>> 1. Defined DataSource within GlobalNamingResources
>>>>>>>>                <Resource name="/DefaultDS"
>>>>>>>
>>>>>>> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start
>>>>>>> the
>>>>>>> name with a / character.
>>>>>>>
>>>>>>>>                auth="Container"
>>>>>>>>                type="javax.sql.DataSource"
>>>>>>>>                description="SSO DataSource"
>>>>>>>>                username="josso"
>>>>>>>>                password="josso"
>>>>>>>>                driverClassName="oracle.jdbc.OracleDriver"
>>>>>>>>                url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>>>>
>>>>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>>>>                maxActive="8"
>>>>>>>>                maxIdle="4"/>
>>>>>>>>
>>>>>>>> 2. Added res-reference in web.xml
>>>>>>>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
>>>>>>>
>>>>>>> If you've defined it in the global resources, you don't need to
>>>>>>> redefine
>>>>>>> it here, just use:
>>>>>>>
>>>>>>>       <ResourceLink
>>>>>>>         global="jdbc/DefaultDS"
>>>>>>>         name="jdbc/DefaultDS"
>>>>>>>         type="javax.sql.DataSource"/>
>>>>>>>
>>>>>>>
>>>>>>> p
>>>>>>>
>>>>>>>>                <Resource name="/DefaultDS"
>>>>>>>>                auth="Container"
>>>>>>>>                type="javax.sql.DataSource"
>>>>>>>>                description="SSO DataSource"
>>>>>>>>                username="josso"
>>>>>>>>                password="josso"
>>>>>>>>                driverClassName="oracle.jdbc.OracleDriver"
>>>>>>>>                url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>>>>
>>>>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>>>>                maxActive="8"
>>>>>>>>                maxIdle="4"/>
>>>>>>>>
>>>>>>>> 4. In josso-gateway-db-stores.xml
>>>>>>>>        <db-istore:datasource-store id="josso-identity-store"
>>>>>>>>                          dsJndiName="java:comp/env/DefaultDS"
>>>>>>>>                          userQueryString="SELECT NAME FROM
>>>>>>>> JOSSO_USER
>>>>>>>> WHERE
>>>>>>>> LOGIN = ?"
>>>>>>>>                          rolesQueryString="SELECT ROLE FROM
>>>>>>>> JOSSO_USER_ROLE
>>>>>>>> WHERE LOGIN = ?;"
>>>>>>>>                          credentialsQueryString="SELECT LOGIN AS
>>>>>>>> USERNAME,
>>>>>>>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>>>>>>>                          userPropertiesQueryString="SELECT NAME,
>>>>>>>> VALUE
>>>>>>>> FROM
>>>>>>>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>>>>>>>                          resetCredentialDml="UPDATE JOSSO_USER SET
>>>>>>>> PASSWORD
>>>>>>>> = ?
>>>>>>>> WHERE LOGIN = ?"
>>>>>>>>                          relayCredentialQueryString="SELECT LOGIN
>>>>>>>> FROM
>>>>>>>> JOSSO_USER WHERE #?# = ?" />
>>>>>>>>
>>>>>>>> 5. When i try to access the example partner application (/partner),
>>>>>>>> getting
>>>>>>>> the following error:
>>>>>>>>                Error : Error During Lookup Name DefaultDS is not
>>>>>>>> bound
>>>>>>>> in
>>>>>>>> this
>>>>>>>> Context
>>>>>>>>
>>>>>>>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>>>>>>>
>>>>>>>> Please help me out to proceed further. Quick response is highly
>>>>>>>> appreciable.
>>>>>>>>
>>>>>>>> Thanks in Advance.
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>>
>>>>>>>>> Mikolaj Rydzewski wrote:
>>>>>>>>>> Now, I want to setup Josso single sign on system (www.josso.org)
>>>>>>>>>> and
>>>>>>>>>> force it to use JNDI DataSources as well. With no luck.
>>>>>>>>> Here's the solution for anyone interested (addition to typical
>>>>>>>>> josso
>>>>>>>>> setup):
>>>>>>>>>
>>>>>>>>>         * define DataSource within GlobalNamingResources (e.g.
>>>>>>>>> jdbc/users)
>>>>>>>>>         * add JNDI support to josso webapp (e.g. and ResourceLink
>>>>>>>>> to
>>>>>>>>>           META-INF/context.xml and resource-ref to
>>>>>>>>> WEB-INF/web.xml)
>>>>>>>>>         * reference DataSource from josso-gateway-config.xml using
>>>>>>>>>           java:comp/env/jdbc/users as its JNDI name
>>>>>>>>>
>>>>>>>>> Enjoy ;-)
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Quoted from:
>>>>>>>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>>>>>>>
>>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>>
>>>>>>>>> Christopher Schultz wrote:
>>>>>>>>>>>        * add JNDI support to josso webapp (e.g. and ResourceLink
>>>>>>>>>>> to
>>>>>>>>>>>          META-INF/context.xml and resource-ref to
>>>>>>>>>>> WEB-INF/web.xml)
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Note that this is not required for Realms. See
>>>>>>>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>>>>>>>
>>>>>>>>> I'm exposing DataSource to josso webapp, not the Realm. So I need
>>>>>>>>> this.
>>>>>>>>> Lack of such configuration was causing my initial problems.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26591124.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 01/12/2009 11:41, vramanaj wrote:
>
> I have removed path and docbase from webapp.xml file. I have tried the db
> connection from a servlet as below. I have gone through the josso source
> codes. It is failing at below getDataSource function.
>
>      protected DataSource getDataSource() throws SSOIdentityException {
>
>          if (_datasource == null) {
>
>              try {
>
>                  if (logger.isDebugEnabled()) logger.debug("[getDatasource()
> : ]" + _dsJndiName);
>
>                  InitialContext ic = new InitialContext();
>                  _datasource = (DataSource) ic.lookup(_dsJndiName);
>
>              } catch (NamingException ne) {
>                  logger.error("Error during DB connection lookup", ne);
>                  throw new SSOIdentityException(
>                          "Error During Lookup\n" + ne.getMessage());
>              }
>
>          }
>
>          return _datasource;
>      }

So, you are confirming that the DataSource isn't working?

p


> Pid Ster wrote:
>>
>> On 01/12/2009 10:36, vramanaj wrote:
>>>
>>> Full Stack Trace:
>>> Dec 1, 2009 1:46:58 AM
>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>> getDataSource
>>> SEVERE: Error during DB connection lookup
>>> javax.naming.NameNotFoundException: Name jdbc is not bound in this
>>> Context
>>>           at
>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>           at
>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>           at
>>> org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
>>>           at javax.naming.InitialContext.lookup(InitialContext.java:392)
>>>           at
>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDataSource(DataSourceIdentityStore.java:85)
>>>           at
>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDBConnection(DataSourceIdentityStore.java:105)
>>>           at
>>> org.josso.gateway.identity.service.store.db.AbstractDBIdentityStore.loadCredentials(AbstractDBIdentityStore.java:125)
>>>           at
>>> org.josso.auth.scheme.AbstractAuthenticationScheme.getKnownCredentials(AbstractAuthenticationScheme.java:166)
>>>           at
>>> org.josso.auth.scheme.UsernamePasswordAuthScheme.authenticate(UsernamePasswordAuthScheme.java:160)
>>>           at
>>> org.josso.auth.AuthenticatorImpl.check(AuthenticatorImpl.java:69)
>>>           at
>>> org.josso.gateway.identity.service.SSOIdentityProviderImpl.login(SSOIdentityProviderImpl.java:201)
>>>           at
>>> org.josso.gateway.identity.service.SSOIdentityProviderImpl.assertIdentity(SSOIdentityProviderImpl.java:274)
>>>           at
>>> org.josso.gateway.SSOGatewayImpl.assertIdentity(SSOGatewayImpl.java:332)
>>>           at
>>> org.josso.gateway.signon.LoginAction.login(LoginAction.java:144)
>>>           at
>>> org.josso.gateway.signon.LoginAction.execute(LoginAction.java:86)
>>>           at
>>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>>>           at
>>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>>>           at
>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>>>           at
>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>>>           at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>>>           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>>           at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>           at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>           at
>>> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>>>           at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>           at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>           at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>           at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>>           at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>           at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>           at
>>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>>>           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)
>>> ------------------------------------------------------------------------------------------------------
>>> /apache-tomcat-6.0.18-sso/conf/Catalina/localhost/partnerapp.xml:
>>>
>>> <Context path="/partnerapp"
>>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>>            debug="99" reloadable="true" antiJARLocking="true"
>>
>> path is not legal here, and docBase is not necessary if the path to
>> tomcat is the same for conf and webapps.
>>
>>
>> Can you make a normal connection to the Db within a servlet, or does it
>> throw an exception?
>>
>>    Context context = new InitialContext();
>>    context  = (Context) context.lookup("java:/comp/env");
>>    DataSource ds = (DataSource) context.lookup("jdbc/DefaultDS");
>>    Connection conn = ds.getConnection();
>>
>>
>> p
>>
>>
>>> antiResourceLocking="false" crossContext="true">
>>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>>> type="javax.sql.DataSource"/>
>>> </Context>
>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>
>>>
>>> Pid Ster wrote:
>>>>
>>>> On 01/12/2009 05:13, vramanaj wrote:
>>>>>
>>>>> Still getting the same error after changing Data Source name to
>>>>> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>>>>>
>>>>>             Error : Error During Lookup Name jdbc is not bound in this
>>>>> Context
>>>>
>>>> What is the full stack trace?
>>>>
>>>> Are you adding it to tomcat/conf/webapp.xml or to the
>>>> META-INF/context.xml?  Check that Tomcat isn't overwriting the former,
>>>> with the latter during startup or app reload cycles.
>>>>
>>>>> Are there any extra customizations required for Josso+Tomcat6?
>>>>
>>>> Tomcat doesn't know what JOSSO is.
>>>>
>>>> Can you write a sample servlet that gets a connection from the
>>>> DataSource you've defined?  Maybe we can see if there's a problem with
>>>> the definition, or if it's JOSSO that can't see the DS.
>>>>
>>>>
>>>> p
>>>>
>>>>
>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>
>>>>> Pid Ster wrote:
>>>>>>
>>>>>> On 30/11/2009 13:46, vramanaj wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am facing problem with configuring JNDI DataSources for Josso
>>>>>>> project
>>>>>>> in
>>>>>>> Tomcat 6. Getting the following errors in tomcat log when i am trying
>>>>>>> to
>>>>>>> access the application. Defined resource in
>>>>>>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>>>>>>> application's
>>>>>>> web.xml.
>>>>>>>
>>>>>>> Nov 30, 2009 7:48:52 AM
>>>>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>>>>>> getDataSource
>>>>>>> SEVERE: Error during DB connection lookup
>>>>>>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in
>>>>>>> this
>>>>>>> Context
>>>>>>>            at
>>>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>>>>>            at
>>>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>>>>>
>>>>>>> Steps Followed:
>>>>>>> 1. Defined DataSource within GlobalNamingResources
>>>>>>>                <Resource name="/DefaultDS"
>>>>>>
>>>>>> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start
>>>>>> the
>>>>>> name with a / character.
>>>>>>
>>>>>>>                auth="Container"
>>>>>>>                type="javax.sql.DataSource"
>>>>>>>                description="SSO DataSource"
>>>>>>>                username="josso"
>>>>>>>                password="josso"
>>>>>>>                driverClassName="oracle.jdbc.OracleDriver"
>>>>>>>                url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>>>
>>>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>>>                maxActive="8"
>>>>>>>                maxIdle="4"/>
>>>>>>>
>>>>>>> 2. Added res-reference in web.xml
>>>>>>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
>>>>>>
>>>>>> If you've defined it in the global resources, you don't need to
>>>>>> redefine
>>>>>> it here, just use:
>>>>>>
>>>>>>       <ResourceLink
>>>>>>         global="jdbc/DefaultDS"
>>>>>>         name="jdbc/DefaultDS"
>>>>>>         type="javax.sql.DataSource"/>
>>>>>>
>>>>>>
>>>>>> p
>>>>>>
>>>>>>>                <Resource name="/DefaultDS"
>>>>>>>                auth="Container"
>>>>>>>                type="javax.sql.DataSource"
>>>>>>>                description="SSO DataSource"
>>>>>>>                username="josso"
>>>>>>>                password="josso"
>>>>>>>                driverClassName="oracle.jdbc.OracleDriver"
>>>>>>>                url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>>>
>>>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>>>                maxActive="8"
>>>>>>>                maxIdle="4"/>
>>>>>>>
>>>>>>> 4. In josso-gateway-db-stores.xml
>>>>>>>        <db-istore:datasource-store id="josso-identity-store"
>>>>>>>                          dsJndiName="java:comp/env/DefaultDS"
>>>>>>>                          userQueryString="SELECT NAME FROM JOSSO_USER
>>>>>>> WHERE
>>>>>>> LOGIN = ?"
>>>>>>>                          rolesQueryString="SELECT ROLE FROM
>>>>>>> JOSSO_USER_ROLE
>>>>>>> WHERE LOGIN = ?;"
>>>>>>>                          credentialsQueryString="SELECT LOGIN AS
>>>>>>> USERNAME,
>>>>>>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>>>>>>                          userPropertiesQueryString="SELECT NAME, VALUE
>>>>>>> FROM
>>>>>>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>>>>>>                          resetCredentialDml="UPDATE JOSSO_USER SET
>>>>>>> PASSWORD
>>>>>>> = ?
>>>>>>> WHERE LOGIN = ?"
>>>>>>>                          relayCredentialQueryString="SELECT LOGIN FROM
>>>>>>> JOSSO_USER WHERE #?# = ?" />
>>>>>>>
>>>>>>> 5. When i try to access the example partner application (/partner),
>>>>>>> getting
>>>>>>> the following error:
>>>>>>>                Error : Error During Lookup Name DefaultDS is not bound
>>>>>>> in
>>>>>>> this
>>>>>>> Context
>>>>>>>
>>>>>>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>>>>>>
>>>>>>> Please help me out to proceed further. Quick response is highly
>>>>>>> appreciable.
>>>>>>>
>>>>>>> Thanks in Advance.
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>
>>>>>>>> Mikolaj Rydzewski wrote:
>>>>>>>>> Now, I want to setup Josso single sign on system (www.josso.org)
>>>>>>>>> and
>>>>>>>>> force it to use JNDI DataSources as well. With no luck.
>>>>>>>> Here's the solution for anyone interested (addition to typical josso
>>>>>>>> setup):
>>>>>>>>
>>>>>>>>         * define DataSource within GlobalNamingResources (e.g.
>>>>>>>> jdbc/users)
>>>>>>>>         * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>>>           META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>>>         * reference DataSource from josso-gateway-config.xml using
>>>>>>>>           java:comp/env/jdbc/users as its JNDI name
>>>>>>>>
>>>>>>>> Enjoy ;-)
>>>>>>>>
>>>>>>>> --
>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> Quoted from:
>>>>>>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>>>>>>
>>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>>
>>>>>>>> Christopher Schultz wrote:
>>>>>>>>>>        * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>>>>>          META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Note that this is not required for Realms. See
>>>>>>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>>>>>>
>>>>>>>> I'm exposing DataSource to josso webapp, not the Realm. So I need
>>>>>>>> this.
>>>>>>>> Lack of such configuration was causing my initial problems.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
I have removed path and docbase from webapp.xml file. I have tried the db
connection from a servlet as below. I have gone through the josso source
codes. It is failing at below getDataSource function.

    protected DataSource getDataSource() throws SSOIdentityException {

        if (_datasource == null) {

            try {

                if (logger.isDebugEnabled()) logger.debug("[getDatasource()
: ]" + _dsJndiName);

                InitialContext ic = new InitialContext();
                _datasource = (DataSource) ic.lookup(_dsJndiName);

            } catch (NamingException ne) {
                logger.error("Error during DB connection lookup", ne);
                throw new SSOIdentityException(
                        "Error During Lookup\n" + ne.getMessage());
            }

        }

        return _datasource;
    }




Pid Ster wrote:
> 
> On 01/12/2009 10:36, vramanaj wrote:
>>
>> Full Stack Trace:
>> Dec 1, 2009 1:46:58 AM
>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>> getDataSource
>> SEVERE: Error during DB connection lookup
>> javax.naming.NameNotFoundException: Name jdbc is not bound in this
>> Context
>>          at
>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>          at
>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>          at
>> org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
>>          at javax.naming.InitialContext.lookup(InitialContext.java:392)
>>          at
>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDataSource(DataSourceIdentityStore.java:85)
>>          at
>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDBConnection(DataSourceIdentityStore.java:105)
>>          at
>> org.josso.gateway.identity.service.store.db.AbstractDBIdentityStore.loadCredentials(AbstractDBIdentityStore.java:125)
>>          at
>> org.josso.auth.scheme.AbstractAuthenticationScheme.getKnownCredentials(AbstractAuthenticationScheme.java:166)
>>          at
>> org.josso.auth.scheme.UsernamePasswordAuthScheme.authenticate(UsernamePasswordAuthScheme.java:160)
>>          at
>> org.josso.auth.AuthenticatorImpl.check(AuthenticatorImpl.java:69)
>>          at
>> org.josso.gateway.identity.service.SSOIdentityProviderImpl.login(SSOIdentityProviderImpl.java:201)
>>          at
>> org.josso.gateway.identity.service.SSOIdentityProviderImpl.assertIdentity(SSOIdentityProviderImpl.java:274)
>>          at
>> org.josso.gateway.SSOGatewayImpl.assertIdentity(SSOGatewayImpl.java:332)
>>          at
>> org.josso.gateway.signon.LoginAction.login(LoginAction.java:144)
>>          at
>> org.josso.gateway.signon.LoginAction.execute(LoginAction.java:86)
>>          at
>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>>          at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>>          at
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>>          at
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>          at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>          at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>          at
>> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>>          at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>          at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>          at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>          at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>          at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>          at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>          at
>> org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>>          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)
>> ------------------------------------------------------------------------------------------------------
>> /apache-tomcat-6.0.18-sso/conf/Catalina/localhost/partnerapp.xml:
>>
>> <Context path="/partnerapp"
>> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>>           debug="99" reloadable="true" antiJARLocking="true"
> 
> path is not legal here, and docBase is not necessary if the path to 
> tomcat is the same for conf and webapps.
> 
> 
> Can you make a normal connection to the Db within a servlet, or does it 
> throw an exception?
> 
>   Context context = new InitialContext();
>   context  = (Context) context.lookup("java:/comp/env");
>   DataSource ds = (DataSource) context.lookup("jdbc/DefaultDS");
>   Connection conn = ds.getConnection();
> 
> 
> p
> 
> 
>> antiResourceLocking="false" crossContext="true">
>> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
>> type="javax.sql.DataSource"/>
>> </Context>
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> Pid Ster wrote:
>>>
>>> On 01/12/2009 05:13, vramanaj wrote:
>>>>
>>>> Still getting the same error after changing Data Source name to
>>>> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>>>>
>>>>            Error : Error During Lookup Name jdbc is not bound in this
>>>> Context
>>>
>>> What is the full stack trace?
>>>
>>> Are you adding it to tomcat/conf/webapp.xml or to the
>>> META-INF/context.xml?  Check that Tomcat isn't overwriting the former,
>>> with the latter during startup or app reload cycles.
>>>
>>>> Are there any extra customizations required for Josso+Tomcat6?
>>>
>>> Tomcat doesn't know what JOSSO is.
>>>
>>> Can you write a sample servlet that gets a connection from the
>>> DataSource you've defined?  Maybe we can see if there's a problem with
>>> the definition, or if it's JOSSO that can't see the DS.
>>>
>>>
>>> p
>>>
>>>
>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>
>>>> Pid Ster wrote:
>>>>>
>>>>> On 30/11/2009 13:46, vramanaj wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am facing problem with configuring JNDI DataSources for Josso
>>>>>> project
>>>>>> in
>>>>>> Tomcat 6. Getting the following errors in tomcat log when i am trying
>>>>>> to
>>>>>> access the application. Defined resource in
>>>>>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>>>>>> application's
>>>>>> web.xml.
>>>>>>
>>>>>> Nov 30, 2009 7:48:52 AM
>>>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>>>>> getDataSource
>>>>>> SEVERE: Error during DB connection lookup
>>>>>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in
>>>>>> this
>>>>>> Context
>>>>>>           at
>>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>>>>           at
>>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>>>>
>>>>>> Steps Followed:
>>>>>> 1. Defined DataSource within GlobalNamingResources
>>>>>>               <Resource name="/DefaultDS"
>>>>>
>>>>> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start
>>>>> the
>>>>> name with a / character.
>>>>>
>>>>>>               auth="Container"
>>>>>>               type="javax.sql.DataSource"
>>>>>>               description="SSO DataSource"
>>>>>>               username="josso"
>>>>>>               password="josso"
>>>>>>               driverClassName="oracle.jdbc.OracleDriver"
>>>>>>               url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>>
>>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>>               maxActive="8"
>>>>>>               maxIdle="4"/>
>>>>>>
>>>>>> 2. Added res-reference in web.xml
>>>>>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
>>>>>
>>>>> If you've defined it in the global resources, you don't need to
>>>>> redefine
>>>>> it here, just use:
>>>>>
>>>>>      <ResourceLink
>>>>>        global="jdbc/DefaultDS"
>>>>>        name="jdbc/DefaultDS"
>>>>>        type="javax.sql.DataSource"/>
>>>>>
>>>>>
>>>>> p
>>>>>
>>>>>>               <Resource name="/DefaultDS"
>>>>>>               auth="Container"
>>>>>>               type="javax.sql.DataSource"
>>>>>>               description="SSO DataSource"
>>>>>>               username="josso"
>>>>>>               password="josso"
>>>>>>               driverClassName="oracle.jdbc.OracleDriver"
>>>>>>               url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>>
>>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>>               maxActive="8"
>>>>>>               maxIdle="4"/>
>>>>>>
>>>>>> 4. In josso-gateway-db-stores.xml
>>>>>>       <db-istore:datasource-store id="josso-identity-store"
>>>>>>                         dsJndiName="java:comp/env/DefaultDS"
>>>>>>                         userQueryString="SELECT NAME FROM JOSSO_USER
>>>>>> WHERE
>>>>>> LOGIN = ?"
>>>>>>                         rolesQueryString="SELECT ROLE FROM
>>>>>> JOSSO_USER_ROLE
>>>>>> WHERE LOGIN = ?;"
>>>>>>                         credentialsQueryString="SELECT LOGIN AS
>>>>>> USERNAME,
>>>>>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>>>>>                         userPropertiesQueryString="SELECT NAME, VALUE
>>>>>> FROM
>>>>>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>>>>>                         resetCredentialDml="UPDATE JOSSO_USER SET
>>>>>> PASSWORD
>>>>>> = ?
>>>>>> WHERE LOGIN = ?"
>>>>>>                         relayCredentialQueryString="SELECT LOGIN FROM
>>>>>> JOSSO_USER WHERE #?# = ?" />
>>>>>>
>>>>>> 5. When i try to access the example partner application (/partner),
>>>>>> getting
>>>>>> the following error:
>>>>>>               Error : Error During Lookup Name DefaultDS is not bound
>>>>>> in
>>>>>> this
>>>>>> Context
>>>>>>
>>>>>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>>>>>
>>>>>> Please help me out to proceed further. Quick response is highly
>>>>>> appreciable.
>>>>>>
>>>>>> Thanks in Advance.
>>>>>>
>>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>
>>>>>>> Mikolaj Rydzewski wrote:
>>>>>>>> Now, I want to setup Josso single sign on system (www.josso.org)
>>>>>>>> and
>>>>>>>> force it to use JNDI DataSources as well. With no luck.
>>>>>>> Here's the solution for anyone interested (addition to typical josso
>>>>>>> setup):
>>>>>>>
>>>>>>>        * define DataSource within GlobalNamingResources (e.g.
>>>>>>> jdbc/users)
>>>>>>>        * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>>          META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>>        * reference DataSource from josso-gateway-config.xml using
>>>>>>>          java:comp/env/jdbc/users as its JNDI name
>>>>>>>
>>>>>>> Enjoy ;-)
>>>>>>>
>>>>>>> --
>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Quoted from:
>>>>>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>>>>>
>>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>>
>>>>>>> Christopher Schultz wrote:
>>>>>>>>>       * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>>>>         META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>>>>
>>>>>>>>
>>>>>>>> Note that this is not required for Realms. See
>>>>>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>>>>>
>>>>>>> I'm exposing DataSource to josso webapp, not the Realm. So I need
>>>>>>> this.
>>>>>>> Lack of such configuration was causing my initial problems.
>>>>>>>
>>>>>>> --
>>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26590480.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 01/12/2009 10:36, vramanaj wrote:
>
> Full Stack Trace:
> Dec 1, 2009 1:46:58 AM
> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
> getDataSource
> SEVERE: Error during DB connection lookup
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>          at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>          at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>          at
> org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
>          at javax.naming.InitialContext.lookup(InitialContext.java:392)
>          at
> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDataSource(DataSourceIdentityStore.java:85)
>          at
> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDBConnection(DataSourceIdentityStore.java:105)
>          at
> org.josso.gateway.identity.service.store.db.AbstractDBIdentityStore.loadCredentials(AbstractDBIdentityStore.java:125)
>          at
> org.josso.auth.scheme.AbstractAuthenticationScheme.getKnownCredentials(AbstractAuthenticationScheme.java:166)
>          at
> org.josso.auth.scheme.UsernamePasswordAuthScheme.authenticate(UsernamePasswordAuthScheme.java:160)
>          at org.josso.auth.AuthenticatorImpl.check(AuthenticatorImpl.java:69)
>          at
> org.josso.gateway.identity.service.SSOIdentityProviderImpl.login(SSOIdentityProviderImpl.java:201)
>          at
> org.josso.gateway.identity.service.SSOIdentityProviderImpl.assertIdentity(SSOIdentityProviderImpl.java:274)
>          at
> org.josso.gateway.SSOGatewayImpl.assertIdentity(SSOGatewayImpl.java:332)
>          at org.josso.gateway.signon.LoginAction.login(LoginAction.java:144)
>          at org.josso.gateway.signon.LoginAction.execute(LoginAction.java:86)
>          at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
>          at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>          at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>          at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>          at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>          at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>          at
> org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
>          at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>          at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>          at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>          at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>          at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>          at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>          at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
>          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)
> ------------------------------------------------------------------------------------------------------
> /apache-tomcat-6.0.18-sso/conf/Catalina/localhost/partnerapp.xml:
>
> <Context path="/partnerapp"
> docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
>           debug="99" reloadable="true" antiJARLocking="true"

path is not legal here, and docBase is not necessary if the path to 
tomcat is the same for conf and webapps.


Can you make a normal connection to the Db within a servlet, or does it 
throw an exception?

  Context context = new InitialContext();
  context  = (Context) context.lookup("java:/comp/env");
  DataSource ds = (DataSource) context.lookup("jdbc/DefaultDS");
  Connection conn = ds.getConnection();


p


> antiResourceLocking="false" crossContext="true">
> <ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
> type="javax.sql.DataSource"/>
> </Context>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> Pid Ster wrote:
>>
>> On 01/12/2009 05:13, vramanaj wrote:
>>>
>>> Still getting the same error after changing Data Source name to
>>> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>>>
>>>            Error : Error During Lookup Name jdbc is not bound in this
>>> Context
>>
>> What is the full stack trace?
>>
>> Are you adding it to tomcat/conf/webapp.xml or to the
>> META-INF/context.xml?  Check that Tomcat isn't overwriting the former,
>> with the latter during startup or app reload cycles.
>>
>>> Are there any extra customizations required for Josso+Tomcat6?
>>
>> Tomcat doesn't know what JOSSO is.
>>
>> Can you write a sample servlet that gets a connection from the
>> DataSource you've defined?  Maybe we can see if there's a problem with
>> the definition, or if it's JOSSO that can't see the DS.
>>
>>
>> p
>>
>>
>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>
>>> Pid Ster wrote:
>>>>
>>>> On 30/11/2009 13:46, vramanaj wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I am facing problem with configuring JNDI DataSources for Josso project
>>>>> in
>>>>> Tomcat 6. Getting the following errors in tomcat log when i am trying
>>>>> to
>>>>> access the application. Defined resource in
>>>>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>>>>> application's
>>>>> web.xml.
>>>>>
>>>>> Nov 30, 2009 7:48:52 AM
>>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>>>> getDataSource
>>>>> SEVERE: Error during DB connection lookup
>>>>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in this
>>>>> Context
>>>>>           at
>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>>>           at
>>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>>>
>>>>> Steps Followed:
>>>>> 1. Defined DataSource within GlobalNamingResources
>>>>>               <Resource name="/DefaultDS"
>>>>
>>>> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start the
>>>> name with a / character.
>>>>
>>>>>               auth="Container"
>>>>>               type="javax.sql.DataSource"
>>>>>               description="SSO DataSource"
>>>>>               username="josso"
>>>>>               password="josso"
>>>>>               driverClassName="oracle.jdbc.OracleDriver"
>>>>>               url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>
>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>               maxActive="8"
>>>>>               maxIdle="4"/>
>>>>>
>>>>> 2. Added res-reference in web.xml
>>>>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
>>>>
>>>> If you've defined it in the global resources, you don't need to redefine
>>>> it here, just use:
>>>>
>>>>      <ResourceLink
>>>>        global="jdbc/DefaultDS"
>>>>        name="jdbc/DefaultDS"
>>>>        type="javax.sql.DataSource"/>
>>>>
>>>>
>>>> p
>>>>
>>>>>               <Resource name="/DefaultDS"
>>>>>               auth="Container"
>>>>>               type="javax.sql.DataSource"
>>>>>               description="SSO DataSource"
>>>>>               username="josso"
>>>>>               password="josso"
>>>>>               driverClassName="oracle.jdbc.OracleDriver"
>>>>>               url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>>
>>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>>               maxActive="8"
>>>>>               maxIdle="4"/>
>>>>>
>>>>> 4. In josso-gateway-db-stores.xml
>>>>>       <db-istore:datasource-store id="josso-identity-store"
>>>>>                         dsJndiName="java:comp/env/DefaultDS"
>>>>>                         userQueryString="SELECT NAME FROM JOSSO_USER
>>>>> WHERE
>>>>> LOGIN = ?"
>>>>>                         rolesQueryString="SELECT ROLE FROM
>>>>> JOSSO_USER_ROLE
>>>>> WHERE LOGIN = ?;"
>>>>>                         credentialsQueryString="SELECT LOGIN AS
>>>>> USERNAME,
>>>>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>>>>                         userPropertiesQueryString="SELECT NAME, VALUE
>>>>> FROM
>>>>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>>>>                         resetCredentialDml="UPDATE JOSSO_USER SET
>>>>> PASSWORD
>>>>> = ?
>>>>> WHERE LOGIN = ?"
>>>>>                         relayCredentialQueryString="SELECT LOGIN FROM
>>>>> JOSSO_USER WHERE #?# = ?" />
>>>>>
>>>>> 5. When i try to access the example partner application (/partner),
>>>>> getting
>>>>> the following error:
>>>>>               Error : Error During Lookup Name DefaultDS is not bound in
>>>>> this
>>>>> Context
>>>>>
>>>>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>>>>
>>>>> Please help me out to proceed further. Quick response is highly
>>>>> appreciable.
>>>>>
>>>>> Thanks in Advance.
>>>>>
>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>
>>>>>
>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>
>>>>>> Mikolaj Rydzewski wrote:
>>>>>>> Now, I want to setup Josso single sign on system (www.josso.org) and
>>>>>>> force it to use JNDI DataSources as well. With no luck.
>>>>>> Here's the solution for anyone interested (addition to typical josso
>>>>>> setup):
>>>>>>
>>>>>>        * define DataSource within GlobalNamingResources (e.g.
>>>>>> jdbc/users)
>>>>>>        * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>          META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>        * reference DataSource from josso-gateway-config.xml using
>>>>>>          java:comp/env/jdbc/users as its JNDI name
>>>>>>
>>>>>> Enjoy ;-)
>>>>>>
>>>>>> --
>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>> Quoted from:
>>>>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>>>>
>>>>> Mikolaj Rydzewski-2 wrote:
>>>>>>
>>>>>> Christopher Schultz wrote:
>>>>>>>>       * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>>>         META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>>>
>>>>>>>
>>>>>>> Note that this is not required for Realms. See
>>>>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>>>>
>>>>>> I'm exposing DataSource to josso webapp, not the Realm. So I need
>>>>>> this.
>>>>>> Lack of such configuration was causing my initial problems.
>>>>>>
>>>>>> --
>>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Full Stack Trace:
Dec 1, 2009 1:46:58 AM
org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
getDataSource
SEVERE: Error during DB connection lookup
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
        at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at
org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDataSource(DataSourceIdentityStore.java:85)
        at
org.josso.gateway.identity.service.store.db.DataSourceIdentityStore.getDBConnection(DataSourceIdentityStore.java:105)
        at
org.josso.gateway.identity.service.store.db.AbstractDBIdentityStore.loadCredentials(AbstractDBIdentityStore.java:125)
        at
org.josso.auth.scheme.AbstractAuthenticationScheme.getKnownCredentials(AbstractAuthenticationScheme.java:166)
        at
org.josso.auth.scheme.UsernamePasswordAuthScheme.authenticate(UsernamePasswordAuthScheme.java:160)
        at org.josso.auth.AuthenticatorImpl.check(AuthenticatorImpl.java:69)
        at
org.josso.gateway.identity.service.SSOIdentityProviderImpl.login(SSOIdentityProviderImpl.java:201)
        at
org.josso.gateway.identity.service.SSOIdentityProviderImpl.assertIdentity(SSOIdentityProviderImpl.java:274)
        at
org.josso.gateway.SSOGatewayImpl.assertIdentity(SSOGatewayImpl.java:332)
        at org.josso.gateway.signon.LoginAction.login(LoginAction.java:144)
        at org.josso.gateway.signon.LoginAction.execute(LoginAction.java:86)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.josso.gateway.filter.ProtocolHandlerFilter.doFilter(ProtocolHandlerFilter.java:86)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:275)
        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)
------------------------------------------------------------------------------------------------------
/apache-tomcat-6.0.18-sso/conf/Catalina/localhost/partnerapp.xml:

<Context path="/partnerapp"
docBase="/usr2/tomcat/sso/apache-tomcat-6.0.18-sso/webapps/partnerapp"
         debug="99" reloadable="true" antiJARLocking="true"
antiResourceLocking="false" crossContext="true">
<ResourceLink global="jdbc/DefaultDS" name="jdbc/DefaultDS"
type="javax.sql.DataSource"/>
</Context>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Pid Ster wrote:
> 
> On 01/12/2009 05:13, vramanaj wrote:
>>
>> Still getting the same error after changing Data Source name to
>> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>>
>>           Error : Error During Lookup Name jdbc is not bound in this
>> Context
> 
> What is the full stack trace?
> 
> Are you adding it to tomcat/conf/webapp.xml or to the 
> META-INF/context.xml?  Check that Tomcat isn't overwriting the former, 
> with the latter during startup or app reload cycles.
> 
>> Are there any extra customizations required for Josso+Tomcat6?
> 
> Tomcat doesn't know what JOSSO is.
> 
> Can you write a sample servlet that gets a connection from the 
> DataSource you've defined?  Maybe we can see if there's a problem with 
> the definition, or if it's JOSSO that can't see the DS.
> 
> 
> p
> 
> 
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>> Pid Ster wrote:
>>>
>>> On 30/11/2009 13:46, vramanaj wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am facing problem with configuring JNDI DataSources for Josso project
>>>> in
>>>> Tomcat 6. Getting the following errors in tomcat log when i am trying
>>>> to
>>>> access the application. Defined resource in
>>>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>>>> application's
>>>> web.xml.
>>>>
>>>> Nov 30, 2009 7:48:52 AM
>>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>>> getDataSource
>>>> SEVERE: Error during DB connection lookup
>>>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in this
>>>> Context
>>>>          at
>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>>          at
>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>>
>>>> Steps Followed:
>>>> 1. Defined DataSource within GlobalNamingResources
>>>>              <Resource name="/DefaultDS"
>>>
>>> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start the
>>> name with a / character.
>>>
>>>>              auth="Container"
>>>>              type="javax.sql.DataSource"
>>>>              description="SSO DataSource"
>>>>              username="josso"
>>>>              password="josso"
>>>>              driverClassName="oracle.jdbc.OracleDriver"
>>>>              url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>             
>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>              maxActive="8"
>>>>              maxIdle="4"/>
>>>>
>>>> 2. Added res-reference in web.xml
>>>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
>>>
>>> If you've defined it in the global resources, you don't need to redefine
>>> it here, just use:
>>>
>>>     <ResourceLink
>>>       global="jdbc/DefaultDS"
>>>       name="jdbc/DefaultDS"
>>>       type="javax.sql.DataSource"/>
>>>
>>>
>>> p
>>>
>>>>              <Resource name="/DefaultDS"
>>>>              auth="Container"
>>>>              type="javax.sql.DataSource"
>>>>              description="SSO DataSource"
>>>>              username="josso"
>>>>              password="josso"
>>>>              driverClassName="oracle.jdbc.OracleDriver"
>>>>              url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>>             
>>>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>>              maxActive="8"
>>>>              maxIdle="4"/>
>>>>
>>>> 4. In josso-gateway-db-stores.xml
>>>>      <db-istore:datasource-store id="josso-identity-store"
>>>>                        dsJndiName="java:comp/env/DefaultDS"
>>>>                        userQueryString="SELECT NAME FROM JOSSO_USER
>>>> WHERE
>>>> LOGIN = ?"
>>>>                        rolesQueryString="SELECT ROLE FROM
>>>> JOSSO_USER_ROLE
>>>> WHERE LOGIN = ?;"
>>>>                        credentialsQueryString="SELECT LOGIN AS
>>>> USERNAME,
>>>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>>>                        userPropertiesQueryString="SELECT NAME, VALUE
>>>> FROM
>>>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>>>                        resetCredentialDml="UPDATE JOSSO_USER SET
>>>> PASSWORD
>>>> = ?
>>>> WHERE LOGIN = ?"
>>>>                        relayCredentialQueryString="SELECT LOGIN FROM
>>>> JOSSO_USER WHERE #?# = ?" />
>>>>
>>>> 5. When i try to access the example partner application (/partner),
>>>> getting
>>>> the following error:
>>>>              Error : Error During Lookup Name DefaultDS is not bound in
>>>> this
>>>> Context
>>>>
>>>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>>>
>>>> Please help me out to proceed further. Quick response is highly
>>>> appreciable.
>>>>
>>>> Thanks in Advance.
>>>>
>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>
>>>>
>>>> Mikolaj Rydzewski-2 wrote:
>>>>>
>>>>> Mikolaj Rydzewski wrote:
>>>>>> Now, I want to setup Josso single sign on system (www.josso.org) and
>>>>>> force it to use JNDI DataSources as well. With no luck.
>>>>> Here's the solution for anyone interested (addition to typical josso
>>>>> setup):
>>>>>
>>>>>       * define DataSource within GlobalNamingResources (e.g.
>>>>> jdbc/users)
>>>>>       * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>         META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>       * reference DataSource from josso-gateway-config.xml using
>>>>>         java:comp/env/jdbc/users as its JNDI name
>>>>>
>>>>> Enjoy ;-)
>>>>>
>>>>> --
>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>> Quoted from:
>>>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>>>
>>>> Mikolaj Rydzewski-2 wrote:
>>>>>
>>>>> Christopher Schultz wrote:
>>>>>>>      * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>>        META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>>
>>>>>>
>>>>>> Note that this is not required for Realms. See
>>>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>>>
>>>>> I'm exposing DataSource to josso webapp, not the Realm. So I need
>>>>> this.
>>>>> Lack of such configuration was causing my initial problems.
>>>>>
>>>>> --
>>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26589184.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 01/12/2009 05:13, vramanaj wrote:
>
> Still getting the same error after changing Data Source name to
> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>
>           Error : Error During Lookup Name jdbc is not bound in this Context

What is the full stack trace?

Are you adding it to tomcat/conf/webapp.xml or to the 
META-INF/context.xml?  Check that Tomcat isn't overwriting the former, 
with the latter during startup or app reload cycles.

> Are there any extra customizations required for Josso+Tomcat6?

Tomcat doesn't know what JOSSO is.

Can you write a sample servlet that gets a connection from the 
DataSource you've defined?  Maybe we can see if there's a problem with 
the definition, or if it's JOSSO that can't see the DS.


p


> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Pid Ster wrote:
>>
>> On 30/11/2009 13:46, vramanaj wrote:
>>>
>>> Hi,
>>>
>>> I am facing problem with configuring JNDI DataSources for Josso project
>>> in
>>> Tomcat 6. Getting the following errors in tomcat log when i am trying to
>>> access the application. Defined resource in
>>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>>> application's
>>> web.xml.
>>>
>>> Nov 30, 2009 7:48:52 AM
>>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>>> getDataSource
>>> SEVERE: Error during DB connection lookup
>>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in this
>>> Context
>>>          at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>>          at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>>
>>> Steps Followed:
>>> 1. Defined DataSource within GlobalNamingResources
>>>              <Resource name="/DefaultDS"
>>
>> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start the
>> name with a / character.
>>
>>>              auth="Container"
>>>              type="javax.sql.DataSource"
>>>              description="SSO DataSource"
>>>              username="josso"
>>>              password="josso"
>>>              driverClassName="oracle.jdbc.OracleDriver"
>>>              url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>              factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>              maxActive="8"
>>>              maxIdle="4"/>
>>>
>>> 2. Added res-reference in web.xml
>>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
>>
>> If you've defined it in the global resources, you don't need to redefine
>> it here, just use:
>>
>>     <ResourceLink
>>       global="jdbc/DefaultDS"
>>       name="jdbc/DefaultDS"
>>       type="javax.sql.DataSource"/>
>>
>>
>> p
>>
>>>              <Resource name="/DefaultDS"
>>>              auth="Container"
>>>              type="javax.sql.DataSource"
>>>              description="SSO DataSource"
>>>              username="josso"
>>>              password="josso"
>>>              driverClassName="oracle.jdbc.OracleDriver"
>>>              url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>>              factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>>              maxActive="8"
>>>              maxIdle="4"/>
>>>
>>> 4. In josso-gateway-db-stores.xml
>>>      <db-istore:datasource-store id="josso-identity-store"
>>>                        dsJndiName="java:comp/env/DefaultDS"
>>>                        userQueryString="SELECT NAME FROM JOSSO_USER WHERE
>>> LOGIN = ?"
>>>                        rolesQueryString="SELECT ROLE FROM JOSSO_USER_ROLE
>>> WHERE LOGIN = ?;"
>>>                        credentialsQueryString="SELECT LOGIN AS USERNAME,
>>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>>                        userPropertiesQueryString="SELECT NAME, VALUE FROM
>>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>>                        resetCredentialDml="UPDATE JOSSO_USER SET PASSWORD
>>> = ?
>>> WHERE LOGIN = ?"
>>>                        relayCredentialQueryString="SELECT LOGIN FROM
>>> JOSSO_USER WHERE #?# = ?" />
>>>
>>> 5. When i try to access the example partner application (/partner),
>>> getting
>>> the following error:
>>>              Error : Error During Lookup Name DefaultDS is not bound in
>>> this
>>> Context
>>>
>>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>>
>>> Please help me out to proceed further. Quick response is highly
>>> appreciable.
>>>
>>> Thanks in Advance.
>>>
>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>
>>>
>>> Mikolaj Rydzewski-2 wrote:
>>>>
>>>> Mikolaj Rydzewski wrote:
>>>>> Now, I want to setup Josso single sign on system (www.josso.org) and
>>>>> force it to use JNDI DataSources as well. With no luck.
>>>> Here's the solution for anyone interested (addition to typical josso
>>>> setup):
>>>>
>>>>       * define DataSource within GlobalNamingResources (e.g. jdbc/users)
>>>>       * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>         META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>       * reference DataSource from josso-gateway-config.xml using
>>>>         java:comp/env/jdbc/users as its JNDI name
>>>>
>>>> Enjoy ;-)
>>>>
>>>> --
>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>> Quoted from:
>>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>>
>>> Mikolaj Rydzewski-2 wrote:
>>>>
>>>> Christopher Schultz wrote:
>>>>>>      * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>>        META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>>
>>>>>
>>>>> Note that this is not required for Realms. See
>>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>>
>>>> I'm exposing DataSource to josso webapp, not the Realm. So I need this.
>>>> Lack of such configuration was causing my initial problems.
>>>>
>>>> --
>>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
vramanaj wrote:
> Still getting the same error after changing Data Source name to
> 'jdbc/DefaultDS'. Added resource link in webapp.xml.
>
>          Error : Error During Lookup Name jdbc is not bound in this Context
>
> Are there any extra customizations required for Josso+Tomcat6?
>   
The 'trick' with Josso configuration is, that you need to use short JNDI 
names at tomcat/web.xml/context.xml level (e.g. jdbc/DefaultDS), but you 
have to use full JNDI named at Josso configuration level (e.g. 
java:comp/env/jdbc/DefaultDS).

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by vramanaj <vr...@gmail.com>.
Still getting the same error after changing Data Source name to
'jdbc/DefaultDS'. Added resource link in webapp.xml.

         Error : Error During Lookup Name jdbc is not bound in this Context

Are there any extra customizations required for Josso+Tomcat6?
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Pid Ster wrote:
> 
> On 30/11/2009 13:46, vramanaj wrote:
>>
>> Hi,
>>
>> I am facing problem with configuring JNDI DataSources for Josso project
>> in
>> Tomcat 6. Getting the following errors in tomcat log when i am trying to
>> access the application. Defined resource in
>> conf/Catalina/localhost/webapp.xml. And res-reference in the
>> application's
>> web.xml.
>>
>> Nov 30, 2009 7:48:52 AM
>> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
>> getDataSource
>> SEVERE: Error during DB connection lookup
>> javax.naming.NameNotFoundException: Name DefaultDS is not bound in this
>> Context
>>         at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>>         at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>
>> Steps Followed:
>> 1. Defined DataSource within GlobalNamingResources
>>             <Resource name="/DefaultDS"
> 
> Try using "jdbc/DefaultDS".  I don't believe you're allowed to start the 
> name with a / character.
> 
>>             auth="Container"
>>             type="javax.sql.DataSource"
>>             description="SSO DataSource"
>>             username="josso"
>>             password="josso"
>>             driverClassName="oracle.jdbc.OracleDriver"
>>             url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>             factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>             maxActive="8"
>>             maxIdle="4"/>
>>
>> 2. Added res-reference in web.xml
>> 3. Defined resource in conf/Catalina/localhost/webapp.xml
> 
> If you've defined it in the global resources, you don't need to redefine 
> it here, just use:
> 
>    <ResourceLink
>      global="jdbc/DefaultDS"
>      name="jdbc/DefaultDS"
>      type="javax.sql.DataSource"/>
> 
> 
> p
> 
>>             <Resource name="/DefaultDS"
>>             auth="Container"
>>             type="javax.sql.DataSource"
>>             description="SSO DataSource"
>>             username="josso"
>>             password="josso"
>>             driverClassName="oracle.jdbc.OracleDriver"
>>             url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>>             factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>>             maxActive="8"
>>             maxIdle="4"/>
>>
>> 4. In josso-gateway-db-stores.xml
>>     <db-istore:datasource-store id="josso-identity-store"
>>                       dsJndiName="java:comp/env/DefaultDS"
>>                       userQueryString="SELECT NAME FROM JOSSO_USER WHERE
>> LOGIN = ?"
>>                       rolesQueryString="SELECT ROLE FROM JOSSO_USER_ROLE
>> WHERE LOGIN = ?;"
>>                       credentialsQueryString="SELECT LOGIN AS USERNAME,
>> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>>                       userPropertiesQueryString="SELECT NAME, VALUE FROM
>> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>>                       resetCredentialDml="UPDATE JOSSO_USER SET PASSWORD
>> = ?
>> WHERE LOGIN = ?"
>>                       relayCredentialQueryString="SELECT LOGIN FROM
>> JOSSO_USER WHERE #?# = ?" />
>>
>> 5. When i try to access the example partner application (/partner),
>> getting
>> the following error:
>>             Error : Error During Lookup Name DefaultDS is not bound in
>> this
>> Context
>>
>> I am using Josso 1.8.0 with tomcat 6.0.18.
>>
>> Please help me out to proceed further. Quick response is highly
>> appreciable.
>>
>> Thanks in Advance.
>>
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> Mikolaj Rydzewski-2 wrote:
>>>
>>> Mikolaj Rydzewski wrote:
>>>> Now, I want to setup Josso single sign on system (www.josso.org) and
>>>> force it to use JNDI DataSources as well. With no luck.
>>> Here's the solution for anyone interested (addition to typical josso
>>> setup):
>>>
>>>      * define DataSource within GlobalNamingResources (e.g. jdbc/users)
>>>      * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>        META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>      * reference DataSource from josso-gateway-config.xml using
>>>        java:comp/env/jdbc/users as its JNDI name
>>>
>>> Enjoy ;-)
>>>
>>> --
>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>> Quoted from:
>> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>>
>> Mikolaj Rydzewski-2 wrote:
>>>
>>> Christopher Schultz wrote:
>>>>>     * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>>       META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>>
>>>>
>>>> Note that this is not required for Realms. See
>>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>>
>>> I'm exposing DataSource to josso webapp, not the Realm. So I need this.
>>> Lack of such configuration was causing my initial problems.
>>>
>>> --
>>> Mikolaj Rydzewski<mi...@ceti.pl>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p26586790.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to access JNDI resources on Tomcat level

Posted by Pid <pi...@pidster.com>.
On 30/11/2009 13:46, vramanaj wrote:
>
> Hi,
>
> I am facing problem with configuring JNDI DataSources for Josso project in
> Tomcat 6. Getting the following errors in tomcat log when i am trying to
> access the application. Defined resource in
> conf/Catalina/localhost/webapp.xml. And res-reference in the application's
> web.xml.
>
> Nov 30, 2009 7:48:52 AM
> org.josso.gateway.identity.service.store.db.DataSourceIdentityStore
> getDataSource
> SEVERE: Error during DB connection lookup
> javax.naming.NameNotFoundException: Name DefaultDS is not bound in this
> Context
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>
> Steps Followed:
> 1. Defined DataSource within GlobalNamingResources
>             <Resource name="/DefaultDS"

Try using "jdbc/DefaultDS".  I don't believe you're allowed to start the 
name with a / character.

>             auth="Container"
>             type="javax.sql.DataSource"
>             description="SSO DataSource"
>             username="josso"
>             password="josso"
>             driverClassName="oracle.jdbc.OracleDriver"
>             url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>             factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>             maxActive="8"
>             maxIdle="4"/>
>
> 2. Added res-reference in web.xml
> 3. Defined resource in conf/Catalina/localhost/webapp.xml

If you've defined it in the global resources, you don't need to redefine 
it here, just use:

   <ResourceLink
     global="jdbc/DefaultDS"
     name="jdbc/DefaultDS"
     type="javax.sql.DataSource"/>


p

>             <Resource name="/DefaultDS"
>             auth="Container"
>             type="javax.sql.DataSource"
>             description="SSO DataSource"
>             username="josso"
>             password="josso"
>             driverClassName="oracle.jdbc.OracleDriver"
>             url="jdbc:oracle:thin:@md1npddev10:1521:jdaj"
>             factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
>             maxActive="8"
>             maxIdle="4"/>
>
> 4. In josso-gateway-db-stores.xml
>     <db-istore:datasource-store id="josso-identity-store"
>                       dsJndiName="java:comp/env/DefaultDS"
>                       userQueryString="SELECT NAME FROM JOSSO_USER WHERE
> LOGIN = ?"
>                       rolesQueryString="SELECT ROLE FROM JOSSO_USER_ROLE
> WHERE LOGIN = ?;"
>                       credentialsQueryString="SELECT LOGIN AS USERNAME,
> PASSWORD FROM JOSSO_USER WHERE LOGIN = ?"
>                       userPropertiesQueryString="SELECT NAME, VALUE FROM
> JOSSO_USER_PROPERTY WHERE LOGIN = ?"
>                       resetCredentialDml="UPDATE JOSSO_USER SET PASSWORD = ?
> WHERE LOGIN = ?"
>                       relayCredentialQueryString="SELECT LOGIN FROM
> JOSSO_USER WHERE #?# = ?" />
>
> 5. When i try to access the example partner application (/partner), getting
> the following error:
>             Error : Error During Lookup Name DefaultDS is not bound in this
> Context
>
> I am using Josso 1.8.0 with tomcat 6.0.18.
>
> Please help me out to proceed further. Quick response is highly appreciable.
>
> Thanks in Advance.
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> Mikolaj Rydzewski-2 wrote:
>>
>> Mikolaj Rydzewski wrote:
>>> Now, I want to setup Josso single sign on system (www.josso.org) and
>>> force it to use JNDI DataSources as well. With no luck.
>> Here's the solution for anyone interested (addition to typical josso
>> setup):
>>
>>      * define DataSource within GlobalNamingResources (e.g. jdbc/users)
>>      * add JNDI support to josso webapp (e.g. and ResourceLink to
>>        META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>      * reference DataSource from josso-gateway-config.xml using
>>        java:comp/env/jdbc/users as its JNDI name
>>
>> Enjoy ;-)
>>
>> --
>> Mikolaj Rydzewski<mi...@ceti.pl>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
> Quoted from:
> http://old.nabble.com/How-to-access-JNDI-resources-on-Tomcat-level-tp19672443p19689928.html
>
> Mikolaj Rydzewski-2 wrote:
>>
>> Christopher Schultz wrote:
>>>>     * add JNDI support to josso webapp (e.g. and ResourceLink to
>>>>       META-INF/context.xml and resource-ref to WEB-INF/web.xml)
>>>>
>>>
>>> Note that this is not required for Realms. See
>>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources
>>>
>> I'm exposing DataSource to josso webapp, not the Realm. So I need this.
>> Lack of such configuration was causing my initial problems.
>>
>> --
>> Mikolaj Rydzewski<mi...@ceti.pl>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org