Error on device-policy(clouddpc): policies.json file not found for dedicated devices using Android Management API - google-apis-explorer

I am using Android-Management API and QR Code scan after factory reset to provision devices as dedicated device. but provisioning process fail because device-policy app is installed but failed to sync policies.
I checked with "adb logcat" while trying to manually sync policies using device-policy app.
adb logcat shows:
12-03 00:01:53.833 8043 10532 E clouddpc: [PolicyDetailsPreferenceFragment] Error populating policy list for display.
12-03 00:01:53.833 8043 10532 E clouddpc: java.io.FileNotFoundException: /data/user/0/com.google.android.apps.work.clouddpc/files/policies.json (No such file or directory)
12-03 00:01:53.833 8043 10532 E clouddpc: at java.io.FileInputStream.open0(Native Method)
12-03 00:01:53.833 8043 10532 E clouddpc: at java.io.FileInputStream.open(FileInputStream.java:231)
12-03 00:01:53.833 8043 10532 E clouddpc: at java.io.FileInputStream.<init>(FileInputStream.java:165)
12-03 00:01:53.833 8043 10532 E clouddpc: at android.app.ContextImpl.openFileInput(ContextImpl.java:560)
12-03 00:01:53.833 8043 10532 E clouddpc: at android.content.ContextWrapper.openFileInput(ContextWrapper.java:202)
12-03 00:01:53.833 8043 10532 E clouddpc: at deo.c(PG:1)
12-03 00:01:53.833 8043 10532 E clouddpc: at com.google.android.apps.work.clouddpc.ui.statusui.PolicyDetailsPreferenceFragment.az(PG:13)
12-03 00:01:53.833 8043 10532 E clouddpc: at dvp.call(Unknown Source:2)
12-03 00:01:53.833 8043 10532 E clouddpc: at ign.c(PG:1)
12-03 00:01:53.833 8043 10532 E clouddpc: at ift.run(PG:4)
12-03 00:01:53.833 8043 10532 E clouddpc: at igo.run(PG:1)
12-03 00:01:53.833 8043 10532 E clouddpc: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-03 00:01:53.833 8043 10532 E clouddpc: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-03 00:01:53.833 8043 10532 E clouddpc: at java.lang.Thread.run(Thread.java:764)
12-03 00:02:01.791 8043 8043 I clouddpc: [PolicyDetailsPreferenceFragment] Current state: hasTokenKey=false hasSetupStarted=false wasDeviceEverCompliant=false hasSetupFinished=false
Can anyone please help me to fix this issue?

This usually happens when you create an enrollment token without a policy. If you want to enroll a device without a policy, it is advisable to create a blank policy and assign it during the creation of the enrollment token instead.
policy_name = enterprise_name + '/policies/policy_default'
policy_json = {}
policy = androidmanagement.enterprises().policies().patch(
name=policy_name,
body=policy_json
).execute()
enrollment_token = androidmanagement.enterprises().enrollmentTokens().create(
parent=enterprise_name,
body={"policyName" : policy_name}
).execute()
If the device enrolled is not linked with a policy within 5 minutes, the enrollment will fail and the device will be factory reset.

Related

Thingsboard: JSON parse error when reading MQTT timestamp

I get this MQTT payload from a device: (and I can't change how the device sends it)
{t:2021-11-08T16:17:15Z,10:99,14:24,55:20.85,56:64.38,53:36.00}
This is the timestamp: t:2021-11-08T16:17:15Z
I know that TB expects the UNIX style timestamp, and I expected to change this timestamp into the UNIX style in a transform node in the Rule Chain.
But, it never gets there because I believe that TB parses it before getting to the Rule Chain, and throughs an exception and rejects the readings.
How can I prevent TB to do that early parsing so I can get to the value and change it to the expected ts format? Is there a configuration or any other way besides forking the project and rewriting the parser?
Thank you!
Here is the error I get from the logs:
2021-11-08 23:39:25,124 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Processing connect msg for client: xxxx!
2021-11-08 23:39:25,125 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Processing connect msg for client with user name: null!
2021-11-08 23:39:25,167 [DefaultTransportService-18-34] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Client connected!
2021-11-08 23:39:25,183 [nioEventLoopGroup-4-5] WARN o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Failed to process publish msg [device/lre/readings][1]
org.thingsboard.server.common.transport.adaptor.AdaptorException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 18 path $.t
at org.thingsboard.server.transport.mqtt.adaptors.JsonMqttAdaptor.convertToPostTelemetry(JsonMqttAdaptor.java:67)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processDevicePublish(MqttTransportHandler.java:343)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processPublish(MqttTransportHandler.java:298)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processRegularSessionMsg(MqttTransportHandler.java:255)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.lambda$processMsgQueue$0(MqttTransportHandler.java:249)
at org.thingsboard.server.transport.mqtt.session.DeviceSessionCtx.tryProcessQueuedMsgs(DeviceSessionCtx.java:181)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processMsgQueue(MqttTransportHandler.java:249)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.enqueueRegularSessionMsg(MqttTransportHandler.java:241)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processMqttMsg(MqttTransportHandler.java:183)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.channelRead(MqttTransportHandler.java:156)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 18 path $.t
at com.google.gson.internal.Streams.parse(Streams.java:60)
at com.google.gson.JsonParser.parse(JsonParser.java:84)
at com.google.gson.JsonParser.parse(JsonParser.java:59)
at com.google.gson.JsonParser.parse(JsonParser.java:45)
at org.thingsboard.server.transport.mqtt.adaptors.JsonMqttAdaptor.convertToPostTelemetry(JsonMqttAdaptor.java:65)
... 30 common frames omitted
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 18 path $.t
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1567)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:495)
at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:418)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:742)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:718)
at com.google.gson.internal.Streams.parse(Streams.java:48)
... 34 common frames omitted
2021-11-08 23:39:25,183 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Closing current session due to invalid publish msg [device/lre/readings][1]
2021-11-08 23:39:25,184 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Client disconnected!
2021-11-08 23:39:28,533 [queue-scheduler-11-thread-1] INFO o.t.s.q.u.DefaultTbApiUsageClient - Reporting API usage statistics for 3 tenants and customers
2021-11-08 23:39:29,253 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-0 [TS] queueSize [0] totalAdded [6] totalSaved [6] totalFailed [0]
2021-11-08 23:39:29,254 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-2 [TS] queueSize [0] totalAdded [90] totalSaved [90] totalFailed [0]
2021-11-08 23:39:29,351 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-0 [TS Latest] queueSize [0] totalAdded [6] totalSaved [6] totalFailed [0]
2021-11-08 23:39:29,351 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-2 [TS Latest] queueSize [0] totalAdded [90] totalSaved [90] totalFailed [0]
2021-11-08 23:39:29,530 [TB-Scheduling-6] INFO o.t.server.actors.ActorSystemContext - Rule Engine JS Invoke Stats: requests [6] responses [3] failures [0]
2021-11-08 23:39:29,612 [TB-Scheduling-5] INFO o.t.s.s.s.DefaultTbEntityDataSubscriptionService - Stats: regularQueryInvocationCnt = [1], regularQueryInvocationTime = [2], dynamicQueryCnt = [3] dynamicQueryInvocationCnt = [1], dynamicQueryInvocationTime = [2], alarmQueryInvocationCnt = [0], alarmQueryInvocationTime = [0]

Does Primefaces have something with Yasson in Wildfly?

