Forum Discussion

cabletie's avatar
cabletie
Occasional Contributor
7 years ago

How to fix "cannot get property 'info' on null object' when importing swagger

Hi,

 

When trying to create my first project by importing from my swagger (Apoen API 2.0) spec, it fails with "java.lang.NullPointerException: cannot get property 'info' on null object".

 

I don't really want to share my API spec - is there anywhere I get see more detailed info on what's upsetting it?

 

Project -> Import Swagger/OpenAPI definition

...browse to file, select .yaml file, click OK and get this:

 

 

ReadyAPI 2.2.0
© SmartBear Inc. 2007-2018
http://www.smartbear.com

Build Date: 20180202-1457
cfadb2503b0140bf76b285753b58766e11a09b3d
Information about 3rd party libraries

 

  • Thanks again - now you've put me on to the Open Source version I'll look into that!

     

    By the way, (and to record it here for others searching for the same problem), the issue was to do with CORS which I had set up correctly on the AWS S3 service I was using to serve the .yaml file but an extension in my browser (unfortunately I have not been able to determine which one) was somehow blocking the Origin header and so the 

    Access-Control-Allow-Origin header was not being returned.

    In turn, the browser disallowed loading the resource.

     

  • cabletie's avatar
    cabletie
    Occasional Contributor

    Also, it loads without error in swagger UI...

  • cabletie's avatar
    cabletie
    Occasional Contributor

    And further, I've now located the error logs and include them here:

    Thu Feb 08 15:16:10 AEDT 2018:ERROR:java.lang.NullPointerException: Cannot get property 'info' on null object
       java.lang.NullPointerException: Cannot get property 'info' on null object
       	at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
       	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
       	at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
       	at com.smartbear.swagger.Swagger2Importer.createRestService(Swagger2Importer.groovy:306)
       	at com.smartbear.swagger.Swagger2Importer.this$2$createRestService(Swagger2Importer.groovy)
       	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.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
       	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:64)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
       	at com.smartbear.swagger.Swagger2Importer.importSwagger(Swagger2Importer.groovy:87)
       	at com.eviware.soapui.impl.rest.actions.service.UpdateRESTServiceWizard.a(UpdateRESTServiceWizard.java:148)
       	at com.eviware.soapui.impl.rest.actions.service.UpdateRESTServiceWizard.perform(UpdateRESTServiceWizard.java:173)
       	at com.eviware.soapui.impl.rest.actions.service.UpdateRESTServiceWizard.perform(UpdateRESTServiceWizard.java:1)
       	at com.eviware.soapui.support.action.swing.SwingActionDelegate.actionPerformed(SwingActionDelegate.java:129)
       	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
       	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
       	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
       	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
       	at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
       	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
       	at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157)
       	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
       	at java.awt.Component.processMouseEvent(Component.java:6533)
       	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
       	at java.awt.Component.processEvent(Component.java:6298)
       	at java.awt.Container.processEvent(Container.java:2236)
       	at java.awt.Component.dispatchEventImpl(Component.java:4889)
       	at java.awt.Container.dispatchEventImpl(Container.java:2294)
       	at java.awt.Component.dispatchEvent(Component.java:4711)
       	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
       	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
       	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
       	at java.awt.Container.dispatchEventImpl(Container.java:2280)
       	at java.awt.Window.dispatchEventImpl(Window.java:2746)
       	at java.awt.Component.dispatchEvent(Component.java:4711)
       	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
       	at java.awt.EventQueue.access$500(EventQueue.java:97)
       	at java.awt.EventQueue$3.run(EventQueue.java:709)
       	at java.awt.EventQueue$3.run(EventQueue.java:703)
       	at java.security.AccessController.doPrivileged(Native Method)
       	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
       	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
       	at java.awt.EventQueue$4.run(EventQueue.java:731)
       	at java.awt.EventQueue$4.run(EventQueue.java:729)
       	at java.security.AccessController.doPrivileged(Native Method)
       	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
       	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
       	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
       	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
       	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
       	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
       	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
       	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  • JHunt's avatar
    JHunt
    Community Hero

    Perhaps a problem with the Swagger2Importer.groovy in ReadyAPI (the not open source version), perhaps a problem with your YAML, or both, but I don't know because I can't see either of them.

     

    You or somebody else should move this to the ReadyAPI section?

    • cabletie's avatar
      cabletie
      Occasional Contributor

      Thanks JHunt. I am evaluating ReadyAPI/SoapUI and as a result, I hadn't fully appreciated the product structure. Apologies for posting in the wrong place. (Mind you, this problem is not boding well for me taking up the product ...)

  • JHunt's avatar
    JHunt
    Community Hero

    Sure - just keep in mind that most of the posters here (including myself) are just users of the Open Source version. That's why I posted in a way to let you know that I know nothing about ReadyAPI (I've not used, not even the trial).

     

    What I or others post in this section doesn't represent the quality of the support from the SmartBear team for pro users in the pro section.

    • cabletie's avatar
      cabletie
      Occasional Contributor

      Thanks again - now you've put me on to the Open Source version I'll look into that!

       

      By the way, (and to record it here for others searching for the same problem), the issue was to do with CORS which I had set up correctly on the AWS S3 service I was using to serve the .yaml file but an extension in my browser (unfortunately I have not been able to determine which one) was somehow blocking the Origin header and so the 

      Access-Control-Allow-Origin header was not being returned.

      In turn, the browser disallowed loading the resource.