5 Replies Latest reply on Oct 7, 2013 3:29 AM by Rakesh Balguri

    Error while using EmbeddedServer in 8.5

    Rakesh Balguri Expert

      Hi all,

       

      We are migrating from Teiid8.1 to Teiid 8.5.

      We have some test cases based on the Embedded Server which works fine in 8.1 but gives the followin error in Teiid 8.5 and the test case fails.

      Domain already registered org.infinispan when trying to register: type=CacheManager,name="DefaultCacheManager"

      [JmxUtil] - ISPN000034: There's already an cache manager instance registered under 'org.infinispan' JMX domain. If you want to allow multiple instances configured with same JMX domain enable 'allowDuplicateDomains' attribute in 'globalJmxStatistics' config element.

      Can you please suggest on how to fix this problem.

       

      Also, I have another test case which throws NullPointerException in Teiid code. Attached is the test case and following is the stacktrace.

      Also the addDataType of MetadataFactory id depreciated. What is the equivalent method. I am suspecting the addDataType() is the causing the issue.

      java.lang.NullPointerException

        at java.lang.String$CaseInsensitiveComparator.compare(String.java:1227)

        at java.lang.String$CaseInsensitiveComparator.compare(String.java:1221)

        at java.util.TreeMap.compare(TreeMap.java:1188)

        at java.util.TreeMap.put(TreeMap.java:531)

        at org.teiid.metadata.MetadataStore.addDatatype(MetadataStore.java:96)

        at org.teiid.metadata.MetadataStore.addDataTypes(MetadataStore.java:89)

        at org.teiid.metadata.MetadataFactory.mergeInto(MetadataFactory.java:551)

        at org.teiid.metadata.MetadataFactory.asMetadataStore(MetadataFactory.java:560)

        at com.ca.chorus.data.com.translator.DatacomExecutionFactoryTests.getMetadata(DatacomExecutionFactoryTests.java:44)

        at com.ca.chorus.data.com.translator.DatacomExecutionFactoryTests.eliminatesRTrimFunctionCall(DatacomExecutionFactoryTests.java:55)

        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:601)

        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

        • 1. Re: Error while using EmbeddedServer in 8.5
          Ramesh Reddy Master

          Firs case you are registering the infinispan twice, or not terminating the infinispan properly on the previous shutdown on the same jvm instance, fix that the issue will go away.

           

          As per the DataType issie, I believe your test case is wrong, the first two data types you are adding have no specifics.

          • 2. Re: Error while using EmbeddedServer in 8.5
            Steven Hawkins Master

            > Also the addDataType of MetadataFactory id depreciated. What is the equivalent method

             

            See the javadoc, use addEnterpriseDatatype instead.  This matches the terminology in Designer.  The other reason for the change is to clarify the scoping of the datatype to just the vdb, not as a global datatype.

             

            > I am suspecting the addDataType() is the causing the issue.

             

            No, either way we are expecting the datatype to be named - the setName method.  There just isn't a good error message here.

             

            In your MetadataFactory constructor consider using SystemMetadata.getInstance().getRuntimeTypeMap() which provides all of the built-in runtime types.

             

            > Can you please suggest on how to fix this problem.

             

            There are a couple of possibilities here.  The first question is are you trying to run multiple Teiid FakeServer/EmbeddedServer simultaneously?  If so there will likely be some configuration options we need to consider as the cache configuration effectively assumes a single instance.  If not, then you probably just have a lingering instance running in which case you need to make sure that you are properly shutting down the old instance before starting another one.

            • 3. Re: Error while using EmbeddedServer in 8.5
              Rakesh Balguri Expert

              Yes, We are creating a Single EmbeddedServer instance and use it in multiple tests.

              Can you tell me the configuration options that we can use?

              • 4. Re: Error while using EmbeddedServer in 8.5
                Steven Hawkins Master

                > Can you tell me the configuration options that we can use?

                 

                If you just intend to run a single instance, then you should not see this exception if all other instances have been shutdown - EmbeddedServer.stop()

                • 5. Re: Error while using EmbeddedServer in 8.5
                  Rakesh Balguri Expert

                  Thanks Steve.

                  The problem was that there are multiple tests running and each with an instance of embedded server.

                  I stopped the previous embedded server instance after the test execution, that solved the problem.