Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-3766

HTTP Binding is failing to start due to unimplemented function being called by toString()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Java-SCA-1.6
    • Java-SCA-1.x
    • Java SCA HTTP Binding
    • None
    • Tuscany Java SCA 1.6
      Windows XP SP3
      JDK 1.6
    • Patch Available

    Description

      I set up a service using Tuscany that exposes itself using binding.http.
      This service is implemented using Spring and will act like a servlet to all intents and purposes.

      However during startup an exception is thrown because the method org.apache.tuscany.sca.implementation.spring.invocation.SpringImplementationTie .getURI() is being called, and this method has nothing in it but "throw new IllegalStateException("Not yet impl");"
      However in the scenario above the only reason that getURI() us being called is because of a toString() that gets run on startup.

      By changing getURI() to:
      public String getURI()

      { return this.component.getURI(); }

      the exception is not thrown and no other problems occur and our service works perfectly. (patch attached)

      The solution here is either the code above, however this may have knock on effects on other components that use getURI() there throwing an exception is OK, however in this case because it is only being called in a toString() either we should not throw an exception, or else the toString() should catch and swallow the exception.

      Here is the trace of the exception that happens:

      SEVERE: Exception starting filter Tuscany
      org.osoa.sca.ServiceRuntimeException: java.lang.reflect.InvocationTargetException
      at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:220)
      at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:76)
      at org.apache.tuscany.sca.host.webapp.WebAppServletHost.init(WebAppServletHost.java:238)
      at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.init(TuscanyServletFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
      at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:199)
      ... 30 more
      Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at org.apache.tuscany.sca.implementation.spring.invocation.SpringContextStub.start(SpringContextStub.java:106)
      at org.apache.tuscany.sca.implementation.spring.invocation.SpringImplementationProvider.start(SpringImplementationProvider.java:77)
      at org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:644)
      at org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:560)
      at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:728)
      at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:187)
      at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:100)
      at org.apache.tuscany.sca.host.webapp.WebSCADomain.<init>(WebSCADomain.java:41)
      ... 35 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tuscany.sca.implementation.spring.invocation.SpringContextStub.start(SpringContextStub.java:99)
      ... 42 more
      Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at org.apache.tuscany.sca.implementation.spring.runtime.context.SpringImplementationStub.getURI(SpringImplementationStub.java:65)
      at org.apache.tuscany.sca.implementation.spring.runtime.context.SCAParentApplicationContext.getDisplayName(SCAParentApplicationContext.java:114)
      at org.springframework.context.support.AbstractApplicationContext.toString(AbstractApplicationContext.java:1272)
      at java.lang.String.valueOf(String.java:2826)
      at java.lang.StringBuilder.append(StringBuilder.java:115)
      at org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:454)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:392)
      at org.apache.tuscany.sca.implementation.spring.runtime.context.SpringContextTie.start(SpringContextTie.java:70)
      ... 47 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tuscany.sca.implementation.spring.runtime.context.SpringImplementationStub.getURI(SpringImplementationStub.java:62)
      ... 54 more
      Caused by: java.lang.IllegalStateException: Not yet impl
      at org.apache.tuscany.sca.implementation.spring.invocation.SpringImplementationTie.getURI(SpringImplementationTie.java:53)
      ... 59 more

      Attachments

        1. 3766.padraigmyers.patch
          0.7 kB
          Padraig Myers

        Activity

          People

            Unassigned Unassigned
            padraigmyers Padraig Myers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: