is it any solution of failed to find provider in android? - android-xml

error is :
[2011-07-08 18:30:54 - Android2Wrox.com] Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
[2011-07-08 18:30:54 - Android2Wrox.com] Please check logcat output for more details.
[2011-07-08 18:30:54 - Android2Wrox.com] Launch canceled!
--
i have facing more this type of error on when i implement two application in AndroidManifest.xml file: i have give that XML code :
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="Android2Wrox.comActivity"
android:label="#string/app_name" android:theme="#style/Android2Wrox"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<application android:name="MyApplication" android:icon="#drawable/image">
</application>
07-08 16:42:46.101: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:42:46.101: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:02.069: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:02.229: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:02.489: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:02.739: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:02.849: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:03.029: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:03.119: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:03.239: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:03.359: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:03.969: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:04.269: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:04.702: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 16:43:04.939: ERROR/ActivityThread(464): Failed to find provider info for com.google.settings
07-08 17:46:37.180: ERROR/DictionaryBackupAgent(196): Couldn't read from the cursor

Have you requested an INTERNET permission in your AndroidManifest.xml? I.e.
<uses-permission android:name="android.permission.INTERNET" />

Related

implementation 'com.google.android.gms:play-services-ads:19.2.0'

when I use last version of 'com.google.android.gms:play-services-ads:19.2.0', I receive an error message. In fact I have performed all the steps as they are in the documentation.
The error message is:
at android.app.ActivityThread.installProvider(ActivityThread.java:5814)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5403)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5342)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.IllegalStateException:
******************************************************************************
* Invalid application ID. Follow instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to find your app ID. *
******************************************************************************
at com.google.android.gms.internal.ads.zzyz.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:24)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:5811)
... 10 more
You have to declare your admob application_id in project's manifest XML file like this:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/your_ad_app_id" />
Firstly, you need to get value for APPLICATION_ID from your Google Admob account and put it on AndroidManifest.xml as below correctly. Your account value starts with "ca-app-pub- *** "
<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>
</manifest>
<manifest>
<application
android:name="com.google.android.gms.permission.AD_ID">
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy " />
</application>
</manifest>

How to register a custom ProtocolMapper in Keycloak?

