Re: [pax-web-jsp] Can pax-web-jsp handle simple custom tags with .tag (not .tld) extension in a WAB (not WAR)?

2017-06-19 Thread Eben Stewart
Sounds good... knowing the history, and the future dev plans, especially if 
they make it into the OSGI spec, is always good :D

I'm taking from your comments that the ExtenderConstants are not long term? 
 It would be better to have an HttpWhiteboardConstants way of doing it?

I think all the annotations are there - I will look into seeing what I can 
do to contribute - still wrapping my head around it all, so I want to have 
a good understanding of how it's all *supposed* to work.

On Monday, June 19, 2017 at 3:07:53 PM UTC-4, Achim Nierbeck wrote:
>
> Hi,
>
> thanks for the sample, will see to it. 
> regarding the comments/remarks, see my comments inline :) 
>
> Achim 
>
> 2017-06-19 14:50 GMT+02:00 Eben Stewart  >:
>
>> Attached is a working example, the smallest I could get it (project is 
>> bndtools under Eclipse)
>>
>> A few points that threw me off, that did not seem clear at first 
>> (although they make sense now) - a lot of it had to do with the whiteboard 
>> extensions to get resources and jsp support - I am not aware if the OSGI 
>> spec even handles those concepts (although the WAR/WAB is).  I do like this 
>> way better, as it doesn't make the bundle "special" in the way in handles 
>> servlets, jsps and resources... they are all just services.
>>
>
> Just a bit of History, it might make the picture clearer for you. 
> The Pax Web Whiteboard extender exists since the WAR/WAB part has been 
> implemented, and at the time beeing that part also moved into the OSGi 
> spec. If you take a look at it, Pax Web and the Pax Url war URL-Handler are 
> part of the reference implementation for that part of the OSGi Spec. 
> So actually the Pax Web Whiteboard extension mechanism is "pretty" old :) 
> About 2 years ago an Whiteboard extender mechanism had been added to the 
> OSGi spec, so we working on Pax Web tried to adapt the existing code to the 
> new spec. 
>  
>
>>
>> 1) The use of HttpContextMapping
>>
>>- There is no default implementation of this, like JspMapping and 
>>ResourceMapping, so also cannot use annotations to initialize?
>>- How to use HttpContextMapping, DefaultHttpContext (or shared), and 
>>still be able to get to handleSecurity()
>>
>>
> You can retrieve a DefaultHttpContext Instance from the HttpService (or 
> WebContainer Service), register it as your own HttpContext. Maybe that 
> helps to what your are looking for? 
>  
>
>> 2) No DefaultHttpContext (that can be extended as an annotated Service)
>>
>>- DefaultHttpContext is package private, so there is no "automatic" 
>>way to wire in a custom HttpContext (for the handleSecurity() method) 
>>without doing a lot of boilerplate coding to get the service, create the 
>>context, etc.  Since the DefaultHttpContext handles the getResource() 
>>correctly in this scenario, it would be nice to be able to extend this 
>>class, and get it wired in via annotations.
>>- I think what I was expecting was to have something similar to 
>>JspMapping or ResourceMapping that allowed me to specify path and 
>> contextID 
>>as annotations, and have the default getResources() handler, while being 
>>able to override the getSecurity()
>>
>>
>>
> Sounds like a new feature, this in itself it worthy a new Issue, oh and we 
> do love contributions ;) 
>  
>
>> 3) Required use of "ExtenderConstants.PROPERTY_HTTP_CONTEXT_ID" instead 
>> of "HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT" in Servlets
>>
>>- Could not get the context selector to work - only the Extender 
>>property correctly maps the servlet to the context, as created by 
>>HttpContextMapping
>>
>>
> See above, about us trying to form the existing Whiteboard extender into 
> the specified one by the OSGi Spec, so this could be a bug :) 
>  
>
>> 4) JspMapping and ResourceMapping cannot use annotations to initialize
>>
>>- Tried using the ExtenderConstants.PROPERTY_HTTP_CONTEXT_ID 
>>annotation property - won't work - had expected to use Whiteboard, or 
>>Whiteboard-like annotations
>>- Initializing in the constructor does work
>>
>> Sounds like another feature request. 
>
>  
>
>> Hope all this makes sense - not sure how to translate this into a JIRA 
>> bug or feature request.
>>
>
> Makes a lot of sense now, you could open different issues / feature 
> requests for those. Oh and we do love contributions, if I didn't tell you 
> that before :)
>  
>
>>
>> In the end, I have a workaround, and a sample you might be able to use to 
>> make the scenario more clear, so that it might help others.
>>
>
> yeah, thanks will form a sample out of it, so we can actually use it as a 
> reference for the integration tests for those issues/bugs/feature request 
> you'll create ;)  
>
>>
>> On Saturday, June 17, 2017 at 3:42:51 PM UTC-4, Achim Nierbeck wrote:
>>>
>>> Hi, 
>>>
>>> thanks, sounds like a good idea. 
>>> Yep, that's a standard scenario, so it could be a bug you found, 
>>> 

[pax=jdbc-1.1.0] 65k DB connections with pool of 25.

2017-06-19 Thread Dutch Dude
All -

I have been struggling with DB connection errors with PAX-JDBC for a while 
now, and I couldn't really get my mind around it.

Just today I noticed something really bizar. On a Windows Server, PAX-JDBC 
(sometimes) ends up in a loop creating DB connections until the OS runs out 
of resources. 

This is the error message:

2017-06-19 16:34:53,676 [ERROR] qtp1288985130-157 MyRepositoryImpl:686 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217
-774c696): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 
The driver was unable to create a connection due to an inability to 
establish the client portion of a socket.

This is usually caused by a limit on the number of sockets imposed by the 
operating system. This limit is usually configurable. 

For Unix-based platforms, see the manual page for the 'ulimit' command. 
Kernel or system reconfiguration may also be required.

For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (
Q196271).
Error Code: 0


When I do a netstat -an | find "" I see thousands and thousands of 
connections (or at least attempted connections, I don't recall the state of 
the connection).

One other interesting thing to note is that if I increase the maxTotal AND 
the maxIdle values in the config below, the problem doesn't happen, or at 
least a lot less frequent.

osgi.jdbc.driver.class=com.mysql.jdbc.Driver
url=jdbc:mysql://my_db_server:3306/mydb?useSSL=false
dataSourceName=jdbc/mynonjta
user=
password=
databaseName=
pool=dbcp2
#jdbc.pool.timeBetweenEvictionRunsMillis=1000
#jdbc.pool.softMinEvictableIdleTimeMillis=7000
jdbc.pool.maxTotal=25
jdbc.pool.maxIdle=25
#jdbc.pool.minIdle=10

Could it be that the maxTotal and maxIdle being the same causes some havoc 
here? The idea is to never close connections once they are open, but I 
might have misunderstood the settings for these properties.

OS Microsof Windows Server 2012 R2.
Java 8
PAX-JDBC 1.1.0

Please Advise.

It seems fairly reproducible so let me know when there is anything you 
would like me to test.


Kind Regards,

Erwin

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
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 ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pax-web-jsp] Can pax-web-jsp handle simple custom tags with .tag (not .tld) extension in a WAB (not WAR)?

2017-06-19 Thread Eben Stewart
Attached is a working example, the smallest I could get it (project is 
bndtools under Eclipse)

A few points that threw me off, that did not seem clear at first (although 
they make sense now) - a lot of it had to do with the whiteboard extensions 
to get resources and jsp support - I am not aware if the OSGI spec even 
handles those concepts (although the WAR/WAB is).  I do like this way 
better, as it doesn't make the bundle "special" in the way in handles 
servlets, jsps and resources... they are all just services.

1) The use of HttpContextMapping

   - There is no default implementation of this, like JspMapping and 
   ResourceMapping, so also cannot use annotations to initialize?
   - How to use HttpContextMapping, DefaultHttpContext (or shared), and 
   still be able to get to handleSecurity()

2) No DefaultHttpContext (that can be extended as an annotated Service)

   - DefaultHttpContext is package private, so there is no "automatic" way 
   to wire in a custom HttpContext (for the handleSecurity() method) without 
   doing a lot of boilerplate coding to get the service, create the context, 
   etc.  Since the DefaultHttpContext handles the getResource() correctly in 
   this scenario, it would be nice to be able to extend this class, and get it 
   wired in via annotations.
   - I think what I was expecting was to have something similar to 
   JspMapping or ResourceMapping that allowed me to specify path and contextID 
   as annotations, and have the default getResources() handler, while being 
   able to override the getSecurity()


3) Required use of "ExtenderConstants.PROPERTY_HTTP_CONTEXT_ID" instead of 
"HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT" in Servlets

   - Could not get the context selector to work - only the Extender 
   property correctly maps the servlet to the context, as created by 
   HttpContextMapping

4) JspMapping and ResourceMapping cannot use annotations to initialize

   - Tried using the ExtenderConstants.PROPERTY_HTTP_CONTEXT_ID annotation 
   property - won't work - had expected to use Whiteboard, or Whiteboard-like 
   annotations
   - Initializing in the constructor does work

Hope all this makes sense - not sure how to translate this into a JIRA bug 
or feature request.

In the end, I have a workaround, and a sample you might be able to use to 
make the scenario more clear, so that it might help others.

On Saturday, June 17, 2017 at 3:42:51 PM UTC-4, Achim Nierbeck wrote:
>
> Hi, 
>
> thanks, sounds like a good idea. 
> Yep, that's a standard scenario, so it could be a bug you found, 
> especially since the non OSGi spec whiteboard properties seem to work. 
>
> regards, Achim 
>
>
> 2017-06-17 17:17 GMT+02:00 Eben Stewart  >:
>
>> Sure... let me get something stripped down to the essentials
>>
>> Maybe show how I got it to work, and how I would have expected it to 
>> work, given the current docs?  Esp if I can get it working with all 
>> annotations (via annotations on JspMapping and ResourceMapping classes) - 
>> no Activator class, 
>>
>> I don't know if it's necessarily a bug, but rather a disconnect or 
>> clarification (possibly just in documentation/samples).
>>
>> At a minimum, it might make a good basis for a sample? I can't be the 
>> only one trying to do a Servlet->forward to JSP->Custom tags in jsp.  
>> Pretty standard scenario.
>>
>> On Friday, June 16, 2017 at 4:27:52 PM UTC-4, Achim Nierbeck wrote:
>>>
>>> Ok, 
>>>
>>> maybe you can provide a little test project, we could use it as a sample 
>>> and as foundation for an integration test. 
>>> Sounds like you have a special condition we don't have covered right 
>>> now. 
>>> So it might be a bug. 
>>>
>>> regards, Achim 
>>>  
>>>
>>> 2017-06-16 22:06 GMT+02:00 Eben Stewart :
>>>
 I'm using 6.0.6.snapshot

 On Friday, June 16, 2017 at 3:10:56 PM UTC-4, Achim Nierbeck wrote:
>
> Hi 
>
> are you looking for this? 
>
> https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/whiteboard-ds/src/main/java/org/ops4j/pax/web/samples/whiteboard/ds/WhiteboardServletWithContext.java
>
> That should work, which version of Pax Web are you using? 
>
> regards, Achim 
>
>
> 2017-06-16 20:25 GMT+02:00 Eben Stewart :
>
>> One step further
>>
>> This works:
>>
>> final HttpContextMapping httpContextMapping = new 
>> HttpContextMapping() {
>>
>> static final String HTTP_CONTEXT_ID = "customContext";
>>
>> @Override
>> public String getHttpContextId() {
>> return HTTP_CONTEXT_ID;
>> }
>>
>> @Override
>> public String getPath() {
>> return "customContext";
>> }
>>
>> @Override
>> public Map getParameters() {
>> return null;
>> }
>>
>> @Override
>> public HttpContext getHttpContext() {
>> return null; 
>> }
>> };
>>

Re: PAX Wicket 4 (moving to wicket 7)

2017-06-19 Thread 'Christoph Läubrich' via OPS4J

Hi Nino,

I created the branch v3.1.x, it is working so far beside the karaf tests 
fail with


Server returned HTTP response code: 401 for URL: 
http://localhost:8181/issues


any idea what is causing this? If we have sorted this out I think we 
should make this the 4.0 version and make wicket 8 a pax-wicket 5.0 version


Am 19.06.2017 12:09, schrieb nino martinez wael:

Ok great, let me know If I can do something..



--
--
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
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 ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PAX Wicket 4 (moving to wicket 8)

2017-06-19 Thread 'Christoph Läubrich' via OPS4J
Found the issue: The logmessage simply has wrong parameter order and a 
missleading logger name, beside this this has no impact on the code 
since we scan the classpath for pax-wicket annotations


The real cause for the waring is: 
https://stackoverflow.com/questions/12142872/java-lang-classformaterror-absent-code-attribute-in-method-that-is-not-native-o


I will add code that ignores javax. classes becuas ethe will never carry 
pax wicket annotations.


Am 14.06.2017 10:52, schrieb nino martinez wael:
OK i've removed the pax web dependency from the test.. But now I am 
getting this, could it be because of blueprint and springdm depends on 
pax-web somehow?:



org.ops4j.pax.wicket.service[org.ops4j.pax.wicket.internal.extender.PaxWicketBundleListener] 
: Class 'org.ops4j.pax.wicket.spi.blueprint' was found via bundle 
javax.activation.DataHandlerDataSource's resource path, but 
classloader can't load it (is the jar file

 corrupted or a dependant optional dependencies not resolved?)
org.ops4j.pax.wicket.service[org.ops4j.pax.wicket.internal.extender.PaxWicketBundleListener] 
: Class 'org.ops4j.pax.wicket.spi.blueprint' was found via bundle 
javax.activation.DataSourceDataContentHandler's resource path, but 
classloader can't load it (is the j

ar file corrupted or a dependant optional dependencies not resolved?)
org.ops4j.pax.wicket.service[org.ops4j.pax.wicket.internal.extender.PaxWicketBundleListener] 
: Class 'org.ops4j.pax.wicket.spi.blueprint' was found via bundle 
javax.activation.ObjectDataContentHandler's resource path, but 
classloader can't load it (is the jar f

ile corrupted or a dependant optional dependencies not resolved?)
org.ops4j.pax.wicket.service[org.ops4j.pax.wicket.internal.extender.PaxWicketBundleListener] 
: Class 'org.ops4j.pax.wicket.spi.blueprint' was found via bundle 
javax.activation.SecuritySupport's resource path, but classloader 
can't load it (is the jar file corru

pted or a dependant optional dependencies not resolved?)
org.ops4j.pax.wicket.service[org.ops4j.pax.wicket.internal.extender.PaxWicketBundleListener] 
: Class 'org.ops4j.pax.wicket.spi.springdm' was found via bundle 
javax.activation.DataHandlerDataSource's resource path, but 
classloader can't load it (is the jar file

corrupted or a dependant optional dependencies not resolved?)


On Monday, May 22, 2017 at 6:55:09 AM UTC+2, nino martinez wael wrote:

Hi

Over 2 months ago I made the last changes to the 4.x.y branch[1]
to support wicket 8. I cannot get the "bare" felix tests to work
(I seem to be missing some dependency, which I cannot figure out)..

The question is, should I just disable the the test, as there are
no horison on it getting to work and release what we have..? If
not, how should we get the broken felix tests to work, i'm pretty
sure its some dependency thing that's out of sync.

[1]https://github.com/ops4j/org.ops4j.pax.wicket/tree/v4.x.y



Regard Nino

--
--
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

---
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 ops4j+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
--
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
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 ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.