[jboss-as7-dev] Deploy of a singleton service will not work in AS7 (upstream)

Paul Ferraro paul.ferraro at redhat.com
Thu Jul 19 12:23:02 EDT 2012


Ah - that's because the change I made to master, while being source
compatible, broke binary compatibility.

I'll submit a pull request to restore binary compatibility for these
methods.  Thanks for catching this Wolf.

On Wed, 2012-07-18 at 16:38 +0200, Wolf-Dieter Fink wrote:
> 
> 
> My code is
>         ServiceController<String> controller =
> singleton.build(CurrentServiceContainer.getServiceContainer())
>                 .addDependency(ServerEnvironmentService.SERVICE_NAME,
> ServerEnvironment.class, service.env)
>                 .install();
> CurrentServiceContainer is:
>        public static ServiceContainer getServiceContainer()
>        {
>          return serviceContainer;
>        }
> And ServiceContainer:
>         public interface ServiceContainer extends ServiceTarget,
> ServiceRegistry {
> 
> 
> So it looks valid for me, also I did not see a change of the methods
> signature.
> 
> Wolf
> 
> On 07/18/2012 04:25 PM, Tomaž Cerar wrote:
> 
> > Hi,
> > 
> > you sure it is still valid?
> > 
> > as looking at the code in upstream: 
> > https://github.com/jbossas/jboss-as/blob/master/clustering/singleton/src/main/java/org/jboss/as/clustering/singleton/SingletonService.java#L83
> > you have two build methods and none of them take ServiceContainer
> > 
> > you have:
> > 
> > public ServiceBuilder<T> build(ServiceTarget target) 
> > public ServiceBuilder<T> build(ServiceTarget target, String
> > container)
> > 
> > it seems that it was changed in begining of this month...
> > 
> > --
> > tomaz
> > 
> > 
> > 
> > 
> > On Wed, Jul 18, 2012 at 4:13 PM, Wolf-Dieter Fink <wfink at redhat.com>
> > wrote:
> >         Hi,
> >         
> >         my SingeltonService will run in EAP6 and AS7.1 but the start
> >         will fail
> >         in the current upstream (the service.jar is compiled against
> >         7.1.1.Final
> >         maven dependencies)
> >         I did not understand the error ATM because the method
> >         signature is still
> >         valid.
> >         My service is packed as a jar without any org.jboss classes
> >         in it.
> >         
> >         Any idea whats wrong?
> >         
> >         Wolf
> >         
> >         
> >         Caused by: java.lang.NoSuchMethodError:
> >         org.jboss.as.clustering.singleton.SingletonService.build(Lorg/jboss/msc/service/ServiceContainer;)Lorg/jboss/msc/service/ServiceBuilder;
> >              at
> >         org.jboss.as.quickstarts.cluster.hasingleton.service.ejb.StartupSingleton.startup(StartupSingleton.java:62)
> >              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >         Method)
> >         [rt.jar:1.6.0_22]
> >              at
> >         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >         [rt.jar:1.6.0_22]
> >              at
> >         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >         [rt.jar:1.6.0_22]
> >              at java.lang.reflect.Method.invoke(Method.java:616)
> >         [rt.jar:1.6.0_22]
> >              at
> >         org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130)
> >         [jboss-as-ee-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
> >              at
> >         org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.as.ee.component.ManagedReferenceInterceptorFactory
> >         $ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
> >         [jboss-as-ee-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
> >              at
> >         org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
> >         [jboss-as-ee-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
> >              at
> >         org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
> >         [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> >              at
> >         org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:227)
> >              ... 20 more
> >         
> >         15:55:17,013 INFO  [org.jboss.as.server]
> >         (management-handler-thread - 2)
> >         JBAS015870: Deploy of deployment
> >         "jboss-as-cluster-ha-singleton-ejb.jar"
> >         was rolled back with failure message {"JBAS014671: Failed
> >         services" =>
> >         {"jboss.deployment.unit.\"jboss-as-cluster-ha-singleton-ejb.jar\".component.StartupSingleton.START"
> >         => "org.jboss.msc.service.StartException in service
> >         jboss.deployment.unit.\"jboss-as-cluster-ha-singleton-ejb.jar\".component.StartupSingleton.START:
> >         java.lang.IllegalStateException: JBAS011048: Failed to
> >         construct
> >         component instance
> >              Caused by: java.lang.IllegalStateException: JBAS011048:
> >         Failed to
> >         construct component instance
> >              Caused by: javax.ejb.EJBException: Unexpected Error
> >              Caused by: java.lang.NoSuchMethodError:
> >         org.jboss.as.clustering.singleton.SingletonService.build(Lorg/jboss/msc/service/ServiceContainer;)Lorg/jboss/msc/service/ServiceBuilder;"}}
> >         
> >         _______________________________________________
> >         jboss-as7-dev mailing list
> >         jboss-as7-dev at lists.jboss.org
> >         https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
> > 
> 
> 
> -- 
> Red Hat GmbH
> Technopark II, Building 1
> Werner-von-Siemens-Ring 11-15
> 85630 Grasbrunn
> Germany
> 
> Email: wfink at redhat.com
> ________________________________________________________________________
> Handelsregister: Amtsgericht Muenchen HRB 153243
> Geschaeftsfuehrer: Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev




More information about the jboss-as7-dev mailing list