Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSGi services are not supported #1693

Closed
pminearo opened this issue Oct 22, 2014 · 6 comments
Closed

OSGi services are not supported #1693

pminearo opened this issue Oct 22, 2014 · 6 comments
Assignees

Comments

@pminearo
Copy link

I have a standalone application that creates an instance of the Jetty container within itself via Spring. Hawtio is deployed into the Jetty container via Jetty Handlers (WebAppContext to be specific). We are using the following versions:

Java 1.8.0_20
Spring 4.1.1.RELEASE
Hibernate (with ehcache) 4.3.6.Final
Jetty 8.1.15.v20140411
ActiveMQ 5.10.0.1-SNAPSHOT (we created a snapshot to fix a logging issue)
Camel 2.13.0
Hawtio 4.1.26

We have other dependencies I can include if need be. But I think these are the major players.

The following exception just started to happen when we upgraded some of our dependencies. I do not know where this is coming from. Not sure if this is a compatibility issue with Hawtio and Java 8; or some combination of dependencies. I did notice there is a blueprint.xml file coming from hibernate-ehcache.

2014-10-22 08:33:53,335 INFO  [org.eclipse.jetty.webapp.WebInfConfiguration] [main]: Extract jar:file:/Users/Minearo/Development/etpbzr/etouchpoint/etouchpoint-batch/hawtio/hawtio-default.war!/ to /Users/Minearo/Development/etpbzr/etouchpoint/etouchpoint-batch/work/jetty-127.0.0.1-9110-hawtio-default.war-_hawtio-any-/webapp
2014-10-22 08:33:54,250 INFO  [org.eclipse.jetty.webapp.StandardDescriptorProcessor] [main]: NO JSP Support for /hawtio, did not find org.apache.jasper.servlet.JspServlet
08:33:54,401 INFO  (main) [ConfigManager] Configuration will be discovered via system properties
08:33:54,404 INFO  (main) [JmxTreeWatcher] Welcome to hawtio 1.4.26 : http://hawt.io/ : Don't cha wish your console was hawt like me? ;-)
08:33:54,409 INFO  (main) [UploadManager] Using file upload directory: /var/folders/_z/wl2c9pd17wl8nb65k5xnc6lr0000gn/T//uploads
2014-10-22 08:33:54,414 INFO  [/hawtio] [main]: Loading Blueprint contexts [jar:file:/Users/Minearo/.m2/repository/org/hibernate/hibernate-ehcache/4.3.6.Final/hibernate-ehcache-4.3.6.Final.jar!/OSGI-INF/blueprint/blueprint.xml, jar:file:/Users/Minearo/Development/etpbzr/etouchpoint/etouchpoint-batch/work/jetty-127.0.0.1-9110-hawtio-default.war-_hawtio-any-/webapp/WEB-INF/lib/hawtio-core-1.4.26.jar!/OSGI-INF/blueprint/blueprint.xml, jar:file:/Users/Minearo/Development/etpbzr/etouchpoint/etouchpoint-batch/work/jetty-127.0.0.1-9110-hawtio-default.war-_hawtio-any-/webapp/WEB-INF/lib/hawtio-git-1.4.26.jar!/OSGI-INF/blueprint/blueprint.xml, jar:file:/Users/Minearo/Development/etpbzr/etouchpoint/etouchpoint-batch/work/jetty-127.0.0.1-9110-hawtio-default.war-_hawtio-any-/webapp/WEB-INF/lib/hawtio-json-schema-mbean-1.4.26.jar!/OSGI-INF/blueprint/blueprint.xml, jar:file:/Users/Minearo/Development/etpbzr/etouchpoint/etouchpoint-batch/work/jetty-127.0.0.1-9110-hawtio-default.war-_hawtio-any-/webapp/WEB-INF/lib/hawtio-local-jvm-mbean-1.4.26.jar!/OSGI-INF/blueprint/blueprint.xml]
2014-10-22 08:33:54,552 WARN  [/hawtio] [main]: Failed to startup blueprint container. java.lang.IllegalArgumentException: OSGi services are not supported
java.lang.IllegalArgumentException: OSGi services are not supported
    at org.apache.aries.blueprint.container.NoOsgiRecipeBuilder.createRecipe(NoOsgiRecipeBuilder.java:70) ~[org.apache.aries.blueprint.noosgi-1.0.0.jar:1.0.0]
    at org.apache.aries.blueprint.container.NoOsgiRecipeBuilder.createRepository(NoOsgiRecipeBuilder.java:51) ~[org.apache.aries.blueprint.noosgi-1.0.0.jar:1.0.0]
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.init(BlueprintContainerImpl.java:108) ~[org.apache.aries.blueprint.noosgi-1.0.0.jar:1.0.0]
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.<init>(BlueprintContainerImpl.java:73) ~[org.apache.aries.blueprint.noosgi-1.0.0.jar:1.0.0]
    at io.hawt.blueprint.HawtioBlueprintContextListener.contextInitialized(HawtioBlueprintContextListener.java:97) ~[classes/:na]
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) [jetty-server-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) [jetty-servlet-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) [jetty-server-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) [jetty-servlet-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) [jetty-webapp-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) [jetty-server-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.15.v20140411.jar:8.1.15.v20140411]
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.15.v20140411.jar:8.1.15.v20140411]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_20]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_20]
    at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_20]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1696) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1635) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) [spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) [spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:260) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:63) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:83) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:74) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:116) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:82) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:199) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:251) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:253) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na]
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162) [spring-test-4.1.1.RELEASE.jar:4.1.1.RELEASE]
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) [surefire-junit4-2.17.jar:2.17]
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) [surefire-junit4-2.17.jar:2.17]
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) [surefire-junit4-2.17.jar:2.17]
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) [surefire-booter-2.17.jar:2.17]
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) [surefire-booter-2.17.jar:2.17]
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) [surefire-booter-2.17.jar:2.17]
08:35:20,458 INFO  (main) [AuthenticationFilter] Starting hawtio authentication filter, JAAS authentication disabled
2014-10-22 08:35:20,500 INFO  [/hawtio] [main]: jolokia-agent: Using access restrictor classpath:/jolokia-access.xml
2014-10-22 08:35:20,589 INFO  [org.eclipse.jetty.webapp.WebAppContext] [main]: hawtio at http://127.0.0.1:9110/hawtio
@pminearo
Copy link
Author

Also, I have a DEBUG output as well. I can send that upon request.

@pminearo
Copy link
Author

Looks like hibernate-ehcache added a blueprint.xml file somewhere between 4.2.2-FINAL and 4.3.6-FINAL which is causing a compatibility issue between hawtio and hibernate.

@gashcrumb
Copy link
Member

Looks like we've control over what blueprint XML files are being loaded here ->

https://github.com/hawtio/hawtio/blob/master/hawtio-base/src/main/java/io/hawt/blueprint/HawtioBlueprintContextListener.java#L60-69

So we could either only load hawtio blueprints or add method of filtering the resulting list via configuration. I vote the latter as it's possible we could discover any old blueprint file that could hit this problem. Though, one would think OSGI services could be loaded, maybe this is something that should be improved in blueprint-web. Thoughts?

@pminearo
Copy link
Author

Forgot to mention, how we are using hawtio:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>copy</id>
            <phase>generate-resources</phase>
            <goals>
                <goal>copy</goal>
            </goals>
            <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>io.hawt</groupId>
                        <artifactId>hawtio-default-offline</artifactId>
                        <version>1.4.26</version>
                        <type>war</type>
                        <outputDirectory>${basedir}/hawtio</outputDirectory>
                        <destFileName>hawtio-default.war</destFileName>
                    </artifactItem>
                </artifactItems>
            </configuration>
        </execution>
    </executions>
</plugin>

This brings up an interesting discussion point. We pull in the war file and do no configuration to hawtio. We use whatever defaults are set up. With that said, is it possible to set up both. Meaning, in the hawtio-default-offline, the configuration is to pull in only the hawtio blueprint files. However, hawtio has the ability to configure it as well? There may be times when an app using hawtio wants to pull in other blueprint files?

I also think the blueprint developers should be contacted with this bug. There may be a fix on their end? Or maybe they have a way to set up the configuration?

@davsclaus
Copy link
Member

@gashcrumb yeah I think we should prefix all our blueprint xml files with hawtio-, and then only include those files in that filter.

@davsclaus
Copy link
Member

You can configure which blueprint files to load

  <context-param>
    <param-name>blueprintProperties</param-name>
    <param-value>blueprint.properties</param-value>
  </context-param>
  <context-param>
    <param-name>blueprintLocation</param-name>
    <param-value>OSGI-INF/blueprint/blueprint.xml</param-value>
  </context-param>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants