Uploaded image for project: 'WINDUP - Red Hat Application Migration Toolkit'
  1. WINDUP - Red Hat Application Migration Toolkit
  2. WINDUP-972

DiscoverJPAAnnotationsRuleProvider_JPAEntityBeanRule rule throws java.lang.NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.5.0.CR3
    • 2.5.0.CR2
    • None
    • None
    • None

      It throws NPE on data which doesn't have JPA entities, but still it couldn't do that

      Stack trace:

      SEVERE: Error encountered while evaluating rule: .addRule().when(JavaClass.references(javax.persistence.Entity).at([ANNOTATION]).as(entityAnnotations).or(JavaClass.references(javax.persistence.Table).at([ANNOTATION]).as(tableAnnotations)).or(JavaClass.references(javax.persistence.NamedQuery).at([ANNOTATION]).as(namedQuery)).or(JavaClass.references(javax.persistence.NamedQueries).at([ANNOTATION]).as(namedQueries))).perform(Iteration.over(?).as(entityAnnotations_instance).perform(org.jboss.windup.rules.apps.javaee.rules.DiscoverJPAAnnotationsRuleProvider$1@544cd64b)).withId("DiscoverJPAAnnotationsRuleProvider_JPAEntityBeanRule")
      Failed when iterating [v[25344]={w:vertextype: [JavaTypeReference, fileLocationModel, fileReferenceModel, JavaAnnotationTypeReference, JavaAnnotationTypeValue], resolutionStatus: RECOVERED, length: 7, referenceType: ANNOTATION, lineNumber: 32, resolvedSourceSnippit: javax.persistence.Entity, startPosition: 0, referenceSourceSnippit: @Entity}], due to: null
      org.jboss.windup.util.exception.WindupException: Failed when iterating [v[25344]={w:vertextype: [JavaTypeReference, fileLocationModel, fileReferenceModel, JavaAnnotationTypeReference, JavaAnnotationTypeValue], resolutionStatus: RECOVERED, length: 7, referenceType: ANNOTATION, lineNumber: 32, resolvedSourceSnippit: javax.persistence.Entity, startPosition: 0, referenceSourceSnippit: @Entity}], due to: null
      	at org.jboss.windup.config.operation.Iteration.perform(Iteration.java:290)
      	at org.jboss.windup.config.operation.Iteration.perform(Iteration.java:204)
      	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:168)
      	at org.jboss.windup.config.RuleSubset.perform(RuleSubset.java:265)
      	at org.jboss.windup.exec.WindupProcessorImpl.execute(WindupProcessorImpl.java:152)
      	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.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)
      	at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
      	at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)
      	at org.jboss.windup.exec.WindupProcessorImpl_$$_javassist_5c687f35-aece-46a7-8b12-2646212613f3.execute(WindupProcessorImpl_$$_javassist_5c687f35-aece-46a7-8b12-2646212613f3.java)
      	at org.jboss.windup.rules.tests.WindupRulesTest.runWindup(WindupRulesTest.java:335)
      	at org.jboss.windup.rules.tests.WindupRulesTest.access$400(WindupRulesTest.java:70)
      	at org.jboss.windup.rules.tests.WindupRulesTest$RuleTestVisitor.visit(WindupRulesTest.java:214)
      	at org.jboss.windup.rules.tests.WindupRulesTest$RuleTestVisitor.visit(WindupRulesTest.java:144)
      	at org.jboss.windup.util.file.FileVisit.visit(FileVisit.java:34)
      	at org.jboss.windup.rules.tests.WindupRulesTest.testWindupRules(WindupRulesTest.java:120)
      	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.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)
      	at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
      	at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)
      	at org.jboss.windup.rules.tests.WindupRulesTest_$$_javassist_19379bd3-520f-4c74-89a7-8a70e1d17e91.testWindupRules(WindupRulesTest_$$_javassist_19379bd3-520f-4c74-89a7-8a70e1d17e91.java)
      	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.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)
      	at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
      	at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)
      	at org.jboss.windup.rules.tests.WindupRulesTest_$$_javassist_4dfb05bb-6d05-4728-8d79-6c32b48a205c.testWindupRules(WindupRulesTest_$$_javassist_4dfb05bb-6d05-4728-8d79-6c32b48a205c.java)
      	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.jboss.forge.arquillian.impl.FurnaceTestMethodExecutor.invoke(FurnaceTestMethodExecutor.java:138)
      	at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      	at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)
      	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)
      	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:130)
      	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
      	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
      	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:136)
      	at org.jboss.arquillian.junit.Arquillian$8.evaluate(Arquillian.java:363)
      	at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:245)
      	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
      	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
      	at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:259)
      	at org.jboss.arquillian.junit.Arquillian$7.evaluate(Arquillian.java:321)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:204)
      	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
      	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
      	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      Caused by: java.lang.NullPointerException
      	at org.jboss.windup.rules.apps.javaee.rules.DiscoverJPAAnnotationsRuleProvider.extractEntityBeanMetadata(DiscoverJPAAnnotationsRuleProvider.java:101)
      	at org.jboss.windup.rules.apps.javaee.rules.DiscoverJPAAnnotationsRuleProvider.access$000(DiscoverJPAAnnotationsRuleProvider.java:39)
      	at org.jboss.windup.rules.apps.javaee.rules.DiscoverJPAAnnotationsRuleProvider$1.perform(DiscoverJPAAnnotationsRuleProvider.java:75)
      	at org.jboss.windup.rules.apps.javaee.rules.DiscoverJPAAnnotationsRuleProvider$1.perform(DiscoverJPAAnnotationsRuleProvider.java:71)
      	at org.jboss.windup.config.operation.iteration.AbstractIterationOperation.perform(AbstractIterationOperation.java:65)
      	at org.jboss.windup.config.operation.GraphOperation.perform(GraphOperation.java:24)
      	at org.jboss.windup.config.operation.Iteration.perform(Iteration.java:267)
      	... 116 more
      

              mnovotny@redhat.com Marek Novotny
              mnovotny@redhat.com Marek Novotny
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: