Jdbctemplate connection issue with ejb with java api - jndi

I have spring core api, which is working fine on server start up and am getting the data from oracle database.
When trying to invoke the JAVAapi through ejb application I'm getting below issues. on jndi connection
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection;
nested exception is org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!;
- nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a56092b:f14d:598d7b69:65 status: ActionStatus.ABORT_ONLY >);
- nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!;
- nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a56092b:f14d:598d7b69:65 status: ActionStatus.ABORT_ONLY >))

Related

Devops2019 JobAgent Down after URL Change

We are using Devops 2019 (App and data tiers are on two different servers),As part of our domain migration we have changed our Devops URL
from: https:\domain.wireless.com
to: https:\domain.wire.com
But post URL change, we have noticed all the build agents stopped working (self hosted agents ) and when admin console is launched and tried to send test mail I see below:
Exception Message: The underlying connection was closed:
An unexpected error occurred on a send. (type WebException)Exception Stack Trace:
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.TeamFoundation.Admin.Console.Models.DlgSendTestMailViewModel.SendEmail()
Inner Exception Details:
Exception Message: Unable to read data from the transport connection:
An existing connection was forcibly closed by the remote host. (type IOException)
Exception Stack Trace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
Need some assistance on how to resolve such issues
Probably not your ideal approach, but you could just remove and register the agents using the new URL. You'd have to reset any custom capabilities afterwards.
For windows, the URL is stored in a hidden file at the agent root folder. I don't think it works just modifying it in that agent configuration, but you could try changing one and stop/start the agent if it is running as a service. If it is running auto-login (maybe for UI testing), I've never had any success except for removing/reconfiguring.

Spring security and shared sessions across two services

I have an auth-service (which does LDAP authentication and DB authorization). - uses spring security and spring session redis
Have a data-service which uses the auth-service for authentication/session management. - uses spring session redis and spring security(uses custom auth provider to call the auth-service via a Feign client)
So when use logs-in it hits the auth-service /user endpoint and gets the sessionid back. When I use the same sessionid for an endpoint in data-service, I get the below error
Uncaught exception thrown
org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is org.springframework.core.NestedIOException: Failed to deserialize object type; nested exception is java.lang.ClassNotFoundException: XXX (an entity in auth-service)
Redis details
127.0.0.1:6379> KEYS *
1) "spring:session:sessions:expires:ff3705e1-7403-48dc-a026-4b71d4c847f1"
2) "spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:xxxx"
3) "spring:session:sessions:ff3705e1-7403-48dc-a026-4b71d4c847f1"
4) "spring:session:expirations:1535652420000"
127.0.0.1:6379>
Thanks

IdP metadata format for spring-security-saml

