Apache Karaf включает план Gemini

Я загрузил Karaf 3.0.8 и попытался включить план Spring 3.2 и Gemini - безуспешно.

karaf@root()> feature:install spring/3.2.17.RELEASE_1
karaf@root()> feature:install gemini-blueprint 
Exception in thread "EclipseGeminiBlueprintExtenderThread-25" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 22 in XML document from URL [bundle://55.0:0/OSGI-INF/blueprint/kar-deployer.xml] is invalid; 
nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c:    
The matching wildcard is strict, but no declaration can be found for element 'ext:property-placeholder'.
....
karaf@root()> feature:list -i
Name             | Version          | Installed | Repository     | Description                                       
---------------------------------------------------------------------------------------------------------------------
spring           | 3.2.17.RELEASE_1 | x         | spring-3.0.8   | Spring 3.2.x support                              
gemini-blueprint | 1.0.0.RELEASE    | x         | spring-3.0.8   | Gemini Blueprint Extender                         
standard         | 3.0.8            | x         | standard-3.0.8 | Karaf standard feature                            
config           | 3.0.8            | x         | standard-3.0.8 | Provide OSGi ConfigAdmin support                  
region           | 3.0.8            | x         | standard-3.0.8 | Provide Region Support                            
package          | 3.0.8            | x         | standard-3.0.8 | Package commands and mbeans                       
kar              | 3.0.8            | x         | standard-3.0.8 | Provide KAR (KARaf archive) support               
ssh              | 3.0.8            | x         | standard-3.0.8 | Provide a SSHd server on Karaf                    
management       | 3.0.8            | x         | standard-3.0.8 | Provide a JMX MBeanServer and a set of MBeans in K
karaf@root()> list -t 0
START LEVEL 100 , List Threshold: 0
ID | State    | Lvl | Version          | Name                                                               
------------------------------------------------------------------------------------------------------------
 0 | Active   |   0 | 4.2.1            | System Bundle                                                      
 1 | Active   |   5 | 2.4.7            | OPS4J Pax Url - aether:                                            
 2 | Active   |   5 | 2.4.7            | OPS4J Pax Url - wrap:                                              
 3 | Active   |   8 | 1.8.4            | OPS4J Pax Logging - API                                            
 4 | Active   |   8 | 1.8.4            | OPS4J Pax Logging - Service                                        
 5 | Active   |  10 | 3.0.8            | Apache Karaf :: Service :: Guard                                   
 6 | Active   |  10 | 1.8.4            | Apache Felix Configuration Admin Service                           
 7 | Active   |  11 | 3.5.2            | Apache Felix File Install                                          
 8 | Active   |  12 | 5.0.3            | ASM all classes with debug info                                    
 9 | Active   |  20 | 1.1.1            | Apache Aries Util                                                  
10 | Active   |  20 | 1.0.1            | Apache Aries Proxy API                                             
11 | Active   |  20 | 1.0.8            | Apache Aries Blueprint CM                                          
12 | Active   |  20 | 1.0.4            | Apache Aries Proxy Service                                         
13 | Active   |  20 | 1.0.1            | Apache Aries Blueprint API                                         
14 | Resolved |  20 | 1.0.0            | Apache Aries Blueprint Core Compatiblity Fragment Bundle, Hosts: 15
15 | Active   |  20 | 1.6.1            | Apache Aries Blueprint Core, Fragments: 14                         
16 | Active   |  24 | 3.0.8            | Apache Karaf :: Deployer :: Spring                                 
17 | Active   |  24 | 3.0.8            | Apache Karaf :: Deployer :: Blueprint                              
18 | Active   |  24 | 3.0.8            | Apache Karaf :: Deployer :: Wrap Non OSGi Jar                      
19 | Active   |  25 | 3.0.8            | Apache Karaf :: Region :: Core                                     
20 | Active   |  25 | 3.0.8            | Apache Karaf :: Features :: Core                                   
21 | Active   |  26 | 3.0.8            | Apache Karaf :: Deployer :: Features                               
22 | Active   |  30 | 2.13.0           | JLine                                                              
23 | Active   |  30 | 0.2.1            | JLEdit :: Core                                                     
24 | Active   |  30 | 3.0.8            | Apache Karaf :: Features :: Command                                
25 | Active   |  30 | 3.0.8            | Apache Karaf :: Bundle :: Core                                     
26 | Active   |  30 | 3.0.8            | Apache Karaf :: Bundle :: Commands                                 
27 | Active   |  30 | 3.0.8            | Apache Karaf :: Shell :: Console                                   
28 | Active   |  30 | 3.0.8            | Apache Karaf :: JAAS :: Modules                                    
29 | Active   |  30 | 3.0.8            | Apache Karaf :: JAAS :: Config                                     
30 | Active   |  30 | 0.14.0           | Apache Mina SSHD :: Core                                           
31 | Active   |  30 | 3.0.8            | Apache Karaf :: Shell :: Help System                               
32 | Active   |  30 | 3.0.8            | Apache Karaf :: Shell :: Table                                     
33 | Active   |  30 | 3.0.8            | Apache Karaf :: System :: Core                                     
34 | Active   |  30 | 3.0.8            | Apache Karaf :: System :: Shell Commands                           
35 | Active   |  30 | 3.0.8            | Apache Karaf :: Shell :: Various Commands                          
36 | Active   |  30 | 1.0.0            | Apache Aries Quiesce API                                           
37 | Active   |  30 | 3.0.8            | Apache Karaf :: ConfigAdmin :: Core                                
38 | Active   |  30 | 3.0.8            | Apache Karaf :: ConfigAdmin :: Commands                            
39 | Active   |  30 | 3.0.8            | Apache Karaf :: Instance :: Core                                   
40 | Active   |  30 | 3.0.8            | Apache Karaf :: Instance :: Command                                
41 | Active   |  30 | 3.0.8            | Apache Karaf :: JAAS :: Command                                    
42 | Active   |  30 | 3.0.8            | Apache Karaf :: Diagnostic :: Core                                 
43 | Active   |  30 | 3.0.8            | Apache Karaf :: Diagnostic :: Command                              
44 | Active   |  30 | 3.0.8            | Apache Karaf :: Log :: Core                                        
45 | Active   |  30 | 3.0.8            | Apache Karaf :: Log :: Command                                     
46 | Active   |  30 | 3.0.8            | Apache Karaf :: Service :: Core                                    
47 | Active   |  30 | 3.0.8            | Apache Karaf :: Service :: Command                                 
48 | Active   |  30 | 1.0.0.v20110524  | Region Digraph                                                     
49 | Active   |  30 | 3.0.8            | Apache Karaf :: Region :: Persistence                              
50 | Active   |  30 | 3.0.8            | Apache Karaf :: Region :: Shell Commands                           
51 | Active   |  30 | 3.0.8            | Apache Karaf :: Package :: Core                                    
52 | Active   |  30 | 3.0.8            | Apache Karaf :: Package :: Commands                                
53 | Active   |  30 | 3.0.8            | Apache Karaf :: KAR :: Core                                        
54 | Active   |  30 | 3.0.8            | Apache Karaf :: KAR :: Command                                     
55 | Active   |  30 | 3.0.8            | Apache Karaf :: Deployer :: Karaf Archive (.kar)                   
56 | Active   |  30 | 2.0.7            | Apache MINA Core                                                   
57 | Active   |  30 | 3.0.8            | Apache Karaf :: Shell :: SSH                                       
58 | Active   |  30 | 3.0.8            | Apache Karaf :: Management                                         
59 | Active   |  30 | 1.1.1            | Apache Aries JMX API                                               
60 | Active   |  30 | 1.1.6            | Apache Aries JMX Core                                              
61 | Active   |  30 | 1.1.0            | Apache Aries JMX Blueprint API                                     
62 | Active   |  30 | 1.1.0            | Apache Aries JMX Blueprint Core                                    
63 | Active   |  30 | 1.0.0            | Apache Aries JMX Whiteboard                                        
64 | Active   |  30 | 1.0.0.6          | Apache ServiceMix :: Bundles :: aopalliance                        
65 | Active   |  30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-core                        
66 | Active   |  30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-expression                  
67 | Active   |  30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-beans                       
68 | Active   |  30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-aop                         
69 | Active   |  30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-context                     
70 | Active   |  30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-context-support             
71 | Active   |  30 | 1.0.0.RELEASE    | gemini-blueprint-io                                                
72 | Active   |  30 | 1.0.0.RELEASE    | gemini-blueprint-core                                              
73 | Active   |  30 | 1.0.0.RELEASE    | gemini-blueprint-extender 

После перезапуска я получил следующее исключение, напечатанное почти для каждого пакета

73 - org.eclipse.gemini.blueprint.extender - 1.0.0.RELEASE | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.karaf.config.command, config=OSGI-INF/blueprint/shell-config.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 25 in XML document from URL [bundle://38.0:0/OSGI-INF/blueprint/shell-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'command-bundle'.

Для некоторых пакетов проблема с элементом command-bundle, а для других — с элементом ext:property-placeholder.

Итак, похоже, что в основных пакетах Karaf есть неверный чертеж xml? Это ошибка?


person Community    schedule 27.08.2017    source источник


Ответы (1)


Версии Apache Karaf 2.x и 3.x используют внутреннюю схему. Спецификация Blueprint несколько ограничена и не охватывает какой-либо механизм расширения через пространства имен. Это поддерживается как Aries Blueprint, так и Gemini Blueprint, но по-разному. Эти версии Karaf полагаются на Aries Blueprint, поэтому немного сложно заставить работать Gemini Blueprint.

Karaf 4.x больше не использует Blueprint внутри, поэтому установить там Gemini Blueprint должно быть намного проще.
Тем не менее, Gemini Blueprint не очень активен, поэтому вместо этого вам следует взглянуть на реализацию Aries Blueprint. Fwiw, Aries Blueprint также обеспечивает полную совместимость с Spring, если вам нужно.

person Guillaume Nodet    schedule 06.09.2017