Infinite loop for SAML request in spring-saml - saml
I am seeing extremely wired and inconsistent behavior in webapp with spring-saml.
Our setup -
Two IDP being chosen based on url pattern - implemented using CustomSAMLContextProviderImpl (works fine based on url it redirects to configured IDP)
Configured both SAML provider/IDP using CachingMetadataManager with list of ExtendedMetadataDelegate. Based on explaination here and code-example
spring mvc application (version - 4.1.6.RELEASE)
spring saml security (version - 1.0.1.RELEASE)
Now, sometime I observe infinite looping behavior between IDP(https://default-idp.com/sso/idp/SAML2) and SP (https://my-application.com/).
Attaching piece of log
16:29:07.829 [ajp-bio-8009-exec-1] DEBUG c.s.s.s.CustomSAMLContextProviderImpl - Using default SP/Local EntityId https://my-application.com/
16:29:07.829 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://my-application.com/
16:29:07.829 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://my-application.com/
16:29:07.829 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document did not contain a descriptor for entity https://my-application.com/
16:29:07.829 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document did not contain any role descriptors of type {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor for entity https://my-application.com/
16:29:07.830 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document does not contain a role of type {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor supporting protocol urn:oasis:names:tc:SAML:2.0:protocol for entity https://my-application.com/
16:29:07.830 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://my-application.com/
16:29:07.830 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://my-application.com/
16:29:07.831 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Building credential from keystore entry for entityID sam, usage type UNSPECIFIED
16:29:07.831 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Processing PrivateKeyEntry from keystore
16:29:07.831 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.c.EvaluableCredentialCriteriaRegistry - Registry located evaluable criteria class org.opensaml.xml.security.credential.criteria.EvaluableEntityIDCredentialCriteria for criteria class org.opensaml.xml.security.criteria.EntityIDCriteria
16:29:07.832 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Building credential from keystore entry for entityID sam, usage type UNSPECIFIED
16:29:07.832 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Processing PrivateKeyEntry from keystore
16:29:07.832 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.c.EvaluableCredentialCriteriaRegistry - Registry located evaluable criteria class org.opensaml.xml.security.credential.criteria.EvaluableEntityIDCredentialCriteria for criteria class org.opensaml.xml.security.criteria.EntityIDCriteria
16:29:07.845 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://javax.xml.XMLConstants/feature/secure-processing'
16:29:07.846 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://apache.org/xml/features/dom/defer-node-expansion'
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://apache.org/xml/features/disallow-doctype-decl'
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG c.s.s.s.CustomSAMLContextProviderImpl - Using default IDP/Peer EntityId https://default-idp.com/sso/idp/SAML2
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://default-idp.com/sso/idp/SAML2
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://default-idp.com/sso/idp/SAML2
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.s.security.saml.util.SAMLUtil - Index for AssertionConsumerService not specified, returning default
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.s.security.saml.SAMLEntryPoint - Processing SSO using WebSSO profile
16:29:07.847 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.s.s.saml.websso.WebSSOProfileImpl - Using default consumer service with binding urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Beginning encode message to outbound transport of type: org.opensaml.ws.transport.http.HttpServletResponseAdapter
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Deflating and Base64 encoding SAML message
16:29:07.848 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Marshalling message
16:29:07.850 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Building URL to redirect client to
16:29:07.850 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Generating signature with key type 'RSA', algorithm URI 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' over query string 'SAMLRequest=jVJLa8JAEL73V4S956n4WEzEVqSCxWBiD72tu6MuJLtxZxPaf9%2FEKLWX0tMwMN%2BD75vZ%2FLMsnAYMSq1iEnoBcUBxLaQ6xWSfr9wJmSdPM2RlEVV0Uduz2sGlBrTOAhGMbXEvWmFdgsnANJLDfreJydnaCqnvX5iHX%2BWJ1SfwGJ6jbuMVeFyXfkfqZ9mWOMuWTypmrybuUAGNK5V1S2G8CyvYATswUxZ4D0ftS1H52eJtExFnpQ2Hq8GYHFmBQJz1MiYsHB%2BOo0MwCIdSiDAYiLNgRyZ4xKftbI8wZYiygR8YYg1rhbbVikkUhCM3GLjhNA9HNJrSYOxNhpMP4qRGW8118SxVn1dtFNUMJVLFSkBqOe3M0cgL6KE%2FQvqa56mbbrOcOO%2F33KMu97YJhbRP%2Bm%2Bu6iZMkr4YenVsHhn%2BJmD36kjyj6Jm%2FqNKclt%2Ff0PyDQ%3D%3D&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1'
16:29:07.851 [ajp-bio-8009-exec-1] DEBUG o.opensaml.xml.security.SigningUtil - Computing signature over input using private key of type RSA and JCA algorithm ID SHA1withRSA
16:29:07.860 [ajp-bio-8009-exec-1] DEBUG o.opensaml.xml.security.SigningUtil - Computed signature: 0ab25de333a8968a0fca40329d52d1e0fef52ecc3aeb94bf5a8e956b560f63ca47bdea64f1611281f29320c5997734dc61dd7adf2b87a44d16f3f639d05221b06909679168996536629bfa72606bd06f95c8bd83ce8ddea4bda13159e40cfbe51f9dcd37f556cf2b465367a180567f5e9d95092b41f42447ec57d77c4c66d7d0615cacf28003422e752da78ea12b274d2bd79df35686a34ed29e3a09c967f29c1b3acbe0c752384b17d7e60f5281e07d6961dedbd2778ea872c6c0be211c154bcdb663c0d14c8accdb61084e8d52acdf76e3496249a952571632a722146cd9515058fe81fbc81abc1de75ee5fe228519f5e5dd2441497c019580795ec1c81520
16:29:07.860 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Generated digital signature value (base64-encoded) CrJd4zOolooPykAynVLR4P71Lsw665S/Wo6Va1YPY8pHvepk8WESgfKTIMWZdzTcYd163yuHpE0W8/Y50FIhsGkJZ5FomWU2Ypv6cmBr0G+VyL2Dzo3epL2hMVnkDPvlH53NN/VWzytGU2ehgFZ/Xp2VCStB9CRH7FfXfExm19BhXKzygANCLnUtp46hKydNK9ed81aGo07SnjoJyWfynBs6y+DHUjhLF9fmD1KB4H1pYd7b0neOqHLGwL4hHBVLzbZjwNFMiszbYQhOjVKs33bjSWJJqVJXFjKnIhRs2VFQWP6B+8gavB3nXuX+IoUZ9eXdJEFJfAGVgHlewcgVIA==
16:29:07.860 [ajp-bio-8009-exec-1] DEBUG PROTOCOL_MESSAGE -
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:AuthnRequest
AssertionConsumerServiceURL="https://my-application.com//saml/SSO"
Destination="https://default-idp.com/sso/idp/SAML2"
ForceAuthn="false" ID="a17bf6b0314idd103dhdafadc2c9afa"
IsPassive="false" IssueInstant="2016-03-19T16:29:07.848Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Version="2.0" xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://my-application.com/</saml2:Issuer>
</saml2p:AuthnRequest>
16:29:07.860 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Successfully encoded message.
16:29:07.860 [ajp-bio-8009-exec-1] DEBUG o.s.s.s.storage.HttpSessionStorage - Storing message a17bf6b0314idd103dhdafadc2c9afa to session 09CFF767DEC97C3B752DBD9E609B15DF
16:29:07.860 [ajp-bio-8009-exec-1] INFO o.s.s.saml.log.SAMLDefaultLogger - AuthNRequest;SUCCESS;127.0.0.1;https://my-application.com/;https://default-idp.com/sso/idp/SAML2;;;
#BOOKMARK-REQUEST-ENDS
# EXPECTS = DEBUG o.s.s.saml.SAMLProcessingFilter - Attempting SAML2 authentication using profile urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser
#BOOKMARK-REQUEST-STARTS
16:30:50.203 [ajp-bio-8009-exec-1] DEBUG c.s.s.s.CustomSAMLContextProviderImpl - Using default SP/Local EntityId https://my-application.com/
16:30:50.203 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://my-application.com/
16:30:50.203 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://my-application.com/
16:30:50.203 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document did not contain a descriptor for entity https://my-application.com/
16:30:50.203 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document did not contain any role descriptors of type {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor for entity https://my-application.com/
16:30:50.204 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document does not contain a role of type {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor supporting protocol urn:oasis:names:tc:SAML:2.0:protocol for entity https://my-application.com/
16:30:50.204 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://my-application.com/
16:30:50.204 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://my-application.com/
16:30:50.205 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Building credential from keystore entry for entityID sam, usage type UNSPECIFIED
16:30:50.205 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Processing PrivateKeyEntry from keystore
16:30:50.205 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.c.EvaluableCredentialCriteriaRegistry - Registry located evaluable criteria class org.opensaml.xml.security.credential.criteria.EvaluableEntityIDCredentialCriteria for criteria class org.opensaml.xml.security.criteria.EntityIDCriteria
16:30:50.205 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Building credential from keystore entry for entityID sam, usage type UNSPECIFIED
16:30:50.205 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Processing PrivateKeyEntry from keystore
16:30:50.205 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.c.EvaluableCredentialCriteriaRegistry - Registry located evaluable criteria class org.opensaml.xml.security.credential.criteria.EvaluableEntityIDCredentialCriteria for criteria class org.opensaml.xml.security.criteria.EntityIDCriteria
16:30:50.219 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://javax.xml.XMLConstants/feature/secure-processing'
16:30:50.219 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://apache.org/xml/features/dom/defer-node-expansion'
16:30:50.220 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://apache.org/xml/features/disallow-doctype-decl'
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG c.s.s.s.CustomSAMLContextProviderImpl - Using default IDP/Peer EntityId https://default-idp.com/sso/idp/SAML2
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://default-idp.com/sso/idp/SAML2
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://default-idp.com/sso/idp/SAML2
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.s.security.saml.util.SAMLUtil - Index for AssertionConsumerService not specified, returning default
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.s.security.saml.SAMLEntryPoint - Processing SSO using WebSSO profile
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:30:50.221 [ajp-bio-8009-exec-1] DEBUG o.s.s.saml.websso.WebSSOProfileImpl - Using default consumer service with binding urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
16:30:50.222 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Beginning encode message to outbound transport of type: org.opensaml.ws.transport.http.HttpServletResponseAdapter
16:30:50.222 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Deflating and Base64 encoding SAML message
16:30:50.222 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Marshalling message
16:30:50.224 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Building URL to redirect client to
16:30:50.224 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Generating signature with key type 'RSA', algorithm URI 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' over query string 'SAMLRequest=jVLJbsIwEL33KyLfs5myWSSIFqEiURWR0ENvxkwTS4kdPE7U%2Fn0TAiq9oB5Hepvem9n8qyycBgxKrSISegFxQAl9lCqLyD5duRMyjx9myMuCVmxR21zt4FQDWmeBCMa2vGetsC7BJGAaKWC%2F20Qkt7ZC5vsn7uF3mfE6A49jTrtLVOAJXfqdqJ8kb8RZtnpScXsOcaUeoXGlsm55NN6JF%2FyAHZkrC6Kno%2FblsfKTxeuGEmeljYBzwIh88gKBOOtlRLgYZmOZc3kYwUAOaC7HUownU55lj8MOg1uOKBv4ZSHWsFZoW6uI0CAcucHADadpOGKDgA0Dj9Lwgzhbo60WuniSqq%2BrNoppjhKZ4iUgs4J12Rj1AnboQche0nTrbt%2BSlDjv19ppV3s7hELWF31fq7oYk7jfhZ0Tm1uF%2BwL8uhyJ%2F7HTzL91iS%2Fn32eIfwA%3D&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1'
16:30:50.224 [ajp-bio-8009-exec-1] DEBUG o.opensaml.xml.security.SigningUtil - Computing signature over input using private key of type RSA and JCA algorithm ID SHA1withRSA
16:30:50.232 [ajp-bio-8009-exec-1] DEBUG o.opensaml.xml.security.SigningUtil - Computed signature: 7901bedd79bd271365601068be83596e5932a902cc36af693f47ce9f63a2ac9387403c713951673ec712f8cc22efe2a13772616f3a82d1c14eee7547fd04f9366e963c62d8af31fd53eb4ded9b3a1869a8df0c0a52b901621a5ec7c9ff5d92b3e7a918de5b7fad61002ffcf8fa3766c8fa2aeba9d5102db80073805d947f8d1334197b228d629769d79968ab448d36090e4362e2bc9b6149161e3aebfe9b2ebf07b76654e58ca2f05ed02a0e3939c266c04b259a9d1b4cc1fc4f124a8c43d029c8e5e1de6f5ed898762f4231dc182fd1855e5316fcd1d13438de85d31f3700757006c3c6f3436a644bad1ac149effdc75effcfecd138219b0f72ef3ada54b306
16:30:50.232 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Generated digital signature value (base64-encoded) eQG+3Xm9JxNlYBBovoNZblkyqQLMNq9pP0fOn2OirJOHQDxxOVFnPscS+Mwi7+KhN3JhbzqC0cFO7nVH/QT5Nm6WPGLYrzH9U+tN7Zs6GGmo3wwKUrkBYhpex8n/XZKz56kY3lt/rWEAL/z4+jdmyPoq66nVEC24AHOAXZR/jRM0GXsijWKXadeZaKtEjTYJDkNi4rybYUkWHjrr/psuvwe3ZlTljKLwXtAqDjk5wmbASyWanRtMwfxPEkqMQ9ApyOXh3m9e2Jh2L0Ix3Bgv0YVeUxb80dE0ON6F0x83AHVwBsPG80NqZEutGsFJ7/3HXv/P7NE4IZsPcu862lSzBg==
16:30:50.233 [ajp-bio-8009-exec-1] DEBUG PROTOCOL_MESSAGE -
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:AuthnRequest
AssertionConsumerServiceURL="https://my-application.com//saml/SSO"
Destination="https://default-idp.com/sso/idp/SAML2"
ForceAuthn="false" ID="ac5g7ihaib6e3i32hi7ic789agg45e"
IsPassive="false" IssueInstant="2016-03-19T16:30:50.221Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Version="2.0" xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://my-application.com/</saml2:Issuer>
</saml2p:AuthnRequest>
16:30:50.233 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Successfully encoded message.
16:30:50.233 [ajp-bio-8009-exec-1] DEBUG o.s.s.s.storage.HttpSessionStorage - Storing message ac5g7ihaib6e3i32hi7ic789agg45e to session 5E6F51ACA1C337DFEA1BAE43F8C0B17D
16:30:50.233 [ajp-bio-8009-exec-1] INFO o.s.s.saml.log.SAMLDefaultLogger - AuthNRequest;SUCCESS;127.0.0.1;https://my-application.com/;https://default-idp.com/sso/idp/SAML2;;;
#BOOKMARK-REQUEST-ENDS
# EXPECTS = DEBUG o.s.s.saml.SAMLProcessingFilter - Attempting SAML2 authentication using profile urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser
#REFRESH-METADATA-STARTS
16:31:06.138 [Timer-0] DEBUG o.o.s.m.p.AbstractReloadingMetadataProvider - Beginning refresh of metadata from '/opt/CONFIG/APP/metadata/idp-meta-nsl.xml'
16:31:06.139 [Timer-0] DEBUG o.o.s.m.p.ResourceBackedMetadataProvider - resource /opt/CONFIG/APP/metadata/idp-meta-nsl.xml was last modified 2016-02-05T00:02:42.000Z
16:31:06.139 [Timer-0] DEBUG o.o.s.m.p.AbstractReloadingMetadataProvider - Metadata from '/opt/CONFIG/APP/metadata/idp-meta-nsl.xml' has not changed since last refresh
16:31:06.139 [Timer-0] DEBUG o.o.s.m.p.AbstractReloadingMetadataProvider - Computing new expiration time for cached metadata from '/opt/CONFIG/APP/metadata/idp-meta-nsl.xml
16:31:06.140 [Timer-0] INFO o.o.s.m.p.AbstractReloadingMetadataProvider - Next refresh cycle for metadata provider '/opt/CONFIG/APP/metadata/idp-meta-nsl.xml' will occur on '2016-03-19T16:36:06.140Z' ('2016-03-19T16:36:06.140Z' local time)
16:36:06.141 [Timer-0] DEBUG o.o.s.m.p.AbstractReloadingMetadataProvider - Beginning refresh of metadata from '/opt/CONFIG/APP/metadata/idp-meta-nsl.xml'
#BOOKMARK-REFRESH-METADATA-STARTS
#BOOKMARK-REQUEST-STARTS
16:59:09.514 [ajp-bio-8009-exec-1] DEBUG c.s.s.s.CustomSAMLContextProviderImpl - Using default SP/Local EntityId https://my-application.com/
16:59:09.515 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://my-application.com/
16:59:09.516 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://my-application.com/
16:59:09.516 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document did not contain a descriptor for entity https://my-application.com/
16:59:09.516 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document did not contain any role descriptors of type {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor for entity https://my-application.com/
16:59:09.516 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Metadata document does not contain a role of type {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor supporting protocol urn:oasis:names:tc:SAML:2.0:protocol for entity https://my-application.com/
16:59:09.516 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://my-application.com/
16:59:09.516 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://my-application.com/
16:59:09.517 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Building credential from keystore entry for entityID sam, usage type UNSPECIFIED
16:59:09.517 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Processing PrivateKeyEntry from keystore
16:59:09.517 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.c.EvaluableCredentialCriteriaRegistry - Registry located evaluable criteria class org.opensaml.xml.security.credential.criteria.EvaluableEntityIDCredentialCriteria for criteria class org.opensaml.xml.security.criteria.EntityIDCriteria
16:59:09.517 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Building credential from keystore entry for entityID sam, usage type UNSPECIFIED
16:59:09.517 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.KeyStoreCredentialResolver - Processing PrivateKeyEntry from keystore
16:59:09.517 [ajp-bio-8009-exec-1] DEBUG o.o.x.s.c.c.EvaluableCredentialCriteriaRegistry - Registry located evaluable criteria class org.opensaml.xml.security.credential.criteria.EvaluableEntityIDCredentialCriteria for criteria class org.opensaml.xml.security.criteria.EntityIDCriteria
16:59:09.531 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://javax.xml.XMLConstants/feature/secure-processing'
16:59:09.532 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://apache.org/xml/features/dom/defer-node-expansion'
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.xml.parse.StaticBasicParserPool - Setting DocumentBuilderFactory attribute 'http://apache.org/xml/features/disallow-doctype-decl'
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG c.s.s.s.CustomSAMLContextProviderImpl - Using default IDP/Peer EntityId https://default-idp.com/sso/idp/SAML2
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.ChainingMetadataProvider - Checking child metadata provider for entity descriptor with entity ID: https://default-idp.com/sso/idp/SAML2
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.p.AbstractMetadataProvider - Searching for entity descriptor with an entity ID of https://default-idp.com/sso/idp/SAML2
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.s.security.saml.util.SAMLUtil - Index for AssertionConsumerService not specified, returning default
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.s.security.saml.SAMLEntryPoint - Processing SSO using WebSSO profile
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selecting default IndexedEndpoint
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.o.s.m.support.SAML2MetadataHelper - Selected IndexedEndpoint with explicit isDefault of true
16:59:09.533 [ajp-bio-8009-exec-1] DEBUG o.s.s.saml.websso.WebSSOProfileImpl - Using default consumer service with binding urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
16:59:09.534 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Beginning encode message to outbound transport of type: org.opensaml.ws.transport.http.HttpServletResponseAdapter
16:59:09.534 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Deflating and Base64 encoding SAML message
16:59:09.534 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Marshalling message
16:59:09.536 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Building URL to redirect client to
16:59:09.536 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Generating signature with key type 'RSA', algorithm URI 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' over query string 'SAMLRequest=jVLLasJAFN33K8Ls89SIGUzEVqSCRTFpF92Nk6sZSWbi3Im0f9%2FEKLUb6fLCeXHOnUy%2FqtI6g0ahZEx8xyMWSK5yIQ8xec8W9phMk6cJsqoMajprTCG3cGoAjTVDBG1a3ouS2FSgU9BnweF9u4pJYUyN1HVPzMHv6sCaAzgMi6C7eA0OV5XbibppuibWvNUTkplLiBs1h7MtpLGrXDsnVrIddmQmDfCejsoVee2ms7dVQKyF0hwuAWOyZyUCsZbzmLBgGIp9uIOhPx4ci9CPjsWQ7cZcHAd51GJwwxDFGX5ZiA0sJZrWKiaB549sb2D7UeaPaBhRL3LCwfCTWButjOKqfBayr6vRkiqGAqlkFSA1nHbZaOB4dNeDkL5m2cberNOMWB%2B32oOu9nYIibQv%2BrFWfTUmSb8LvSTW9wqPBdhtOZL8Y6eJe%2B%2BSXM%2B%2Fz5D8AA%3D%3D&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1'
16:59:09.536 [ajp-bio-8009-exec-1] DEBUG o.opensaml.xml.security.SigningUtil - Computing signature over input using private key of type RSA and JCA algorithm ID SHA1withRSA
16:59:09.544 [ajp-bio-8009-exec-1] DEBUG o.opensaml.xml.security.SigningUtil - Computed signature: 3f398705a802aab6e084e3fa021f94e773e66d864f5fa71208bd96ca3312525f8bbf7fb914e6b2ab606cada63b4a3846280fe833d250c7c44050267c94bde585c283f5bf6876e6cfed238191fe2a0b03c7a6fb34651144a132bb7bd8485b0eec466f84b748fb6f10a11329e667279ebd141c8e48dfa1284863ad92ed6c0fbf7ec925a61fe2d305a028913c876b4e9d9558372bac13789362cc2010557c2d863da13ccbcc17cc322dab85308dd495b31fd008ada4813361da5cb7d5ee111d0f457e8a3b0c37bf2653cdbb99812bef0736c686b454babf699c8839d55d6a846fd1f9efc0f7a5649526a6a4230f53362a0ab9a3ca284393b4b2b81c0e7d6688db4d
16:59:09.544 [ajp-bio-8009-exec-1] DEBUG o.o.s.b.e.HTTPRedirectDeflateEncoder - Generated digital signature value (base64-encoded) PzmHBagCqrbghOP6Ah+U53PmbYZPX6cSCL2WyjMSUl+Lv3+5FOayq2BsraY7SjhGKA/oM9JQx8RAUCZ8lL3lhcKD9b9odubP7SOBkf4qCwPHpvs0ZRFEoTK7e9hIWw7sRm+Et0j7bxChEynmZyeevRQcjkjfoShIY62S7WwPv37JJaYf4tMFoCiRPIdrTp2VWDcrrBN4k2LMIBBVfC2GPaE8y8wXzDItq4UwjdSVsx/QCK2kgTNh2ly31e4RHQ9Ffoo7DDe/JlPNu5mBK+8HNsaGtFS6v2mciDnVXWqEb9H578D3pWSVJqakIw9TNioKuaPKKEOTtLK4HA59ZojbTQ==
16:59:09.545 [ajp-bio-8009-exec-1] DEBUG PROTOCOL_MESSAGE -
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:AuthnRequest
AssertionConsumerServiceURL="https://my-application.com//saml/SSO"
Destination="https://default-idp.com/sso/idp/SAML2"
ForceAuthn="false" ID="a245if5be4183jh519jh4ab8cij3d9"
IsPassive="false" IssueInstant="2016-03-19T16:59:09.534Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Version="2.0" xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://my-application.com/</saml2:Issuer>
</saml2p:AuthnRequest>
16:59:09.545 [ajp-bio-8009-exec-1] DEBUG o.o.w.m.encoder.BaseMessageEncoder - Successfully encoded message.
16:59:09.545 [ajp-bio-8009-exec-1] DEBUG o.s.s.s.storage.HttpSessionStorage - Storing message a245if5be4183jh519jh4ab8cij3d9 to session 0AFFA9527C8EEF8479BFCB6AE6655D3B
16:59:09.545 [ajp-bio-8009-exec-1] INFO o.s.s.saml.log.SAMLDefaultLogger - AuthNRequest;SUCCESS;127.0.0.1;https://my-application.com/;https://default-idp.com/sso/idp/SAML2;;;
Thanks in advance.
As far as you obtained:
16:59:09.545 [ajp-bio-8009-exec-1] INFO o.s.s.saml.log.SAMLDefaultLogger - AuthNRequest;SUCCESS;127.0.0.1;https://my-application.com/;https://default-idp.com/sso/idp/SAML2
the AuthN process on the IdP-side has been completed.
Generally, there are two main cases:
there is an error in your implementation of SAMLUserDetailsService interface. In particular, check if the list of authorities for the instance of org.springframework.security.core.userdetails.User (returned by the method loadUserBySAML) contains at least one org.springframework.security.core.GrantedAuthority, properly configured according to your role model.
there is an unexpected behavior while executing the filter chain, thus the security context is cleaned right after the authentication process (i.e., Spring Security on Wildfly / Undertow: error executing the filter chain).
If your issue doesn't belong to those two cases, please provide a more verbose log to better point out the cause of the infinite loop.
make sure you import trust of your IDP in SP machines, and alos make sure SP and IDP in same time , we faced a similar issue and an system restart of IDP and SP has solved the issue.
Related
no transaction is in progress - Karaf + Camel 3.3. 0 + JPA
I have been trying to implement a simple Camel + Karaf Webservice which saves the entity into the database using camel JPA but I haven't been successfully. The problem I am facing is that when I try to save data using to("jpa://entityClass") I am getting the below exception: javax.persistence.TransactionRequiredException: no transaction is in progress at **org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:413) ~[?:?] ..... at org.apache.camel.component.jpa.JpaProducer$3.doInTransaction(JpaProducer.java:310) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)** at org.apache.camel.component.jpa.JpaProducer.processEntity(JpaProducer.java:254) at org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:173) at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:67) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168) at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395) at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) at org.apache.camel.processor.Pipeline.process(Pipeline.java:147) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286)... at org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:219) at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:569) My Project Setup: Camel 3.3.0 , Karaf 4.2.10 Routes use Java DSL On Karaf, I have installed the MSSQL Data Source which works fine. My Camel Context: <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/spring/camel-blueprint.xsd" > <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent"> <property name="joinTransaction" value="false"/> </bean> <cm:property-placeholder persistent-id="application"> </cm:property-placeholder> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <package>com.abc.routes</package> </camelContext> </blueprint> I see that the Entity Manager and Transaction Manager are getting plugged in correctly and I don't see any issue with respect to DB connectivity: Logs 10:01:24.648 INFO [pipe-restart 301] HHH000490: Using JtaPlatform implementation: [org.hibernate.osgi.OsgiJtaPlatform] 10:01:24.655 INFO [pipe-restart 301] Tracking DataSource for punit camel with filter (&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name=myDs)) 10:01:24.658 INFO [pipe-restart 301] Found DataSource for camel osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=myDs) 10:01:24.661 INFO [pipe-restart 301] HHH000204: Processing PersistenceUnitInfo [name: camel] 10:01:25.037 INFO [pipe-restart 301] HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect 10:01:24.658 INFO [pipe-restart 301] Found DataSource for camel osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=myDS) 10:01:25.037 INFO [pipe-restart 301] HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect 10:01:25.127 WARN [pipe-restart 301] HHH000038: Composite-id class does not override equals(): com.mycompany.model 10:01:25.128 WARN [pipe-restart 301] HHH000039: Composite-id class does not override hashCode(): com.mycompany.model 10:01:25.130 INFO [pipe-restart 301] HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader. 10:01:26.498 INFO [pipe-restart 301] HHH000490: Using JtaPlatform implementation: [org.hibernate.osgi.OsgiJtaPlatform] 10:01:26.511 INFO [pipe-restart 301] Persistence units added for bundle camel-db event 128 10:01:26.597 INFO [pipe-restart 301] Blueprint bundle camel-db/1.0.0.SNAPSHOT has been started 10:01:26.600 INFO [Blueprint Event Dispatcher: 1] Attempting to start CamelContext: camel-2 10:01:26.605 INFO [Blueprint Event Dispatcher: 1] JMX is enabled 10:01:26.660 INFO [Blueprint Event Dispatcher: 1] Apache Camel 3.3.0 (CamelContext: camel-2) is starting **10:01:26.695 INFO [Blueprint Event Dispatcher: 1] Using EntityManagerFactory found in registry with id [EntityManagerFactory0] org.hibernate.internal.SessionFactoryImpl#33bc3397** **10:01:26.697 INFO [Blueprint Event Dispatcher: 1] Using TransactionManager found in registry with id [PlatformTransactionManager0] org.ops4j.pax.transx.tm.impl.geronimo.GeronimoPlatformTransactionManager#3c487367** Can any one help? I have been trying to resolve this for more than a month now. There are solutions for similar problems but not for Camel on Karaf.
I fixed it myself. Issue was in the persistence.xml. The transaction-type was set to "RESOURCE_LOCAL" and I changed to JTA and added a JTA data source.
Does Spring Cloud AWS Secrets Manager config compatible with Spring Boot 2?
I'm trying to run spring-cloud-starter-aws-secrets-manager-config with Spring Boot 2.1.0.RELEAS version and I have the following error: 14:26:59.423 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.0.13.Final 14:26:59.430 [background-preinit] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable. 14:26:59.434 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration. 14:26:59.435 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL 14:26:59.436 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader 14:26:59.436 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only. 14:26:59.561 [background-preinit] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL 14:26:59.565 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator. 14:26:59.565 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver. 14:26:59.565 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider. 14:26:59.565 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider. 14:26:59.565 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory. 14:26:59.783 [main] ERROR org.springframework.boot.SpringApplication - Application run failed java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347) at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
Invalid connector configuration using Shibboleth IdP 3.3.2 with Postgres
I am using DataConnector in attribute-resolver.xml to connect to database and fetch attributes. When i connect to local postgres using the below configuration it works, means i am able to go to Unsolicited idp link idp/profile/SAML2/Unsolicited, authenticate and fetch the attributes and generate Saml2 assertion and send it to SP. <DataConnector id="myDatabase" xsi:type="RelationalDatabase"> <ApplicationManagedConnection jdbcDriver="org.postgresql.Driver" jdbcURL="jdbc:postgresql://localhost:5432/postgres" jdbcUserName="postgres" jdbcPassword="postgresql" /> <QueryTemplate> <![CDATA[ SELECT password, 12345 as EmployeeID, 'Nilesh' as FirstName, 'Lulla' as LastName from users where username='$requestContext.principalName' ]]> </QueryTemplate> <Column columnName="password" attributeID="password" /> <Column columnName="employeeid" attributeID="EmployeeID" /> <Column columnName="firstname" attributeID="FirstName" /> <Column columnName="lastname" attributeID="LastName" /> </DataConnector> When i use the postgres server url and connection string it gives error, Shibboleth is not starting at all. Status page is also not opening. https://idp.abc.com/idp/status <DataConnector id="myDatabase" xsi:type="RelationalDatabase"> <ApplicationManagedConnection jdbcDriver="org.postgresql.Driver" jdbcURL="jdbc:postgresql://TPA1238.enterprise.org:5444/cpe_admin" jdbcUserName="admin_temp" jdbcPassword="temp2018" /> <QueryTemplate> <![CDATA[ SELECT panelist_id, first_name, last_name from user_details where user_id='$requestContext.principalName' ]]> </QueryTemplate> <Column columnName="panelist_id" attributeID="EmployeeID" /> <Column columnName="first_name" attributeID="FirstName" /> <Column columnName="last_name" attributeID="LastName" /> </DataConnector> I am getting the following errors: 2018-02-02 21:24:44,530 - DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory:568] - Retrieved dependent beans for bean '(inner bean)#1c33e528': [eduPersonPrincipalName] 2018-02-02 21:24:44,530 - DEBUG [org.springframework.beans.factory.support.DisposableBeanAdapter:337] - Invoking destroy method 'destroy' on bean with name '(inner bean)#53d2d002' 2018-02-02 21:24:44,531 - DEBUG [org.springframework.beans.factory.support.DisposableBeanAdapter:337] - Invoking destroy method 'destroy' on bean with name '(inner bean)#5b39a3e6' 2018-02-02 21:24:44,531 - DEBUG [org.springframework.beans.factory.support.DisposableBeanAdapter:337] - Invoking destroy method 'destroy' on bean with name 'net.shibboleth.idp.saml.attribute.encoding.impl.SAML2ScopedStringAttributeEncoder#0' 2018-02-02 21:24:44,532 - DEBUG [org.springframework.beans.factory.support.DisposableBeanAdapter:337] - Invoking destroy method 'destroy' on bean with name 'net.shibboleth.idp.saml.attribute.encoding.impl.SAML1ScopedStringAttributeEncoder#0' 2018-02-02 21:24:44,542 - ERROR [net.shibboleth.utilities.java.support.service.AbstractReloadableService:181] - Service 'shibboleth.AttributeResolverService': Initial load failed net.shibboleth.utilities.java.support.service.ServiceException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myDatabase': Invocation of init method failed; nested exception is net.shibboleth.utilities.java.support.component.ComponentInitializationException: Data Connector 'myDatabase': Invalid connector configuration at net.shibboleth.ext.spring.service.ReloadableSpringService.doReload(ReloadableSpringService.java:336) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myDatabase': Invocation of init method failed; nested exception is net.shibboleth.utilities.java.support.component.ComponentInitializationException: Data Connector 'myDatabase': Invalid connector configuration at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) Caused by: net.shibboleth.utilities.java.support.component.ComponentInitializationException: Data Connector 'myDatabase': Invalid connector configuration at net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.RDBMSDataConnector.doInitialize(RDBMSDataConnector.java:141) Caused by: net.shibboleth.idp.attribute.resolver.dc.ValidationException: Invalid connector configuration at net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.DataSourceValidator.validate(DataSourceValidator.java:165) Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) Caused by: java.lang.InterruptedException: null at java.lang.Object.wait(Native Method) 2018-02-02 21:24:44,543 - INFO [net.shibboleth.utilities.java.support.service.AbstractReloadableService:183] - Service 'shibboleth.AttributeResolverService': Continuing to poll configuration 2018-02-02 21:24:44,543 - INFO [net.shibboleth.utilities.java.support.service.AbstractReloadableService:199] - Service 'shibboleth.AttributeResolverService': Reload time set to: 900000, starting refresh thread 2018-02-02 21:24:44,544 - DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory:484] - Finished creating instance of bean 'shibboleth.AttributeResolverService' and 018-02-02 21:24:44,580 - DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory:251] - Returning cached instance of singleton bean 'shibboleth.IdentifiableBeanPostProcessor' 2018-02-02 21:24:44,583 - DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory:251] - Returning cached instance of singleton bean 'shibboleth.NameIdentifierGenerationResources' 2018-02-02 21:24:44,584 - TRACE [org.springframework.beans.TypeConverterDelegate:438] - Converting String to [interface org.springframework.core.io.Resource] using property editor [org.springframework.core.io.ResourceEditor#800d065] 2018-02-02 21:24:44,586 - TRACE [org.springframework.beans.TypeConverterDelegate:438] - Converting String to [interface org.springframework.core.io.Resource] using property editor [org.springframework.core.io.ResourceEditor#800d065] 2018-02-02 21:24:44,592 - DEBUG [org.springframework.beans.TypeConverterDelegate:315] - Original ConversionService attempt failed - ignored since PropertyEditor based conversion eventually succeeded org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.util.ArrayList<?>] to type [#javax.annotation.Nonnull #javax.annotation.Nullable java.util.List<org.springframework.core.io.Resource>] for value '[C:/Program Files (x86)/Shibboleth/IdP/conf/saml-nameid.xml, C:/Program Files (x86)/Shibboleth/IdP/system/conf/saml-nameid-system.xml]'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.util.ArrayList<?>] to type [#javax.annotation.Nonnull #javax.annotation.Nullable org.springframework.core.io.Resource] at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:42) Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.util.ArrayList<?>] to type [#javax.annotation.Nonnull #javax.annotation.Nullable org.springframework.core.io.Resource] at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:313) 2018-02-02 21:24:44,596 - DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory:1678] - Invoking init method 'initialize' on bean with name 'shibboleth.NameIdentifierGenerationService' 2018-02-02 21:24:44,597 - INFO [net.shibboleth.utilities.java.support.service.AbstractReloadableService:172] - Service 'shibboleth.NameIdentifierGenerationService': Performing initial load 2018-02-02 21:24:44,598 - INFO [net.shibboleth.utilities.java.support.service.AbstractReloadableService:258] - Service 'shibboleth.NameIdentifierGenerationService': Reloading service configuration When i use local postgres for fetching attributes in attribute-resolver.xml and for Authentication when i use JAAS with the same postgres server configuration that works fine. com.tagish.auth.DBLogin required debug=true dbDriver="org.postgresql.Driver" dbURL="jdbc:postgresql://TPA1238.enterprise.org:5444/cpe_admin" dbUser="admin_temp" dbPassword="temp2018" userTable="user_details" userColumn="user_id" passColumn="user_id";
There was some compatibility issue for which i just upgraded my postgres driver to latest one and it worked. Link to download the driver. https://jdbc.postgresql.org/download.html I was using postgresql-9.4.1211.jre6.jar i tried with postgresql-42.2.1.jar and it worked.
Tomcat logback console appender follows ROOT level only and not named appenders
I use Tomcat with Eclipse. I recently upgraded to Neon and also recreated my Tomcat server configuration in there. Since then, I have not been able to log my web application properly to the Eclipse console. Specifically, if I set an INFO level in my web application appenders, they will go successfully to a log file, but not the console. Strangely, it is only if I change the ROOT level from WARN to INFO, then the console will show the INFO levels for my application. But of course that puts everything else at INFO also, making this not very useful. I send all Tomcat logging through logback as well. For my launch configuration, I use in arguments: -Dcatalina.base="C:\dev\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="C:\dev\apache-tomcat-7.0.52" -Dwtp.deploy="C:\dev\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -Djava.endorsed.dirs="C:\dev\apache-tomcat-7.0.52\endorsed" -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" -Djava.util.logging.config.file="C:/dev/apache-tomcat-7.0.52/conf/logging.properties" -Ddeployment.security.SSLv2Hello=false -Ddeployment.security.SSLv3=false -Ddeployment.security.TLSv1=false -Ddeployment.security.TLSv1.1=true -Ddeployment.security.TLSv1.2=true -Dlogback.configurationFile="C:/dev/apache-tomcat-7.0.52/lib/logback.xml" and in the classpath, I add tomcat-juli.jar and jul-to-slf4j-1.7.25.jar. Here is my logback.xml: <?xml version="1.0" encoding="UTF-8"?> <configuration scan="true" scanPeriod="10 seconds"> <!-- always a good idea to have an OnConsoleStatusListener --> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level (%file:%line\) - %message%n</pattern> </encoder> </appender> <!-- Tomcat service output has been disabled so all stdout/stderr messages come here as well. --> <appender name="main" class="ch.qos.logback.core.rolling.RollingFileAppender"> --> <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender --> <File>C:/dev/apache-tomcat-7.0.52/logs/tomcat7.log</File> <Append>true</Append> <encoder> <Charset>UTF-8</Charset> <pattern>%5level [%thread] %date{ISO8601} %class{0}:%line %mdc{requestId} - %message %n%rootException</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <maxHistory>10</maxHistory> <FileNamePattern>C:/dev/apache-tomcat-7.0.52/logs/tomcat7.%d{yyyy-MM-dd}.log</FileNamePattern> </rollingPolicy> </appender> <!-- If desired, we can create a class logger with additivity false to put that in its own log file --> <!-- be quiet --> <logger name="org.apache.struts2.util.TokenHelper" level="ERROR" /> <logger name="org.dbunit.dataset.AbstractTableMetaData" level="ERROR"/> <logger name="org.springframework.mock.web.MockServletContext" level="ERROR"/> <logger name="org.w3c.tidy" level="OFF"/> <logger name="com.opensymphony.xwork2.DefaultActionProxy" level="ERROR"/> <!-- having issues with logging --> <logger name="ch.qos" level="DEBUG" /> <logger name="com.mycompany.web.product.Catalog" level="INFO" /> <root level="WARN"> <appender-ref ref="CONSOLE"/> <appender-ref ref="main"/> </root> </configuration> And here is the output in the Eclipse console I get when I start Tomcat: 20:01:06,793 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [C:/dev/apache-tomcat-7.0.52/lib/logback.xml] at [file:/C:/dev/apache-tomcat-7.0.52/lib/logback.xml] 20:01:06,938 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set 20:01:06,974 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/C:/dev/apache-tomcat-7.0.52/lib/logback.xml] 20:01:06,975 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 10 seconds 20:01:06,980 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Added status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener] 20:01:07,017 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] 20:01:07,023 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE] 20:01:07,032 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property 20:01:07,079 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender] 20:01:07,083 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [main] 20:01:07,086 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property 20:01:07,100 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy#391359742 - No compression will be used 20:01:07,103 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy#391359742 - Will use the pattern C:/dev/apache-tomcat-7.0.52/logs/tomcat7.%d{yyyy-MM-dd}.log for the active file 20:01:07,111 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'C:/dev/apache-tomcat-7.0.52/logs/tomcat7.%d{yyyy-MM-dd}.log'. 20:01:07,111 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight. 20:01:07,119 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sun Jul 09 19:51:44 EDT 2017 20:01:07,124 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[main] - Active log file name: C:/dev/apache-tomcat-7.0.52/logs/tomcat7.log 20:01:07,124 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[main] - File property is set to [C:/dev/apache-tomcat-7.0.52/logs/tomcat7.log] 20:01:07,128 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.struts2.util.TokenHelper] to ERROR 20:01:07,128 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.dbunit.dataset.AbstractTableMetaData] to ERROR 20:01:07,128 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.mock.web.MockServletContext] to ERROR 20:01:07,128 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.w3c.tidy] to OFF 20:01:07,128 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.opensymphony.xwork2.DefaultActionProxy] to ERROR 20:01:07,129 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [ch.qos] to DEBUG 20:01:07,129 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.sentrylink.web.product.Catalog] to INFO 20:01:07,129 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN 20:01:07,130 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT] 20:01:07,131 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [main] to Logger[ROOT] 20:01:07,131 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration. 20:01:07,132 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#14acaea5 - Registering current configuration as safe fallback point 20:01:07.606 [main] WARN (SetPropertiesRule.java:218) - [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:web' did not find a matching property. 20:01:10,298 |-INFO in ch.qos.logback.classic.servlet.LogbackServletContainerInitializer#55d16720 - Adding an instance of class ch.qos.logback.classic.servlet.LogbackServletContextListener to the current web-app 20:01:17,590 |-INFO in ch.qos.logback.classic.servlet.LogbackServletContainerInitializer#75b3fa82 - Adding an instance of class ch.qos.logback.classic.servlet.LogbackServletContextListener to the current web-app 20:01:24,547 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - filename property not set. Assuming [conf\logback-access.xml] 20:01:24,547 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Could NOT configuration file [C:\dev\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\logback-access.xml] using property "catalina.base" 20:01:24,547 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Found configuration file [C:\dev\apache-tomcat-7.0.52\conf\logback-access.xml] using property "catalina.home" 20:01:24,554 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - debug attribute not set 20:01:24,554 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Added status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener] 20:01:24,554 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender] 20:01:24,554 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE] 20:01:24,556 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy#1990676241 - No compression will be used 20:01:24,556 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy#1990676241 - Will use the pattern logs/data-access.%d{yyyy-MM-dd}.log for the active file 20:01:24,557 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'logs/data-access.%d{yyyy-MM-dd}.log'. 20:01:24,557 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight. 20:01:24,558 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sat Jul 08 22:21:36 EDT 2017 20:01:24,558 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.access.PatternLayoutEncoder] for [encoder] property 20:01:24,572 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: logs/data-access.log 20:01:24,572 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [logs/data-access.log] 20:01:24,573 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - End of configuration. 20:01:24,573 |-INFO in ch.qos.logback.access.joran.JoranConfigurator#783a197d - Registering current configuration as safe fallback point 20:01:24,573 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Done configuring At this point I load a web page that triggers the Catalog class with INFO logging. It successfully logs in the tomcat7.log file listed above. But it does NOT appear in the console. If I change the Catalog appender to WARN level the log file correctly leaves out the INFO messages. And as mentioned earler, if I leave the Catalog appender at INFO and change the ROOT appender to INFO, it will show up in the console along with everything else. I have upgraded to the latest versions of logback and slf4j and it has not helped. Any help appreciated.
I was able to resolve this. I have a custom context.xml as part of my Eclipse Tomcat server configuration. It had the attribute, swallowOutput="true". This is good for a production machine (it suppresses stdout) but not for what I was trying to do here. After setting that false, things worked. Why it worked before in Luna, but not Neon, who knows.
Instantiating EntityManagerFactory with GWT, JPA and Tomcat
I am using GWT with JPA and Hibernate in Tomcat Apache container. When I try testing my dao and database connection from a Standalone java application it works fine. Howerver, when I use it in server enviornment, it SOMETIMES works sometimes doesn't. Here is an abridged sequence of logevents: org.hibernate.type.BasicTypeRegistry - Adding type registration boolean -> org.hibernate.type.BooleanType#82b436 INFO org.hibernate.cfg.Environment - Hibernate 3.6.0.Final 42937 [btpool0-0] INFO org.hibernate.cfg.Environment -hibernate.properties not found 42940 [btpool0-0] INFO org.hibernate.cfg.Environment -Bytecode provider name : javassist [btpool0-0] INFO org.hibernate.cfg.Environment - usingJDK 1.4 java.sql.Timestamp handling 43038 [btpool0-0] DEBUG org.hibernate.id.factory.DefaultIdentifierGeneratorFactor - Registering IdentifierGenerator strategy [uuid2] -> [class org.hibernate.id.UUIDGenerator] 43069 [btpool0-0] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.6.0.Final 43090 [btpool0-0] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration text -> org.hibernate.type.TextType#1cf00aa43106 [btpool0-0] DEBUG org.hibernate.ejb.Ejb3Configuration - Look up for persistence unit: transactions-optional 43269 [btpool0-0] DEBUG org.hibernate.ejb.Ejb3Configuration Detect class: true; detect hbm: true 43285 [btpool0-0] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Searching mapped entities in jar/par: file://xxxxx 43378 [btpool0-0] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: com.demo.server.hello 43492 [btpool0-0] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Java element filter matched for com.demo.server.hello 43505 [btpool0-0] DEBUG org.hibernate.ejb.Ejb3Configuration - Detect class: true; detect hbm: true 43505 [btpool0-0] DEBUG org.hibernate.ejb.Ejb3Configuration - Creating Factory: transactions-optional After this I get no log message and my client layer can not talk to database layer. When my client layer is able to talk to database layer, the entry following above log entry is as follows: 1063 [main] DEBUG org.hibernate.cfg.Configuration - Processing hbm.xml files If you could point out as to what might be going wrong, I will really appreciate it. I can't figure out if its eclipse compilation fault, or some problem in GWT plugin or (most likely) my programming bug.
Are you sure you are using JPA? I'm not familiar with GWT, but I assume it deploys your application as a WAR file. If so, check if you WAR file contains a META-INF/persistence.xml file, and verify the connection details from there. 1063 [main] DEBUG org.hibernate.cfg.Configuration - Processing hbm.xml files It seems that Hibernate is creating a session every time your client is able to talk to the database. The fact that sometimes it's called (and works) indicates that it's not a problem with Hibernate. Otherwise, you'd see a consistent behavior. So, I would double-check if the requests are not failing before reaching Hibernate. For instance, I would try to add some debug log entries before and after Hibernate is called.