adal4j: testAcquireToken fails - java

I've downloaded adal4j from Github and I've built it with maven. Compilation passed successfully but one of the tests - testAcquireToken() always fails with the same error:
AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.
What I am doing wrong? I am interesting exactly in the scenario of this test.
My environment: Windows 7 64 bit. Java version "1.7.0_02" 32 bit.
testAcquireToken
java.util.concurrent.ExecutionException: java.lang.AssertionError:
Unexpected method call AuthenticationCallback.onFailure(com.microsoft.aad.adal4j.AuthenticationException: {"error":"invalid_client","error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 285b162f-2655-429a-bde7-3c5042aed74e\r\nCorrelation ID: b5eae0c9-2574-4ffb-ade8-8a25f02df980\r\nTimestamp: 2014-09-09 13:48:26Z"}):
AuthenticationCallback.onSuccess(<any>): expected: 1, actual: 0
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at com.microsoft.aad.adal4j.AuthenticationContextTest.testAcquireToken(AuthenticationContextTest.java:102)
Caused by: java.lang.AssertionError:
Unexpected method call AuthenticationCallback.onFailure(com.microsoft.aad.adal4j.AuthenticationException: {"error":"invalid_client","error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 285b162f-2655-429a-bde7-3c5042aed74e\r\nCorrelation ID: b5eae0c9-2574-4ffb-ade8-8a25f02df980\r\nTimestamp: 2014-09-09 13:48:26Z"}):
AuthenticationCallback.onSuccess(<any>): expected: 1, actual: 0
at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:44)
at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:94)
at $Proxy15.onFailure(Unknown Source)
at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:133)
at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:112)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
... Removed 30 stack frames

Related

java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.protocol.json.SdkStructuredCborFactory

I'm upgrading amazonaws sdks in my project
following are the upgrades I did in POM
amazon-kinesis-client from 1.9.0 to 1.14.9
amazon-kinesis-producer from 0.10.2 to 0.15.2
aws-java-sdk-core from 1.11.272 to 1.12.398
jmespath-java from 1.11.98 to 1.12.398
after the changes getting the following runtime errors in log file and my kinesis consumer/worker are not working. kinesis-producer working fine.
[ INFO] [] [RecordProcessor-0000] (06 Feb 2023 11:35:49) (KinesisDataFetcher.java:171) - Initializing shard shardId-000000000000 with 49636335084413016973448851393414073031389798471324139522
[ERROR] [] [Thread-10] (06 Feb 2023 11:35:50) (Worker.java:709) - Worker.run caught exception, sleeping for 1000 milli seconds!
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.protocol.json.SdkStructuredCborFactory
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisShardConsumer.determineTaskOutcome(KinesisShardConsumer.java:393)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisShardConsumer.checkAndSubmitNextTask(KinesisShardConsumer.java:328)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisShardConsumer.consumeShard(KinesisShardConsumer.java:316)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.runProcessLoop(Worker.java:698)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:681)
at com.hk.web.listener.KinesisConsumer$2.run(KinesisConsumer.java:109)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.protocol.json.SdkStructuredCborFactory
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisShardConsumer.determineTaskOutcome(KinesisShardConsumer.java:376)
... 6 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.protocol.json.SdkStructuredCborFactory
at com.amazonaws.protocol.json.SdkJsonProtocolFactory.getSdkFactory(SdkJsonProtocolFactory.java:141)
at com.amazonaws.protocol.json.SdkJsonProtocolFactory.createGenerator(SdkJsonProtocolFactory.java:55)
at com.amazonaws.protocol.json.SdkJsonProtocolFactory.createGenerator(SdkJsonProtocolFactory.java:75)
at com.amazonaws.protocol.json.SdkJsonProtocolFactory.createProtocolMarshaller(SdkJsonProtocolFactory.java:65)
at com.amazonaws.services.kinesis.model.transform.GetShardIteratorRequestProtocolMarshaller.marshall(GetShardIteratorRequestProtocolMarshaller.java:52)
at com.amazonaws.services.kinesis.AmazonKinesisClient.executeGetShardIterator(AmazonKinesisClient.java:1420)
at com.amazonaws.services.kinesis.AmazonKinesisClient.getShardIterator(AmazonKinesisClient.java:1405)
at com.amazonaws.services.kinesis.clientlibrary.proxies.KinesisProxy.getIterator(KinesisProxy.java:574)
at com.amazonaws.services.kinesis.clientlibrary.proxies.MetricsCollectingKinesisProxyDecorator.getIterator(MetricsCollectingKinesisProxyDecorator.java:125)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisDataFetcher.getIterator(KinesisDataFetcher.java:224)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisDataFetcher.advanceIteratorTo(KinesisDataFetcher.java:200)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisDataFetcher.initialize(KinesisDataFetcher.java:172)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitializeTask.call(InitializeTask.java:94)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.MetricsCollectingTaskDecorator.call(MetricsCollectingTaskDecorator.java:49)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.MetricsCollectingTaskDecorator.call(MetricsCollectingTaskDecorator.java:24)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
I was checking if both my kiensis producer & consumer are working fine or not, producer is working fine after the upgrade, but kinesis consumer/worker are giving the error I mentioned.
I found the fix, needed to upgrade the com.fasterxml.jackson.core:jackson-databind from 2.6.x to 2.12.x+ and that resolved the error.
thanks everyone who responded.

Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase

