Provider com.sap.cloud.sdk.cloudplatform.connectivity.CertificateBasedHttpClientFactory not a subtype - sap-cloud-sdk

In SAP Cloud SDK FAQ page, there is a QA about I'm Observing a DefaultHttpClientFactory not a subtype Exception, now I encountered a similar error Provider com.sap.cloud.sdk.cloudplatform.connectivity.CertificateBasedHttpClientFactory not a subtype, however I could not exclude connectivity-scp-cf since this is mandatory?
Any hints how to solve this error?
Caused by: com.sap.core.connectivity.jco.cf.auth.TokenFactory$GetTokenException: Could not get ClientCredentialsGrantAccessToken
at com.sap.core.connectivity.jco.cf.auth.TokenFactory.getClientCredentialsGrantAccessToken(TokenFactory.java:61)
at com.sap.core.connectivity.jco.cf.destination.ConnectivityConfigurationCF.getConfiguration(ConnectivityConfigurationCF.java:72)
... 92 more
Caused by: java.lang.NoClassDefFoundError: com/sap/cloud/security/client/HttpClientFactory : cannot initialize class because prior initialization attempt failed
at com.sap.core.connectivity.jco.cf.auth.TokenFactory.executeTokenExchange(TokenFactory.java:94)
at com.sap.core.connectivity.jco.cf.auth.TokenFactory.getClientCredentialsGrantAccessToken(TokenFactory.java:57)
... 93 more
Caused by: java.lang.ExceptionInInitializerError: java.util.ServiceConfigurationError: com.sap.cloud.security.client.HttpClientFactory: Provider com.sap.cloud.sdk.cloudplatform.connectivity.CertificateBasedHttpClientFactory not a subtype

Interface type com.sap.cloud.security.client.HttpClientFactory is part of dependency com.sap.cloud.security.xsuaa:token-client.
When using SAP Java Buildpack (e.g. for JCo), please make sure to give this dependency a provided scope. Otherwise you'll be experiencing class loading issues like in your current case. For further errors, please attach your mvn dependency:tree.

Related

Secured Android SharedPreferences Error: 'Caused by: java.lang.RuntimeException: Field keySize_ for...'

In an Android Kotlin project, I implemented EncryptedSharedPreference feature based on this link using the androidx.security library and it worked well in debug mode. But in release mode, I keep getting this error
java.lang.ExceptionInInitializerError
at com.package_name.i.a.f(:46)
at com.package_name.i.a.j(:52)
at com.package_name.i.a.e(:82)
at com.package_name.MyApplication.onCreate(:37)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.RuntimeException: Field keySize_ for k.a.d.a.h0.u not found. Known fields are [private int k.a.d.a.h0.u.i, private static final k.a.d.a.h0.u k.a.d.a.h0.u.j, private static volatile k.a.d.a.i0.a.a1 k.a.d.a.h0.u.k]
at k.a.d.a.i0.a.v0.n0(:608)
Please kindly share your ideas on how to solve this error.
This bug is related to Minify Enabled, which most likely causes some values to be removed.
A bug is reported already, you can track it here:
https://issuetracker.google.com/issues/157983099
-keep class com.google.crypto.** { *; }
Something is wrong with the rc2 version of android crypto of may 20. So it is better to use 1.0.0-alpha02 in your gradle file.
Remember, takes care with dependencies which are not in rc. You can also fix the issue with a proguard rules (see comment of Sebas LG).
dependencies {
implementation "androidx.security:security-crypto:1.0.0-alpha02"
}
Official documentation : https://developer.android.com/jetpack/androidx/releases/security
Linked commits : https://android.googlesource.com/platform/frameworks/support/+log/f66cdf1658639bd74ae850dfe3c1f5bb72eaebe6..6be101c2241593fee3ef9ab4e1fb337b485f2f9a/security/crypto
I solved using
dependencies {
..
implementation "androidx.security:security-crypto:1.0.0-rc03"
This is due to the fact that AndroidX security library uses the Google Tink library(This is already fixed in Tink 1.4.0), where there is a flaw in working with Proguard.
Add this code to proguard-rules.pro and this should help:
-keepclassmembers class * extends com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite {
<fields>;
}
Links:
https://github.com/google/tink/issues/361
https://github.com/google/tink/blob/master/java_src/src/main/resources/META-INF/proguard/protobuf.pro

MyApplication is never used

I'm trying to use the class "MyApplication". but I got messages such as my title. first of all, I added as (android:name = ".MyApplication"). and also added ( android:allowBackup="true"). but You can see my second screenshot. The Notice said MyApplication is an unresolved class... What should I do for resolving it?
java.lang.RuntimeException: Unable to instantiate application
com.example.todolist.MyApplication: java.lang.ClassNotFoundException: Didn't
find class "com.example.todolist.MyApplication"
Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.example.todolist.MyApplication" on path:/

adf internal error occured on executing a vo in taskflow

can any body tell me the actual reason causing the below error:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:7349)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1257)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1449)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1355)
at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1340)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7236)
at oracle.adf.model.bc4j.DCJboDataControl.executeIteratorBindingWithParams(DCJboDataControl.java:2987)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1541)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
...
...
..
.
Caused by: java.lang.NullPointerException
at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:15884)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:911)
at weblogic.jdbc.wrapper.PreparedStatement_oracle_jdbc_driver_OraclePreparedStatementWrapper.setObjectAtName(Unknown Source)
at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:4669)
at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3687)
at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:22684)
From the stacktrace, it seems some bind variable that is required by your view object query is not being set correctly.
If it works intermittently, it could be that the bind variable is lost at some point. To debug/test, try it with a hard-coded value for your bind variable and see if that works first (if you have a ViewCriteria, try removing that first) - then run the task flow and see if it works consistently.
I would suggest running the application in JDeveloper with -Djbo.debugoutput=console argument. It gives you a lot if information of what your business components are doing and you could catch the error cause in console logs.

