docker - How to set Classpath on Jboss EAP openshift image -


image used : https://access.redhat.com/containers/#/registry.access.redhat.com/jboss-eap-7/eap70-openshift

i can set env variable not work.

dockerfile :

from registry.access.redhat.com/jboss-eap-7/eap70-openshift env classpath $classpath:/opt/eap/standalone/lib/required_libs/fscontext.jar 

it sets variable still following exception,

caused by: java.lang.classnotfoundexception: com.sun.jndi.fscontext.reffscontextfactory [module "org.jboss.as.naming:main" local module loader @b97c004 (finder: local module finder @4590c9c3 (roots: /opt/eap/modules,/opt/eap/modules/system/layers/openshift,/opt/eap/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.0.6.cp,/opt/eap/modules/system/layers/base,/opt/eap/modules/system/add-ons/keycloak))]     @ org.jboss.modules.moduleclassloader.findclass(moduleclassloader.java:196)     @ org.jboss.modules.concurrentclassloader.performloadclassunchecked(concurrentclassloader.java:363)     @ org.jboss.modules.concurrentclassloader.performloadclass(concurrentclassloader.java:351)     @ org.jboss.modules.concurrentclassloader.loadclass(concurrentclassloader.java:93)     @ java.lang.class.forname0(native method)     @ java.lang.class.forname(class.java:348)     @ org.jboss.as.naming.initialcontext.getdefaultinitctx(initialcontext.java:113) 

setting classpath inside container not work.

looking setting classpath show in java process below :

[root@9a290d7939bb ~]# ps -ef | grep java root         1     0  0 jul18 ?        00:05:49 /usr/lib/jvm/java-1.8.0/bin/java -dnop -djava.util.logging.manager=org.apache.juli.classloaderlogmanager -djava.library.path=/opt/webserver/lib -djava.security.egd=file:/dev/./urandom -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -xx:+useparallelgc -xx:minheapfreeratio=20 -xx:maxheapfreeratio=40 -xx:gctimeratio=4 -xx:adaptivesizepolicyweight=90 -xx:maxmetaspacesize=100m -xx:+exitonoutofmemoryerror -djava.endorsed.dirs=/opt/webserver/endorsed **-classpath /opt/webserver/fscontext.jar:/opt/webserver/ldap.jar** -dcatalina.base=/opt/webserver -dcatalina.home=/opt/webserver -djava.io.tmpdir=/opt/webserver/temp org.apache.catalina.startup.bootstrap start 

why don't put lib in /opt/eap/modules or in 1 of directory mentionned in stacktrace ?

don't forget create module.xml file in eap_home/modules/your/package/name/main, ex :

<module xmlns="urn:jboss:module:1.1" name="your.package.name">   <resources>     <resource-root path="fscontext.jar"/>   </resources>   <dependencies>     <module name="com.ibm.mq"/>   </dependencies> </module> 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -