• Bug
  • Status: Closed
  • 0 Showstopper
  • Resolution: Fixed
  • hhuynh
  • Reporter: tgautier
  • October 13, 2007
  • 0
  • Watchers: 1
  • January 23, 2008
  • October 30, 2007

Attachments

  • tgautier (3.00 k) application/xml pom.xml

Description

[INFO] [tc:run] 2007-10-12 22:15:55,674 INFO - Terracotta trunk-nightly-rev5925, as of 20071011-181024 (Revision 5925 by cruise@rh4mo0 from trunk) 2007-10-12 22:15:56,094 INFO - Configuration loaded from the file at ‘/Users/tgautier/src/forge/projects/labs/webcasts/dist-cache/target/classes/tc-config.xml’. [INFO] Resolving modules: [, , , , , , , ] [INFO] Resolving bundle: org.terracotta.modules:excludes_config:1.0.0.SNAPSHOT [INFO] Resolving module org.terracotta.modules:excludes-config:jar:1.0.0-SNAPSHOT [INFO] Resolving bundle: org.terracotta.modules:modules_common:1.0.0.SNAPSHOT [INFO] Resolving module org.terracotta.modules:modules-common:jar:1.0.0-SNAPSHOT [INFO] Resolving bundle: org.terracotta.modules:guimodels_config:1.0.0.SNAPSHOT [INFO] Resolving module org.terracotta.modules:guimodels-config:jar:1.0.0-SNAPSHOT [INFO] Resolving bundle: org.terracotta.modules:jdk15_preinst_config:1.0.0.SNAPSHOT [INFO] Resolving module org.terracotta.modules:jdk15-preinst-config:jar:1.0.0-SNAPSHOT [INFO] Resolving bundle: org.terracotta.modules:spring_config:1.0.0.SNAPSHOT [INFO] Resolving module org.terracotta.modules:spring-config:jar:1.0.0-SNAPSHOT [INFO] Resolving bundle: org.terracotta.modules:standard_config:1.0.0.SNAPSHOT [INFO] Resolving module org.terracotta.modules:standard-config:jar:1.0.0-SNAPSHOT [INFO] Resolving location: org.terracotta.modules:annotations:0.0.1-SNAPSHOT [INFO] Resolving module org.terracotta.modules:annotations:jar:0.0.1-SNAPSHOT [INFO] Resolving location: org.terracotta.modules:clustered-ehcache-1.3:1.0.0 [INFO] Resolving module org.terracotta.modules:clustered-ehcache-1.3:jar:1.0.0 [INFO] Resolving bundle: org.terracotta.modules:clustered_commons_collections_3.1:(any-version) [INFO] Resolving module org.terracotta.modules:clustered-commons-collections-3.1:jar:1.0.0 [INFO] Resolving bundle: org.terracotta.modules:clustered_ehcache_commons_1.0:(any-version) [INFO] Resolving module org.terracotta.modules:clustered-ehcache-commons-1.0:jar:1.0.0 [INFO] Resolving location: org.terracotta.modules:terracotta-cache:1.0.0 [INFO] Resolving module org.terracotta.modules:terracotta-cache:jar:1.0.0 [INFO] Resolving location: org.terracotta.modules:synchronizedmap:1.0.0-SNAPSHOT [INFO] Resolving module org.terracotta.modules:synchronizedmap:jar:1.0.0-SNAPSHOT [INFO] snapshot org.terracotta.modules:synchronizedmap:1.0.0-SNAPSHOT: checking for updates from terracotta-repository [INFO] Resolving location: org.terracotta.modules:synchronizedset:1.0.0-SNAPSHOT [INFO] Resolving module org.terracotta.modules:synchronizedset:jar:1.0.0-SNAPSHOT [INFO] snapshot org.terracotta.modules:synchronizedset:1.0.0-SNAPSHOT: checking for updates from terracotta-repository [INFO] Resolving location: org.terracotta.modules:synchronizedsortedmap:1.0.0-SNAPSHOT [INFO] Resolving module org.terracotta.modules:synchronizedsortedmap:jar:1.0.0-SNAPSHOT [INFO] snapshot org.terracotta.modules:synchronizedsortedmap:1.0.0-SNAPSHOT: checking for updates from terracotta-repository [INFO] Resolving location: org.terracotta.modules:synchronizedsortedset:1.0.0-SNAPSHOT [INFO] Resolving module org.terracotta.modules:synchronizedsortedset:jar:1.0.0-SNAPSHOT [INFO] snapshot org.terracotta.modules:synchronizedsortedset:1.0.0-SNAPSHOT: checking for updates from terracotta-repository [INFO] Resolving location: org.terracotta.modules:synchronizedcollection:1.0.0-SNAPSHOT [INFO] Resolving module org.terracotta.modules:synchronizedcollection:jar:1.0.0-SNAPSHOT [INFO] snapshot org.terracotta.modules:synchronizedcollection:1.0.0-SNAPSHOT: checking for updates from terracotta-repository [INFO] ———————————————————————— [INFO] Starting bootjar tool [INFO] [bootjar] 2007-10-12 22:16:05,189 INFO - Terracotta trunk-nightly-rev5925, as of 20071011-181024 (Revision 5925 by cruise@rh4mo0 from trunk) [INFO] [bootjar] 2007-10-12 22:16:05,701 INFO - Configuration loaded from the file at ‘/Users/tgautier/src/forge/projects/labs/webcasts/dist-cache/target/classes/tc-config.xml’. [INFO] [bootjar] Exception in thread “main” java.lang.RuntimeException: Unable to create runtime for plugins [INFO] [bootjar] at com.tc.plugins.ModulesLoader.initModules(ModulesLoader.java:100) [INFO] [bootjar] at com.tc.object.tools.BootJarTool.(BootJarTool.java:213) [INFO] [bootjar] at com.tc.object.tools.BootJarTool.main(BootJarTool.java:2433) [INFO] [bootjar] Caused by: java.lang.NumberFormatException: For input string: "1-SNAPSHOT" [INFO] [bootjar] at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) [INFO] [bootjar] at java.lang.Integer.parseInt(Integer.java:456) [INFO] [bootjar] at java.lang.Integer.parseInt(Integer.java:497) [INFO] [bootjar] at org.osgi.framework.Version.(Version.java:135) [INFO] [bootjar] at org.osgi.framework.Version.parseVersion(Version.java:208) [INFO] [bootjar] at com.tc.bundles.Resolver.resolveLocation(Resolver.java:177) [INFO] [bootjar] at com.tc.bundles.Resolver.resolve(Resolver.java:94) [INFO] [bootjar] at com.tc.bundles.Resolver.resolve(Resolver.java:110) [INFO] [bootjar] at com.tc.plugins.ModulesLoader.initModules(ModulesLoader.java:146) [INFO] [bootjar] at com.tc.plugins.ModulesLoader.initModules(ModulesLoader.java:95) [INFO] [bootjar] ... 2 more [INFO] OK

