Re: [jboss-osgi-dev] [jboss-osgi-users] failed to start resteasy in OSGi
by Thomas Diesler
This is not yet supported please monitor and vote on
https://issues.jboss.org/browse/AS7-5066
On 06/21/2012 11:01 AM, ZHANG Rocky F wrote:
>
> Hi all,
>
> I am developing a rest bundle who is responding to bring up a RESTEASY
> servlet and then provide interfaces for other bundles to register
> their own handlers into RESTEASY.
>
> *Codes registering RESTEASY servlet into OSGI:*
>
> *ResteasyServlet servlet = new ResteasyServlet();*
>
> HttpService http = (HttpService) context.getService(restServiceReference);
>
> if (null != http) {
>
> Dictionary props = new Properties();
>
> props.put("javax.ws.rs.Application", RestApplication.class.getName());
>
> // props.put("resteasy.use.builtin.providers", "true");
>
> props.put("resteasy.providers", ""
>
> +"org.jboss.resteasy.plugins.providers.jaxb.JAXBElementProvider"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.CollectionProvider"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlRootElementProvider"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlTypeProvider"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBContextFinder"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.AnnotationFactory"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.BaseMarshaller"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.ExternalEntityUnmarshaller"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.IgnoredMediaTypes"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JaxbCollection"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBContextFinder"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBContextWrapper"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JaxbMap"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBMarshalException"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JAXBUnmarshalException"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.PrettyProcessor"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.StylesheetProcessor"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.XmlHeaderProcessor"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.XmlJAXBContextFinder"
>
> // + ",org.jboss.resteasy.plugins.providers.jaxb.XmlNamespacePrefixMapper"
>
> +
> ",org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBContextFinder$CacheKey"
>
> + ",org.jboss.resteasy.plugins.providers.jaxb.JaxbMap$Entry"
>
> + ",org.jboss.resteasy.plugins.providers.DataSourceProvider" +
> ",org.jboss.resteasy.plugins.providers.DocumentProvider"
>
> + ",org.jboss.resteasy.plugins.providers.DefaultTextPlain" +
> ",org.jboss.resteasy.plugins.providers.StringTextStar"
>
> + ",org.jboss.resteasy.plugins.providers.InputStreamProvider" +
> ",org.jboss.resteasy.plugins.providers.ByteArrayProvider"
>
> + ",org.jboss.resteasy.plugins.providers.FormUrlEncodedProvider" +
> ",org.jboss.resteasy.plugins.providers.FileProvider"
>
> + ",org.jboss.resteasy.plugins.providers.StreamingOutputProvider"
>
> + ",org.jboss.resteasy.plugins.providers.IIOImageProvider"
>
> + ",org.jboss.resteasy.plugins.interceptors.CacheControlInterceptor"
>
> +
> ",org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor"
>
> +
> ",org.jboss.resteasy.plugins.interceptors.encoding.ClientContentEncodingHeaderInterceptor"
>
> +
> ",org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor"
>
> +
> ",org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor"
>
> +
> ",org.jboss.resteasy.plugins.interceptors.encoding.ServerContentEncodingHeaderInterceptor");
>
> *http.registerServlet("/*", servlet, props, null);*
>
> *ResteasyServlet class (simply wrapping HttpServletDispatcher)*
>
> import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;
>
> /**
>
> * ResteasyServlet simple wrapper to Resteasy's HttpServletDispatcher.
>
> * @author <a href="mailto:baldin@gmail.com">Davi Baldin H. Tavares</a>
>
> *
>
> */
>
> public class ResteasyServlet extends HttpServletDispatcher {
>
> private static final long serialVersionUID = 5968966644419029725L;
>
> }
>
> *HttpService in OSGI**:*pax-web-jetty-bundle is providing HttpService
> in OSGI**
>
> *RESTEASY bundle used:*
>
> I am using RESTEASY bundle built-in in JBOSS7.1.0.final.
>
> Here is what I am configuring in JBOSS standalone.xml:
>
> <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="eager">
>
> <properties>
>
> <property name="org.osgi.framework.startlevel.beginning">
>
> 5
>
> </property>
>
> </properties>
>
> <capabilities>
>
> <capability name="javax.servlet.api:v25" startlevel="1"/>
>
> <capability name="javax.transaction.api" startlevel="1"/>
>
> <capability name="org.jboss.osgi.logging" startlevel="1"/>
>
> <capability name="org.apache.felix.scr" startlevel="1"/>
>
> <capability name="org.ops4j.pax.web.pax-web-jsp" startlevel="1"/>
>
> <capability name="org.ops4j.pax.web.pax-web-jetty-bundle" startlevel="1"/>
>
> *<capability name="javax.ws.rs.api" startlevel="1"/>*
>
> *<capability name="javax.xml.bind.api" startlevel="1"/>*
>
> <capability name="org.apache.commons.lang" startlevel="1"/>
>
> * <capability name="com.sun.xml.bind" startlevel="1"/>*
>
> <capability name="javax.jmdns" startlevel="1"/>
>
> <capability name="org.apache.log4j" startlevel="1"/>
>
> <capability name="org.apache.felix.log" startlevel="2"/>
>
> <capability name="org.apache.felix.configadmin" startlevel="2"/>
>
> <capability name="org.apache.felix.webconsole" startlevel="2"/>
>
> <capability name="org.ops4j.pax.pax-confmanager" startlevel="3"/>
>
> *<capability name="org.jboss.resteasy.resteasy-jaxb-provider"
> startlevel="3"/>*
>
> *<capability name="org.jboss.resteasy.resteasy-jaxrs" startlevel="3"/>*
>
> </capabilities>
>
> </subsystem>
>
> *Errors:*
>
> When I am running the rest bundle, I got the following error:
>
> 04:05:10,720 DEBUG
> [org.ops4j.pax.web.service.jetty.internal.HttpServiceContext] (MSC
> service thread 1-3) Started servlet context for http context
> [DefaultHttpContext{bundle=com.alu.as3.rest:1.0.0}]
>
> 04:05:10,720 DEBUG
> [org.jboss.osgi.framework.internal.ServiceManagerPlugin] (MSC service
> thread 1-3) Register service: ServiceState{service.id=53,
> objectClass=[javax.servlet.ServletContext],
> osgi.web.symbolicname=com.alu.as3.rest, osgi.web.version=1.0}
>
> 04:05:10,736 DEBUG
> [org.ops4j.pax.web.service.internal.HttpServiceStarted] (MSC service
> thread 1-3) init called on
> com.alu.as3.rest.internal.ResteasyServlet@1037619
>
> 04:05:10,751 ERROR [stderr] (MSC service thread 1-3) 2012-06-21
> 04:05:10.751:WARN:/:unavailable
>
> 04:05:10,751 ERROR [stderr] (MSC service thread 1-3)
> *java.lang.IllegalArgumentException: object is not an instance of
> declaring class*
>
> 04:05:10,767 ERROR [stderr] (MSC service thread 1-3) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> 04:05:10,767 ERROR [stderr] (MSC service thread 1-3) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> 04:05:10,782 ERROR [stderr] (MSC service thread 1-3) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> 04:05:10,782 ERROR [stderr] (MSC service thread 1-3) at
> java.lang.reflect.Method.invoke(Method.java:597)
>
> 04:05:10,798 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.internal.HttpServiceStarted$2.invoke(HttpServiceStarted.java:209)
>
> 04:05:10,814 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.internal.$Proxy9.init(Unknown Source)
>
> 04:05:10,814 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:445)
>
> 04:05:10,829 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:265)
>
> 04:05:10,829 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
>
> 04:05:10,845 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:771)
>
> 04:05:10,860 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1221)
>
> 04:05:10,860 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1280)
>
> 04:05:10,876 ERROR [stderr] (MSC service thread 1-3) at
> org.eclipse.jetty.servlet.ServletHandler.addServletMapping(ServletHandler.java:879)
>
> 04:05:10,876 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.call(JettyServerImpl.java:170)
>
> 04:05:10,891 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.call(JettyServerImpl.java:166)
>
> 04:05:10,907 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)
>
> 04:05:10,907 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addServlet(JettyServerImpl.java:165)
>
> 04:05:10,923 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addServlet(ServerControllerImpl.java:266)
>
> 04:05:10,938 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addServlet(ServerControllerImpl.java:107)
>
> 04:05:10,954 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:165)
>
> 04:05:10,954 ERROR [stderr] (MSC service thread 1-3) at
> org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:56)
>
> 04:05:10,969 ERROR [stderr] (MSC service thread 1-3) at
> com.alu.as3.rest.internal.RestBundleActivator.registerServlet(RestBundleActivator.java:140)
>
> 04:05:10,985 ERROR [stderr] (MSC service thread 1-3) at
> com.alu.as3.rest.internal.RestBundleActivator.start(RestBundleActivator.java:48)
>
> 04:05:10,985 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:300)
>
> 04:05:11,001 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:223)
>
> 04:05:11,001 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)
>
> 04:05:11,016 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)
>
> 04:05:11,032 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)
>
> 04:05:11,032 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)
>
> 04:05:11,047 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)
>
> 04:05:11,047 ERROR [stderr] (MSC service thread 1-3) at
> org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)
>
> 04:05:11,063 ERROR [stderr] (MSC service thread 1-3) at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>
> 04:05:11,078 ERROR [stderr] (MSC service thread 1-3) at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
> 04:05:11,078 ERROR [stderr] (MSC service thread 1-3) at
> java.lang.Thread.run(Thread.java:662)
>
> Who can kindly help me on this?
>
> Thanks in advance!
>
> Rocky,
>
>
>
> _______________________________________________
> jboss-osgi-users mailing list
> jboss-osgi-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-osgi-users
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
12 years, 6 months
Re: [jboss-osgi-dev] Repository failures
by David Bosschaert
I actually have some more tests now but some of these (partly) fail
because of the issues exposed in
https://github.com/jbosgi/jbosgi-repository/pull/2 so I'll wait with
submitting those until this pull request is handled...
Cheers,
David
On 19/06/2012 15:36, David Bosschaert wrote:
> Hi Thomas,
>
> I just filed another pull request that exposes the 2 additional
> failures that I'm getting.
>
> Cheers,
>
> David
12 years, 6 months
Request for review (Configuration Admin Changes for AS7-4893)
by David Bosschaert
Before filing a pull request I would appreciate someone reviewing my
suggested changes for
https://issues.jboss.org/browse/AS7-4893 (ConfigAdmin configuration not
available after restart)
My changes are in the following commit:
https://github.com/bosschaert/jboss-as/commit/bf221bc316c254401ee1b1c25d9...
In particular I'm a little unsure about the
ConfigurationRemove.UPDATING_FLAG that I introduced.
ConfigurationAdminServiceImpl.putConfiguration() first removes the old
configuration from the model and then adds the new one. The problem is
that the deletion in this case shouldn't really be sent to the
ConfigurationAdmin service as we aren't really deleting the config
object. The UPDATING_FLAG is used to indicate that notifications should
not be sent of this removal. I guess the mismatch is that OSGi
ConfigAdmin has an update() which replaces the old value where the DMR
API only supports REMOVE followed by ADD.
Maybe I should get rid of this UPDATING_FLAG and an UPDATE operation to
the DMR API? Any ideas appreciated
Cheers,
David
12 years, 6 months