WildFly + java Preferences cannot find custom preferences class in classpath -
i deploying ear below structure wildfly 9.0.2
my.ear |-my.sar (it sar archive) |-lib |-mypreferencesimpl.jar
i able load classes in lib/mypreferencesimpl.jar my.sar (like class.forname(com.my.preferencesfactory) directly. however, java.util.prefs.preferences.factory not able load com.my.preferencesfactory. passing djava.util.prefs.preferencesfactory=com.my.preferencesfactory
command line parameter during wildfly startup.
below exception thrown.
caused by: java.lang.classnotfoundexception: com.my.preferencesfactory [module "org.jboss.as.jmx:main" local module loader @76a3e297 (finder: local module finder @4d3167f4 (roots: /csa_wildfly/wildfly/modules,/csa_wildfly/wildfly/modules/system/layers/base))] @ org.jboss.modules.moduleclassloader.findclass(moduleclassloader.java:205) @ org.jboss.modules.concurrentclassloader.performloadclassunchecked(concurrentclassloader.java:455) @ org.jboss.modules.concurrentclassloader.performloadclasschecked(concurrentclassloader.java:404) @ org.jboss.modules.concurrentclassloader.performloadclass(concurrentclassloader.java:385) @ org.jboss.modules.concurrentclassloader.loadclass(concurrentclassloader.java:130) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:348) @ java.util.prefs.preferences.factory(preferences.java:254)
please me fix this.
update:
fixed migrating startup service using jmx service @singleton + @startup ejb. no other changes required.
when pass arg djava.util.prefs.preferencesfactory=com.my.preferencesfactory
in command line, wildfly going class in classes available it, provided way of modules . during wildfly bootup, it's not going know there application class present, neither can provide same class other deployments on same container. if want command line arg work, make sure deploy factory implementation wildfly module.
Comments
Post a Comment