Comments

Taylor Gautier 2007-10-13

Note that I did not specify any modules in my config file with a version of 1-SNAPSHOT

Taylor Gautier 2007-10-13

Note further that upon hitting this exception, it would be nice to print out the offending module - or rather in case of any failure to load a module, to print out the offending module.

Eugene Kuleshov 2007-10-13

Taylor, please attach pom.xml and tc-config.xml from your project. BTW, does the same config work from the kit?

Taylor Gautier 2007-10-15

offending pom.xml

Taylor Gautier 2007-10-15

https://svn.terracotta.org/repo/forge/projects/labs/webcasts/dist-cache

Eugene Kuleshov 2007-10-16

Taylor, version of your module in [1] isn’t compatible with osgi versions. We discussed at the meeting that we could actually recognize “-SNAPSHOT” suffix and replace it with “.SNAPSHOT” but it still won’t work for 2 number versions. So, you should use 1.0.0.SNAPSHOT :

[1] https://svn.terracotta.org/repo/forge/projects/labs/webcasts/dist-cache/src/main/resources/tc-config.xml

Taylor Gautier 2007-10-18

We agreed on Tuesday that we would enable versions to be 1.0.0-SNAPSHOT.

Eugene Kuleshov 2007-10-18

I’ll look at that on Monday. However please note that it won’t resolve issue for you as I already explained in my previous comment. You have the following entry in your tc-config.xml

converted OSGi version 1.0.SNAPSHOT still going to be invalid. So, you’ll have to fix your projects anyways.

Anyways, current workaround is to use version “1.0.0.SNAPSHOT” in tc-config.xml

Alex Miller 2007-10-19

Egads, this is what I’ve been hitting for the last day. I’ve been talking at length to Juris this morning to understand fully what’s happening. Let me see if I can restate in a way that helps. I think Eugene is saying it above but not in enough detail.

Currently, config modules extend the config-module-parent pom.xml which uses the maven jar plugin to create a jar with a bundle manifest where the bundle version is set to ${project.version}. So, the result of building any config module that extends from this is a jar which has an OSGi manifest with a version bound to the module’s Maven project version.

The ${project.version} is typically set to something like 1.0-SNAPSHOT. This affects the name of the jar and the location in the Maven repository and how you reference it as a tc-config module. To date, there have been a bunch of changes to allow us to resolve in a repository the location of a jar using either .SNAPSHOT or -SNAPSHOT and that’s all well and good.

The problem above occurs when you start trying to use the jar you found in an OSGi context. And the problem is that the jar is broken. The bundle version in the manifest is bound to the project version which had -SNAPSHOT on the end and that is simply not valid in OSGi. So, regardless of any manipulations we do to resolve this jar in the repository, it’s not going to work when we give it to Knoplerfish.

Apparently Juris and Gary have some changes designed to address the exception seen above but I suspect that only moves the problem one step further downstream as the bundle is still irretrievably broken. I can’t imagine any way to fix this problem other than to break the hard tie between the bundle version and the Maven project version. Maybe we could extend the Maven jar plugin to “fix” the version number before it goes into the bundle version property.

BTW, I ran into a similar problem in tying the bundle symbolic name to the Maven artifact ID. For example, the terracotta-cache module has an artifact ID of “terracotta-cache” but the “-“ is invalid in an OSGi symbolic name, so I’m manually changing to _. I can only do that by NOT extending from the config-module-parent which hard-codes this linkage.

Fiona OShea 2007-10-23

This is a very high priority to resolve.

Juris Galang 2007-10-30

We now allow users to specify -SNAPSHOT from tc-config; However the MANIFEST file for the TIM must still use .SNAPSHOT for the Bundle-Version entry.

The characters dash, underscore, and dot are allowed for Bundle-Name, and Bundle-SymbolicName entries.

This is resolved.

Juris Galang 2007-10-30

See comment above.

NOTE: The bundle that was failing here (annotations) happens to be a badly constructed TIM — so there’s actually two issues here:

  1. We didn’t use to allow -SNAPSHOT in tc-config (now we do)
  2. The annotations TIM is broken - the manifest file is not configured correctly. I’ve created a new JIRA issue for this.