Community Development (Terracotta Server)
  1. Community Development (Terracotta Server)
  2. CDV-81

Option to specify DSO root names for matching Spring App context

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: 3 Minor 3 Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: SpringRuntime
    • Labels:
      None
    • Fix In Branch:
      trunk
    • Terracotta Target:
      Pending
    • LOE:
      1

      Description

      We should allow to assign aliases for the application contexts. So, such alias will be used to identify roots created for the Spring's application contexts in place where we using "synthetic id" now.

      That would also allow us to share bean instances from different apps (even between standalone app and one running in tomcat) as long as they using the same aliases.

      To support that we'll need to add an "alias" attribute to <application-context> element in Spring config:

      <application>
      <spring>
      <jee-application name="*">
      <application-contexts>
      <application-context alias="clusteredServices">
      <paths>
      <path>*/context.xml</path>
      </paths>
      <beans>
      <bean name="master" />
      <bean name="queue" />
      </beans>
      </application-context>
      </application-contexts>
      </jee-application>
      </spring>
      </application>

      That is very simple but important addition and will only affect how we create name for the roots.

      1. errors.txt
        19 kB
        Eugene Kuleshov

        Issue Links

          Activity

          Hide
          Fiona OShea added a comment -

          Do you want this included in Lawton

          Show
          Fiona OShea added a comment - Do you want this included in Lawton
          Hide
          Dileo Moreira added a comment -

          After consulting with Eugene, he now suggests we use the same notation as for DSO roots.

          New notation:
          <application-context>
          <root-name>clusteredServices</root-name>

          This looks good to me.

          Show
          Dileo Moreira added a comment - After consulting with Eugene, he now suggests we use the same notation as for DSO roots. New notation: <application-context> <root-name>clusteredServices</root-name> This looks good to me.
          Hide
          Eugene Kuleshov added a comment -

          I've implemented new configuration element and was able to map beans from different contexts to the same root. But unfortunately it wasn't too useful, because of this error. It seems like we need to figure out how to map or rename classloaders between the nodes to make such configuration work.

          Caused by: com.tc.exception.TCRuntimeException: java.lang.ClassNotFoundException: No registered loader for description: Tomcat.context:/jmx, trying to load com.tcspring.ComplexBeanId
          at com.tc.object.ClientObjectManagerImpl.lookup(ClientObjectManagerImpl.java:502)
          at com.tc.object.ClientObjectManagerImpl.lookupObject(ClientObjectManagerImpl.java:399)
          at com.tc.object.ClientObjectManagerImpl.lookupObject(ClientObjectManagerImpl.java:392)
          at com.tc.object.applicator.HashMapApplicator.getObjectForKey(HashMapApplicator.java:137)
          at com.tc.object.applicator.HashMapApplicator.apply(HashMapApplicator.java:102)
          at com.tc.object.applicator.HashMapApplicator.hydrate(HashMapApplicator.java:92)
          at com.tc.object.TCClassImpl.hydrate(TCClassImpl.java:152)
          at com.tc.object.TCObjectImpl.hydrate(TCObjectImpl.java:103)
          ... 21 more
          Caused by: java.lang.ClassNotFoundException: No registered loader for description: Tomcat.context:/jmx, trying to load com.tcspring.ComplexBeanId
          at com.tc.object.loaders.StandardClassProvider.getClassFor(StandardClassProvider.java:38)
          at com.tc.object.ClientObjectManagerImpl.lookup(ClientObjectManagerImpl.java:494)
          ... 28 more

          Show
          Eugene Kuleshov added a comment - I've implemented new configuration element and was able to map beans from different contexts to the same root. But unfortunately it wasn't too useful, because of this error. It seems like we need to figure out how to map or rename classloaders between the nodes to make such configuration work. Caused by: com.tc.exception.TCRuntimeException: java.lang.ClassNotFoundException: No registered loader for description: Tomcat.context:/jmx, trying to load com.tcspring.ComplexBeanId at com.tc.object.ClientObjectManagerImpl.lookup(ClientObjectManagerImpl.java:502) at com.tc.object.ClientObjectManagerImpl.lookupObject(ClientObjectManagerImpl.java:399) at com.tc.object.ClientObjectManagerImpl.lookupObject(ClientObjectManagerImpl.java:392) at com.tc.object.applicator.HashMapApplicator.getObjectForKey(HashMapApplicator.java:137) at com.tc.object.applicator.HashMapApplicator.apply(HashMapApplicator.java:102) at com.tc.object.applicator.HashMapApplicator.hydrate(HashMapApplicator.java:92) at com.tc.object.TCClassImpl.hydrate(TCClassImpl.java:152) at com.tc.object.TCObjectImpl.hydrate(TCObjectImpl.java:103) ... 21 more Caused by: java.lang.ClassNotFoundException: No registered loader for description: Tomcat.context:/jmx, trying to load com.tcspring.ComplexBeanId at com.tc.object.loaders.StandardClassProvider.getClassFor(StandardClassProvider.java:38) at com.tc.object.ClientObjectManagerImpl.lookup(ClientObjectManagerImpl.java:494) ... 28 more

            People

            • Assignee:
              Product Management
              Reporter:
              Eugene Kuleshov
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: