[osgi-dev] SCR - Could not obtain lock

2019-02-02 Thread Alain Picard via osgi-dev
I regularly get this exception when starting our app, w/o having ever seen
any impact.

!ENTRY org.eclipse.equinox.cm 4 0 2019-02-02 14:31:46.715
!MESSAGE Could not obtain lock
!STACK 0
java.lang.IllegalStateException: Could not obtain lock
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:231)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainActivationWriteLock(AbstractComponentManager.java:266)
at
org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:633)
at
org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609)
at
org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426)
at
org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:284)
at
org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent(RegionConfigurationSupport.java:89)
at
org.eclipse.equinox.internal.cm.EventDispatcher$1.run(EventDispatcher.java:89)
at
org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)

IIRC I have seen forum threads to this effect, but is there anything that
we should do with this ? If it happens once the product is deployed that
doesn't look good and I hate putting exceptions under the rug.

Please advise.

Cheers,
Alain
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] ServletContextListener not working?

2019-02-02 Thread Thomas Driessen via osgi-dev
Hi Dirk,

I've read all of your great blog post. By the way thank you for those .
Unfortunately, in those you do exact the same things as I did in my example.

The servlet looks like this:

@Component(service = Servlet.class, scope = ServiceScope.PROTOTYPE)
public class MyServlet extends HttpServlet{

 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello World!");
}
}

and the ServletContextListener like this:

@Component
@HttpWhiteboardListener
public class MySCL implements ServletContextListener {

@Override
public void contextDestroyed(ServletContextEvent arg0) {
System.out.println("Destroyed");
}

@Override
public void contextInitialized(ServletContextEvent arg0) {
System.out.println("Initialized");
}
}

I think by using the new annotations everything should be set up right. The
Servlet works as expected, but the SCL is never called.

In contrast to your blog post examples I didn't use any specific
ServletContext(Helper), but I thought this would lead to using the default
ServletContext. I think in most of my cases I do not need to use a specific
ServletContext,, so the default would be sufficient.

Kind regards,
Thomas



Am Sa., 2. Feb. 2019 um 16:50 Uhr schrieb Dirk Fauth :

> Hi,
>
> Not sure if this helps, but I wrote a blog post a while ago where I also
> used a ServletContextListener in my example.
>
> http://blog.vogella.com/2017/04/20/access-osgi-services-via-web-interface/
>
> Maybe it helps in finding the cause.
>
> Are you using the http whiteboard pattern and did you set the required
> component property?
>
> Greez,
> Dirk
>
> Am Sa., 2. Feb. 2019, 16:07 hat Thomas Driessen via osgi-dev <
> osgi-dev@mail.osgi.org> geschrieben:
>
>> Hi,
>>
>> I just tried to get a ServletContextListener to work, but did not
>> succeed, although everything is done as defined by the spec.
>>
>> Here you can find a minimal example of my setup
>> https://github.com/Sandared/io.jatoms.osgi.possiblebugs.scl
>>
>> The Servlet I'm registering is working fine, but the
>> ServletContextListener that I registered too is never called.
>> Even if I call getServletContext() from within the Servlet, my Listener
>> is never called.
>>
>> I would have expected the ServletContextListener to be called at least
>> once, after a DefaultServletContext has been created by the
>> ServletContainer, or am I wrong with this assumption?
>>
>> Kind regards,
>> Thomas
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] ServletContextListener not working?

2019-02-02 Thread Dirk Fauth via osgi-dev
Hi,

Not sure if this helps, but I wrote a blog post a while ago where I also
used a ServletContextListener in my example.

http://blog.vogella.com/2017/04/20/access-osgi-services-via-web-interface/

Maybe it helps in finding the cause.

Are you using the http whiteboard pattern and did you set the required
component property?

Greez,
Dirk

Am Sa., 2. Feb. 2019, 16:07 hat Thomas Driessen via osgi-dev <
osgi-dev@mail.osgi.org> geschrieben:

> Hi,
>
> I just tried to get a ServletContextListener to work, but did not succeed,
> although everything is done as defined by the spec.
>
> Here you can find a minimal example of my setup
> https://github.com/Sandared/io.jatoms.osgi.possiblebugs.scl
>
> The Servlet I'm registering is working fine, but the
> ServletContextListener that I registered too is never called.
> Even if I call getServletContext() from within the Servlet, my Listener is
> never called.
>
> I would have expected the ServletContextListener to be called at least
> once, after a DefaultServletContext has been created by the
> ServletContainer, or am I wrong with this assumption?
>
> Kind regards,
> Thomas
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] ServletContextListener not working?

2019-02-02 Thread Thomas Driessen via osgi-dev
Hi,

I just tried to get a ServletContextListener to work, but did not succeed,
although everything is done as defined by the spec.

Here you can find a minimal example of my setup
https://github.com/Sandared/io.jatoms.osgi.possiblebugs.scl

The Servlet I'm registering is working fine, but the ServletContextListener
that I registered too is never called.
Even if I call getServletContext() from within the Servlet, my Listener is
never called.

I would have expected the ServletContextListener to be called at least
once, after a DefaultServletContext has been created by the
ServletContainer, or am I wrong with this assumption?

Kind regards,
Thomas
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] enRoute workspace debugging

2019-02-02 Thread Ferry Huberts via osgi-dev
You could try and turn off sources and see what happens.

-sources: false

I use
-sources: ${if;${gestalt;batch};false;true}
in my Gradle build, to have sources in the bundles when building in
bndtools, and no sources when building in gradle/jenkins


On 02/02/2019 14:57, Ferry Huberts via osgi-dev wrote:
> Maybe it is inconvenient, but I think that strictly speaking that is
> absolutely right, since those java files correspond to what is actually
> running.
> 
> On 02/02/2019 14:52, Thomas Driessen via osgi-dev wrote:
>> It seems those are the .java files within the OSGI-OPT folder of the
>> generated  bundle/.jar.
>> But I have no idea why Eclipse picks those up when it is debugging. 
>> I used the enroute archetypes and didn't change anything.
>> Maybe it's just a setting somewhere in Eclipse that has to be changed or
>> within the pom files, I don't know :(
>>
>> Am Sa., 2. Feb. 2019 um 03:55 Uhr schrieb Raymond Auge via osgi-dev
>> mailto:osgi-dev@mail.osgi.org>>:
>>
>> The bigger question is why I'm the world are there java files in
>> target? target is the build directory. We are there source files in
>> there?
>>
>> - Ray
>>
>> On Fri, Feb 1, 2019, 13:47 Paul F Fraser via osgi-dev
>> mailto:osgi-dev@mail.osgi.org> wrote:
>>
>> Thomas,
>> Thank goodness someone else has experienced this. I thought it
>> was my problem only.
>> I mentioned this on this list previously but so far no response.
>> Paul
>>
>>
>> On 2/02/2019 3:54 am, Thomas Driessen via osgi-dev wrote:
>>> Hi,
>>>
>>> now that I'm using the enroute maven workspace I stumbled upon
>>> another issue.
>>>
>>> When I'm debugging and a breakpoint is hit, then Eclipse does
>>> not open the respective .java file in my project,
>>> but the java file from the target folder. 
>>> Now each time I want to change breakpoints/code/etc. I have to
>>> go back to the workspace .java file.
>>> Is there a way to tell Eclipse to use the workspace .java file
>>> instead of the target folder .java file for debugging?
>>>
>>> Kind regards,
>>> Thomas
>>>
>>> ___
>>> OSGi Developer Mail List
>>> osgi-dev@mail.osgi.org 
>>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org 
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org 
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
> 

-- 
Ferry Huberts
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] enRoute workspace debugging

2019-02-02 Thread Ferry Huberts via osgi-dev
Maybe it is inconvenient, but I think that strictly speaking that is
absolutely right, since those java files correspond to what is actually
running.

On 02/02/2019 14:52, Thomas Driessen via osgi-dev wrote:
> It seems those are the .java files within the OSGI-OPT folder of the
> generated  bundle/.jar.
> But I have no idea why Eclipse picks those up when it is debugging. 
> I used the enroute archetypes and didn't change anything.
> Maybe it's just a setting somewhere in Eclipse that has to be changed or
> within the pom files, I don't know :(
> 
> Am Sa., 2. Feb. 2019 um 03:55 Uhr schrieb Raymond Auge via osgi-dev
> mailto:osgi-dev@mail.osgi.org>>:
> 
> The bigger question is why I'm the world are there java files in
> target? target is the build directory. We are there source files in
> there?
> 
> - Ray
> 
> On Fri, Feb 1, 2019, 13:47 Paul F Fraser via osgi-dev
> mailto:osgi-dev@mail.osgi.org> wrote:
> 
> Thomas,
> Thank goodness someone else has experienced this. I thought it
> was my problem only.
> I mentioned this on this list previously but so far no response.
> Paul
> 
> 
> On 2/02/2019 3:54 am, Thomas Driessen via osgi-dev wrote:
>> Hi,
>>
>> now that I'm using the enroute maven workspace I stumbled upon
>> another issue.
>>
>> When I'm debugging and a breakpoint is hit, then Eclipse does
>> not open the respective .java file in my project,
>> but the java file from the target folder. 
>> Now each time I want to change breakpoints/code/etc. I have to
>> go back to the workspace .java file.
>> Is there a way to tell Eclipse to use the workspace .java file
>> instead of the target folder .java file for debugging?
>>
>> Kind regards,
>> Thomas
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org 
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 

-- 
Ferry Huberts
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] enRoute workspace debugging

2019-02-02 Thread Thomas Driessen via osgi-dev
It seems those are the .java files within the OSGI-OPT folder of the
generated  bundle/.jar.
But I have no idea why Eclipse picks those up when it is debugging.
I used the enroute archetypes and didn't change anything.
Maybe it's just a setting somewhere in Eclipse that has to be changed or
within the pom files, I don't know :(

Am Sa., 2. Feb. 2019 um 03:55 Uhr schrieb Raymond Auge via osgi-dev <
osgi-dev@mail.osgi.org>:

> The bigger question is why I'm the world are there java files in target?
> target is the build directory. We are there source files in there?
>
> - Ray
>
> On Fri, Feb 1, 2019, 13:47 Paul F Fraser via osgi-dev <
> osgi-dev@mail.osgi.org wrote:
>
>> Thomas,
>> Thank goodness someone else has experienced this. I thought it was my
>> problem only.
>> I mentioned this on this list previously but so far no response.
>> Paul
>>
>>
>> On 2/02/2019 3:54 am, Thomas Driessen via osgi-dev wrote:
>>
>> Hi,
>>
>> now that I'm using the enroute maven workspace I stumbled upon another
>> issue.
>>
>> When I'm debugging and a breakpoint is hit, then Eclipse does not open
>> the respective .java file in my project,
>> but the java file from the target folder.
>> Now each time I want to change breakpoints/code/etc. I have to go back to
>> the workspace .java file.
>> Is there a way to tell Eclipse to use the workspace .java file instead of
>> the target folder .java file for debugging?
>>
>> Kind regards,
>> Thomas
>>
>> ___
>> OSGi Developer Mail 
>> listosgi-...@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev