Re: Karaf 4.2.2, Java 11, OpenJFX 11 and PaxExam

2018-12-27 Thread Kerry
Hi Freeman,

I updated to the PAX version as advised but now I get a Karaf start up issue 
when I try to run my test and I get the same result when I remove my custom 
configuration of the Karaf container:

[main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System 
(Version: 4.13.1) created.
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner 
for class com.javatechnics.flexfx.boot.DeployFlexFxTest
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - running test class 
com.javatechnics.flexfx.boot.DeployFlexFxTest
[main] INFO org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - 
Creating RMI registry server on 127.0.0.1:21000
[main] INFO org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - 
Found 0 options when requesting OverrideJUnitBundlesOption.class
[main] INFO org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - 
Wait for test container to finish its initialization [ RelativeTimeout value = 
18 ]
[main] INFO org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient - Waiting 
for remote bundle context.. on 21000 name: 572ce6a6-fc5b-4884-a699-2c7a0132875e 
timout: [ RelativeTimeout value = 18 ]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by 
org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender
 
(file:/home/kerry/intellijprojects/flexfx/it/tests/target/paxexam/unpack/106f6824-a4ac-4a12-af4b-aecdd0b6bd9c/system/org/apache/felix/org.apache.felix.framework/5.6.10/org.apache.felix.framework-5.6.10.jar)
 to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of 
org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release

java.lang.RuntimeException: Container never came up
    at 
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.stop(KarafTestContainer.java:629)
    at 
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.tearDown(EagerSingleStagedReactor.java:118)
    at 
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.afterClass(EagerSingleStagedReactor.java:132)
    at 
org.ops4j.pax.exam.spi.reactors.ReactorManager.afterClass(ReactorManager.java:441)
    at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:107)
    at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at 
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Process finished with exit code 254

java.lang.RuntimeException: Cannot get the remote bundle context

    at 
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:261)
    at 
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:218)
    at 
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:659)
    at 
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:262)
    at 
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:194)
    at 
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.setUp(EagerSingleStagedReactor.java:86)
    at 
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.beforeClass(EagerSingleStagedReactor.java:136)
    at 
org.ops4j.pax.exam.spi.reactors.ReactorManager.beforeClass(ReactorManager.java:457)
    at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:97)
    at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at 
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.rmi.NotBoundException: 572ce6a6-fc5b-4884-a699-2c7a0132875e
    at java.rmi/sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:234)
    at 
java.rmi/sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:115)
    at 
java.rmi/sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:467)
    at 

Re: Karaf 4.2.2, Java 11, OpenJFX 11 and PaxExam

2018-12-26 Thread Freeman Fang
Hi,

Please use PAX-EXAM 4.13.1, which will address this issue.

Cheers
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 27, 2018, at 2:42 AM, Kerry  wrote:
> 
> Thanks Freeman. I've ended up using
> 
> new VMOption("-p"), new VMOption("/usr/lib/jvm/jfx1.11.0/lib"),
> new VMOption("--add-modules"), new 
> VMOption("javafx.base,javafx.controls,javafx.fxml,javafx.graphics")
> 
> Which seems to do the trick but I've got a Karaf start up issue now to solve:
> 
> Cannot access RandomAccessFile java.io.FileNotFoundException: /karaf.log 
> (Permission denied) java.io.FileNotFoundException: /karaf.log (Permission 
> denied)
> 
> Looks like it's looking in the root directory for the log file so something 
> must be different about the configuration and need to work out what has 
> changed (I've previously had the tests working under earlier versions of 
> Karaf and Java)
> 
> 
> Kerry
> On 23/12/2018 23:21, Freeman Fang wrote:
>> 
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> 
>> 
>> 
>> 
>> 
>>> On Dec 24, 2018, at 4:38 AM, Kerry >> > wrote:
>>> 
>>> Hi,
>>> 
>>> I'm trying to to get my project FlexFx to work on Java 11 with OpenJFX 11 
>>> inside Karaf 4.2.2 and have so far managed to get it to work by manually 
>>> deploying the OpenJFX jars to the `jdk9plus` folder of Karaf.
>>> 
>>> I am now trying to update the integration tests which use Pax Exam and 
>>> because JavaFX is no longer part of the JDK-11 I need to include these in 
>>> the Karaf configuration. To begin with I tried this:
>>> 
>>> bootClasspathLibraries(
>>> new 
>>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_BASE_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
>>> new 
>>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_CONTROLS_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
>>> new 
>>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_FXML_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)))
>>> 
>>> but this only put the artifacts into the lib folder not `lib/jdk9plus`
>> 
>> Then I think you can add 
>> 
>> new VMOption("-classpath"),
>> new VMOption(“lib/whatever_yourlib_is")
>> 
>>> 
>>> Also (and this is where I am still new and confused with the Java9 + module 
>>> system) the above artifacts are not the actual ones I used when I manually 
>>> installed OpenJFX to Karaf. I manually installed the SDK from gluon 
>>> (https://gluonhq.com/products/javafx/ 
>>> ) and this zip file includes native 
>>> libraries as well as JARs. These are what I think I should be installing 
>>> automatically but I'm uncertain how I can go about this with PaxExam.
>>> 
>>> Does anyone have any suggestions?
>>> 
>>> Thanks, Kerry.
>>> 
>>> 
>> 



Re: Karaf 4.2.2, Java 11, OpenJFX 11 and PaxExam

2018-12-26 Thread Kerry
Thanks Freeman. I've ended up using

new VMOption("-p"), new VMOption("/usr/lib/jvm/jfx1.11.0/lib"),
new VMOption("--add-modules"), new 
VMOption("javafx.base,javafx.controls,javafx.fxml,javafx.graphics")

Which seems to do the trick but I've got a Karaf start up issue now to solve:

Cannot access RandomAccessFile java.io.FileNotFoundException: /karaf.log 
(Permission denied) java.io.FileNotFoundException: /karaf.log (Permission 
denied)

Looks like it's looking in the root directory for the log file so something 
must be different about the configuration and need to work out what has changed 
(I've previously had the tests working under earlier versions of Karaf and Java)


Kerry

On 23/12/2018 23:21, Freeman Fang wrote:
>
> -
> Freeman(Yue) Fang
>
> Red Hat, Inc. 
>
>
>
>
>
>> On Dec 24, 2018, at 4:38 AM, Kerry > > wrote:
>>
>> Hi,
>>
>> I'm trying to to get my project FlexFx to work on Java 11 with OpenJFX 11 
>> inside Karaf 4.2.2 and have so far managed to get it to work by manually 
>> deploying the OpenJFX jars to the `jdk9plus` folder of Karaf.
>>
>> I am now trying to update the integration tests which use Pax Exam and 
>> because JavaFX is no longer part of the JDK-11 I need to include these in 
>> the Karaf configuration. To begin with I tried this:
>>
>> bootClasspathLibraries(
>>     new 
>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_BASE_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
>>     new 
>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_CONTROLS_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
>>     new 
>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_FXML_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)))
>>
>> but this only put the artifacts into the lib folder not `lib/jdk9plus`
>
> Then I think you can add 
>
> new VMOption("-classpath"),
>                 new VMOption(“lib/whatever_yourlib_is")
>
>>
>> Also (and this is where I am still new and confused with the Java9 + module 
>> system) the above artifacts are not the actual ones I used when I manually 
>> installed OpenJFX to Karaf. I manually installed the SDK from gluon 
>> (https://gluonhq.com/products/javafx/) and this zip file includes native 
>> libraries as well as JARs. These are what I think I should be installing 
>> automatically but I'm uncertain how I can go about this with PaxExam.
>>
>> Does anyone have any suggestions?
>>
>> Thanks, Kerry.
>>
>>
>


Re: Karaf 4.2.2, Java 11, OpenJFX 11 and PaxExam

2018-12-23 Thread Freeman Fang

-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 24, 2018, at 4:38 AM, Kerry  wrote:
> 
> Hi,
> 
> I'm trying to to get my project FlexFx to work on Java 11 with OpenJFX 11 
> inside Karaf 4.2.2 and have so far managed to get it to work by manually 
> deploying the OpenJFX jars to the `jdk9plus` folder of Karaf.
> 
> I am now trying to update the integration tests which use Pax Exam and 
> because JavaFX is no longer part of the JDK-11 I need to include these in the 
> Karaf configuration. To begin with I tried this:
> 
> bootClasspathLibraries(
> new 
> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_BASE_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
> new 
> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_CONTROLS_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
> new 
> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_FXML_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)))
> 
> but this only put the artifacts into the lib folder not `lib/jdk9plus`

Then I think you can add 

new VMOption("-classpath"),
new VMOption(“lib/whatever_yourlib_is")

> 
> Also (and this is where I am still new and confused with the Java9 + module 
> system) the above artifacts are not the actual ones I used when I manually 
> installed OpenJFX to Karaf. I manually installed the SDK from gluon 
> (https://gluonhq.com/products/javafx/) and this zip file includes native 
> libraries as well as JARs. These are what I think I should be installing 
> automatically but I'm uncertain how I can go about this with PaxExam.
> 
> Does anyone have any suggestions?
> 
> Thanks, Kerry.
> 
>