I use neo4j:2.2.4. This is my error:
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, D:\neo4j\neo4j-enterprise-2.2.4\data\new_movie
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:366)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:91)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:181)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:71)
at traverser.Traversals.startTraversing(Traversals.java:34)
at traverser.Traversals.main(Traversals.java:28)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#1f6670f' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:343)
... 6 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#1a1f567' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:164)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507)
... 8 more
Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UnexpectedUpgradingStoreVersionException: 'neostore.nodestore.db' has a store version number that we cannot upgrade from. Expected 'v0.A.1' but file is version 'NodeStore v0.A.5'.
at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:80)
at org.neo4j.kernel.impl.storemigration.StoreMigrator.needsMigration(StoreMigrator.java:135)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.getParticipantsEagerToMigrate(StoreUpgrader.java:268)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:143)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:344)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507)
... 11 more
The source of your error looks like
"has a store version number that we cannot upgrade from. Expected 'v0.A.1' but file is version 'NodeStore v0.A.5'. at"
You may take a look at this post : https://github.com/jexp/batch-import/issues/101
It sort of looks like you store is semi-upgraded, although I don't know how that would have happened. Could you copy-paste contents from your <graph.db>/messages.log file, whatever is in between the last:
--- INITIALIZED diagnostics START ---
and
--- INITIALIZED diagnostics END ---
that might help in investigations. Thanks

WebSphere onMessage error : Exception data: java.lang.reflect.InvocationTargetException

Here's my problem :
We have a banking Websphere application (version 7.0.0.27 ) on an AIX multi-instance server. On this application, we have received 51 MQ messages in 1 min to process but for 5 of them, we have the following errors :
[9/23/15 9:18:36:301 CEST] 00000065 LocalExceptio E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(TrefleIntermediationEAR#TrefleEJB-3.4.3.4.jar#OPFRestitutionReception, null)". Exception data: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor521.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:47)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:98)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:136)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:574)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)
Caused by: java.lang.RuntimeException: JMSCC0109: A message driven bean threw a runtime exception 'java.lang.ExceptionInInitializerError'.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:313)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:388)
at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:104)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:3018)
at com.ibm.msg.client.jms.internal.JmsXAQueueSessionImpl$1.run(JmsXAQueueSessionImpl.java:395)
at com.ibm.mq.jms.MQSession.run(MQSession.java:862)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:1055)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:1082)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:752)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:718)
... 8 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
at fr.bdf.trefle.trf.launcher.AbstractLauncher.retrieveOverridingStandaloneConnectionData(AbstractLauncher.java:117)
at fr.bdf.trefle.trf.launcher.AbstractLauncher.createFactory(AbstractLauncher.java:83)
at fr.bdf.trefle.trf.launcher.AbstractLauncher.<clinit>(AbstractLauncher.java:71)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at fr.bdf.trefle.trf.dao.FlowMonitorServiceImpl.insertFlowMonitor(FlowMonitorServiceImpl.java:465)
at fr.bdf.trefle.trf.dao.FlowMonitorServiceImpl.createFlowMonitor(FlowMonitorServiceImpl.java:176)
at fr.bdf.trefle.trf.mdb.OPFRestitutionReception.onMessage(OPFRestitutionReception.java:213)
at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java:302)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java:271)
at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java:240)
at com.ibm.mq.jms.MQSession$FacadeMessageListener.onMessage(MQSession.java:147)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2846)
... 14 more
Caused by: java.util.MissingResourceException: Can't find resource for bundle configTechStandalone, key en_US
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:379)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:108)
at fr.bdf.trefle.common.util.StandaloneTechConfigurable.<clinit>(StandaloneTechConfigurable.java:31)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
... 28 more
From my analysis, here's what I can conclude :
In the stack trace, the root error, mainly java.util.MissingResourceException, doesn't seem like the real cause because the resource the process is trying to get exists and for the other process, this works fine.
I tried to see if the method used to get the resource, getBundle(), has some performance issue but I didn't find anything.
I also tried to see if this was an already existing IBM bug but if it is the case, I can't find it.

