[ https://issues.apache.org/jira/browse/KARAF-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079305#comment-16079305 ]
Steinar Bang commented on KARAF-5115: ------------------------------------- I'm seeing this behaviour now in [my application|https://github.com/steinarb/ukelonn/tree/using-vaadin]: * The application stops with a frozen console with the following output on the console: {noformat} java.lang.IllegalStateException: No inital startlevel yet at org.apache.felix.framework.FrameworkStartLevelImpl.setStartLevel(FrameworkStartLevelImpl.java:131) at org.apache.karaf.main.Main.setStartLevel(Main.java:605) at org.apache.karaf.main.Main$KarafLockCallback.lockAquired(Main.java:711) at org.apache.karaf.main.Main.doMonitor(Main.java:382) at org.apache.karaf.main.Main.access$100(Main.java:75) at org.apache.karaf.main.Main$3.run(Main.java:369) {noformat} * This only happens the first time the application is started, if I kill karaf and start it again everything starts normal I don't try loading anything cxf related (as far as I know). This application is currently a [vaadin|] application that uses the pax whiteboard extender, registering both a servlet and a filter handling the authentication/authorization (uses shiro). I figured it is caused by something I've done, but I don't know what. The behaviour on Win10, karaf-4.1.1 and java 1.8.0_102-b14 is identical to what's described over. The behaviour on debian stretch, karaf-4.1.1 and openjdk 1.8.0_131 is slightly different: the stack trace ends up in karaf.log instead of the console, and the console seems to autorestart: {noformat} sb@lorenzo:~/skrot/apache-karaf-4.1.1$ bin/karaf debug karaf: JAVA_HOME not set; results may vary Listening for transport dt_socket at address: 5005 __ __ ____ / //_/____ __________ _/ __/ / ,< / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (4.1.1) Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. karaf@root()> feature:repo-add mvn:no.priv.bang.ukelonn/ukelonn.karaf/LATEST/xml/features Adding feature url mvn:no.priv.bang.ukelonn/ukelonn.karaf/LATEST/xml/features karaf@root()> feature:install liquibase-core karaf@root()> feature:install ukelonn-db-derby-test karaf@root()> feature:install ukelonn karaf@root()> __ __ ____ / //_/____ __________ _/ __/ / ,< / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (4.1.1) Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. karaf@root()> {noformat} To reproduce: # Clone and build the application {noformat} mkdir -p ~/git cd ~/git git clone https://github.com/sbang/jsr330activator.git cd jsr330activator mvn clean install git clone https://github.com/steinarb/ukelonn.git cd ukelonn mvn clean install {noformat} # Start karaf and install the application with the following commands in the karaf console {noformat} feature:repo-add mvn:no.priv.bang.ukelonn/ukelonn.karaf/LATEST/xml/features feature:install liquibase-core feature:install ukelonn-db-derby-test feature:install ukelonn {noformat} # The console will be stuck (or on debian: restart) after this > Error while installing cxf > -------------------------- > > Key: KARAF-5115 > URL: https://issues.apache.org/jira/browse/KARAF-5115 > Project: Karaf > Issue Type: Bug > Affects Versions: 4.1.1 > Environment: Windows 10 64bit > Java JDK 1.8.0_131 > Reporter: Massimo Bono > Labels: features > Attachments: karaf.log > > > Hello, > I was trying to create a REST application with karaf. > I know there are examples over the internet showing how this can be achieved > (like [this > one|http://liquid-reality.de:8090/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi]), > but usually they use blueprints as DI. My goal is to use Declarative Service > instead. > I followed this > [guide|https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=55153391]: > it uses Karaf 3.0.3 and CXF 3.1.0, but I **think** it should work with 4.1.1 > as well. > By doing the following: > {code} > karaf@root()> feature:install scr http pax-cdi-web-weld > karaf@root()> feature:repo-add cxf 3.1.11 > Adding feature url mvn:org.apache.cxf.karaf/apache-cxf/3.1.11/xml/features > karaf@root()> feature:install cxf/3.1.11 cxf-jaxrs-cdi/3.1.11 > {code} > Karaf gives the following error: > {code} > java.lang.IllegalStateException: No inital startlevel yet > at > org.apache.felix.framework.FrameworkStartLevelImpl.setStartLevel(FrameworkStartLevelImpl.java:131) > at org.apache.karaf.main.Main.setStartLevel(Main.java:605) > at > org.apache.karaf.main.Main$KarafLockCallback.lockAquired(Main.java:711) > at org.apache.karaf.main.Main.doMonitor(Main.java:382) > at org.apache.karaf.main.Main.access$100(Main.java:75) > at org.apache.karaf.main.Main$3.run(Main.java:369) > {code} > Furthermore, karaf *won't* return the console control to me, but remains > stuck waiting nothing. > It's highly possible that my procedure to install pax-cdi and cxf is flawed, > but I still think that showing that error on the console and letting the > shell going unresponsive are a bug of karaf (or a bug of the underlying OSGi > framework, aka felix itself). > Sorry if this behaviour is not a bug at all, but is just caused by my > ignorance of the tool. > Regards, -- This message was sent by Atlassian JIRA (v6.4.14#64029)