• Bug
  • Status: New
  • 2 Major
  • Resolution:
  • teck
  • Reporter: rmvn2000
  • February 26, 2013
  • 0
  • Watchers: 2
  • October 10, 2013

Description

I am using the terracotta-trunk-nightly-rev17042 a Jan 2011 build. So we are currently using Felix OSGI. With Standalone ehcache there were no issues but in the terracotta clustered mode things break down.

I found that I was able to start up TC with Equinox OSGI which was suggested in http://forums.terracotta.org/forums/posts/list/3529.page dated April 2010. I noticed the same : Code: Caused by: java.io.IOException: FakeURLStreamHandler can not be used! at org.apache.felix.framework.FakeURLStreamHandler.openConnection(FakeURLStreamHandler.java:39) at java.net.URL.openConnection(URL.java:945) at java.net.URL.openStream(URL.java:1010) at org.terracotta.express.ClientFactoryImpl.(ClientFactoryImpl.java:49)

Now upon investigating more I came across http://www.mail-archive.com/[email protected]/msg04556.html the Apache felix mailing list which outlined the cause of the exception as using the code source url to refer to jars, which according to them is not part of the OSGI spec. So, In short the current implementation of terracotta seems to be relying on a Equinox OSGI specific solution.

Comments

Mani Ramarajyam 2013-02-26

Hello Tim,

I am working on a project where we are trying to do Ehcache/Terracotta integration in OSGI based environment.

We are running into different issue after following the steps as per your comment. We modified the pom.xml file to point to snapshots repository and now I can see ehcache-2.7.0-SNAPSHOT.jar and terracotta-toolkit-runtime-3.8.0-SNAPSHOT.jar downloaded in Maven Dependency. When I try to deploy the new OSGi bundle, it is complaining about the old package structure as follows:

Error executing command: Error starting bundles: Unable to start bundle 1091: Unresolved constraint in bundle com.mfoundry.mretl.ehcache.mretl-example-ehcache-model [1091]: Unable to resolve 1091.3: missing requirement [1091.3] osgi.wiring.package; (osgi.wiring.package=com.terracotta.express)

Now with the latest terracotta-toolkit-runtime-3.8.0-SNAPSHOT.jar, I do not see any com.terracotta.express and I can only locate com.terracotta.toolkit.express package. If we are missing any additional files, please let us know the pom.xml section for this snapshot version to work good.

Your help is very much appreciated. Please also let us know if we need to use a different version all together as the JIRA is more than 5 months old.

Thanks, Mani Ramarajyam

Mani Ramarajyam 2013-02-26

I modified the OSGI bundle to consider the import of old packages as optional and I am seeing a different error now:

Caused by: java.lang.ClassNotFoundException: org.terracotta.toolkit.nonstop.NonStopConfiguration not found by com.mretl.ehcache.mretl-example-ehcache-model [1092] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1499) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1882) at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_41] at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.createToolkitInstanceFactory(TerracottaClusteredInstanceFactory.java:83)

In the Terracotta toolkit downloaded , the package is missing. Please provide the correct version.

Thanks, Mani

Mani Ramarajyam 2013-02-26

I am now using the following dependencies in the pom.xml and the issue mentioned above got resolved:

net.sf.ehcache ehcache 2.7.0-SNAPSHOT org.slf4j slf4j-simple 1.6.6 org.terracotta terracotta-toolkit-runtime 4.1.0-SNAPSHOT terracotta-releases http://www.terracotta.org/download/reflector/releases true true terracotta-snapshots http://www.terracotta.org/download/reflector/snapshots true true

But I am running into schema related errors in terracotta server:

Caused by: com.tc.config.schema.setup.ConfigurationSetupException: ******************************************************************************* The configuration data in the base configuration from server at ‘localhost:9510’ does not obey the Terracotta schema: [0]: Line 4, column 5: Expected elements ‘tc-properties servers clients’ instead of ‘system’ here in element [email protected]://www.terracotta.org/config [1]: Line 14, column 13: Expected elements ‘offheap authentication http-authentication index data-backup tsa-port jmx-port tsa-group-port security’ instead of ‘statistics’ here in element server [2]: Line 15, column 13: Expected elements ‘offheap authentication http-authentication index data-backup tsa-port jmx-port tsa-group-port security’ instead of ‘dso-port’ here in element server [3]: Line 17, column 13: Expected elements ‘offheap authentication http-authentication index data-backup tsa-port tsa-group-port security’ instead of ‘l2-group-port’ here in element server [4]: Line 20, column 13: Expected elements ‘offheap authentication http-authentication tsa-port tsa-group-port security’ instead of ‘dso’ here in element server [5]: Line 32, column 9: Expected elements ‘server mirror-group update-check garbage-collection restartable client-reconnect-window’ instead of ‘mirror-groups’ here in element servers [6]: Line 45, column 9: Expected elements ‘server mirror-group update-check garbage-collection restartable client-reconnect-window’ instead of ‘ha’ here in element servers [7]: Line 56, column 5: Expected element ‘tc-properties’ instead of ‘application’ here in element [email protected]://www.terracotta.org/config

*******************************************************************************

at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.getConfigFromSourceStream(StandardXMLFileConfigurationCreator.java:504)

Please let us know the server version that I need to run to make it working.

Thanks, Mani