I'm struggling with registering a custom ProtocolMapper in Keycloak. I would like to add some data from my database on token request. So i followed the idea given in Keycloak add extra claims from database / external source.
I implemented the ProtocolMapper interface and added the file
META-INF/services/org.keycloak.protocol.ProtocolMapper
containing the reference to my class. So far so good and Keycloak recognizes the new implementation. I'm also able to configure it via the admin console.
To add some data to the token I think I must also add one/some of the interfaces
org.keycloak.protocol.oidc.mappers.UserInfoTokenMapper
org.keycloak.protocol.oidc.mappers.OIDCIDTokenMapper
org.keycloak.protocol.oidc.mappers.OIDCAccessTokenMapper
and implement the methods according to the interface(s).
The problem now is that as soon as I add the interface I get the following log message:
08:55:07,292 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."keycloak-spi.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."keycloak-spi.jar".POST_MODULE
: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "keycloak-spi.jar"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Failed to link at/lotterien/jam/keycloak/spi/JamAuthorizationInfoProtocolMapper (Module "deployment.keycloak-spi.jar" from Service Module Loader): org/keycloak/protocol/oidc/mappers/UserInfoTokenMapper
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:713)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at org.keycloak.provider.DefaultProviderLoader.load(DefaultProviderLoader.java:60)
at org.keycloak.provider.ProviderManager.load(ProviderManager.java:92)
at org.keycloak.services.DefaultKeycloakSessionFactory.loadFactories(DefaultKeycloakSessionFactory.java:214)
at org.keycloak.services.DefaultKeycloakSessionFactory.deploy(DefaultKeycloakSessionFactory.java:115)
at org.keycloak.provider.ProviderManagerRegistry.deploy(ProviderManagerRegistry.java:42)
at org.keycloak.subsystem.server.extension.KeycloakProviderDeploymentProcessor.deploy(KeycloakProviderDeploymentProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
Why does Keycloak not find its own interface? Shouldn't it be provided out of the box?
What do I miss to make it work?
Edit 1
I got a little bit further. I added a file
META-INF/jboss-deployment-structure.xml
with content
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.keycloak.keycloak-services"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
and now the exception is gone.
Unfortunately the method transformUserInfoToken() in my class is still not called on token request.
Can anyone put me in the right direction please?
It finally works. Even there are still open questions I could implement the needed functionality.
I had to implement the Interface
org.keycloak.protocol.oidc.mappers.OIDCAccessTokenMapper
(instead of org.keycloak.protocol.oidc.mappers.UserInfoTokenMapper)
Now my transformAccessToken() method is called on every request to URL http://<host>:<port>/auth/realms/testrealm/protocol/openid-connect/token
I think the problem came from my misunderstanding of the terms AccessToken, UserInfo and IDToken. I thought all three are part of the token generated. But it seems the OIDCAccessTokenMapper is the only way to get additional information into the access token.
The remaining open question for me is where the UserInfo and the IDToken would appear. Maybe somebody can give an answer for that.
I have a solution for MY specific problem. I had the same error - but already had a jboss-deployment-structure.xml with comparable contents. The reason it didnĀ“t work for me was, that I had an EAR containing my implementation and libs as JARs. So the needed structure for jboss-deployment-structure.xml differed.
I post it here for others struggling with the same problem:
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<system export="true">
<paths>
<path name="com/sun/xml/internal/ws/spi"/>
</paths>
</system>
</dependencies>
</deployment>
<sub-deployment name="org.my.implementation-1.0-SNAPSHOT.jar">
<dependencies>
<module name="org.keycloak.keycloak-core"/>
<module name="org.keycloak.keycloak-server-spi"/>
<module name="org.keycloak.keycloak-server-spi-private"/>
<module name="org.keycloak.keycloak-services"/>
<module name="javax.ws.rs.api"/>
</dependencies>
</sub-deployment>
</jboss-deployment-structure>

How to configure WSO2 EI 6.1.x Analytics with MongoDB event store

I tried to configure WSO2 EI Analytics 6.1.1u23 to use MongoDb as event store but without success.
I have found this PR to add MongoDb support for Analytics records;
I have added in analytics-datasources.xml this configuration:
<providers>
<provider>org.wso2.carbon.datasource.reader.mongo.MongoDataSourceReader</provider>
</providers>
<datasource>
<name>WSO2_ANALYTICS_DS_MONGO</name>
<description>The datasource used for analytics record store</description>
<definition type="MONGO">
<configuration>
<host>xxx.xxx.xxx.xxx</host>
<port>27017</port>
</configuration>
</definition>
</datasource>
And in analytics-config.xml this configuration:
<analytics-record-store name="EVENT_STORE">
<implementation>org.wso2.carbon.analytics.datasource.mongo.MongoAnalyticsRecordStore</implementation>
<properties>
<property name="datasource">WSO2_ANALYTICS_DS_MONGO</property>
<property name="database">WSO2_DAS_EVENT</property>
</properties>
</analytics-record-store>
At startup I get the follow error: org.wso2.carbon.datasource.reader.mongo.MongoDa
taSourceReader cannot be found
UPDATE: I have added the missing library org.wso2.carbon.datasource.reader.mongo-4.4.33.jar
and now I get the follow error:
TID: [-1234] [] [2018-03-05 13:47:10,701] WARN {org.wso2.carbon.metrics.impl.MetricServiceImpl} - Failed to build the reporter {org.wso2.carbon.metrics.impl.MetricServiceImpl}
org.wso2.carbon.metrics.impl.util.ReporterBuildException: Error when looking up the Data Source: 'jdbc/WSO2MetricsDB'.
at org.wso2.carbon.metrics.impl.util.JDBCReporterBuilder.build(JDBCReporterBuilder.java:174)
at org.wso2.carbon.metrics.impl.util.JDBCReporterBuilder.build(JDBCReporterBuilder.java:33)
at org.wso2.carbon.metrics.impl.MetricServiceImpl.<init>(MetricServiceImpl.java:201)
at org.wso2.carbon.metrics.impl.MetricServiceImpl.<init>(MetricServiceImpl.java:65)
...
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: javax.naming.NameNotFoundException: Name [WSO2MetricsDB] is not bound in this Context. Unable to find [WSO2MetricsDB].
at org.apache.naming.NamingContext.lookup(NamingContext.java:825)
at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
at org.apache.naming.NamingContext.lookup(NamingContext.java:836)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:709)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.wso2.carbon.metrics.impl.util.JDBCReporterBuilder.build(JDBCReporterBuilder.java:172)
... 86 more
What's missing/wrong in my configuration?
Thank in advance for any help
Marco

Configure Event Listener in Keycloak

I'm configuring a event listener in KeyCloak in a Wildfly 9.0.1.
I have created a .jar with two clases, implements a provider like Keycloak explains in his github's example.
In this example, Keycloak people explain it's necessary to register the provider editing "standalone/configuration/standalone.xml" and adding the module to the providers element.
I code this definition inside the tag "subsystem":
<spi name="eventsListener">
<provider name="my-event-listener" enabled="true">
<properties>
<property name="max" value="100" />
</properties>
</provider>
</spi>
When I start the server, it gives me a error like this:
ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
at org.jboss.as.server.ServerService.boot(ServerService.java:350)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: Unknown keycloak-server subsystem tag: spi
at org.keycloak.subsystem.server.extension.KeycloakSubsystemParser.readElement(KeycloakSubsystemParser.java:55)
at org.keycloak.subsystem.server.extension.KeycloakSubsystemParser.readElement(KeycloakSubsystemParser.java:39)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1199)
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:457)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
... 3 more
FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
Someone knows what is wrong? I need help.
Thanks you.
I think you must code your definition inside : <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">

ServiceActivator for container managed clustering using jgroups : org.jboss.msc.service.ServiceActivator: Provider class not found error

I am trying to use a service activator for jgroups channel.
I have put a file called : org.jboss.msc.service.ServiceActivator
in META-INF/services/
the content of the file is something like com.blahblah.project.cluster.JGroupsServiceActivator
which is the actual location of existence of the JGroupsServiceActivator file.
My deployment is an ear package which has a jar and a war file within. However when I try to deploy my application, I keep getting the following error:
11:45:52,222 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "proj-ejb-0.61.1-SNAPSHOT.jar" of deployment "proj-ear.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.util.ServiceConfigurationError: org.jboss.msc.service.ServiceActivator: Provider com.blahblah.proj.cluster.JGroupsServiceActivator not found
at java.util.ServiceLoader.fail(ServiceLoader.java:231) [rt.jar:1.7.0_25]
at java.util.ServiceLoader.access$300(ServiceLoader.java:181) [rt.jar:1.7.0_25]
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:365) [rt.jar:1.7.0_25]
at java.util.ServiceLoader$1.next(ServiceLoader.java:445) [rt.jar:1.7.0_25]
at org.jboss.as.server.deployment.service.ServiceActivatorProcessor.deploy(ServiceActivatorProcessor.java:60) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
... 5 more
11:45:52,419 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "proj-ejb-0.61.1-SNAPSHOT.jar" of deployment "proj-ear.ear"
It does not find the provider. Is there any idea why? Here JgroupsServiceActivator is my own class within the jar.
How can I make this file explicitly visible to jboss?
Try adding a dependency to org.jboss.as.server in the project manifest (war/META-INF/MANIFEST.MF).
it's similar to gcvt's answer but that's what solved the problem for me - adding dependency module 'org.jboss.as.server' to jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.jgroups"/>
<module name="org.jboss.as.naming"/>
<module name="org.jboss.as.clustering.jgroups"/>
<module name="org.infinispan"/>
<module name="org.jboss.as.server"/>
</dependencies>
</deployment>
</jboss-deployment-structure>