[ 
https://issues.apache.org/jira/browse/ATLAS-1347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Apoorv Naik reassigned ATLAS-1347:
----------------------------------

    Assignee: Apoorv Naik

> Creating a class with unknown supertype results in "409 Conflict", where as 
> expected is "400 Bad Message"
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: ATLAS-1347
>                 URL: https://issues.apache.org/jira/browse/ATLAS-1347
>             Project: Atlas
>          Issue Type: Bug
>    Affects Versions: 0.8-incubating
>            Reporter: Ayub Khan
>            Assignee: Apoorv Naik
>             Fix For: 0.8-incubating
>
>         Attachments: ATLAS-1347.patch
>
>
> Creating a class with unknown supertype results in "409 Conflict", where as 
> expected is "400 Bad Message"
> {noformat}
> {
>   "enumTypes":[
>   ],
>   "structTypes":[
>   ],
>   "traitTypes":[
>   ],
>   "classTypes":[
>     {
>       "superTypes":[
>         "superClassw4ny4wbeck"
>       ],
>       
> "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
>       "typeName":"classw4ny4wbeck",
>       "typeDescription":null,
>       "typeVersion":"1.0",
>       "attributeDefinitions":null
>     }
>   ]
> }
> {noformat}
> {noformat}
> 2016-12-01 08:52:00,087 ERROR - [pool-2-thread-9 - 
> 9ae5cce3-0634-423d-b648-d01e81674750:] ~ graph rollback due to exception  
> (GraphTransactionInterceptor:57)
> org.apache.atlas.exception.AtlasBaseException: superClassw4ny4wbeck: Unknown 
> typename
>         at 
> org.apache.atlas.type.AtlasTypeRegistry.getType(AtlasTypeRegistry.java:94)
>         at 
> org.apache.atlas.type.AtlasEntityType.collectTypeHierarchyInfo(AtlasEntityType.java:267)
>         at 
> org.apache.atlas.type.AtlasEntityType.getTypeHierarchyInfo(AtlasEntityType.java:248)
>         at 
> org.apache.atlas.type.AtlasEntityType.resolveReferences(AtlasEntityType.java:76)
>         at 
> org.apache.atlas.type.AtlasTypeRegistry$AtlasTransientTypeRegistry.resolveReferences(AtlasTypeRegistry.java:285)
>         at 
> org.apache.atlas.type.AtlasTypeRegistry$AtlasTransientTypeRegistry.addTypes(AtlasTypeRegistry.java:344)
>         at 
> org.apache.atlas.repository.store.graph.AtlasTypeDefGraphStore.createTypesDef(AtlasTypeDefGraphStore.java:577)
>         at 
> org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:50)
>         at 
> org.apache.atlas.web.rest.TypesREST.createAtlasTypeDefs(TypesREST.java:438)
>         at 
> org.apache.atlas.web.resources.TypesResource.submit(TypesResource.java:109)
>         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 
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>         at 
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
>         at 
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>         at 
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
>         at 
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
>         at 
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>         at 
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
>         at 
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
>         at 
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
>         at 
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
>         at 
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
>         at 
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
>         at 
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
>         at 
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>         at 
> com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
>         at 
> com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
>         at 
> com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
>         at 
> com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
>         at 
> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
>         at 
> org.apache.atlas.web.filters.AuditFilter.doFilter(AuditFilter.java:71)
>         at 
> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
>         at 
> com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
>         at 
> com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
> {noformat}
> {noformat}
> 2016-12-01 08:52:00,244 INFO  - [main:] ~ java.lang.AssertionError: The 
> following asserts failed:
> Status code mismatch expected [400] but found [409], Status Message mismatch 
> expected [Bad Request] but found [Conflict], Error message mismatch. expected 
> [Unknown datatype: superClassw4ny4wbeck] but found [superClassw4ny4wbeck: 
> Unknown typename]
>         at org.testng.asserts.SoftAssert.assertAll(SoftAssert.java:38)
>         at 
> org.apache.atlas.regression.tests.TypeResourceTest.createClassSuperTypeThatDoesNotExistTest(TypeResourceTest.java:330)
>         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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
>         at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
>         at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
>         at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
>         at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
>         at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
>         at org.testng.TestRunner.privateRun(TestRunner.java:771)
>         at org.testng.TestRunner.run(TestRunner.java:621)
>         at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
>         at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
>         at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
>         at org.testng.SuiteRunner.run(SuiteRunner.java:259)
>         at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>         at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>         at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
>         at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
>         at org.testng.TestNG.run(TestNG.java:1032)
>         at 
> org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
>         at 
> org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
>         at 
> org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
>         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)
>  (TestNGListener:57)
> 2016-12-01 08:52:00,245 INFO  - [main:] ~ 
> --------------------------------------------------------------------------------
>  (TestNGListener:58)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to