I am developing a sort of media player for android, want to get Album Art, and use this code.
Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id);
ContentResolver res = context.getContentResolver();
try {
in = res.openInputStream(uri);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Bitmap artwork = BitmapFactory.decodeStream(in);
But I get FileNotfoundExeption, and artwork sets to null(
Here is the LogCat
09-06 14:55:56.713: ERROR/MetadataRetrieverClient(34): failed to extract an album art
09-06 14:55:56.723: WARN/System.err(536): java.io.FileNotFoundException: No entry for content://media/external/audio/albumart/1
09-06 14:55:56.733: WARN/System.err(536): at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:123)
09-06 14:55:56.733: WARN/System.err(536): at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:538)
09-06 14:55:56.733: WARN/System.err(536): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:484)
09-06 14:55:56.733: WARN/System.err(536): at android.content.ContentResolver.openInputStream(ContentResolver.java:319)
09-06 14:55:56.733: WARN/System.err(536): at player.org.Progress.onCreate(Progress.java:92)
09-06 14:55:56.733: WARN/System.err(536): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-06 14:55:56.733: WARN/System.err(536): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
09-06 14:55:56.733: WARN/System.err(536): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
09-06 14:55:56.743: WARN/System.err(536): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-06 14:55:56.743: WARN/System.err(536): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
09-06 14:55:56.743: WARN/System.err(536): at android.os.Handler.dispatchMessage(Handler.java:99)
09-06 14:55:56.743: WARN/System.err(536): at android.os.Looper.loop(Looper.java:123)
09-06 14:55:56.743: WARN/System.err(536): at android.app.ActivityThread.main(ActivityThread.java:3683)
09-06 14:55:56.743: WARN/System.err(536): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 14:55:56.743: WARN/System.err(536): at java.lang.reflect.Method.invoke(Method.java:507)
09-06 14:55:56.743: WARN/System.err(536): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-06 14:55:56.743: WARN/System.err(536): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-06 14:55:56.753: WARN/System.err(536): at dalvik.system.NativeStart.main(Native Method)
Related
Sample example is :
<flow name="testFlow">
<poll doc:name="Poll">
<fixed-frequency-scheduler frequency="10000" startDelay="10"/>
<wmq:inbound-endpoint queue="${mq.ssl.mvs.queue1}" connector-ref="wMQConfig1" doc:name="WMQ"/>
</poll>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
I get following error:
org.mule.module.launcher.DeploymentInitException: SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'wmq:inbound-endpoint'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-poll-override, "http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected. at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:205)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:63)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:136)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:58) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:324)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:345)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:163)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170)
~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:15)
~[tooling-support-3.8.0.jar:?]
You are using a Poll wrapped wmq:inbound-endpoint as your message source. If you are reading from the WebSphereMQ you will need to change this to a wmq:outbound-endpoint component else move it to the process flow section.
I want to configure my LDAP with activiti explorer so I have followed the instructions from the user guide and i created activiti-custom-context.xml file and I did what he said but it didn't work for me and give me this error
in the tomcat log
03:43:35,413 [localhost-startStop-1] ERROR org.activiti.engine.impl.interceptor.CommandContext - Error while closing command context
org.activiti.engine.ActivitiIllegalArgumentException: This query is not supported by the LDAPGroupManager
at org.activiti.ldap.LDAPGroupManager.findGroupByQueryCriteria(LDAPGroupManager.java:94)
at org.activiti.ldap.LDAPGroupManager.findGroupCountByQueryCriteria(LDAPGroupManager.java:100)
at org.activiti.engine.impl.GroupQueryImpl.executeCount(GroupQueryImpl.java:118)
at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:170)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.AbstractQuery.count(AbstractQuery.java:157)
at org.activiti.explorer.conf.DemoDataConfiguration.createGroup(DemoDataConfiguration.java:118)
at org.activiti.explorer.conf.DemoDataConfiguration.initDemoGroups(DemoDataConfiguration.java:108)
at org.activiti.explorer.conf.DemoDataConfiguration.init(DemoDataConfiguration.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1558)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.activiti.explorer.servlet.WebConfigurer.contextInitialized(WebConfigurer.java:40)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
03:43:35,417 [localhost-startStop-1] WARN org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoDataConfiguration': Invocation of init method failed; nested exception is org.activiti.engine.ActivitiIllegalArgumentException: This query is not supported by the LDAPGroupManager
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1558)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.activiti.explorer.servlet.WebConfigurer.contextInitialized(WebConfigurer.java:40)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
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: org.activiti.engine.ActivitiIllegalArgumentException: This query is not supported by the LDAPGroupManager
at org.activiti.ldap.LDAPGroupManager.findGroupByQueryCriteria(LDAPGroupManager.java:94)
at org.activiti.ldap.LDAPGroupManager.findGroupCountByQueryCriteria(LDAPGroupManager.java:100)
at org.activiti.engine.impl.GroupQueryImpl.executeCount(GroupQueryImpl.java:118)
at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:170)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.AbstractQuery.count(AbstractQuery.java:157)
at org.activiti.explorer.conf.DemoDataConfiguration.createGroup(DemoDataConfiguration.java:118)
at org.activiti.explorer.conf.DemoDataConfiguration.initDemoGroups(DemoDataConfiguration.java:108)
at org.activiti.explorer.conf.DemoDataConfiguration.init(DemoDataConfiguration.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 25 more
this is my activiti-custom-context.xml file
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="true" />
<property name="enableDatabaseEventLogging" value="true" />
<property name="customFormTypes">
<list>
<bean class="org.activiti.explorer.form.UserFormType" />
<bean class="org.activiti.explorer.form.ProcessDefinitionFormType" />
<bean class="org.activiti.explorer.form.MonthFormType" />
</list>
</property>
<property name="configurators">
<list>
<bean class="org.activiti.ldap.LDAPConfigurator">
<!-- Server connection params -->
<property name="server" value="ldap://localhost" />
<property name="port" value="8389" />
<property name="securityAuthentication" value="simple" />
<property name="user" value="uid=admin,ou=system" />
<property name="password" value="secret" />
<!-- Query params -->
<!--<prMY Coperty name="baseDn" value="dc=test,dc=com" />-->
<property name="baseDn" value="o=mojo" />
<!--HANGE END -->
<property name="queryUserByUserId"
value="(&(objectClass=inetOrgPerson)(displayname={0}))" />
<property name="queryUserByFullNameLike"
value="(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
<property name="queryGroupsForUser"
value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
<property name="userIdAttribute" value="uid" />
<property name="userFirstNameAttribute" value="cn" />
<property name="userLastNameAttribute" value="sn" />
<property name="groupIdAttribute" value="cn" />
<property name="groupNameAttribute" value="cn" />
</bean>
</list>
</property>
</bean>
application.yaml:
proxy.http.host: localhost
proxy.http.port: 3128
The config class:
#Component
#ConfigurationProperties(prefix = "proxy.http")
data class ProxyConfig(var host: String = "", var port: Int = -1) {
}
The consumer (an object type)
object RestUtils {
#Autowired
lateinit var proxyConfig: ProxyConfig
fun createRestTemplate(): RestTemplate {
val proxy = Proxy(Proxy.Type.HTTP, InetSocketAddress(proxyConfig.host, 3128))
Unfortunatelly, it ends at runtime in a kotlin.UninitializedPropertyAccessException exception.
Stacktrace:
kotlin.UninitializedPropertyAccessException: lateinit property proxyConfig has not been initialized
at com.test.infrastructure.RestUtils.createRestTemplate(RestUtils.kt:16) ~[classes/:na]
at com.test.monitoring.MonitoringController.getComponentsStatus(MonitoringController.kt:36) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_20]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_20]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_20]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at com.daimlertss.repocar.service.infrastructure.CorsFilter.doFilter(CorsFilter.kt:24) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:213) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) ~[spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458) [tomcat-embed-core-8.0.33.jar:8.0.33]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_20]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.33.jar:8.0.33]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_20]
Dependency injection does not work with Kotlin objects. Every object has a single instance created by the compiler-generated code and stored in a static field, and it's not possible to inject any dependencies into that instance.
You need to change your code so that RestUtils is a regular class.
I have a tabbed Android App like this:
The first two Tabs contains empty Views, the third contains a tableview.
I added to it an eventlistener (on a custom event) and I update his content in real time each time the event is fired.
var tb;
function update(){
tb.setData([]);
var row = [];
var r = Titanium.UI.createTableViewRow();
row.push(r);
tb.setData(row);
return true;
}
function MainView() {
self = new ui.View();
tb = Titanium.UI.createTableView({
scrollable: false,
showVerticalScrollIndicator: false,
top: 10,
width: "98%",
//height: perH(0.95) - baseH,
border: 1,
borderColor: "gray",
borderRadius: 6,
});
self.add(tb);
// And i add an event listener to call the update function
Ti.App.addEventListener( 'updateFav', update );
return self;
}
module.exports = MainView;
Each time I fire the event the tableview is updated normally and everything works well.
But if i tap the first tab, and go to the second or third, the app crashes! "Has stopped" is the message that Android shows.
The logcat says "NullPointer exception" but i dont know why!
Again: The problem occurs simply changing the current tab form first to second or third! The problem not occurs changing only from second to third or viceversa!!!!
Any suggestion?
This is the error:
[WARN][dalvikvm( 2070)] threadid=1: thread exiting with uncaught exception (group=0xb1f48648)
[ERROR][TiApplication( 2070)] (main) [42854,169668] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.3,2013/09/18 12:01,222f4d1
[ERROR][TiApplication( 2070)] java.lang.NullPointerException
[ERROR][TiApplication( 2070)] at android.view.ViewConfiguration.get(ViewConfiguration.java:318)
[ERROR][TiApplication( 2070)] at android.view.View.<init>(View.java:3264)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.<init>(ViewGroup.java:448)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.TiImageView.<init>(TiImageView.java:63)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.TiUIImageView.<init>(TiUIImageView.java:94)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.ImageViewProxy.createView(ImageViewProxy.java:43)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:452)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.proxy.TiViewProxy.forceCreateView(TiViewProxy.java:406)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.createControls(TiTableViewRowProxyItem.java:246)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:408)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:90)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:229)
[ERROR][TiApplication( 2070)] at android.widget.AbsListView.obtainView(AbsListView.java:2177)
[ERROR][TiApplication( 2070)] at android.widget.ListView.makeAndAddView(ListView.java:1840)
[ERROR][TiApplication( 2070)] at android.widget.ListView.fillDown(ListView.java:675)
[ERROR][TiApplication( 2070)] at android.widget.ListView.fillFromTop(ListView.java:736)
[ERROR][TiApplication( 2070)] at android.widget.ListView.layoutChildren(ListView.java:1655)
[ERROR][TiApplication( 2070)] at android.widget.AbsListView.onLayout(AbsListView.java:2012)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][TiApplication( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:572)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1388)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
[ERROR][TiApplication( 2070)] at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
[ERROR][TiApplication( 2070)] at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][TiApplication( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][TiApplication( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][TiApplication( 2070)] at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1976)
[ERROR][TiApplication( 2070)] at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1730)
[ERROR][TiApplication( 2070)] at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
[ERROR][TiApplication( 2070)] at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
[ERROR][TiApplication( 2070)] at android.view.Choreographer$CallbackRecord.run(Choreographer.j
[ERROR][AndroidRuntime( 2070)] FATAL EXCEPTION: main
[ERROR][AndroidRuntime( 2070)] java.lang.NullPointerException
[ERROR][AndroidRuntime( 2070)] at android.view.ViewConfiguration.get(ViewConfiguration.java:318)
[ERROR][AndroidRuntime( 2070)] at android.view.View.<init>(View.java:3264)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.<init>(ViewGroup.java:448)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.TiImageView.<init>(TiImageView.java:63)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.TiUIImageView.<init>(TiUIImageView.java:94)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.ImageViewProxy.createView(ImageViewProxy.java:43)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:452)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.proxy.TiViewProxy.forceCreateView(TiViewProxy.java:406)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.createControls(TiTableViewRowProxyItem.java:246)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:408)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:90)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:229)
[ERROR][AndroidRuntime( 2070)] at android.widget.AbsListView.obtainView(AbsListView.java:2177)
[ERROR][AndroidRuntime( 2070)] at android.widget.ListView.makeAndAddView(ListView.java:1840)
[ERROR][AndroidRuntime( 2070)] at android.widget.ListView.fillDown(ListView.java:675)
[ERROR][AndroidRuntime( 2070)] at android.widget.ListView.fillFromTop(ListView.java:736)
[ERROR][AndroidRuntime( 2070)] at android.widget.ListView.layoutChildren(ListView.java:1655)
[ERROR][AndroidRuntime( 2070)] at android.widget.AbsListView.onLayout(AbsListView.java:2012)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][AndroidRuntime( 2070)] at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:572)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1388)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
[ERROR][AndroidRuntime( 2070)] at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
[ERROR][AndroidRuntime( 2070)] at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
[ERROR][AndroidRuntime( 2070)] at android.view.View.layout(View.java:14289)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewGroup.layout(ViewGroup.java:4562)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1976)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1730)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
[ERROR][AndroidRuntime( 2070)] at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
[ERROR][AndroidRuntime( 2070)] at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
[ERROR][AndroidRuntime( 2070)] at android.view.Choreographer.doCallbacks(Choreographer.java:562)
[ERROR][AndroidRuntime( 2070)] at android.view.Choreographer.doFrame(C
I have a few questions about GCM (Google Cloud Messaging).
The first question is that: I am unable to start up the program. It seems to be always crashing:
The manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gcmtutorial"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<permission android:name="com.example.gcmtutorial.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcmtutorial.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.gcmtutorial" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The code is:
package com.example.gcmtutorial;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import com.google.android.gcm.GCMRegistrar;
public class MainActivity extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, "714669202278");
} else {
Log.v("Registered", "Already registered");
}
setContentView(R.layout.activity_main);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
The error that I receive is that
07-27 18:11:23.504: E/AndroidRuntime(11390): FATAL EXCEPTION: main
07-27 18:11:23.504: E/AndroidRuntime(11390): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gcmtutorial/com.example.gcmtutorial.MainActivity}: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) } without permission com.google.android.c2dm.permission.RECEIVE
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2205)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2240)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ActivityThread.access$600(ActivityThread.java:139)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1262)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.os.Looper.loop(Looper.java:156)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ActivityThread.main(ActivityThread.java:4987)
07-27 18:11:23.504: E/AndroidRuntime(11390): at java.lang.reflect.Method.invokeNative(Native Method)
07-27 18:11:23.504: E/AndroidRuntime(11390): at java.lang.reflect.Method.invoke(Method.java:511)
07-27 18:11:23.504: E/AndroidRuntime(11390): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-27 18:11:23.504: E/AndroidRuntime(11390): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-27 18:11:23.504: E/AndroidRuntime(11390): at dalvik.system.NativeStart.main(Native Method)
07-27 18:11:23.504: E/AndroidRuntime(11390): Caused by: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) } without permission com.google.android.c2dm.permission.RECEIVE
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ContextImpl.startService(ContextImpl.java:1356)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.content.ContextWrapper.startService(ContextWrapper.java:359)
07-27 18:11:23.504: E/AndroidRuntime(11390): at com.google.android.gcm.GCMRegistrar.internalRegister(GCMRegistrar.java:229)
07-27 18:11:23.504: E/AndroidRuntime(11390): at com.google.android.gcm.GCMRegistrar.register(GCMRegistrar.java:217)
07-27 18:11:23.504: E/AndroidRuntime(11390): at com.example.gcmtutorial.MainActivity.onCreate(MainActivity.java:24)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.Activity.performCreate(Activity.java:4538)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
07-27 18:11:23.504: E/AndroidRuntime(11390): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-27 18:11:23.504: E/AndroidRuntime(11390): ... 11 more
I have Google them up, but there seems to be no solution.
My second question is:
How can I write a php server using GCM
I have referred to:
GCM sending with curl (php)
GCM with PHP (Google Cloud Messaging)
The thing that I don't get is what does registration ID mean
try package.GCMIntentService in service in your manifest