Re: javax.annotation.PostConstruct issue when running with JDK11

2018-10-04 Thread Jean-Baptiste Onofré
You are welcome ! Always happy to help !

Regards
JB

Le 4 oct. 2018 à 15:31, à 15:31, Oleg Cohen  a 
écrit:
>Thank you, JB!
>
>I got it to work successfully by adding lib/ext jar files to the
>classpath when launching Karaf (-classpath)
>
>Best regards,
>Oleg
>
>> On Oct 1, 2018, at 1:42 PM, Jean-Baptiste Onofré 
>wrote:
>>
>> Please let me know if you have any issue.
>>
>> By the way, I'm preparing blog post + documentation update about how
>to
>> use Karaf on Java 10/11 and dealing with modules.
>>
>> I created a Jira about that:
>>
>> https://issues.apache.org/jira/browse/KARAF-5938
>>
>> I also plan to add few examples about that (in karaf/examples).
>>
>> Regards
>> JB
>>
>> On 01/10/2018 19:18, Oleg Cohen wrote:
>>> Thank you, JB! I will give it a try.
>>>
>>> Best
>>> Oleg
>>>
>>> Sent from my iPhone
>>>
 On Oct 1, 2018, at 11:57 AM, Jean-Baptiste Onofré 
>wrote:

 Hi Oleg,

 You can add at Karaf level (in the startup) or via dynamic-import
>on pax
 web.

 Regards
 JB

> On 01/10/2018 17:44, Oleg Cohen wrote:
> Thank you, JB!
>
> In my case it is pax-web that can’t find the class, so I guess I
>need to add to ext lib. How can I add it? Should I do it at the JDK
>level or it is a mechanism in Karaf?
>
> Thank you,
> Oleg
>
>> On Oct 1, 2018, at 11:33 AM, Jean-Baptiste Onofré
> wrote:
>>
>> Hi Oleg,
>>
>> Correct, javax.annotation is available up to Java 10 (and even
>using
>> Java 10, the javax.annotation package has been splitted).
>>
>> When using Java 11, you have to explicitly install either jsr305
>or
>> javax.annotation jar files (it could be as private package of
>your
>> bundle, or ext lib).
>>
>> Regards
>> JB
>>
>>> On 01/10/2018 17:14, Oleg Cohen wrote:
>>> Greetings,
>>>
>>> I am trying to run my Karaf application under JDK 11. I am
>getting the following exception:
>>>
>>> Caused by: java.lang.ClassNotFoundException:
>javax.annotation.PostConstruct cannot be found by
>org.ops4j.pax.web.pax-web-jsp_7.2.3
>>>
>>> It appears that the jigsaw module providing this package is not
>available in JDK 11. The suggestion is to use a dependency.
>>>
>>> Wondering if anybody ran into this and what a
>solution/workaround might be.
>>>
>>> Thank you!
>>> Oleg
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com


Re: javax.annotation.PostConstruct issue when running with JDK11

2018-10-04 Thread Oleg Cohen
Thank you, JB!

I got it to work successfully by adding lib/ext jar files to the classpath when 
launching Karaf (-classpath)

Best regards,
Oleg

> On Oct 1, 2018, at 1:42 PM, Jean-Baptiste Onofré  wrote:
> 
> Please let me know if you have any issue.
> 
> By the way, I'm preparing blog post + documentation update about how to
> use Karaf on Java 10/11 and dealing with modules.
> 
> I created a Jira about that:
> 
> https://issues.apache.org/jira/browse/KARAF-5938
> 
> I also plan to add few examples about that (in karaf/examples).
> 
> Regards
> JB
> 
> On 01/10/2018 19:18, Oleg Cohen wrote:
>> Thank you, JB! I will give it a try.
>> 
>> Best
>> Oleg
>> 
>> Sent from my iPhone
>> 
>>> On Oct 1, 2018, at 11:57 AM, Jean-Baptiste Onofré  wrote:
>>> 
>>> Hi Oleg,
>>> 
>>> You can add at Karaf level (in the startup) or via dynamic-import on pax
>>> web.
>>> 
>>> Regards
>>> JB
>>> 
 On 01/10/2018 17:44, Oleg Cohen wrote:
 Thank you, JB!
 
 In my case it is pax-web that can’t find the class, so I guess I need to 
 add to ext lib. How can I add it? Should I do it at the JDK level or it is 
 a mechanism in Karaf?
 
 Thank you,
 Oleg
 
> On Oct 1, 2018, at 11:33 AM, Jean-Baptiste Onofré  
> wrote:
> 
> Hi Oleg,
> 
> Correct, javax.annotation is available up to Java 10 (and even using
> Java 10, the javax.annotation package has been splitted).
> 
> When using Java 11, you have to explicitly install either jsr305 or
> javax.annotation jar files (it could be as private package of your
> bundle, or ext lib).
> 
> Regards
> JB
> 
>> On 01/10/2018 17:14, Oleg Cohen wrote:
>> Greetings,
>> 
>> I am trying to run my Karaf application under JDK 11. I am getting the 
>> following exception:
>> 
>> Caused by: java.lang.ClassNotFoundException: 
>> javax.annotation.PostConstruct cannot be found by 
>> org.ops4j.pax.web.pax-web-jsp_7.2.3
>> 
>> It appears that the jigsaw module providing this package is not 
>> available in JDK 11. The suggestion is to use a dependency.
>> 
>> Wondering if anybody ran into this and what a solution/workaround might 
>> be.
>> 
>> Thank you!
>> Oleg
>> 
> 
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



Re: DB Connection pool n ot getting created with KARAF 4.2.1 (Open JPA 3.0.0)

2018-10-04 Thread Jean-Baptiste Onofré
Hi,

did you install the pax-jdbc corresponding feature ?

How did you create the datasource ?

Regards
JB

On 04/10/2018 13:35, munishgupta.asr wrote:
> Hi All,
> 
> With KARAF 4.2.0, OpenJPA version was 2.4.2. I upgraded KARAF to 4.2.1 and
> with that, Open JPA feature version has been upgraded to 3.0.0.
> 
> After bringing server up, I can see exceptions in log while DB pool is
> getting created. 
> 
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC
> driver class 'org.hsqldb.jdbc.JDBCDriver'
>   at
> org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
> ~[?:?]
>   at
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
> ~[?:?]
>   at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> ~[?:?]
>   at
> org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
> ~[?:?]
>   at
> org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:86)
> ~[?:?]
>   at
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:93)
> ~[?:?]
> 
> My JDBC driver bundles are same like before (SQL or Postgre or HSQL), that
> does not have any changes.
> I can see the org.hsqldb.jdbc.JDBCDriver is available and exported via
> driver bundle.
> 
> Can you suggest something what could be probable issue here? it is working
> fine with KARAF 4.2.0 / OpenJPA 2.4.2.
> 
> Regards
> Munish
>   
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


DB Connection pool n ot getting created with KARAF 4.2.1 (Open JPA 3.0.0)

2018-10-04 Thread munishgupta.asr
Hi All,

With KARAF 4.2.0, OpenJPA version was 2.4.2. I upgraded KARAF to 4.2.1 and
with that, Open JPA feature version has been upgraded to 3.0.0.

After bringing server up, I can see exceptions in log while DB pool is
getting created. 

Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC
driver class 'org.hsqldb.jdbc.JDBCDriver'
at
org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
~[?:?]
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
~[?:?]
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
~[?:?]
at
org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
~[?:?]
at
org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:86)
~[?:?]
at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:93)
~[?:?]

My JDBC driver bundles are same like before (SQL or Postgre or HSQL), that
does not have any changes.
I can see the org.hsqldb.jdbc.JDBCDriver is available and exported via
driver bundle.

Can you suggest something what could be probable issue here? it is working
fine with KARAF 4.2.0 / OpenJPA 2.4.2.

Regards
Munish




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html