You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by gasius <na...@combalt.com> on 2012/05/07 21:30:22 UTC

Customizing JAVA_OPTS of child instance

Hi,

I need to customize JAVA_OPTS (define classes for
javax.xml.parsers.DocumentBuilderFactory,
javax.xml.transform.TransformerFactory, javax.xml.parsers.SAXParserFactory)
when starting Karaf instances. There are no problems to customize Java
options for the root instance by editing scripts in bin directory. But our
applications are served on child instances and I found that editing of
scripts in bin directory has no impact. Is there some way to add any extra
Java options ar change current (for example memory allocation) when starting
child instances?

BR,
gasius 

--
View this message in context: http://karaf.922171.n3.nabble.com/Customizing-JAVA-OPTS-of-child-instance-tp3969455.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Customizing JAVA_OPTS of child instance

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You can setup the JAVA_HOME in the instances/MY_INSTANCE/bin script 
(karaf/admin).

Regards
JB

On 05/08/2012 10:46 AM, gasius wrote:
> Thak you, admin:change-opts works fine!
>
> But now I have another question. How admin:start command locates JAVA_HOME?
> I had set JAVA_HOME to point to my Java JDK but I see that child instance is
> started using JRE. None of changes in admin script works because it
> dedicates execution to org.apache.karaf.admin.main.Execute. Starting child
> instance using JRE causes some issues for us.
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Customizing-JAVA-OPTS-of-child-instance-tp3969455p3970743.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

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

Re: Customizing JAVA_OPTS of child instance

Posted by gasius <na...@combalt.com>.
Thak you, admin:change-opts works fine!

But now I have another question. How admin:start command locates JAVA_HOME?
I had set JAVA_HOME to point to my Java JDK but I see that child instance is
started using JRE. None of changes in admin script works because it
dedicates execution to org.apache.karaf.admin.main.Execute. Starting child
instance using JRE causes some issues for us.

--
View this message in context: http://karaf.922171.n3.nabble.com/Customizing-JAVA-OPTS-of-child-instance-tp3969455p3970743.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Customizing JAVA_OPTS of child instance

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Gasius,

You can use the admin:change-opts command to change it.

For instance:

karaf@root> admin:change-opts instance "-XX:MaxPermSize=256 -Xmx1024m"

When you use the client or admin script, it will use the JAVA_OPTS in 
the instance.properties populated by the command.

Regards
JB

On 05/07/2012 09:30 PM, gasius wrote:
> Hi,
>
> I need to customize JAVA_OPTS (define classes for
> javax.xml.parsers.DocumentBuilderFactory,
> javax.xml.transform.TransformerFactory, javax.xml.parsers.SAXParserFactory)
> when starting Karaf instances. There are no problems to customize Java
> options for the root instance by editing scripts in bin directory. But our
> applications are served on child instances and I found that editing of
> scripts in bin directory has no impact. Is there some way to add any extra
> Java options ar change current (for example memory allocation) when starting
> child instances?
>
> BR,
> gasius
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Customizing-JAVA-OPTS-of-child-instance-tp3969455.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

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