Deletion from B tree - data-structures

I have question in my homework its about b-tree deletion with minimum branching factor t=2.
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [W]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R Y
/ | \ / \ / \ / \ / \
A C F I K M O Q ST X Z
Now after deleting Y from the above tree i get the final tree..
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [W]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R X
/ | \ / \ / \ / \ / \
A C F I K M O Q S T Z
Will this be the final tree after Deleting Y... i am not sure thats why posting here to be corrected..thankss

I don't think it's correct, T cannot be in the right sub-tree of W since T comes before W.
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [T]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R X
/ | \ / \ / \ / \ / \
A C F I K M O Q S W Z
Here are the steps:
Remove Y:
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [W]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R null
/ | \ / \ / \ / \ / \
A C F I K M O Q ST X Z
Replace with smallest from right sub-tree (Z), rebalance at Z's old location
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [W]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R Z
/ | \ / \ / \ / \ /
A C F I K M O Q ST X
Cannot borrow from sibling (X), merge children at Z:
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [W]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R [X,Z]
/ | \ / \ / \ / \
A C F I K M O Q ST
Cannot borrow from sibling (R), merge children at W:
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [Q,R,S,T,W,X,Z]
/ | \
/ | \
/ | \
BD J N
/ | \ / \ / \
A C F I K M O
Merged node (previously W) is now too large, split evenly:
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [T]
/ | \ / \
/ | \ [Q,R,S] [W,X,Z]
/ | \
BD J N
/ | \ / \ / \
A C F I K M O
Left node of T is now too large, split evenly:
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [T]
/ | \ / \
/ | \ / [W,X,Z]
/ | \ /
BD J N R
/ | \ / \ / \ / \
A C F I K M O Q S
Right node of T is also too large, split evenly:
[P]
/ \
/ \
/ \
/ \
/ \
[G][L] [T]
/ | \ / \
/ | \ / \
/ | \ / \
BD J N R X
/ | \ / \ / \ / \ / \
A C F I K M O Q S W Z

it is so good question.
L goes to the root,
P goes to it's right child and sit near W
N and it's children becomes left child of P
for delete Y, W must go middle down of R and Y
Y goes down between X and Z
now you can delete Y ...
[ L ]
/ \
!!!!!! / \
/ \
/ \
/ \
[G] [P]
/ \ / \
/ \ / \
/ \ / \
[B D] [J] N R W
/ | \ / \ / \ / | \
A C F I K M O Q ST X Z --->Y

it is so good question.
L goes to the root,
P goes to it's right child and sit near W
N and it's children becomes left child of P
for delete Y, W must go middle down of R and Y
Y goes down between X and Z
now you can delete Y ...
[ L ]
/ \
/ \
/ \
/ \
/ \
[G] [P]
/ \ / \
/ \ / \
/ \ / \
[B D] [J] N R W
/ | \ / \ / \ / | \
A C F I K M O Q ST X Z --->Y

Related

AVL trees insertion and deletion

I would like to know whether I am applying the following insertion and deletion operations correctly on an AVL tree:
62
/ \
44 78
/ \ \
17 50 88
/ \
48 54
insert(42)
insert(90)
delete(62)
insert(92)
delete(50)
For this question, a deletion replaces the deleted item with its successor.
This is how I think the tree should be modified by those operations:
insert(42) and insert(90)
62
/ \
44 78
/ \ \
17 50 88
\ / \ \
42 48 54 90
delete(62)
78
/ \
44 88
/ \ \
17 50 90
\ / \
42 48 54
insert(92)
78
/ \
44 88
/ \ \
17 50 90
\ / \ \
42 48 54 92
delete(50)
78
/ \
44 88
/ \ \
17 54 90
\ / \
42 48 92
There are a two cases where rotations are needed:
___62___
/ \
__44__ 78
/ \ \
17 50 88
/ \
48 54
You had applied insert(42) correctly, but insert(90) creates an unbalanced subtree rooted at 78 (marked with asterisk): its right side has a height of 2, while its left side is empty:
___62___
/ \
__44__ 78*
/ \ \
17 50 88
\ / \ \
42 48 54 90
So, this will not stay like that: a simple left rotation will move 88 up, and 78 down:
___62___
/ \
__44__ 88
/ \ / \
17 50 78 90
\ / \
42 48 54
You had it correct for delete(62): that will swap the root with its successor, which is 78, and then 62 is removed:
___78___
/ \
__44__ 88
/ \ \
17 50 90
\ / \
42 48 54
insert(92) will bring an unbalance at node 88:
___78___
/ \
__44__ 88*
/ \ \
17 50 90
\ / \ \
42 48 54 92
And so a simple left rotation is again applied:
___78___
/ \
__44__ 90
/ \ / \
17 50 88 92
\ / \
42 48 54
delete(50) was correctly executed. Given the above state, we get:
___78___
/ \
__44__ 90
/ \ / \
17 54 88 92
\ /
42 48

FFmpeg downmuxing multiple tracks with custom "af"s

I am trying to do a custom downmix conversion, that is the rough equivalent of :
ffmpeg -y -i "file.mkv" \
-map 0:1 -c:0 flac -ac:0 4 \
-map 0:3 -c:1 flac -ac:1 3 \
-map 0:3 -c:2 flac -ac:2 3 \
audio.mkv
I tried using the command:
ffmpeg -y -i "file.mkv" \
-map 0:1 -c:0 flac -af:0 "pan=3.1| FL < FL + 0.6*BL + 0.6*SL | FR < FR + 0.6*BR + 0.6*SR | FC = FC | LFE = LFE" \
-map 0:3 -c:1 flac -af:1 "pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC | LFE = LFE" \
-map 0:3 -c:2 flac -af:2 "pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC + 0.5*LFE | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC + 0.5*LFE" \
audio.mkv
But it gave an error that only 1 "af" is supported, unlike "ac":
Only '-af pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC + 0.5*LFE | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC + 0.5*LFE | LFE = FC' read, ignoring remaining -af options: Use ',' to separate filters
So I tried doing as it said, and separated them with a comma:
ffmpeg -y -i "file.mkv" \
-map 0:1 -c:0 flac \
-map 0:3 -c:1 flac \
-map 0:3 -c:2 flac \
-af "pan=3.1| FL < FL + 0.6*BL + 0.6*SL | FR < FR + 0.6*BR + 0.6*SR | FC = FC | LFE = LFE,pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC | LFE = LFE,pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC + 0.5*LFE | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC + 0.5*LFE | LFE = LFE" \
audio.mkv
Which started the encoding, but I noticed that it was only applying the last pan, and all three tracks were being downmixed to the last 2.1!
According to the documentation, https://ffmpeg.org/ffmpeg-filters.html#Filtergraph-syntax-1 adding a "," is creating a "filterchain" which I don't think I want, as I am doing the same filter on three different tracks. So I am at a loss of what I am supposed to do from there.
Thanks for any help!
-af is an old shorthand for -filter:a and does not accept stream specifiers. Use -filter:a:1 for example to assign filters for the 2nd audio output stream.
Another method is to use -filter_complex:
ffmpeg -i "file.mkv" -filter_complex \
"[0:1]pan=3.1| FL < FL + 0.6*BL + 0.6*SL | FR < FR + 0.6*BR + 0.6*SR | FC = FC | LFE = LFE[a0];
[0:3]pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC | LFE = LFE[a1];
[0:3]pan=2.1| FL < FL + 0.6*BL + 0.6*SL + 0.5*FC + 0.5*LFE | FR < FR + 0.6*BR + 0.6*SR + 0.5*FC + 0.5*LFE[a2]" \
-map "[a0]" -map "[a1]" -map "[a2]" -c:a flac audio.mkv

2-3-4 Tree Deletion Operation

How can I delete the node 1 from 2-3-4 Tree if the tree's structure is as below:
4 10
/ | \
2 6,8 12,14
/  \ / | \ / | \
1 3 5 7 9 11 13 15
The way I like to think of it, you only delete leaves or internal nodes that have a single child, and the children of whatever you delete have to stay the same level.
This requires pulling a key down from the level above to hold them, which merges with a sibling.
If the parent only has one key, this will cause a cascaded delete.
Deleting 1 by pulling down 2 causes a cascaded delete:
4 , 10
/ | \
X 6,8 12,14
| / | \ / | \
2,3 5 7 9 11 13 15
The cascaded delete pulls down the 4:
10
/ \
4,6,8 12,14
/ | | \ / | \
2,3 5 7 9 11 13 15
If the sibling is too big to merge, you may have to redistribute from the sibling. This would be required if this was a 2-3 tree, for example:
Redistributing a key from 6,8
6 , 10
/ | \
4 8 12,14
/ \ / \ / | \
2,3 5 7 9 11 13 15

distributing graph nodes into buckets

I have a adjacency matrix nxn. Each node of the graph has m outgoing edges and I want to distribute these nodes into b buckets.
Each bucket should hold a minimum of l and a maximum of u nodes (uxb >= n). Each node inside the bucket should have at least one outgoing edge to another node inside the bucket.
I feel that I am missing the best angle to solve this.
How would you approach this?
Start by separating the graph into connected components this can be done in O(n) time and memory by performing a depth-first or breadth-first search.
If any nodes are not connected to another node then a solution is not possible.
Start from the leaves of each DFS/BFS tree (i.e. nodes connected to only one other node) and split each connected component into pairs (or triplets) of adjacent nodes. Each pair (or triplet) should go into the next bucket with the fewest number of nodes in it.
o o
/ \ |
o o o o | | | | | |
| / \ / | | | | | | |
o o o o | | | | | |
\ \ / / |____| |____| |____|
--o---- Bucket 1 Bucket 2 Bucket 3
Remove 2 nodes from the left leaf.
o o
/ \ |
a o o o |a | | | | |
| / \ / | || | | | | |
a o o o |a | | | | |
\ \ / / |____| |____| |____|
--o---- Bucket 1 Bucket 2 Bucket 3
Remove 2 nodes from the right leaf.
o b
/ \ |
o o b |a | |b | | |
/ \ / | || | || | | |
o o o |a | |b | | |
\ / / |____| |____| |____|
o---- Bucket 1 Bucket 2 Bucket 3
Then remove the final degree 1 vertex and its neighbour:
o
/ \
o o |a | |b | |c |
/ \ / || | || | || |
o o c |a | |b | |c |
\ / / |____| |____| |____|
c---- Bucket 1 Bucket 2 Bucket 3
This creates a new degree 1 vertex in the remaining sub-graph so remove that and its adjacent vertex:
o
/ \
d o |a d | |b | |c |
/ \ / || | | || | || |
d o |a d | |b | |c |
|____| |____| |____|
Bucket 1 Bucket 2 Bucket 3
There are only 3 vertices left, if it will fit in a bucket then put it into the bucket - otherwise move a pair from the bucket with the smallest number of items to the bucket with the next lowest number of items and add the triplet in its place.
e
\
e |a d | |e e | |c b |
/ || | | |\ / | || | |
e |a d | | e | |c b |
|____| |____| |____|
Bucket 1 Bucket 2 Bucket 3
The only issue will be when you get star-like connected components
o o
\ /
o--o--o
/ \
o o
Then the entire connected component will need to go into the same bucket as you cannot split the graph by removing a pair of triplet of adjacent vertices without having single disjoint vertices remaining. This you can check for by testing whether if you remove a pair there are other adjacent vertices that were degree one and if so add them to the pair.

Apache tomcat catalina springsource bundle is not RESOLVED on equinox OSGi container

I have a java application in which I start Equinox OSGi container (version 3.10.1.v20140909-1633) and load apache catalina springsource bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956 and other dependent bundles.
Following is my config.ini file.
eclipse.ignoreApp=true
# custom org.osgi.framework.system.packages to export javax.activation and javax.xml.bind.* with a non-0.0.0 version
org.osgi.framework.system.packages=javax.accessibility; version="0.0.0", \
javax.activation; version="1.1.0", \
javax.activity; version="0.0.0", \
javax.annotation; version="0.0.0", \
javax.annotation.processing; version="0.0.0", \
javax.crypto; version="0.0.0", \
javax.crypto.interfaces; version="0.0.0", \
javax.crypto.spec; version="0.0.0", \
javax.imageio; version="0.0.0", \
javax.imageio.event; version="0.0.0", \
javax.imageio.metadata; version="0.0.0", \
javax.imageio.plugins.bmp; version="0.0.0", \
javax.imageio.plugins.jpeg; version="0.0.0", \
javax.imageio.spi; version="0.0.0", \
javax.imageio.stream; version="0.0.0", \
javax.jws; version="0.0.0", \
javax.jws.soap; version="0.0.0", \
javax.lang.model; version="0.0.0", \
javax.lang.model.element; version="0.0.0", \
javax.lang.model.type; version="0.0.0", \
javax.lang.model.util; version="0.0.0", \
javax.management; version="0.0.0", \
javax.management.loading; version="0.0.0", \
javax.management.modelmbean; version="0.0.0", \
javax.management.monitor; version="0.0.0", \
javax.management.openmbean; version="0.0.0", \
javax.management.relation; version="0.0.0", \
javax.management.remote; version="0.0.0", \
javax.management.remote.rmi; version="0.0.0", \
javax.management.timer; version="0.0.0", \
javax.naming; version="0.0.0", \
javax.naming.directory; version="0.0.0", \
javax.naming.event; version="0.0.0", \
javax.naming.ldap; version="0.0.0", \
javax.naming.spi; version="0.0.0", \
javax.net; version="0.0.0", \
javax.net.ssl; version="0.0.0", \
javax.print; version="0.0.0", \
javax.print.attribute; version="0.0.0", \
javax.print.attribute.standard; version="0.0.0", \
javax.print.event; version="0.0.0", \
javax.rmi; version="0.0.0", \
javax.rmi.CORBA; version="0.0.0", \
javax.rmi.ssl; version="0.0.0", \
javax.script; version="0.0.0", \
javax.security.auth; version="0.0.0", \
javax.security.auth.callback; version="0.0.0", \
javax.security.auth.kerberos; version="0.0.0", \
javax.security.auth.login; version="0.0.0", \
javax.security.auth.spi; version="0.0.0", \
javax.security.auth.x500; version="0.0.0", \
javax.security.cert; version="0.0.0", \
javax.security.sasl; version="0.0.0", \
javax.sound.midi; version="0.0.0", \
javax.sound.midi.spi; version="0.0.0", \
javax.sound.sampled; version="0.0.0", \
javax.sound.sampled.spi; version="0.0.0", \
javax.sql; version="0.0.0", \
javax.sql.rowset; version="0.0.0", \
javax.sql.rowset.serial; version="0.0.0", \
javax.sql.rowset.spi; version="0.0.0", \
javax.swing; version="0.0.0", \
javax.swing.border; version="0.0.0", \
javax.swing.colorchooser; version="0.0.0", \
javax.swing.event; version="0.0.0", \
javax.swing.filechooser; version="0.0.0", \
javax.swing.plaf; version="0.0.0", \
javax.swing.plaf.basic; version="0.0.0", \
javax.swing.plaf.metal; version="0.0.0", \
javax.swing.plaf.multi; version="0.0.0", \
javax.swing.plaf.synth; version="0.0.0", \
javax.swing.table; version="0.0.0", \
javax.swing.text; version="0.0.0", \
javax.swing.text.html; version="0.0.0", \
javax.swing.text.html.parser; version="0.0.0", \
javax.swing.text.rtf; version="0.0.0", \
javax.swing.tree; version="0.0.0", \
javax.swing.undo; version="0.0.0", \
javax.tools; version="0.0.0", \
javax.transaction; version="0.0.0", \
javax.transaction.xa; version="0.0.0", \
javax.xml; version="0.0.0", \
javax.xml.bind; version="2.1.0", \
javax.xml.bind.annotation; version="2.1.0", \
javax.xml.bind.annotation.adapters; version="2.1.0", \
javax.xml.bind.attachment; version="2.1.0", \
javax.xml.bind.helpers; version="2.1.0", \
javax.xml.bind.util; version="2.1.0", \
javax.xml.crypto; version="0.0.0", \
javax.xml.crypto.dom; version="0.0.0", \
javax.xml.crypto.dsig; version="0.0.0", \
javax.xml.crypto.dsig.dom; version="0.0.0", \
javax.xml.crypto.dsig.keyinfo; version="0.0.0", \
javax.xml.crypto.dsig.spec; version="0.0.0", \
javax.xml.datatype; version="0.0.0", \
javax.xml.namespace; version="0.0.0", \
javax.xml.parsers; version="0.0.0", \
javax.xml.soap; version="0.0.0", \
javax.xml.stream; version="0.0.0", \
javax.xml.stream.events; version="0.0.0", \
javax.xml.stream.util; version="0.0.0", \
javax.xml.transform; version="0.0.0", \
javax.xml.transform.dom; version="0.0.0", \
javax.xml.transform.sax; version="0.0.0", \
javax.xml.transform.stax; version="0.0.0", \
javax.xml.transform.stream; version="0.0.0", \
javax.xml.validation; version="0.0.0", \
javax.xml.ws; version="0.0.0", \
javax.xml.ws.handler; version="0.0.0", \
javax.xml.ws.handler.soap; version="0.0.0", \
javax.xml.ws.http; version="0.0.0", \
javax.xml.ws.soap; version="0.0.0", \
javax.xml.ws.spi; version="0.0.0", \
javax.xml.xpath; version="0.0.0", \
org.ietf.jgss; version="0.0.0", \
org.omg.CORBA; version="0.0.0", \
org.omg.CORBA_2_3; version="0.0.0", \
org.omg.CORBA_2_3.portable; version="0.0.0", \
org.omg.CORBA.DynAnyPackage; version="0.0.0", \
org.omg.CORBA.ORBPackage; version="0.0.0", \
org.omg.CORBA.portable; version="0.0.0", \
org.omg.CORBA.TypeCodePackage; version="0.0.0", \
org.omg.CosNaming; version="0.0.0", \
org.omg.CosNaming.NamingContextExtPackage; version="0.0.0", \
org.omg.CosNaming.NamingContextPackage; version="0.0.0", \
org.omg.Dynamic; version="0.0.0", \
org.omg.DynamicAny; version="0.0.0", \
org.omg.DynamicAny.DynAnyFactoryPackage; version="0.0.0", \
org.omg.DynamicAny.DynAnyPackage; version="0.0.0", \
org.omg.IOP; version="0.0.0", \
org.omg.IOP.CodecFactoryPackage; version="0.0.0", \
org.omg.IOP.CodecPackage; version="0.0.0", \
org.omg.Messaging; version="0.0.0", \
org.omg.PortableInterceptor; version="0.0.0", \
org.omg.PortableInterceptor.ORBInitInfoPackage; version="0.0.0", \
org.omg.PortableServer; version="0.0.0", \
org.omg.PortableServer.CurrentPackage; version="0.0.0", \
org.omg.PortableServer.POAManagerPackage; version="0.0.0", \
org.omg.PortableServer.POAPackage; version="0.0.0", \
org.omg.PortableServer.portable; version="0.0.0", \
org.omg.PortableServer.ServantLocatorPackage; version="0.0.0", \
org.omg.SendingContext; version="0.0.0", \
org.omg.stub.java.rmi; version="0.0.0", \
org.w3c.dom; version="0.0.0", \
org.w3c.dom.bootstrap; version="0.0.0", \
org.w3c.dom.css; version="0.0.0", \
org.w3c.dom.events; version="0.0.0", \
org.w3c.dom.html; version="0.0.0", \
org.w3c.dom.ls; version="0.0.0", \
org.w3c.dom.ranges; version="0.0.0", \
org.w3c.dom.stylesheets; version="0.0.0", \
org.w3c.dom.traversal; version="0.0.0", \
org.w3c.dom.views; version="0.0.0", \
org.xml.sax; version="0.0.0", \
org.xml.sax.ext; version="0.0.0", \
org.xml.sax.helpers; version="0.0.0"
#
# derby and mysql must appear before com.castiron.drivers
#
osgi.bundles=acme/org.apache.derbyclient-10.8.3.3.jar#1:start, \
acme/org.apache.derby-10.8.3.3.jar#1:start, \
acme/com.castiron.drivers-1.0.0.jar#1:start, \
acme/org.apache.openjpa-2.2.0.jar#1:start, \
com.approuter.jpa.fragment-1.0.0.jar#1, \
acme/com.springsource.serp-1.13.1.jar#1:start, \
acme/org.apache.commons-dbcp-1.2.2.jar#1:start, \
acme/com.springsource.org.apache.commons.pool-1.5.3.jar#1:start, \
acme/com.springsource.org.apache.xmlcommons-1.3.3.jar#1:start, \
acme/com.springsource.javax.xml.soap-1.3.0.jar#1:start, \
acme/javax.xml.rpc-1.1.0.jar#1:start, \
acme/com.springsource.javax.ejb-3.0.0.jar#1:start, \
com.approuter.ejb.fragment-1.0.0.jar#1, \
acme/com.springsource.javax.management.j2ee-1.0.1.jar#1:start, \
acme/javax.jms-1.1.0.jar#1:start, \
acme/com.springsource.org.apache.activemq-5.3.0.jar#1:start, \
acme/com.springsource.org.apache.kahadb-5.3.0.jar#1:start, \
acme/org.apache.camel-1.3.0.jar#1:start, \
acme/org.apache.hadoop-2.2.0.jar#1:start, \
acme/org.javassist-3.13.0.jar#1:start, \
acme/net.sf.ehcache-1.6.jar#1:start, \
acme/org.hibernate-3.2.5.jar#1:start, \
acme/javax.interceptor-1.1.jar#1:start, \
acme/org.apache.webbeans-1.0.0.jar#3:start, \
acme/org.stax-ex-1.0.0.jar#1:start, \
acme/com.xmlrpc-1.2.jar#:start, \
acme/com.saaj-impl-1.3.0.jar#1:start, \
acme/com.jaxb-impl-2.1.12.jar#1:start, \
acme/com.jaxws-rt-2.1.7.jar#1:start, \
acme/com.xml-streambuffer-0.8.jar#1:start, \
acme/com.ibm.xml.xlxp-1.1.14.jar#1:start, \
acme/antlr-2.7.7.jar#1:start, \
acme/com.springsource.commonj-1.1.0.jar#1:start, \
acme/net.sf.cglib-2.1.3.jar#1:start, \
acme/com.springsource.org.apache.commons.collections-3.2.1.jar#1:start, \
acme/com.springsource.org.apache.commons.io-1.4.0.jar#1:start, \
acme/com.springsource.org.apache.commons.logging-1.1.1.jar#1:start, \
acme/com.springsource.org.apache.log4j-1.2.15.jar#1:start, \
com.approuter.log4j.fragment-1.0.0.jar#1, \
acme/com.springsource.org.dom4j-1.6.1.jar#1:start, \
acme/com.springsource.org.jaxen-1.1.1.jar#1:start, \
acme/com.springsource.javax.xml.stream-1.0.1.jar#1:start, \
acme/com.springsource.org.objectweb.asm-1.5.3.jar#1:start, \
acme/com.springsource.org.objectweb.asm.attrs-1.5.3.jar#1:start, \
acme/spring-osgi-extender-1.2.0.jar#1:start, \
acme/spring-osgi-core-1.2.0.jar#1:start, \
acme/spring-osgi-io-1.2.0.jar#1:start, \
acme/spring-core-2.5.6.jar#1:start, \
acme/spring-context-2.5.6.jar#1:start, \
acme/spring-beans-2.5.6.jar#1:start, \
acme/spring-aop-2.5.6.jar#1:start, \
acme/spring-web-2.5.6.jar#1:start, \
acme/spring-webmvc-2.5.6.jar#1:start, \
acme/com.springsource.org.aopalliance-1.0.0.jar#1:start, \
acme/com.springsource.slf4j.org.apache.commons.logging-1.5.0.jar#1:start, \
acme/com.springsource.slf4j.api-1.5.0.jar#1:start, \
acme/com.springsource.slf4j.log4j-1.5.0.jar#1:start, \
acme/com.springsource.org.apache.el.springsource-6.0.20.S2-r5956.jar#1:start, \
acme/com.springsource.org.apache.jasper.springsource-6.0.20.S2-r5956.jar#1, \
acme/com.springsource.org.apache.jasper.org.eclipse.jdt-6.0.16.jar#1:start, \
acme/com.springsource.org.apache.juli.extras.springsource-6.0.20.S2-r5956.jar#1:start, \
acme/com.springsource.org.apache.coyote.springsource-6.0.20.S2-r5956.jar#1, \
acme/com.springsource.javax.el-2.1.0.jar#1:start, \
acme/com.springsource.javax.servlet-2.5.0.jar#1:start, \
acme/com.springsource.javax.servlet.jsp-2.1.0.jar#1:start, \
acme/com.springsource.javax.servlet.jsp.jstl-1.1.2.jar#1:start, \
acme/com.springsource.org.apache.commons.el-1.0.0.jar#1:start, \
acme/com.springsource.org.apache.taglibs.standard-1.1.2.jar#1:start, \
acme/com.springsource.javax.annotation-1.0.0.jar#1:start, \
acme/com.springsource.javax.persistence-1.0.0.jar#1:start, \
acme/com.springsource.javax.transaction-1.1.0.jar#1:start, \
acme/com.springsource.javax.xml.ws-2.1.1.jar#1:start, \
acme/javax.mail-1.4.jar#1:start, \
acme/com.springsource.org.apache.catalina.springsource-6.0.20.S2-r5956.jar#5:start, \
com.approuter.catalina.start-1.0.0.jar#5:start, \
com.approuter.catalina.fragment-1.0.0.jar#5, \
com.approuter.catalina.realm-1.0.0.jar#5:start, \
com.approuter.spring.osgi.web.fragment-1.0.0.jar#6, \
com.approuter.spring.osgi.web.extender.fragment-1.0.0.jar#6, \
acme/spring-osgi-web-1.2.0.jar#6:start, \
acme/spring-osgi-web-extender-1.2.0.jar#6:start, \
com.approuter.system.configure-1.0.0.jar#1:start, \
com.approuter.system.configure.analytics-1.0.0.jar#1:start, \
wmc.war#7:start, \
acme/net.sf.saxon-9.1.0.7.jar#1:start, \
acme/org.apache.xmlbeans-2.4.0.jar#1:start, \
acme/com.springsource.com.thoughtworks.xstream-1.3.0.jar#1:start, \
acme/com.springsource.com.lowagie.text-2.0.8.jar#1:start, \
acme/com.springsource.javax.management.j2ee-1.0.1.jar#1:start, \
acme/com.springsource.org.apache.commons.codec-1.3.0.jar#1:start, \
acme/org.apache.commons-dbcp-1.2.2.jar#1:start, \
acme/com.springsource.org.apache.commons.fileupload-1.2.0.jar#1:start, \
acme/org.apache.httpcomponents.httpcore_4.2.4.jar#1:start, \
acme/org.apache.httpcomponents.httpclient_4.2.5.jar#1:start, \
acme/com.springsource.org.apache.commons.lang-2.4.0.jar#1:start, \
acme/com.springsource.org.apache.commons.net-1.4.1.jar#1:start, \
acme/com.springsource.org.apache.xbean.spring-3.3.0.jar#1:start, \
acme/com.springsource.org.apache.xerces-2.8.1.jar#1:start, \
acme/com.springsource.org.apache.xml.resolver-1.2.0.jar#1:start, \
acme/org.quartz-1.8.6.jar#1:start, \
com.approuter.quartz_scheduler-1.0.0.jar#1:start, \
acme/com.springsource.org.xmlpull-1.1.3.4-O.jar#1:start, \
com.approuter.common-base-1.0.0.jar#1:start, \
com.approuter.common-1.0.0.jar#1:start, \
com.approuter.module.connectorrepository-1.0.0.jar#1:start, \
com.approuter.deploy.arrepo-1.0.0.jar#1:start, \
com.approuter.logging-1.0.0.jar#1:start, \
com.approuter.maestro.sdk-1.0.0.jar#1:start, \
com.approuter.maestro-1.0.0.jar#1, \
com.approuter.module.common-1.0.0.jar#1:start, \
com.approuter.orcmon-1.0.0.jar#1:start, \
acme/com.xerox.amazonws.typica-1.6.jar#1:start, \
com.approuter.sysconf-1.0.0.jar#1:start, \
com.approuter.security-1.0.0.jar#1:start, \
com.approuter.module.projects-1.0.0.jar#2:start, \
com.approuter.module.thirdparty-1.0.0.jar#2:start, \
com.approuter.module.manageappliances-1.0.0.jar#2:start, \
com.approuter.agent.configuration-1.0.0.jar#1:start, \
com.approuter.module.capacitymeter-1.0.0.jar#4, \
acme/com.hector-0.7.0-31.jar#1:start, \
com.approuter.agent.management-1.0.0.jar#1:start, \
com.approuter.pki-1.0.0.jar#4:start, \
com.approuter.module.pip.repository-1.0.0.jar#4:start, \
org.eclipse.equinox.common#2:start, \
org.eclipse.update.configurator#3:start
# start all bundles up to start level 8
osgi.startLevel=8
When I connect to OSGi console and list all bundles with ss command I see the following result
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.10.1.v20140909-1633
Fragments=1
1 RESOLVED com.approuter.eclipse.osgi.fragment_1.0.0
Master=0
2 ACTIVE org.apache.derbyclient_10.8.3.3
3 ACTIVE org.apache.derby_10.8.3.3
4 ACTIVE com.castiron.drivers_1.0.0
5 ACTIVE com.springsource.serp_1.13.1
6 ACTIVE org.apache.commons-dbcp_1.2.2
7 ACTIVE com.springsource.org.apache.commons.pool_1.5.3
8 ACTIVE com.springsource.org.apache.xmlcommons_1.3.3
9 ACTIVE com.springsource.javax.xml.soap_1.3.0
10 ACTIVE javax.xml.rpc_1.1.0
11 ACTIVE com.springsource.javax.ejb_3.0.0
Fragments=12
12 RESOLVED com.approuter.ejb.fragment_1.0.0
Master=11
13 ACTIVE com.springsource.javax.management.j2ee_1.0.1
14 ACTIVE javax.jms_1.1.0
15 ACTIVE com.springsource.org.apache.activemq_5.3.0
16 ACTIVE com.springsource.org.apache.kahadb_5.3.0
17 ACTIVE org.apache.camel_1.3.0
18 ACTIVE org.apache.hadoop_2.2.0
19 ACTIVE org.javassist_3.13.0
20 ACTIVE net.sf.ehcache_1.6.0
21 ACTIVE org.hibernate_3.2.5
22 ACTIVE javax.interceptor_1.1.0
23 ACTIVE org.apache.webbeans_1.0.0
24 ACTIVE org.stax-ex_1.0.0
25 ACTIVE com.xmlrpc_1.2.0
26 ACTIVE com.saaj-impl_1.3.0
27 ACTIVE com.jaxb-impl_2.1.12
28 ACTIVE com.jaxws-rt_2.1.7
29 ACTIVE com.xml-streambuffer_0.8.0
30 ACTIVE com.ibm.xml.xlxp_1.1.14
31 ACTIVE antlr_2.7.7
32 ACTIVE com.springsource.commonj_1.1.0
33 ACTIVE net.sf.cglib_2.1.3
34 ACTIVE com.springsource.org.apache.commons.collections_3.2.1
35 ACTIVE com.springsource.org.apache.commons.io_1.4.0
36 ACTIVE com.springsource.org.apache.commons.logging_1.1.1
37 ACTIVE com.springsource.org.apache.log4j_1.2.15
Fragments=38
38 RESOLVED com.approuter.log4j.fragment_1.0.0
Master=37
39 ACTIVE com.springsource.org.dom4j_1.6.1
40 ACTIVE com.springsource.org.jaxen_1.1.1
41 ACTIVE com.springsource.javax.xml.stream_1.0.1
42 ACTIVE com.springsource.org.objectweb.asm_1.5.3
43 ACTIVE com.springsource.org.objectweb.asm.tree.attrs_1.5.3
44 ACTIVE org.springframework.osgi.extender_1.2.0
45 ACTIVE org.springframework.osgi.core_1.2.0
46 ACTIVE org.springframework.osgi.io_1.2.0
47 ACTIVE org.springframework.core_2.5.6
48 ACTIVE org.springframework.context_2.5.6
49 ACTIVE org.springframework.beans_2.5.6
50 ACTIVE org.springframework.aop_2.5.6
51 ACTIVE org.springframework.web_2.5.6
52 ACTIVE org.springframework.web.servlet_2.5.6
53 ACTIVE com.springsource.org.aopalliance_1.0.0
54 ACTIVE com.springsource.slf4j.org.apache.commons.logging_1.5.0
55 ACTIVE com.springsource.slf4j.api_1.5.0
56 ACTIVE com.springsource.slf4j.log4j_1.5.0
57 ACTIVE com.springsource.org.apache.el.springsource_6.0.20.S2-r5956
58 INSTALLED com.springsource.org.apache.jasper.springsource_6.0.20.S2-r5956
59 ACTIVE com.springsource.org.apache.jasper.org.eclipse.jdt_6.0.16
60 ACTIVE com.springsource.org.apache.juli.extras.springsource_6.0.20.S2-r5956
61 INSTALLED com.springsource.org.apache.coyote.springsource_6.0.20.S2-r5956
62 ACTIVE com.springsource.javax.el_2.1.0
63 ACTIVE com.springsource.javax.servlet_2.5.0
64 ACTIVE com.springsource.javax.servlet.jsp_2.1.0
65 ACTIVE com.springsource.javax.servlet.jsp.jstl_1.1.2
66 ACTIVE com.springsource.org.apache.commons.el_1.0.0
67 ACTIVE com.springsource.org.apache.taglibs.standard_1.1.2
68 ACTIVE com.springsource.javax.annotation_1.0.0
69 ACTIVE com.springsource.javax.persistence_1.0.0
70 ACTIVE com.springsource.javax.transaction_1.1.0
71 ACTIVE com.springsource.javax.xml.ws_2.1.1
72 ACTIVE javax.mail_1.4.0
73 INSTALLED com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956
74 INSTALLED com.approuter.catalina.start_1.0.0
75 INSTALLED com.approuter.catalina.fragment_1.0.0
76 ACTIVE com.approuter.catalina.realm_1.0.0
77 RESOLVED com.approuter.spring.osgi.web.fragment_1.0.0
Master=79
78 RESOLVED com.approuter.spring.osgi.web.extender.fragment_1.0.0
Master=80
79 ACTIVE org.springframework.osgi.web_1.2.0
Fragments=77
80 RESOLVED org.springframework.osgi.web.extender_1.2.0
Fragments=78
81 ACTIVE com.approuter.system.configure_1.0.0
82 ACTIVE com.approuter.system.configure.analytics_1.0.0
85 INSTALLED com.approuter.nmc_0.0.0
86 ACTIVE net.sf.saxon_9.1.0.7
87 ACTIVE org.apache.xmlbeans_2.4.0
88 ACTIVE com.springsource.com.thoughtworks.xstream_1.3.0
89 ACTIVE com.springsource.com.lowagie.text_2.0.8
90 ACTIVE com.springsource.org.apache.commons.codec_1.3.0
91 ACTIVE com.springsource.org.apache.commons.fileupload_1.2.0
92 ACTIVE org.apache.httpcomponents.httpcore_4.4.0
93 ACTIVE org.apache.httpcomponents.httpclient_4.4.0
94 ACTIVE com.springsource.org.apache.commons.lang_2.4.0
95 ACTIVE com.springsource.org.apache.commons.net_1.4.1
96 ACTIVE com.springsource.org.apache.xbean.spring_3.3.0
97 ACTIVE com.springsource.org.apache.xerces_2.8.1
98 ACTIVE com.springsource.org.apache.xml.resolver_1.2.0
99 ACTIVE org.quartz_1.8.6
100 ACTIVE com.springsource.org.xmlpull_1.1.3.4-O
101 ACTIVE com.approuter.common-base_1.0.0
102 ACTIVE com.approuter.common_1.0.0
103 ACTIVE com.approuter.module.connectorrepository_1.0.0
104 ACTIVE com.approuter.deploy.arrepo_1.0.0
ACTIVE com.approuter.logging_1.0.0
106 ACTIVE com.approuter.maestro.sdk_1.0.0
107 RESOLVED com.approuter.maestro_1.0.0
108 ACTIVE com.approuter.module.common_1.0.0
109 ACTIVE com.approuter.orcmon_1.0.0
110 ACTIVE com.xerox.amazonws.typica_1.6.0
111 ACTIVE com.approuter.sysconf_1.0.0
113 ACTIVE com.approuter.module.projects_1.0.0
114 ACTIVE com.approuter.module.thirdparty_1.0.0
115 ACTIVE com.approuter.module.manageappliances_1.0.0
116 ACTIVE com.approuter.agent.configuration_1.0.0
117 RESOLVED com.approuter.module.capacitymeter_1.0.0
118 ACTIVE com.hector_0.7.0.31
119 ACTIVE com.approuter.agent.management_1.0.0
120 RESOLVED com.approuter.pki_1.0.0
121 ACTIVE com.approuter.module.pip.repository_1.0.0
122 ACTIVE org.eclipse.equinox.common_3.6.200.v20130402-1505
123 ACTIVE org.apache.felix.gogo.command_0.10.0.v201209301215
124 ACTIVE org.apache.felix.gogo.runtime_0.10.0.v201209301036
125 ACTIVE org.apache.felix.gogo.shell_0.10.0.v201212101605
126 ACTIVE org.eclipse.equinox.console_1.1.0.v20140131-1639
127 ACTIVE org.apache.felix.fileinstall_3.4.0
128 ACTIVE org.eclipse.osgi.services_3.4.0.v20140312-2051
Here the bundles com.springsource.org.apache.jasper.springsource_6.0.20.S2-r5956 and com.springsource.org.apache.coyote.springsource_6.0.20.S2-r5956 are fragment bundles whose parent bundle is com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956.
We can see that all these 3 bundles are just INSTALLED.
When I tried to start the bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956 manually with the command start 73, I see following exception.
gogo: BundleException: Could not resolve module: com.springsource.org.apache.catalina.springsource [73]
Unresolved requirement: Import-Package: org.apache.coyote; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.coyote; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.coyote.springsource"; version="6.0.20.S2-r5956"; uses:="javax.management,org.apache.tomcat.util.buf,org.apache.tomcat.util.http,org.apache.tomcat.util.net"
com.springsource.org.apache.coyote.springsource [61]
Unresolved requirement: Import-Package: org.apache.catalina.deploy; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.catalina.deploy; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.catalina.springsource"; version="6.0.20.S2-r5956"
Unresolved requirement: Import-Package: org.apache.catalina; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.catalina; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.catalina.springsource"; version="6.0.20.S2-r5956"; uses:="javax.naming.directory,javax.servlet,javax.servlet.http,org.apache.catalina.connector,org.apache.catalina.deploy,org.apache.catalina.util,org.apache.juli.logging,org.apache.tomcat,org.apache.tomcat.util.http.mapper"
Unresolved requirement: Fragment-Host: com.springsource.org.apache.catalina.springsource; bundle-version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Bundle-SymbolicName: com.springsource.org.apache.catalina.springsource; bundle-version="6.0.20.S2-r5956"
Unresolved requirement: Import-Package: org.apache.coyote.http11; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.coyote.http11; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.coyote.springsource"; version="6.0.20.S2-r5956"; uses:="javax.management,org.apache.coyote,org.apache.tomcat.util.buf,org.apache.tomcat.util.net"
Unresolved requirement: Import-Package: org.apache.coyote.ajp; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.coyote.ajp; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.coyote.springsource"; version="6.0.20.S2-r5956"; uses:="javax.management,org.apache.coyote,org.apache.tomcat.util.buf,org.apache.tomcat.util.net"
Unresolved requirement: Import-Package: org.apache.tomcat; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.tomcat; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.jasper.springsource"; version="6.0.20.S2-r5956"; uses:="javax.servlet"
com.springsource.org.apache.jasper.springsource [58]
Unresolved requirement: Import-Package: org.apache.tools.ant; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.tools.ant.taskdefs; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.tools.ant.types; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.tools.ant.util; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Fragment-Host: com.springsource.org.apache.catalina.springsource; version="[6.0.20.S2-r5956, 6.0.20.S2-r5956]"
But when I looked at the Import and Export packages of both coyote and Jasper bundles, its proper. In fact they are taken from springsource repository.
I did not get the missing constraints for the bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956.
Here which bundle will be resolved first ? Is it parent bundle or fragments ?
How do I resolve this to make sure all the bundles are resolved and successfully start the bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956
Parent bundles are resolved first. After the parents are resolved than fragments get attached to their respective parents. I'd suggest to use latest equinox jar as well. It's easier to resolve these kind of errors by debugging using equinox shell commands. For example, in your case you can check who is exporting the package "org.apache.coyote" by using the command packages org.apache.coyote.

Resources