Run goal of karaf-maven-plugin does not configure the endorsed folders

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Run goal of karaf-maven-plugin does not configure the endorsed folders

ivoleitao
Hi,

As discussed in http://karaf.922171.n3.nabble.com/DOSGI-2-1-0-calling-soap-service-results-in-javax-xml-stream-XMLOutputFactory-cannot-be-created-tp4049778.html the run goal of karaf-maven plugin does not takes into account the endorsed folders.

I've looked at the source at https://github.com/apache/karaf/blob/master/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/RunMojo.java and I think it's just a matter of adding new system properties.

Should I create an issue ?  

Best Regards,
Ivo Leitão
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run goal of karaf-maven-plugin does not configure the endorsed folders

jbonofre
Good point !

Let me fix that.

Regards
JB

On 03/08/2017 05:21 PM, ivoleitao wrote:

> Hi,
>
> As discussed in
> http://karaf.922171.n3.nabble.com/DOSGI-2-1-0-calling-soap-service-results-in-javax-xml-stream-XMLOutputFactory-cannot-be-created-tp4049778.html
> the run goal of karaf-maven plugin does not takes into account the endorsed
> folders.
>
> I've looked at the source at
> https://github.com/apache/karaf/blob/master/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/RunMojo.java
> and I think it's just a matter of adding new system properties.
>
> Should I create an issue ?
>
> Best Regards,
> Ivo Leitão
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Run-goal-of-karaf-maven-plugin-does-not-configure-the-endorsed-folders-tp4049794.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run goal of karaf-maven-plugin does not configure the endorsed folders

ivoleitao
Hello,

Thankyou. I've tried to correct this issue with the following code:

        private static final String JAVA_ENDORSED_DIRS = "java.endorsed.dirs";
        private static final String JAVA_EXT_DIRS = "java.ext.dirs";

....

                String endorsedDirs = System.getProperty(JAVA_ENDORSED_DIRS, "");
                if (endorsedDirs != null && endorsedDirs.trim().length() > 0) {
                        endorsedDirs += ":";
                }
                endorsedDirs += karafDirectory.getAbsolutePath() + "/lib/endorsed";
               
                String extDirs = System.getProperty(JAVA_EXT_DIRS, "");
                if (extDirs != null && extDirs.trim().length() > 0) {
                        extDirs += ":";
                }
                extDirs += karafDirectory.getAbsolutePath() + "/lib/ext";
               
                getLog().info("Setting system properties");
                System.setProperty(JAVA_ENDORSED_DIRS, endorsedDirs);
                System.setProperty(JAVA_EXT_DIRS, extDirs);
       
But I'm still having the same error. When I launch from the command line it works. I must be missing some additional stuff...
Any ideia what could be ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run goal of karaf-maven-plugin does not configure the endorsed folders

ivoleitao
Hello again,

I think we have a much harder problem in here. I think I have to give up from this for now or make a completely new plugin. I've added the java.library.path also as a system property but it does not work also. I've came to the conclusion by looking at the karaf launcher that we need the boot classpath also and I don't now how to setup up that in an already launched vm. I dont' think that is even possible :-S

I'm refering to this:

setupClassPath() {
    # Add the jars in the lib dir
    for file in "${KARAF_HOME}"/lib/boot/*.jar
    do
        if [ -z "${CLASSPATH}" ]; then
            CLASSPATH="${file}"
        else
            CLASSPATH="${CLASSPATH}:${file}"
        fi
    done
}




On 9 March 2017 at 16:56, ivoleitao [via Karaf] <[hidden email]> wrote:
Hello,

Thankyou. I've tried to correct this issue with the following code:

        private static final String JAVA_ENDORSED_DIRS = "java.endorsed.dirs";
        private static final String JAVA_EXT_DIRS = "java.ext.dirs";

....

                String endorsedDirs = System.getProperty(JAVA_ENDORSED_DIRS, "");
                if (endorsedDirs != null && endorsedDirs.trim().length() > 0) {
                        endorsedDirs += ":";
                }
                endorsedDirs += karafDirectory.getAbsolutePath() + "/lib/endorsed";
               
                String extDirs = System.getProperty(JAVA_EXT_DIRS, "");
                if (extDirs != null && extDirs.trim().length() > 0) {
                        extDirs += ":";
                }
                extDirs += karafDirectory.getAbsolutePath() + "/lib/ext";
               
                getLog().info("Setting system properties");
                System.setProperty(JAVA_ENDORSED_DIRS, endorsedDirs);
                System.setProperty(JAVA_EXT_DIRS, extDirs);
       
But I'm still having the same error. When I launch from the command line it works. I must be missing some additional stuff...
Any ideia what could be ?


To start a new topic under Karaf - User, email [hidden email]
To unsubscribe from Karaf - User, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run goal of karaf-maven-plugin does not configure the endorsed folders

Achim Nierbeck
Hi, 

don't know if this will help you, 
but as Pax-Exam does have a Karaf launcher, the sources might help you on finding a solution [1]

regards, Achim 


2017-03-09 18:46 GMT+01:00 ivoleitao <[hidden email]>:
Hello again,

I think we have a much harder problem in here. I think I have to give up
from this for now or make a completely new plugin. I've added the
java.library.path
also as a system property but it does not work also. I've came to the
conclusion by looking at the karaf launcher that we need the boot classpath
also and I don't now how to setup up that in an already launched vm. I
dont' think that is even possible :-S

I'm refering to this:

setupClassPath() {
    # Add the jars in the lib dir
    for file in "${KARAF_HOME}"/lib/boot/*.jar
    do
        if [ -z "${CLASSPATH}" ]; then
            CLASSPATH="${file}"
        else
            CLASSPATH="${CLASSPATH}:${file}"
        fi
    done
}




On 9 March 2017 at 16:56, ivoleitao [via Karaf] <
[hidden email]> wrote:

> Hello,
>
> Thankyou. I've tried to correct this issue with the following code:
>
>         private static final String JAVA_ENDORSED_DIRS =
> "java.endorsed.dirs";
>         private static final String JAVA_EXT_DIRS = "java.ext.dirs";
>
> ....
>
>                 String endorsedDirs = System.getProperty(JAVA_ENDORSED_DIRS,
> "");
>                 if (endorsedDirs != null && endorsedDirs.trim().length() >
> 0) {
>                         endorsedDirs += ":";
>                 }
>                 endorsedDirs += karafDirectory.getAbsolutePath() +
> "/lib/endorsed";
>
>                 String extDirs = System.getProperty(JAVA_EXT_DIRS, "");
>                 if (extDirs != null && extDirs.trim().length() > 0) {
>                         extDirs += ":";
>                 }
>                 extDirs += karafDirectory.getAbsolutePath() + "/lib/ext";
>
>                 getLog().info("Setting system properties");
>                 System.setProperty(JAVA_ENDORSED_DIRS, endorsedDirs);
>                 System.setProperty(JAVA_EXT_DIRS, extDirs);
>
> But I'm still having the same error. When I launch from the command line
> it works. I must be missing some additional stuff...
> Any ideia what could be ?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://karaf.922171.n3.nabble.com/Run-goal-of-karaf-maven-
> plugin-does-not-configure-the-endorsed-folders-tp4049794p4049819.html
> To start a new topic under Karaf - User, email
> [hidden email]
> To unsubscribe from Karaf - User, click here
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=SXZvLmxlaXRhb0BnbWFpbC5jb218OTMwNzQ5fDU3MDgwNzUzMw==>
> .
> NAML
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://karaf.922171.n3.nabble.com/Run-goal-of-karaf-maven-plugin-does-not-configure-the-endorsed-folders-tp4049794p4049820.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

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 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run goal of karaf-maven-plugin does not configure the endorsed folders

ivoleitao
Thanks a lot Achim,

I'm going to take a look.

Best Regards,
Ivo Leitão

On 9 March 2017 at 18:59, Achim Nierbeck [via Karaf] <[hidden email]> wrote:
Hi, 

don't know if this will help you, 
but as Pax-Exam does have a Karaf launcher, the sources might help you on finding a solution [1]

regards, Achim 


2017-03-09 18:46 GMT+01:00 ivoleitao <[hidden email]>:
Hello again,

I think we have a much harder problem in here. I think I have to give up
from this for now or make a completely new plugin. I've added the
java.library.path
also as a system property but it does not work also. I've came to the
conclusion by looking at the karaf launcher that we need the boot classpath
also and I don't now how to setup up that in an already launched vm. I
dont' think that is even possible :-S

I'm refering to this:

setupClassPath() {
    # Add the jars in the lib dir
    for file in "${KARAF_HOME}"/lib/boot/*.jar
    do
        if [ -z "${CLASSPATH}" ]; then
            CLASSPATH="${file}"
        else
            CLASSPATH="${CLASSPATH}:${file}"
        fi
    done
}




On 9 March 2017 at 16:56, ivoleitao [via Karaf] <
[hidden email]> wrote:

> Hello,
>
> Thankyou. I've tried to correct this issue with the following code:
>
>         private static final String JAVA_ENDORSED_DIRS =
> "java.endorsed.dirs";
>         private static final String JAVA_EXT_DIRS = "java.ext.dirs";
>
> ....
>
>                 String endorsedDirs = System.getProperty(JAVA_ENDORSED_DIRS,
> "");
>                 if (endorsedDirs != null && endorsedDirs.trim().length() >
> 0) {
>                         endorsedDirs += ":";
>                 }
>                 endorsedDirs += karafDirectory.getAbsolutePath() +
> "/lib/endorsed";
>
>                 String extDirs = System.getProperty(JAVA_EXT_DIRS, "");
>                 if (extDirs != null && extDirs.trim().length() > 0) {
>                         extDirs += ":";
>                 }
>                 extDirs += karafDirectory.getAbsolutePath() + "/lib/ext";
>
>                 getLog().info("Setting system properties");
>                 System.setProperty(JAVA_ENDORSED_DIRS, endorsedDirs);
>                 System.setProperty(JAVA_EXT_DIRS, extDirs);
>
> But I'm still having the same error. When I launch from the command line
> it works. I must be missing some additional stuff...
> Any ideia what could be ?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://karaf.922171.n3.nabble.com/Run-goal-of-karaf-maven-
> plugin-does-not-configure-the-endorsed-folders-tp4049794p4049819.html
> To start a new topic under Karaf - User, email
> [hidden email]
> To unsubscribe from Karaf - User, click here
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=SXZvLmxlaXRhb0BnbWFpbC5jb218OTMwNzQ5fDU3MDgwNzUzMw==>
> .
> NAML
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://karaf.922171.n3.nabble.com/Run-goal-of-karaf-maven-plugin-does-not-configure-the-endorsed-folders-tp4049794p4049820.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

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 




To start a new topic under Karaf - User, email [hidden email]
To unsubscribe from Karaf - User, click here.
NAML

Loading...