I have Wildfly 14.0.1 and due to an error (bug) in Yasson which is the default implementation of JSONB taken by RESTEASY when serializing/deserializing, I have to upgrade the version of Yasson from 1.0.1 to 1.0.4.
When I change the version in Wildfly module, here is the error that I have in the logs:
SEVERE [org.primefaces.application.exceptionhandler.PrimeExceptionHandler] (default task-1) Can't find bundle for base name messages, locale en: java.util.MissingResourceException: Can't find bundle for base name messages, locale en
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1573)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:1091)
at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:163)
at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
at com.sun.faces.util.MessageUtils.getExceptionMessage(MessageUtils.java:368)
at com.sun.faces.application.ValidateComponentNesting.addOmittedMessage(ValidateComponentNesting.java:109)
at com.sun.faces.application.ValidateComponentNesting.access$000(ValidateComponentNesting.java:36)
at com.sun.faces.application.ValidateComponentNesting$ValidateFormNestingCallback.visit(ValidateComponentNesting.java:91)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1736)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1747)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1747)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1747)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1747)
at com.sun.faces.application.ValidateComponentNesting.processEvent(ValidateComponentNesting.java:53)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:147)
at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:134)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2292)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2265)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:351)
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:761)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:405)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:102)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:223)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:671)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at [APPLICATION_CODE].filters.NoCacheFilter.doFilter(NoCacheFilter.java:36)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68)
at org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103)
at org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161)
at org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73)
at org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
I don't understand what is the relation between Yasson and Primefaces since there is nothing in the logs. What I know is that I don't get this error with Yasson 1.0.1.
The problem was that my application referenced the 'message' bundle which I didn't have in my deployment archive. What happened is that the older version of Yasson had the same-named bundle which was picked up by my deployment, and the new version of Yasson renamed this bundle, which caused my application to fail.

CommondInvokationFailure In Unity: Failed to build apk

Please stack overflow respected folks help me. I am stuck in this problem and can't fix it...
CommandInvokationFailure: Failed to build apk. C:\Program Files\Java\jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Asghar Jatoi/android-sdks\tools" -Dfile.encoding=UTF8 -jar "D:\Dlux Gaming + Mlay Games\Unity 5.6.0\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Error: No such file or directory 'C:/Users/shanti007/Desktop/isizwar/isizwar.keystore' ] stdout[
] exit code: 255 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.HostView:OnGUI()

CSipSimple throwing exception JNI DETECTED ERROR IN APPLICATION,input is not valid Modified UTF-8: illegal start byte 0x8e

CSipSimple throwing exception on android lollipop.
JNI DETECTED ERROR IN APPLICATION,input is not valid Modified UTF-8: illegal start byte 0x8e
while doing voip call, here i am sending message to ISipService in interval just to check call is going on or disconnected.
and i am getting this exception on pjStr.getPtr() which is in pjSipService.java class. here i am pasting my error log.
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x8e
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] string: 'OKp.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p'
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] in call to NewStringUTF
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] from java.lang.String org.pjsip.pjsua.pjsuaJNI.pj_str_t_ptr_get(long, org.pjsip.pjsua.pj_str_t)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] "Thread-1487" prio=5 tid=34 Runnable
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x13084400 self=0xafe5fc00
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] | sysTid=11490 nice=0 cgrp=apps sched=0/0 handle=0xafed3a80
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] | state=R schedstat=( 517221254 1512118979 3817 ) utm=23 stm=28 core=0 HZ=100
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] | stack=0x9dc06000-0x9dc08000 stackSize=1012KB
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #02 pc 002526ad /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #03 pc 0023618b /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #04 pc 000b1215 /system/lib/libart.so (art::JniAbort(char const*, char const*)+620)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #05 pc 000b1945 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #06 pc 000b3ee3 /system/lib/libart.so (art::ScopedCheck::Check(bool, char const*, ...) (.constprop.128)+922)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #07 pc 000bd9e5 /system/lib/libart.so (art::CheckJNI::NewStringUTF(_JNIEnv*, char const*)+44)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] native: #08 pc 000f5885 /data/app/com.xpointers.careteam-2/lib/arm/libpjsipjni.so (_JNIEnv::NewStringUTF(char const*)+8)
any idea? or any alternative to get notify if call had been disconnected by other party? or wifi get disconnected on other device and for that i will get notification that call is disconnected.
This error will throw for lollipop and higher version, because they are using ART, and some symbols are unable to detect by it.
Maybe there is something in this post that will help.
Do not use the JNI call to NewStringUTF unless you control the input 100%
In short, see the above link. Try avoiding the use of NewStringUTF and send a byte array of your input into java and have it make the jstring.
I won't pretend to understand CSipSimple's implementation, but I would not be surprised if this is indeed the source of your problem. I hope that helps. This problem plagues us since Android 5 came out and has slowly become a large problem with using the JNI with user created strings using their soft keyboards.

