Achim, are you there? Can I help somehow because it is impossible to work 
when you can't restart war bundle.

On Tuesday, 16 August 2016 11:25:43 UTC+3, iJava wrote:
>
> Hi Achim,
>
> You know to change from 1 to 0.12 is not so simple - dependencies etc. 
> Could you say - is my code right? Is it enough bundle.stop without 
> WarManager.stop?
> Or it is enought WarManager.stop without bundle.stop.
>
> Is this bug in pax products - I do execute the most simple operation - 
> stop bundle.
>
> On Tuesday, 16 August 2016 11:02:35 UTC+3, Achim Nierbeck wrote:
>>
>> Hi, 
>>
>> could you try with Pax-CDI 0.12.0 ... afaik it's what we use with Apache 
>> Karaf, and it seems to work better ... 
>>
>> regards, Achim 
>>
>>
>> 2016-08-16 8:05 GMT+02:00 iJava <[email protected]>:
>>
>>> Hi all,
>>>
>>> Unfortunately I can't stop wab without exceptions (I use pax-web 4.2.7 
>>> and pax-cdi 1.0) . Now I do this way:
>>>
>>> ServiceReference reference = 
>>> bundleContext.getServiceReference(WarManager.class.getName());
>>> WarManager warManager = (WarManager) bundleContext.getService(reference);
>>> warManager.stop(bundle.getBundleId());
>>> bundle.stop();//I tried without this line but bundle doesn't stop (state 
>>> 32)
>>>
>>> I tried it without WarManager but the same result.
>>>
>>> And this is what I get - I can't understand if it is pax-web or pax-cdi
>>>
>>> java.lang.NullPointerException
>>>     at 
>>> org.ops4j.pax.web.extender.war.internal.DefaultWebAppDependencyManager.removeWebApp(DefaultWebAppDependencyManager.java:99)
>>>     at 
>>> org.ops4j.pax.web.extender.war.internal.WebObserver$1.doDestroy(WebObserver.java:189)
>>>     at 
>>> org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.destroy(SimpleExtension.java:71)
>>>     at 
>>> org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$2.run(AbstractExtender.java:306)
>>>     at 
>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>>     at 
>>> org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender.destroyExtension(AbstractExtender.java:332)
>>>     at 
>>> org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender.bundleChanged(AbstractExtender.java:190)
>>>     at 
>>> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:916)
>>>     at 
>>> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:835)
>>>     at 
>>> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:517)
>>>     at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)
>>>     at org.apache.felix.framework.Felix.stopBundle(Felix.java:2600)
>>>     at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:1038)
>>>     at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:1024)
>>>     at 
>>> org.example.solution.mgr.core.services.OsgiServiceImpl.stopBundle(OsgiServiceImpl.java:97)
>>>     at 
>>> org.example.solution.mgr.svr.services.RmiOsgiServiceImpl.stopBundle(RmiOsgiServiceImpl.java:80)
>>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>     at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>     at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>     at java.lang.reflect.Method.invoke(Method.java:497)
>>>     at 
>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
>>>     at sun.rmi.transport.Transport$1.run(Transport.java:200)
>>>     at sun.rmi.transport.Transport$1.run(Transport.java:197)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$250(TCPTransport.java:683)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$1/783938596.run(Unknown
>>>  
>>> Source)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
>>>     at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>>     at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>>     at java.lang.Thread.run(Thread.java:745)
>>> ERROR: Bundle org.example.site.fend [67] EventDispatcher: Error during 
>>> dispatch. (java.lang.IllegalStateException: Invalid BundleContext.)
>>> java.lang.IllegalStateException: Invalid BundleContext.
>>>     at 
>>> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>>>     at 
>>> org.apache.felix.framework.BundleContextImpl.getServiceObjects(BundleContextImpl.java:529)
>>>     at 
>>> org.ops4j.pax.cdi.extension.impl.compat.Osgi6ServiceObjectsWrapper.init(Osgi6ServiceObjectsWrapper.java:55)
>>>     at 
>>> org.ops4j.pax.cdi.extension.impl.compat.OsgiScopeUtils.createServiceObjectsWrapper(OsgiScopeUtils.java:59)
>>>     at 
>>> org.ops4j.pax.cdi.extension.impl.ServiceEventBridge.serviceChanged(ServiceEventBridge.java:62)
>>>     at 
>>> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)
>>>     at 
>>> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
>>>     at 
>>> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
>>>     at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
>>>     at org.apache.felix.framework.Felix.access$000(Felix.java:106)
>>>     at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420)
>>>     at 
>>> org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
>>>     at 
>>> org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
>>>     at 
>>> org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:235)
>>>     at org.apache.felix.framework.Felix.stopBundle(Felix.java:2635)
>>>     at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:1038)
>>>     at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:1024)
>>>     at 
>>> org.example.solution.mgr.core.services.OsgiServiceImpl.stopBundle(OsgiServiceImpl.java:97)
>>>     at 
>>> org.example.solution.mgr.svr.services.RmiOsgiServiceImpl.stopBundle(RmiOsgiServiceImpl.java:80)
>>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>     at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>     at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>     at java.lang.reflect.Method.invoke(Method.java:497)
>>>     at 
>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
>>>     at sun.rmi.transport.Transport$1.run(Transport.java:200)
>>>     at sun.rmi.transport.Transport$1.run(Transport.java:197)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$250(TCPTransport.java:683)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$1/783938596.run(Unknown
>>>  
>>> Source)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at 
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
>>>     at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>>     at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>>     at java.lang.Thread.run(Thread.java:745)
>>> [RMI TCP Connection(3)-127.0.0.1] INFO 
>>> org.ops4j.pax.web.service.internal.HttpServiceFactoryImpl - Unbinding 
>>> bundle: [org.example.site.fend [67]]
>>>
>>>
>>> -- 
>>> -- 
>>> ------------------
>>> OPS4J - http://www.ops4j.org - [email protected]
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OPS4J" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>>
>> Apache Member
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer 
>> & Project Lead
>> blog <http://notizblog.nierbeck.de/>
>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>
>> Software Architect / Project Manager / Scrum Master 
>>
>>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to