Couchbase - getting "view_undefined" after accessing a newly created Production View

I'm creating a Production View in Couchbase using
HttpFuture<Boolean> asyncResult = client.asyncCreateDesignDoc(designDocProd);
Boolean success = asyncResult.get();
(Omitting the "dev_" prefix from the Design Doc's name creates it as Production View instead of Dev View)
After checking that success indeed equals true, I try to access the view using couchbaseClient.query(view, query) , but then I get the following Error:
SERVER: unknown_error Reason: view_undefined
(Below is the Full Stack Trace if neeeded)
If I add a sleep of 5 seconds, everything works well...
Anyone encountered this issue? am I missing something?
Thanks
Eyal
Full Stack Trace:
Caused by: java.lang.RuntimeException: Failed to access the view
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:871)
.
.
Caused by: java.util.concurrent.ExecutionException: OperationException: SERVER: unknown_error Reason: view_undefined
at com.couchbase.client.internal.HttpFuture.waitForAndCheckOperation(HttpFuture.java:90)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:74)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:64)
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:864)
... 54 more
Caused by: OperationException: SERVER: unknown_error Reason: view_undefined
at com.couchbase.client.protocol.views.NoDocsOperationImpl.parseError(NoDocsOperationImpl.java:106)
at com.couchbase.client.protocol.views.ViewOperationImpl.handleResponse(ViewOperationImpl.java:68)
at com.couchbase.client.ViewNode$MyHttpRequestExecutionHandler.handleResponse(ViewNode.java:204)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.processResponse(AsyncNHttpClientHandler.java:417)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.inputReady(AsyncNHttpClientHandler.java:242)
at com.couchbase.client.http.AsyncConnectionManager$ManagedClientHandler.inputReady(AsyncConnectionManager.java:249)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:172)
at org.apache.http.impl.nio.DefaultClientIOEventDispatch.inputReady(DefaultClientIOEventDispatch.java:155)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:161)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:335)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:275)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
at java.lang.Thread.run(Thread.java:662)

CanĀ“t get Liferay ArticleDisplay in 6.1.20 EE

I do get the following exception in Liferay 6.1.20 EE when I try to get a JournalArticleDisplay with a template. The template exists, the JournalArticle exists - everything is fine ;) And the same code works in 6.1.30 EE ;)
But as soon as I call this method in 6.1.20 EE, it breaks because companyId shall not be 0 :
Caused by: com.liferay.portal.kernel.templateparser.TransformException: Unhandled exception
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.transform(BaseTemplateParser.java:135)
at com.liferay.portal.kernel.templateparser.BaseTransformer.transform(BaseTransformer.java:163)
at com.liferay.portlet.journal.util.JournalUtil.transform(JournalUtil.java:1036)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getArticleDisplay(JournalArticleLocalServiceImpl.java:1090)
... 87 more
Caused by: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 0
at com.liferay.portal.service.persistence.CompanyPersistenceImpl.findByPrimaryKey(CompanyPersistenceImpl.java:486)
at com.liferay.portal.service.base.CompanyLocalServiceBaseImpl.getCompany(CompanyLocalServiceBaseImpl.java:385)
at sun.reflect.GeneratedMethodAccessor232.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at com.sun.proxy.$Proxy113.getCompany(Unknown Source)
at com.liferay.portal.service.CompanyLocalServiceUtil.getCompany(CompanyLocalServiceUtil.java:181)
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.getCompany(BaseTemplateParser.java:150)
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.populateTemplateContext(BaseTemplateParser.java:244)
at com.liferay.portlet.journal.util.VelocityTemplateParser.populateTemplateContext(VelocityTemplateParser.java:178)
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.transform(BaseTemplateParser.java:120)
... 90 more
I am sorry if I caused trouble.
This seems to be a Liferay Bug : https://issues.liferay.com/browse/LPS-25275
We will upgrade our server ...

Categories

Resources