Cobertura gives Argument list too long

I am trying to generate code coverage reports using cobertura plugin.
I have this dependency in my pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>cobertura</goal>
</goals>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
</execution>
</executions>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
When I build my project using this goal -U -B clean install cobertura:cobertura, i get the below error on my jenkins CI
16:37:31 [ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument (default-cli) on project TestModule: Unable to execute Cobertura. Error while executing process. Cannot run program "/bin/sh": error=7, Argument list too long -> [Help 1]
16:37:31 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument (default-cli) on project TestModule: Unable to execute Cobertura.
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:364)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:198)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
16:37:31 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
16:37:31 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
16:37:31 at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
16:37:31 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
16:37:31 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
16:37:31 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
16:37:31 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
16:37:31 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
16:37:31 at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
16:37:31 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:37:31 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
16:37:31 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:37:31 at java.lang.reflect.Method.invoke(Method.java:602)
16:37:31 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
16:37:31 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
16:37:31 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
16:37:31 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
16:37:31 Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute Cobertura.
16:37:31 at org.codehaus.mojo.cobertura.tasks.AbstractTask.executeJava(AbstractTask.java:244)
16:37:31 at org.codehaus.mojo.cobertura.tasks.InstrumentTask.execute(InstrumentTask.java:139)
16:37:31 at org.codehaus.mojo.cobertura.CoberturaInstrumentMojo.execute(CoberturaInstrumentMojo.java:162)
16:37:31 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
16:37:31 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
16:37:31 ... 23 more
16:37:31 Caused by: org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
16:37:31 at org.codehaus.plexus.util.cli.Commandline.execute(Commandline.java:656)
16:37:31 at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:144)
16:37:31 at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:107)
16:37:31 at org.codehaus.mojo.cobertura.tasks.AbstractTask.executeJava(AbstractTask.java:240)
16:37:31 ... 27 more
16:37:31 Caused by: java.io.IOException: Cannot run program "/bin/sh": error=7, Argument list too long
16:37:31 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
16:37:31 at java.lang.Runtime.exec(Runtime.java:615)
16:37:31 at java.lang.Runtime.exec(Runtime.java:526)
16:37:31 at org.codehaus.plexus.util.cli.Commandline.execute(Commandline.java:636)
16:37:31 ... 30 more
16:37:31 Caused by: java.io.IOException: error=7, Argument list too long
16:37:31 at java.lang.UNIXProcess.<init>(UNIXProcess.java:139)
16:37:31 at java.lang.ProcessImpl.start(ProcessImpl.java:152)
16:37:31 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
16:37:31 ... 33 more
The build is successful on my windows machine but fails on jenkins. When I downgrade cobertura version to 2.5.1 this error goes away but I get some parse exceptions since the parser for cobertura for 2.5.1 is not up to date with java syntax.
Can someone help me get this working for 2.6.0 versions and higher for cobertura
This borders on the lines of relevance but may offer assistance
This is caused by a linux limitation whereby the arguments can't exceed 128kb in size
See Linux Kernel constant: MAX_ARG_STRLEN
https://github.com/torvalds/linux/blob/master/include/uapi/linux/binfmts.h
Within Jenkins once you read from/to a variable where this value is exceeded, you will hit this error.
In my case, I had a github webhook that launched a Jenkins job and set a payload parameter to some string > than this limit. Attempting to read this parameter would throw this error.
In order to work around the problem, I have a child job that uses a rest-api call to read the value from parent
You can let the parent job throw a failure, but allow the child job to be launched in all cases.
Below is a slightly refined function I used to pull the information (Stripped out error checking and comments for brevity)
def get_parameter_value_from_parent():
host = 'https://[YOUR_COMPANY].ci.cloudbees.com'
this_build_url = os.environ.get('BUILD_URL')
request_auth = (JENKINS_USER, JENKINS_TOKEN)
url = '{0}/api/json'.format(this_build_url)
parameter_name = 'payload'
payload = ''
#
# Get the upstreamBuild number, and the upstreamUrl
# so we can put together a link to the upstream job
#
response = requests.get(url, auth=request_auth)
this_build = json.loads(response)
build_number = ''
short_url = ''
actions = this_build['actions']
for action in actions:
if action.get('causes'):
for cause in action.get('causes'):
build_number = cause['upstreamBuild']
short_url = cause['upstreamUrl']
parent_url = '{host}/{short_url}{build}/api/json'.format(host=host,
short_url=short_url, build=build_number)
#
# Now get the payload from the parent job by making REST api call
#
response = requests.get(parent_url, auth=request_auth)
upstream_build = json.loads(response)
actions = upstream_build['actions']
for action in actions:
if action.get('parameters'):
for parameter in action.get('parameters'):
if parameter['name'] == parameter_name:
value = parameter['value']
payload = value
return payload
print 'Error: Unable to return payload from parent jenkins job: {0}'.format(parent_url)
sys.exit(1)
All shell have a limit for the command line length. UNIX / Linux / BSD system has a limit on how many bytes can be used for the command line argument and environment variables.
When you start a new process or type a command these limitations are applied and you will see an error message as follows on screen:
Argument list too long
Cobertura is trying to execute a shell command:
getLog().debug( "Working Directory: " + cl.getWorkingDirectory() );
getLog().debug( "Executing command line:" );
getLog().debug( cl.toString() );
int exitCode;
try
{
exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr );
}
catch ( CommandLineException e )
{
throw new MojoExecutionException( "Unable to execute Cobertura.", e );
}
In fact, the plugin is trying to execute a java process to run cobertura:
Commandline cl = new Commandline();
File java = new File( SystemUtils.getJavaHome(), "bin/java" );
cl.setExecutable( java.getAbsolutePath() );
cl.addEnvironment("CLASSPATH", createClasspath());
String log4jConfig = getLog4jConfigFile();
if ( log4jConfig != null )
{
cl.createArg().setValue( "-Dlog4j.configuration=" + log4jConfig );
}
cl.createArg().setValue( "-Xmx" + maxmem );
cl.createArg().setValue( taskClass );
if ( cmdLineArgs.useCommandsFile() )
{
String commandsFile;
try
{
commandsFile = cmdLineArgs.getCommandsFile();
}
catch ( IOException e )
{
throw new MojoExecutionException( "Unable to obtain CommandsFile location.", e );
}
if ( FileUtils.fileExists( commandsFile ) )
{
cl.createArg().setValue( "--commandsfile" );
cl.createArg().setValue( commandsFile );
}
else
{
throw new MojoExecutionException( "CommandsFile doesn't exist: " + commandsFile );
}
}
else
{
Iterator<String> it = cmdLineArgs.iterator();
while ( it.hasNext() )
{
cl.createArg().setValue( it.next() );
}
}
So, first of all, enable cobertura DEBUG traces to show the shell command executed.
I think the problem would be the classpath used in version 2.6 vs the one used in version 2.5.1.
Please, enable debug traces and post the result:
https://wiki.jenkins-ci.org/display/JENKINS/Logging