Exception in Map Reduce job

i have created a map reduce job to fetch the number of employees of a location.
I am using hazelcast 3.6.3. Each employee has name and address.
I have added my code to following git repository.
https://github.com/adasari/hazelcast-demo
Exception :
java.util.concurrent.ExecutionException: java.lang.ClassCastException: com.hazelcast.mapreduce.aggregation.impl.DistinctValuesAggregation$SimpleEntry cannot be cast to com.hazelcast.query.impl.Extractable
at com.hazelcast.mapreduce.impl.task.TrackableJobFuture.setResult(TrackableJobFuture.java:68)
at com.hazelcast.mapreduce.impl.task.JobSupervisor.notifyRemoteException(JobSupervisor.java:156)
at com.hazelcast.mapreduce.impl.operation.NotifyRemoteExceptionOperation.run(NotifyRemoteExceptionOperation.java:54)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:172)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:393)
at com.hazelcast.spi.impl.operationexecutor.classic.OperationThread.processPacket(OperationThread.java:184)
at com.hazelcast.spi.impl.operationexecutor.classic.OperationThread.process(OperationThread.java:137)
at com.hazelcast.spi.impl.operationexecutor.classic.OperationThread.doRun(OperationThread.java:124)
at com.hazelcast.spi.impl.operationexecutor.classic.OperationThread.run(OperationThread.java:99)
Caused by: java.lang.ClassCastException: com.hazelcast.mapreduce.aggregation.impl.DistinctValuesAggregation$SimpleEntry cannot be cast to com.hazelcast.query.impl.Extractable
at com.hazelcast.query.impl.predicates.AbstractPredicate.readAttributeValue(AbstractPredicate.java:129)
at com.hazelcast.query.impl.predicates.AbstractPredicate.apply(AbstractPredicate.java:55)
can you point me the issue ?
Thanks.
Not exactly sure what you're looking for or what you're trying to do (looking at the code) but your problem is here:
Caused by: java.lang.ClassCastException: com.hazelcast.mapreduce.aggregation.impl.DistinctValuesAggregation$SimpleEntry cannot be cast to com.hazelcast.query.impl.Extractable
So you have to implement the Extractable interface with your SimpleEntry class.
I haven't worked on MapReduce but below are my observation while looking/executing the code.
The place it is failing is a different SimpleEntry class, an inner class of DistinctValuesAggregation which doesn't implement Extractable.
There is already a defect in Hazelcast(#7398) but it says closed in 3.6.1 so might as well follow up with them in Git hub.
I found that the code works well when you run the Cluster with just single node. So I suspect the above defect would be impacting the aggregation over multiple nodes.
HazelcastInstance hazelcastInstance = buildCluster(1);
Following actions resolved the issue -
1. DistinctMapper implements DataSerializable
2. SimpleEntry extends QueryableEntry

WebSphereApplication NoClassDefFoundError while unmarshalling XML with JAXB

I´ve deployed an EAR on a Websphere Application Server 7. In my code there is a part where I try to unmarshall a XML file into an object. I get this error when trying to do that:
java.lang.NoClassDefFoundError: com.ibm.xtq.bcel.util.SyntheticRepository (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at com.ibm.xtq.bcel.classfile.JavaClass.<init>(JavaClass.java:109)
at com.ibm.xtq.bcel.classfile.JavaClass.<init>(JavaClass.java:228)
at com.ibm.xtq.bcel.generic.ClassGen.getJavaClass(ClassGen.java:174)
at com.ibm.fcg.bcel.FcgClassGenBCEL.dump2(Unknown Source)
at com.ibm.fcg.bcel.FcgClassGenBCEL.dump(Unknown Source)
at com.ibm.xml.xlxp2.jaxb.unmarshal.codegen.fcg.FCGDeserializationStubGenerator.generate(FCGDeserializationStubGenerator.java:249)
at com.ibm.xml.xlxp2.jaxb.codegen.AbstractGeneratedStubFactory.generateByteCode(AbstractGeneratedStubFactory.java:96)
at com.ibm.xml.xlxp2.jaxb.unmarshal.codegen.fcg.FCGStubFactory.generateStubByteCode(FCGStubFactory.java:46)
at com.ibm.xml.xlxp2.jaxb.codegen.AbstractGeneratedStubFactory.getStubClassConstructor(AbstractGeneratedStubFactory.java:154)
at com.ibm.xml.xlxp2.jaxb.unmarshal.codegen.AbstractGeneratedDeserializationStubFactory.createStub(AbstractGeneratedDeserializationStubFactory.java:58)
at com.ibm.xml.xlxp2.jaxb.unmarshal.impl.DeserializationContext.startComplexType(DeserializationContext.java:662)
at com.ibm.xml.xlxp2.jaxb.unmarshal.impl.DeserializationContext.handleRootElementEvent(DeserializationContext.java:303)
at com.ibm.xml.xlxp2.jaxb.unmarshal.impl.JAXBDocumentScanner.produceRootElementEvent(JAXBDocumentScanner.java:186)
at com.ibm.xml.xlxp2.scan.DocumentScanner.scanRootElement(DocumentScanner.java:2234)
at com.ibm.xml.xlxp2.scan.DocumentScanner.scanProlog(DocumentScanner.java:1726)
at com.ibm.xml.xlxp2.scan.DocumentScanner.nextEvent(DocumentScanner.java:1316)
at com.ibm.xml.xlxp2.scan.DocumentScanner.parseDocumentEntity(DocumentScanner.java:1168)
at com.ibm.xml.xlxp2.jaxb.unmarshal.impl.JAXBDocumentScanner.unmarshal(JAXBDocumentScanner.java:125)
at com.ibm.xml.xlxp2.jaxb.unmarshal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:120)
at com.inditex.lois.core.ws.utilidades.services.impl.AdaptadorServiceImpl.transformarXMLenObjeto(AdaptadorServiceImpl.java:137)
As far as I know that class is part of IBM JDK and cannot be found in runtime. Is there anything I have to modify in my ear or, as I guess, its all about configuring/modifiying WAS configuration (or even applying a patch if this is a bug).
Any help? Thanks a lot.
(Sorry for my english :) )
This exception means that the class com.ibm.xtq.bcel.util.SyntheticRepository is found, but failed static initialization. If there is no other message in the log about this, then this is the time to open a PMR with IBM. Static initializers in internal WebSphere code should never fail during normal usage course.
Same here, there is an APAR:
http://www-01.ibm.com/support/docview.wss?uid=swg1IV41639
Problem conclusion
This defect will be fixed in:
6.0.0 SR14
6.0.1 SR6
7.0.0 SR5
.
The fix resolved the AccessControlException. SyntheticRepository
class can be initialized properly, hence NoClassDefFoundError
does not occur.

Resources