While deploying the sample app from the Quick Start guide in spring-security-saml, I have an import error of the site metadata not clear to me:
- FrameworkServlet 'saml': initialization completed in 399 ms
Started Tomcat Server
The Server is running at http://localhost:8080/spring-security-saml2-sample
- Next refresh cycle for metadata provider 'https://shibboleth.example.org/inner-metadata.xml' will occur on '2015-10-27T08:47:06.933Z' ('2015-10-27T09:47:06.933+01:00' local time)
- Metadata provider failed to properly initialize, fail-fast=true, halting
org.opensaml.saml2.metadata.provider.MetadataProviderException: java.lang.NullPointerException
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.refresh(AbstractReloadingMetadataProvider.java:267)
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.doInitialization(AbstractReloadingMetadataProvider.java:236)
at org.opensaml.saml2.metadata.provider.AbstractMetadataProvider.initialize(AbstractMetadataProvider.java:407)
at org.springframework.security.saml.metadata.ExtendedMetadataDelegate.initialize(ExtendedMetadataDelegate.java:167)
at org.springframework.security.saml.metadata.MetadataManager.initializeProvider(MetadataManager.java:412)
at org.springframework.security.saml.metadata.MetadataManager.refreshMetadata(MetadataManager.java:238)
at org.springframework.security.saml.metadata.CachingMetadataManager.refreshMetadata(CachingMetadataManager.java:86)
at org.springframework.security.saml.metadata.MetadataManager$RefreshTask.run(MetadataManager.java:1040)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.NullPointerException
at org.opensaml.saml2.common.SAML2Helper.getEarliestExpiration(SAML2Helper.java:112)
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.processCachedMetadata(AbstractReloadingMetadataProvider.java:328)
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.refresh(AbstractReloadingMetadataProvider.java:258)
... 9 more
- Initialization of metadata provider org.opensaml.saml2.metadata.provider.HTTPMetadataProvider#54b1cd failed, provider will be ignored
org.opensaml.saml2.metadata.provider.MetadataProviderException: java.lang.NullPointerException
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.refresh(AbstractReloadingMetadataProvider.java:267)
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.doInitialization(AbstractReloadingMetadataProvider.java:236)
at org.opensaml.saml2.metadata.provider.AbstractMetadataProvider.initialize(AbstractMetadataProvider.java:407)
at org.springframework.security.saml.metadata.ExtendedMetadataDelegate.initialize(ExtendedMetadataDelegate.java:167)
at org.springframework.security.saml.metadata.MetadataManager.initializeProvider(MetadataManager.java:412)
at org.springframework.security.saml.metadata.MetadataManager.refreshMetadata(MetadataManager.java:238)
at org.springframework.security.saml.metadata.CachingMetadataManager.refreshMetadata(CachingMetadataManager.java:86)
at org.springframework.security.saml.metadata.MetadataManager$RefreshTask.run(MetadataManager.java:1040)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.NullPointerException
at org.opensaml.saml2.common.SAML2Helper.getEarliestExpiration(SAML2Helper.java:112)
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.processCachedMetadata(AbstractReloadingMetadataProvider.java:328)
at org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider.refresh(AbstractReloadingMetadataProvider.java:258)
... 9 more
The metadata at: https://shibboleth.example.org/inner-metadata.xml is a signed metadata used in the organization (a lot of SP data, some IdP) by Internet2 shibboleth-sp with no problems.
Which is the expected format of IdP metadata for spring-security-saml?
According to the shipped example in the sample application, the IdP metadata contains data for a single IdP, in opposite to your organization metadata which very likely contains all SP and IdP metadata of all SAML actors in your site.
Try extracting the metadata for a single IdP.

Grails + spring-security-core:2.0-RC4 + spring-security-ldap:2.0-RC2

I'm using Grails 2.4 + spring-security-core:2.0-RC4.
I want to use LDAP for authentication but allow only usernames that are in the database and enabled for login.
I already have three domains: user, role and UserRole.
I add compile ":spring-security-ldap:2.0-RC2" in BuildConfig.groovy
and followed the example below but It doesn't work:
This is the error I am getting:
Error | 2015-03-25 18:05:38,542 [http-bio-8090-exec-2] ERROR authentication.RequestHolderAuthenticationFilter - An internal error occurred while trying to authenticate the user. Message: Uncategorized exception occured during LDAP processing; nested exception is javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0906E9, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 –
https://chlebik.wordpress.com/2014/10/27/ldap-authentication-and-db-authorisation-with-grails-spring-security/
How do I resolve this?

Error with WSO2 API Manager OAuth Authentication

I installed the latest WS02 API Manager, 1.6.0. I followed the directions and just did the plain install, nothing special. When I create an API, publish it, subscribe to it, create an Access Token, and try to access it, I am seeing the following error (I replaced the access key, but it is displaying):
[2014-02-03 13:25:47,850] ERROR - APIAuthenticationHandler API authentication failure
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /weather, version: 1 with key: access_key
It seems that the API and access key are not getting connected. Is there something else that I have to do to make that happen? I am not using a separate database for the Key Manager, just whatever comes with the install which is a memory DB I assume. I have tried this from Advanced Rest Client in Chrome. I'm guessing something's just not configured correctly, but I don't see any errors in the start-up. I just see a few warnings along these lines:
[2014-02-03 13:25:01,262] WARN - DefaultSchemaGenerator We don't support method overloading. Ignoring [validateAudience Restriction]
Here is the full stack trace for the error:
[2014-02-03 13:25:47,850] ERROR - APIAuthenticationHandler API authentication failure
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /weather, version: 1 with key: access_key
at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.jav
a:139)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHand
ler.java:92)
at org.apache.synapse.rest.API.process(API.java:285)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:336
)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)

Resources