I am attempting to follow this google codelab
Creating Android Slices
When I enter the following adb command
adb shell am start -a android.intent.action.VIEW -d slice-content://com.android.example.slicecodelab/temperature
The Slice Viewer crashes as follows:-
2019-03-19 10:16:05.704 8343-8583/com.example.android.sliceviewer E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.example.android.sliceviewer, PID: 8343
java.lang.NullPointerException: name == null
at java.lang.Enum.valueOf(Enum.java:242)
at android.graphics.PorterDuff$Mode.valueOf(PorterDuff.java:178)
at androidx.core.graphics.drawable.IconCompat.onPostParceling(IconCompat.java:757)
at androidx.core.graphics.drawable.IconCompatParcelizer.read(IconCompatParcelizer.java:19)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemHolderParcelizer.read(SliceItemHolderParcelizer.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemParcelizer.read(SliceItemParcelizer.java:15)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1342)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1311)
at androidx.slice.SliceParcelizer.read(SliceParcelizer.java:13)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemHolderParcelizer.read(SliceItemHolderParcelizer.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemParcelizer.read(SliceItemParcelizer.java:15)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1342)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1311)
at androidx.slice.SliceParcelizer.read(SliceParcelizer.java:13)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.ParcelImpl.<init>(ParcelImpl.java:37)
at androidx.versionedparcelable.ParcelImpl$1.createFromParcel(ParcelImpl.java:61)
at androidx.versionedparcelable.ParcelImpl$1.createFromParcel(ParcelImpl.java:58)
at android.os.Parcel.readParcelable(Parcel.java:2860)
at android.os.Parcel.readValue(Parcel.java:2754)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3123)
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:273)
at android.os.BaseBundle.unparcel(BaseBundle.java:226)
at android.os.Bundle.getParcelable(Bundle.java:939)
at androidx.slice.compat.SliceProviderCompat.bindSlice(SliceProviderCompat.java:320)
2019-03-19 10:16:05.704 8343-8583/com.example.android.sliceviewer E/AndroidRuntime: at androidx.slice.compat.SliceProviderCompat.bindSlice(SliceProviderCompat.java:378)
at androidx.slice.SliceViewManagerCompat.bindSlice(SliceViewManagerCompat.java:65)
at androidx.slice.widget.SliceLiveData$SliceLiveDataImpl$1.run(SliceLiveData.java:291)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
In fact whatever Android Slice tutorial I attempt to use the Slice Viewer fails in the exact same way
Are android Slices not ready for use?
What Am I dong wrong?
How can I fix Slice Viewer?
UPDATE
Ive raised an Issue (Issue 128658881) and Google are fixing this.
Slice-viewer app crashes on Devices below API 28 when we try to display icons in slice. The app doesn't crash on Pie.
This issue is described here
Related
We using Grails 2.4.5 on a project, and normally running interactive mode on our Linux machines work. I'm not sure what changed, we did not alter any java or grails configs.
java.lang.RuntimeException: Error reading input: Resource temporarily unavailable
at grails.build.logging.GrailsConsole.readLine(GrailsConsole.java:793)
at grails.build.logging.GrailsConsole.showPrompt(GrailsConsole.java:779)
at grails.build.logging.GrailsConsole.showPrompt(GrailsConsole.java:805)
at grails.build.logging.GrailsConsole$showPrompt$1.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at org.codehaus.groovy.grails.cli.interactive.InteractiveMode.showPrompt(InteractiveMode.groovy:50)
at org.codehaus.groovy.grails.cli.interactive.InteractiveMode$showPrompt.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
at org.codehaus.groovy.grails.cli.interactive.InteractiveMode.run(InteractiveMode.groovy:114)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:216)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:236)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)
| Error Interactive mode exited with error: Error reading input: Resource temporarily unavailable
Tried creating a new project and has the same error there too.
What's causing this? Do you see clues in the stack trace on why?
I am trying to launch the android app on emulator.
.apk file seems fine to me since I can manually open the app on emulator , but it fails to open through appium.
Below is my log
`Activity used to start app doesn't exist or cannot be launched
Driver info: driver.version: BaseDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:217)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:140)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:93)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72)
at BaseDriver.setUp(BaseDriver.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy3.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)`
desired capabilities are as follows : `
File classpathRoot = new File(System.getProperty("user.home"));
File appDir = new File(classpathRoot,"Desktop/");
File app = new File(appDir.getCanonicalPath(),"AQ.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","Android Emulator");
capabilities.setCapability("app",app.getAbsolutePath());
capabilities.setCapability("appActivity",".MainActivity");
capabilities.setCapability("fullReset",true);
`
I am trying to test a react native app , I have generated and .apk file for testing android application.
looking for suggestions/guidance/help, thank you
from the error it looks like the 'appActivity' value you are providing is not correct
Two suggestions here
try to add appPackage in Capability as well
Here is all the capabilty for android
Finding correct appPackage and appActivity value
open the application in emulator
run command in command prompt ( i assume you have setup adb tools path)
adb shell dumpsys window windows
in output of this command you will see lots of data , try to check 'mcurrentFocuswindow' and see the appPackage and appActivity there, and verify it with your values
Recently I can observe very weird behavior of TestNG tests launched from surefire plugin. Once suite is finished tests execution just hang without any exceptions or informations. After killing executtion and clearing workspace it seems that SurefireBotter hanged:
Failed to clean project: Failed to delete C:\[path]\target\surefire\surefirebooter380043352616947373.jar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete C:\[path]\target\surefire\surefirebooter380043352616947373.jar
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:215)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.IOException: Failed to delete C:\[path]\target\surefire\surefirebooter380043352616947373.jar
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:249)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:191)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:117)
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:193)
The curious thing is that after killing process with maven manually after it hangs, I still can see java processes in system responsible for that booter.
Framework that I'm using is based on Spring, however I have no idea if this is meaningfull :)
Any hints will be more than welcome :)
You can kill the java process using JPS (a tool provide with the JDK). JPS will list process and id. You can kill the process by the id
while executing one app in dev mode with grails (run-app), i'm facing one issue related to AOP.
I'm using spring cache to cache some services method, and when i try to call one of them, i have this exception :
Note : This app works fine when deployed in external tomcat
org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine implemented interfaces of missing type com.sun.proxy.$Proxy51
[Xlint:cantFindType]
at org.aspectj.weaver.reflect.ReflectionWorld$ExceptionBasedMessageHandler.handleMessage(ReflectionWorld.java:129)
at org.aspectj.weaver.Lint$Kind.signal(Lint.java:340)
at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.raiseCantFindType(MissingResolvedTypeWithKnownSignature.java:232)
at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.getDeclaredInterfaces(MissingResolvedTypeWithKnownSignature.java:86)
at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82)
at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178)
at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130)
at org.aspectj.weaver.internal.tools.TypePatternMatcherImpl.matches(TypePatternMatcherImpl.java:31)
at org.springframework.aop.aspectj.TypePatternClassFilter.matches(TypePatternClassFilter.java:101)
at org.springframework.aop.framework.DefaultAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(DefaultAdvisorChainFactory.java:64)
at org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:489)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:193)
at com.sun.proxy.$Proxy53.list(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:317)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:350)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:299)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy53.list(Unknown Source)
I've been trying to configure Spring Data Neo4j to use the Advanced Mapping mode with AspectJ but I've not been able to get it to work properly with my Spring Boot project. The project compiles and starts up without exception but when I try to call a controller I get a java.lang.NullPointerException. I've compared my code with some of the example projects and I cannot see what I'm doing wrong.
I've put up a small example program that highlights the issue on github: https://github.com/tjakobsen/nullpointer
Below is a copy of the full stack trace I get when I run the above project (I'm using JDK 1.7 with Tomcat 7). Any insight on what I'm doing wrong would be much appreciated.
java.lang.NullPointerException
org.springframework.data.neo4j.aspects.support.node.Neo4jNodeBacking.ajc$interMethod$org_springframework_data_neo4j_aspects_support_node_Neo4jNodeBacking$org_springframework_data_neo4j_aspects_core_NodeBacked$persist(Neo4jNodeBacking.aj:133)
com.example.nullpointer.domain.Person.persist(Person.java:1)
com.example.nullpointer.domain.Person.persist(Person.java:1)
org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.persist(Neo4jEntityPersister.java:229)
org.springframework.data.neo4j.support.Neo4jTemplate.save(Neo4jTemplate.java:356)
org.springframework.data.neo4j.support.Neo4jTemplate.save(Neo4jTemplate.java:350)
org.springframework.data.neo4j.repository.AbstractGraphRepository.save(AbstractGraphRepository.java:91)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:405)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:390)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:344)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
com.sun.proxy.$Proxy69.save(Unknown Source)
com.example.nullpointer.controllers.IndexController.index_aroundBody0(IndexController.java:29)
com.example.nullpointer.controllers.IndexController$AjcClosure1.run(IndexController.java:1)
org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)
org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)
com.example.nullpointer.controllers.IndexController.index(IndexController.java:24)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
I think you're missing the neo4j aspect configuration. Check this out https://github.com/inserpio/nullpointer and let me know if it correctly works also for you.
Cheers,
Lorenzo